scienceworld


Namescienceworld JSON
Version 1.2.2 PyPI version JSON
download
home_pagehttps://scienceworld.github.io
SummaryScienceWorld: An interactive text environment to study AIagents on accomplishing tasks from the standardized elementary science curriculum.
upload_time2024-10-16 20:08:41
maintainerNone
docs_urlNone
authorPeter Jansen
requires_python>=3.7
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">
ScienceWorld
</h1>

<p align="center">
<!-- Version badge using shields.io -->
  <a href="https://github.com/allenai/ScienceWorld/releases">
    <img src="https://img.shields.io/github/v/release/allenai/ScienceWorld">
  </a>
<!-- Link to tutorials badge using shields.io -->
  <a href="https://huggingface.co/spaces/MarcCote/ScienceWorld">
    <img src="https://img.shields.io/badge/🤗-Demo-yellow">
  </a>
<!-- Follow on twitter badge using shields.io -->
  <a href="https://sciworld.apps.allenai.org">
    <img src="https://img.shields.io/badge/Website-green">
  </a>
</p>

ScienceWorld is a text-based virtual environment centered around accomplishing tasks from the standardized elementary science curriculum.  This code accompanies the paper [ScienceWorld: Is your Textual Agent Smarter than a 5th grader?](https://arxiv.org/abs/2203.07540).

<h3 align="center"><img src="https://github.com/allenai/ScienceWorld/blob/main/media/scienceworld_environment.png" width="75%"/></h3>

### Demo and examples

You can try ScienceWorld yourself via our [HuggingFace Space](https://huggingface.co/spaces/MarcCote/ScienceWorld) or read some of the [playthrough transcripts](https://sciworld.apps.allenai.org/explore).

### Citation
```
@misc{scienceworld2022,
    title={ScienceWorld: Is your Agent Smarter than a 5th Grader?},
    author={Ruoyao Wang and Peter Jansen and Marc-Alexandre C{\^o}t{\'e} and Prithviraj Ammanabrolu},
    year={2022},
    eprint={2203.07540},
    archivePrefix={arXiv},
    primaryClass={cs.CL},
    url={https://arxiv.org/abs/2203.07540}
}
```

# Quickstart
**Before running:** You will have to have `Java 1.8+` installed on your system (shipped with most linux distributions) and `Python 3.8+`. We recommend creating a conda environment like this:

```bash
conda create --name scienceworld python=3.8
conda activate scienceworld
```

Then, install ScienceWorld either from PyPi:

    pip install scienceworld

or from source in development mode:

    git clone https://github.com/allenai/ScienceWorld.git
    cd ScienceWorld
    pip install .


Run an example random agent, on task 13 (classification: place a non-living thing in a box), for 5 episodes:

    python examples/random_agent.py --task-num=13 --num-episodes=5 --simplifications-preset easy

Run a user console where you can interact with the environment, on task 3 (change of state: melting):

    python examples/human.py --task-num=3 --num-episodes=5


# Web Server Demo

A web server demo is also available, that allows running a ScienceWorld user console that can be interacted with in a web browser.

<h3 align="center"><img src="https://github.com/allenai/ScienceWorld/blob/main/media/web_demo_screenshot.png" width="75%"/></h3>

To run the web server demo:
```bash
conda create --name scienceworld python=3.8
conda activate scienceworld
pip install scienceworld[webserver]
```

Run the web server:

    python examples/scienceworld-web-server-example.py

Point your web browser to:
`localhost:8080`


# ScienceWorld Design
ScienceWorld is written in Scala (2.12.9), and compiles using `sbt` into a JAR file that is run with Java.  For convenience, a Python API is provided (Python >= 3.8), which interfaces using the `py4j` package.

If you modified the Scala code, you can recompile the JAR file by running:
```bash
./simulator/package.sh
pip install -e .
```

# Tasks
The tasks are listed in the table below along with their number of variations. Either the task ID or its name can be used to a task with `env.load()`.

| Task ID | Task Name                                | # Variations |
|-------|----------------------------------------------------|------|
|   1-1 |                                             boil |   30 |
|   1-2 |                                             melt |   30 |
|   1-3 |                                           freeze |   30 |
|   1-4 |                    change-the-state-of-matter-of |   30 |
|   2-1 |                                  use-thermometer |  540 |
|   2-2 |            measure-melting-point-known-substance |  436 |
|   2-3 |          measure-melting-point-unknown-substance |  300 |
|   3-1 |                                  power-component |   20 |
|   3-2 | power-component-renewable-vs-nonrenewable-energy |   20 |
|   3-3 |                                test-conductivity |  900 |
|   3-4 |          test-conductivity-of-unknown-substances |  600 |
|   4-1 |                                find-living-thing |  300 |
|   4-2 |                            find-non-living-thing |  300 |
|   4-3 |                                       find-plant |  300 |
|   4-4 |                                      find-animal |  300 |
|   5-1 |                                       grow-plant |  126 |
|   5-2 |                                       grow-fruit |  126 |
|   6-1 |                                    chemistry-mix |   32 |
|   6-2 |              chemistry-mix-paint-secondary-color |   36 |
|   6-3 |               chemistry-mix-paint-tertiary-color |   36 |
|   7-1 |                           lifespan-longest-lived |  125 |
|   7-2 |                          lifespan-shortest-lived |  125 |
|   7-3 |       lifespan-longest-lived-then-shortest-lived |  125 |
|   8-1 |                           identify-life-stages-1 |   14 |
|   8-2 |                           identify-life-stages-2 |   10 |
|   9-1 |                   inclined-plane-determine-angle |  168 |
|   9-2 |           inclined-plane-friction-named-surfaces | 1386 |
|   9-3 |         inclined-plane-friction-unnamed-surfaces |  162 |
|  10-1 |                   mendelian-genetics-known-plant |  120 |
|  10-2 |                 mendelian-genetics-unknown-plant |  480 |

# Baseline Agents
**DRRN:** https://github.com/cognitiveailab/drrn-scienceworld

**KG-A2C:** https://github.com/cognitiveailab/kga2c-scienceworld

**CALM:** https://github.com/cognitiveailab/calm-scienceworld

**Behavior Cloning and Decision Transformer:** https://github.com/cognitiveailab/t5-scienceworld

            

Raw data

            {
    "_id": null,
    "home_page": "https://scienceworld.github.io",
    "name": "scienceworld",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Peter Jansen",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/2d/98/101a8ee5fbbcadbdef6ae41b1254a1b17a6b54081e89b6ea88cf4a1523e3/scienceworld-1.2.2.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">\nScienceWorld\n</h1>\n\n<p align=\"center\">\n<!-- Version badge using shields.io -->\n  <a href=\"https://github.com/allenai/ScienceWorld/releases\">\n    <img src=\"https://img.shields.io/github/v/release/allenai/ScienceWorld\">\n  </a>\n<!-- Link to tutorials badge using shields.io -->\n  <a href=\"https://huggingface.co/spaces/MarcCote/ScienceWorld\">\n    <img src=\"https://img.shields.io/badge/\ud83e\udd17-Demo-yellow\">\n  </a>\n<!-- Follow on twitter badge using shields.io -->\n  <a href=\"https://sciworld.apps.allenai.org\">\n    <img src=\"https://img.shields.io/badge/Website-green\">\n  </a>\n</p>\n\nScienceWorld is a text-based virtual environment centered around accomplishing tasks from the standardized elementary science curriculum.  This code accompanies the paper [ScienceWorld: Is your Textual Agent Smarter than a 5th grader?](https://arxiv.org/abs/2203.07540).\n\n<h3 align=\"center\"><img src=\"https://github.com/allenai/ScienceWorld/blob/main/media/scienceworld_environment.png\" width=\"75%\"/></h3>\n\n### Demo and examples\n\nYou can try ScienceWorld yourself via our [HuggingFace Space](https://huggingface.co/spaces/MarcCote/ScienceWorld) or read some of the [playthrough transcripts](https://sciworld.apps.allenai.org/explore).\n\n### Citation\n```\n@misc{scienceworld2022,\n    title={ScienceWorld: Is your Agent Smarter than a 5th Grader?},\n    author={Ruoyao Wang and Peter Jansen and Marc-Alexandre C{\\^o}t{\\'e} and Prithviraj Ammanabrolu},\n    year={2022},\n    eprint={2203.07540},\n    archivePrefix={arXiv},\n    primaryClass={cs.CL},\n    url={https://arxiv.org/abs/2203.07540}\n}\n```\n\n# Quickstart\n**Before running:** You will have to have `Java 1.8+` installed on your system (shipped with most linux distributions) and `Python 3.8+`. We recommend creating a conda environment like this:\n\n```bash\nconda create --name scienceworld python=3.8\nconda activate scienceworld\n```\n\nThen, install ScienceWorld either from PyPi:\n\n    pip install scienceworld\n\nor from source in development mode:\n\n    git clone https://github.com/allenai/ScienceWorld.git\n    cd ScienceWorld\n    pip install .\n\n\nRun an example random agent, on task 13 (classification: place a non-living thing in a box), for 5 episodes:\n\n    python examples/random_agent.py --task-num=13 --num-episodes=5 --simplifications-preset easy\n\nRun a user console where you can interact with the environment, on task 3 (change of state: melting):\n\n    python examples/human.py --task-num=3 --num-episodes=5\n\n\n# Web Server Demo\n\nA web server demo is also available, that allows running a ScienceWorld user console that can be interacted with in a web browser.\n\n<h3 align=\"center\"><img src=\"https://github.com/allenai/ScienceWorld/blob/main/media/web_demo_screenshot.png\" width=\"75%\"/></h3>\n\nTo run the web server demo:\n```bash\nconda create --name scienceworld python=3.8\nconda activate scienceworld\npip install scienceworld[webserver]\n```\n\nRun the web server:\n\n    python examples/scienceworld-web-server-example.py\n\nPoint your web browser to:\n`localhost:8080`\n\n\n# ScienceWorld Design\nScienceWorld is written in Scala (2.12.9), and compiles using `sbt` into a JAR file that is run with Java.  For convenience, a Python API is provided (Python >= 3.8), which interfaces using the `py4j` package.\n\nIf you modified the Scala code, you can recompile the JAR file by running:\n```bash\n./simulator/package.sh\npip install -e .\n```\n\n# Tasks\nThe tasks are listed in the table below along with their number of variations. Either the task ID or its name can be used to a task with `env.load()`.\n\n| Task ID | Task Name                                | # Variations |\n|-------|----------------------------------------------------|------|\n|   1-1 |                                             boil |   30 |\n|   1-2 |                                             melt |   30 |\n|   1-3 |                                           freeze |   30 |\n|   1-4 |                    change-the-state-of-matter-of |   30 |\n|   2-1 |                                  use-thermometer |  540 |\n|   2-2 |            measure-melting-point-known-substance |  436 |\n|   2-3 |          measure-melting-point-unknown-substance |  300 |\n|   3-1 |                                  power-component |   20 |\n|   3-2 | power-component-renewable-vs-nonrenewable-energy |   20 |\n|   3-3 |                                test-conductivity |  900 |\n|   3-4 |          test-conductivity-of-unknown-substances |  600 |\n|   4-1 |                                find-living-thing |  300 |\n|   4-2 |                            find-non-living-thing |  300 |\n|   4-3 |                                       find-plant |  300 |\n|   4-4 |                                      find-animal |  300 |\n|   5-1 |                                       grow-plant |  126 |\n|   5-2 |                                       grow-fruit |  126 |\n|   6-1 |                                    chemistry-mix |   32 |\n|   6-2 |              chemistry-mix-paint-secondary-color |   36 |\n|   6-3 |               chemistry-mix-paint-tertiary-color |   36 |\n|   7-1 |                           lifespan-longest-lived |  125 |\n|   7-2 |                          lifespan-shortest-lived |  125 |\n|   7-3 |       lifespan-longest-lived-then-shortest-lived |  125 |\n|   8-1 |                           identify-life-stages-1 |   14 |\n|   8-2 |                           identify-life-stages-2 |   10 |\n|   9-1 |                   inclined-plane-determine-angle |  168 |\n|   9-2 |           inclined-plane-friction-named-surfaces | 1386 |\n|   9-3 |         inclined-plane-friction-unnamed-surfaces |  162 |\n|  10-1 |                   mendelian-genetics-known-plant |  120 |\n|  10-2 |                 mendelian-genetics-unknown-plant |  480 |\n\n# Baseline Agents\n**DRRN:** https://github.com/cognitiveailab/drrn-scienceworld\n\n**KG-A2C:** https://github.com/cognitiveailab/kga2c-scienceworld\n\n**CALM:** https://github.com/cognitiveailab/calm-scienceworld\n\n**Behavior Cloning and Decision Transformer:** https://github.com/cognitiveailab/t5-scienceworld\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "ScienceWorld: An interactive text environment to study AIagents on accomplishing tasks from the standardized elementary science curriculum.",
    "version": "1.2.2",
    "project_urls": {
        "Homepage": "https://scienceworld.github.io"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9f7d3274b58a3267a4004edd7e72cb820f0609e47447e2f8eae9a2a0c776668b",
                "md5": "4d9996741915a525a79f21b252f21f2f",
                "sha256": "afef9af68e14d1bd512ffaf01bb356f876afe1b0cc31107cf5e3317d363dba3a"
            },
            "downloads": -1,
            "filename": "scienceworld-1.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4d9996741915a525a79f21b252f21f2f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7283832,
            "upload_time": "2024-10-16T20:08:38",
            "upload_time_iso_8601": "2024-10-16T20:08:38.372642Z",
            "url": "https://files.pythonhosted.org/packages/9f/7d/3274b58a3267a4004edd7e72cb820f0609e47447e2f8eae9a2a0c776668b/scienceworld-1.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2d98101a8ee5fbbcadbdef6ae41b1254a1b17a6b54081e89b6ea88cf4a1523e3",
                "md5": "40f0f7451c87c5bdb6450e77c34673f8",
                "sha256": "a3fced7240b09c9727b9ef2b9fee7377a1235886d85d40f2ceb6098be436338d"
            },
            "downloads": -1,
            "filename": "scienceworld-1.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "40f0f7451c87c5bdb6450e77c34673f8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7286075,
            "upload_time": "2024-10-16T20:08:41",
            "upload_time_iso_8601": "2024-10-16T20:08:41.630507Z",
            "url": "https://files.pythonhosted.org/packages/2d/98/101a8ee5fbbcadbdef6ae41b1254a1b17a6b54081e89b6ea88cf4a1523e3/scienceworld-1.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-16 20:08:41",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "scienceworld"
}
        
Elapsed time: 0.31181s