ParlAI README

The project's README from github.com/facebookresearch/ParlAI. As one markdown file: README.md.

CircleCI CircleCI Coverage GitHub contributors Twitter


ParlAI (pronounced “par-lay”) is a python framework for sharing, training and testing dialogue models, from open-domain chitchat, to task-oriented dialogue, to visual question answering.

Its goal is to provide researchers:

ParlAI is described in the following paper: “ParlAI: A Dialog Research Software Platform", arXiv:1705.06476 or see these more up-to-date slides.

Follow us on Twitter and check out our Release notes to see the latest information about new features & updates, and the website http://parl.ai for further docs. For an archived list of updates, check out NEWS.md.

Interactive Tutorial

For those who want to start with ParlAI now, you can try our Colab Tutorial.

Installing ParlAI

Operating System

ParlAI should work as inteded under Linux or macOS. We do not support Windows at this time, but many users report success on Windows using Python 3.8 and issues with Python 3.9. We are happy to accept patches that improve Windows support.

Python Interpreter

ParlAI currently requires Python3.8+.

Requirements

ParlAI supports Pytorch 1.6 or higher. All requirements of the core modules are listed in requirements.txt. However, some models included (in parlai/agents) have additional requirements.

Virtual Environment

We strongly recommend you install ParlAI in a virtual environment using venv or conda.

End User Installation

If you want to use ParlAI without modifications, you can install it with:

cd /path/to/your/parlai-app
python3.8 -m venv venv
venv/bin/pip install --upgrade pip setuptools wheel
venv/bin/pip install parlai

Developer Installation

Many users will want to modify some parts of ParlAI. To set up a development environment, run the following commands to clone the repository and install ParlAI:

git clone https://github.com/facebookresearch/ParlAI.git ~/ParlAI
cd ~/ParlAI
python3.8 -m venv venv
venv/bin/pip install --upgrade pip setuptools wheel
venv/bin/python setup.py develop

Note Sometimes the install from source maynot work due to dependencies (specially in PyTorch related packaged). In that case try building a fresh conda environment and running the similar to the following: conda install pytorch==2.0.0 torchvision torchaudio torchtext pytorch-cuda=11.8 -c pytorch -c nvidia. Check torch setup documentation for your CUDA and OS versions.

All needed data will be downloaded to ~/ParlAI/data. If you need to clear out the space used by these files, you can safely delete these directories and any files needed will be downloaded again.

Documentation

Examples

A large set of scripts can be found in parlai/scripts. Here are a few of them. Note: If any of these examples fail, check the installation section to see if you have missed something.

Display 10 random examples from the SQuAD task

parlai display_data -t squad

Evaluate an IR baseline model on the validation set of the Personachat task:

parlai eval_model -m ir_baseline -t personachat -dt valid

Train a single layer transformer on PersonaChat (requires pytorch and torchtext). Detail: embedding size 300, 4 attention heads, 2 epochs using batchsize 64, word vectors are initialized with fasttext and the other elements of the batch are used as negative during training.

parlai train_model -t personachat -m transformer/ranker -mf /tmp/model_tr6 --n-layers 1 --embedding-size 300 --ffn-size 600 --n-heads 4 --num-epochs 2 -veps 0.25 -bs 64 -lr 0.001 --dropout 0.1 --embedding-type fasttext_cc --candidates batch

Code Organization

The code is set up into several main directories:

Support

If you have any questions, bug reports or feature requests, please don't hesitate to post on our Github Issues page. You may also be interested in checking out our FAQ and our Tips n Tricks.

Please remember to follow our Code of Conduct.

Contributing

We welcome PRs from the community!

You can find information about contributing to ParlAI in our Contributing document.

The Team

ParlAI is currently maintained by Moya Chen, Emily Dinan, Dexter Ju, Mojtaba Komeili, Spencer Poff, Pratik Ringshia, Stephen Roller, Kurt Shuster, Eric Michael Smith, Megan Ung, Jack Urbanek, Jason Weston, Mary Williamson, and Jing Xu. Kurt Shuster is the current Tech Lead.

Former major contributors and maintainers include Alexander H. Miller, Margaret Li, Will Feng, Adam Fisch, Jiasen Lu, Antoine Bordes, Devi Parikh, Dhruv Batra, Filipe de Avila Belbute Peres, Chao Pan, and Vedant Puri.

Citation

Please cite the arXiv paper if you use ParlAI in your work:

@article{miller2017parlai,
  title={ParlAI: A Dialog Research Software Platform},
  author={{Miller}, A.~H. and {Feng}, W. and {Fisch}, A. and {Lu}, J. and {Batra}, D. and {Bordes}, A. and {Parikh}, D. and {Weston}, J.},
  journal={arXiv preprint arXiv:{1705.06476}},
  year={2017}
}

License

ParlAI is MIT licensed. See the LICENSE file for details.

ParlAI (facebookresearch/ParlAI)

Searching Database…

10.6K ·GitHub
archived
这是什么?ParlAI 是 Facebook(Meta)AI 研究院推出的一个 Python 框架,用于共享、训练和评估对话 AI 模型,涵盖从开放域闲聊到面向任务的对话以及视觉问答等场景,并通过统一的 API 提供 100 多个数据集。
这是独立的应用程序,还是我需要在其基础上开发的框架?它是一个 Python 框架和库,并不是独立的应用程序。你需要编写训练和评估脚本,调用 ParlAI 的核心、agents 和 tasks 模块,其中很多模块位于 parlai/scripts 中。
我该如何安装 ParlAI?如果你只想直接使用,可以以普通用户身份通过 pip 安装。如果你计划修改代码,请克隆仓库,并在使用 venv 或 conda 创建的虚拟环境中运行开发者安装。
安装之前我需要准备什么?你需要 Python 3.8 或更高版本,以及 PyTorch 1.6 或更高版本;parlai/agents 中附带的一些模型还会额外需要其他依赖项。
这个项目还在积极维护吗?不再维护。GitHub 仓库已归档,这意味着它不再进行积极开发,也不再接收修复更新,尽管它仍拥有庞大的用户群体和预训练模型库。
它能在 Windows 上运行吗?官方不支持。ParlAI 仅支持 Linux 和 macOS。不过 README 提到,有些用户已在 Windows 上使用 Python 3.8 成功运行,但使用 Python 3.9 时遇到了问题。
ParlAI 的模型库里有什么?它提供了大量预训练的对话模型,可以直接开箱即用,从检索基线模型到基于 Transformer 的 agents 都有,因此你无需从零开始训练自己的模型。
ParlAI 能让模型与真人连接以收集数据吗?可以。它集成了 Amazon Mechanical Turk,用于众包数据收集和人工评估,也集成了 Facebook Messenger,让 agents 可以直接与真人聊天。
ParlAI 支持多少个数据集?支持 100 多个常用的对话和问答数据集,包括 PersonaChat、DailyDialog、SQuAD、HotpotQA、VQA 和 VisDial,全部可以通过同一个统一的 API 访问。
ParlAI 有相关论文吗?有。该框架在 arXiv 论文《ParlAI: A Dialog Research Software Platform》(arXiv:1705.06476)中有所介绍。
What are similar projects?jeeves, bert, MSA, pyod, flex-pi, spaCy, SolarWM, fairseq
Size
145.7 MB
Stars
10.6K
Age
9y
Commits · 90 Days