This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP check in * all the required models added * the model name and directory * Readme core * lint * WIP check in * all the required models added * the model name and directory * Readme core * lint * model zoo list * finalized readme * lint * # flake8: noqa on models list
- Loading branch information
1 parent
777123d
commit 4d3efd7
Showing
8 changed files
with
214 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
""" | ||
The speaker prediction model for MultiLIGHT. | ||
""" | ||
|
||
|
||
from parlai.zoo.multilight.utils import maybe_download | ||
|
||
MODEL_NAME = 'speaker' | ||
|
||
|
||
def download(datapath): | ||
maybe_download(MODEL_NAME, datapath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
import os | ||
from parlai.core.build_data import built, download_models, get_model_dir | ||
|
||
PROJECT_NAME = 'multilight' | ||
VERSION = 'v1.0' | ||
|
||
|
||
def maybe_download(model_type, datapath): | ||
ddir = os.path.join(get_model_dir(datapath), PROJECT_NAME) | ||
if not built(os.path.join(ddir, model_type), VERSION): | ||
opt = {'datapath': datapath, 'model_type': model_type} | ||
fnames = ['model.tar.gz'] | ||
download_models(opt, fnames, PROJECT_NAME, version=VERSION, use_model_type=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
""" | ||
Utterance generations model for multi-player light (multilight dataset). | ||
2.7B parameter | ||
""" | ||
|
||
|
||
from parlai.zoo.multilight.utils import maybe_download | ||
|
||
MODEL_NAME = 'utterance_3B' | ||
|
||
|
||
def download(datapath): | ||
maybe_download(MODEL_NAME, datapath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
""" | ||
Utterance generations model for multi-player light (multilight dataset). | ||
400m parameter | ||
""" | ||
|
||
|
||
from parlai.zoo.multilight.utils import maybe_download | ||
|
||
MODEL_NAME = 'utterance_400m' | ||
|
||
|
||
def download(datapath): | ||
maybe_download(MODEL_NAME, datapath) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Multi-Party Chat: Conversational Agents in Group Settings with Humans and Models | ||
|
||
Jimmy Wei, Kurt Shuster, Arthur Szlam, Jason Weston, Jack Urbanek, Mojtaba Komeili | ||
|
||
## Abstract | ||
|
||
Current dialogue research primarily studies pairwise (two-party) conversations, and does not address the everyday setting where more than two speakers converse together. In this work, we both collect and evaluate multi-party conversations to study this more general case. We use the LIGHT environment to construct grounded conversations, where each participant has an assigned character to role-play. We thus evaluate the ability of language models to act as one or more characters in such conversations. Models require two skills that pairwise-trained models appear to lack: (1) being able to decide when to talk; (2) producing coherent utterances grounded on multiple characters. We compare models trained on our new dataset to existing pairwise-trained dialogue models, as well as large language models with few-shot prompting. We find that our new dataset, MultiLIGHT, which we will publicly release, can help bring significant improvements in the group setting. | ||
|
||
## Paper | ||
|
||
[Link](https://arxiv.org/abs/2304.13835) | ||
|
||
|
||
## Data | ||
|
||
There are three types of teachers in this task. Two of them focus on the utterances and conversation content, the other one on predicting the next speaker. | ||
|
||
1. Utterances from all the characters: | ||
```.sh | ||
parlai dd -t light_multiparty --add-location-to-context true --add-personas-to-context true | ||
``` | ||
|
||
2. Utterances from a single character only: | ||
```.sh | ||
parlai dd -t light_multiparty:FirstSpeakerTeacher --add-location-to-context true --add-personas-to-context true | ||
``` | ||
|
||
3. Predicting the speaker for the next turn: | ||
```.sh | ||
parlai dd -t light_multiparty:SpeakerPredictionTeacher --add-location-to-context true --add-personas-to-context true | ||
``` | ||
|
||
See the [agent](https://github.com/facebookresearch/ParlAI/blob/main/parlai/tasks/light_multiparty/agents.py) for up-to-date details on available teachers and flags. | ||
|
||
### Rendered sample | ||
<p align="center"><img width="50%" src="DatasetExample.png" /></p> | ||
|
||
## Models | ||
|
||
We released three models from this project: | ||
|
||
* `zoo:multilight/utterance_3B/model`: the best performing *Utterance only* model trained on LIGHT, LIGHT Wild and MultiLIGHT, multi-tasked (3B parameters size). | ||
* `zoo:multilight/utterance_400m/model`: the best performing *Utterance only* model trained on LIGHT, LIGHT Wild and MultiLIGHT, multi-tasked (400m parameters size). | ||
* `zoo:multilight/speaker/model`: predicts the next speaker. | ||
|
||
`zoo:multilight/utterance_3B/model` and `zoo:multilight/speaker/model` were used in our human evals as reported in the paper. | ||
|
||
### Running models | ||
|
||
You can run these models with the existing ParlAI dataset, for example | ||
```.sh | ||
parlai eval_model -mf zoo:multilight/utterance_3B/model \ | ||
--task light_multiparty --add-location-to-context true --add-personas-to-context true | ||
``` | ||
|
||
Utterance models performance on all character teachers: | ||
| utterance model | PPL | | ||
|-------------------------------------|-------| | ||
| zoo:multilight/utterance_3B/model | 13.25 | | ||
| zoo:multilight/utterance_400m/model | 15.08 | |