跳转到主要内容

ScienceWorld:一个互动文本环境,用于研究AI代理如何完成标准小学科学课程中的任务。

项目描述

ScienceWorld

ScienceWorld是一个基于文本的虚拟环境,以完成标准小学科学课程中的任务为中心。此代码与论文ScienceWorld:你的文本代理比五年级学生聪明吗?配套。

演示和示例

您可以通过我们的HuggingFace Space亲自尝试ScienceWorld,或阅读一些游戏记录

引用

@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}
}

快速入门

运行前:您必须在系统上安装Java 1.8+(大多数Linux发行版附带)和Python 3.8+。我们建议创建一个conda环境,如下所示

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

然后,从PyPi安装ScienceWorld

pip install scienceworld

或从源代码以开发模式安装

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

运行示例随机代理,在任务13(分类:将非生物物品放入盒子中),运行5个回合

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

运行用户控制台,您可以与之交互的环境,在任务3(状态变化:融化)

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

Web服务器演示

还提供了一个Web服务器演示,允许在Web浏览器中运行ScienceWorld用户控制台。

要运行Web服务器演示

conda create --name scienceworld python=3.8
conda activate scienceworld
pip install scienceworld[webserver]

运行Web服务器

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

将您的Web浏览器指向:localhost:8080

ScienceWorld设计

ScienceWorld是用Scala(2.12.9)编写的,并使用sbt编译成JAR文件,通过Java运行。为了方便,还提供了一个Python API(Python >= 3.8),它通过py4j包进行接口。

如果您修改了Scala代码,可以通过运行以下命令重新编译JAR文件:

./simulator/package.sh
pip install -e .

任务

以下表格列出了任务及其变体数量。可以使用任务ID或名称通过env.load()引用任务。

任务ID 任务名称 # 变体
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

基础代理

DRRN: https://github.com/cognitiveailab/drrn-scienceworld

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

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

行为克隆和决策转换器: https://github.com/cognitiveailab/t5-scienceworld

项目详情


下载文件

下载适用于您平台的应用程序。如果您不确定选择哪个,请了解有关安装包的更多信息。

源分布

scienceworld-1.2.1.tar.gz (7.3 MB 查看散列值)

上传时间

构建分布

scienceworld-1.2.1-py3-none-any.whl (7.3 MB 查看散列值)

上传时间 Python 3

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面