scienceworld


Namescienceworld JSON
Version 1.1.3 PyPI version JSON
download
home_pagehttps://scienceworld.github.io
SummaryScienceWorld: An interactive text environment to study AI agents on accomplishing tasks from the standardized elementary science curriculum.
upload_time2023-01-19 18:11:08
maintainer
docs_urlNone
authorPeter Jansen
requires_python>=3.7
license
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).

Install with pip:
```bash
conda create --name scienceworld python=3.8
conda activate scienceworld
pip install scienceworld
```

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.7), which interfaces using the `py4j` package.

# 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": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Peter Jansen",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/4e/ea/5836491d6806ed325cdae961c83de7b02a007b2dc20f3b1edf0872bd3fc2/scienceworld-1.1.3.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).\n\nInstall with pip:\n```bash\nconda create --name scienceworld python=3.8\nconda activate scienceworld\npip install scienceworld\n```\n\nRun an example random agent, on task 13 (classification: place a non-living thing in a box), for 5 episodes:\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> 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> 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.7), which interfaces using the `py4j` package.\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": "",
    "summary": "ScienceWorld: An interactive text environment to study AI agents on accomplishing tasks from the standardized elementary science curriculum.",
    "version": "1.1.3",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66991ff9371465e8da80ab7f5678d989ea348f82d2824ec73b34c1418377bf7d",
                "md5": "3169554ca3ed619f3baab51a9ebb071f",
                "sha256": "19a55d4e2f6fd7c030a444e901a6ad4db0b94636ea283b895caae88abb514a57"
            },
            "downloads": -1,
            "filename": "scienceworld-1.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3169554ca3ed619f3baab51a9ebb071f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 7271545,
            "upload_time": "2023-01-19T18:11:06",
            "upload_time_iso_8601": "2023-01-19T18:11:06.055499Z",
            "url": "https://files.pythonhosted.org/packages/66/99/1ff9371465e8da80ab7f5678d989ea348f82d2824ec73b34c1418377bf7d/scienceworld-1.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4eea5836491d6806ed325cdae961c83de7b02a007b2dc20f3b1edf0872bd3fc2",
                "md5": "76afbde8e5d50f6a1fc79a90230b0348",
                "sha256": "0018362d2a690badc0be3c996f13f18b7ce0dcaeae2df2ca28b217708f78df58"
            },
            "downloads": -1,
            "filename": "scienceworld-1.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "76afbde8e5d50f6a1fc79a90230b0348",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 7273252,
            "upload_time": "2023-01-19T18:11:08",
            "upload_time_iso_8601": "2023-01-19T18:11:08.679469Z",
            "url": "https://files.pythonhosted.org/packages/4e/ea/5836491d6806ed325cdae961c83de7b02a007b2dc20f3b1edf0872bd3fc2/scienceworld-1.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-19 18:11:08",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "scienceworld"
}
        
Elapsed time: 0.03143s