Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reformat README #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 83 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,53 @@
<<<<<<< HEAD
# Ubuntu Dialogue Corpus v2.0
=======
# README -- Ubuntu Dialogue Corpus v2.0
>>>>>>> 481182591b91173713f23812ce726fe64ad91209

We describe the files for generating the Ubuntu Dialogue Corpus, and the dataset itself.
Scripts for generating the Ubuntu Dialogue Corpus, and information about corpus contents.

## UPDATES FROM UBUNTU CORPUS v1.0:

There are several updates and bug fixes that are present in v2.0. The updates are significant enough that results on the two datasets will not be equivalent, and should not be compared. However, models that do well on the first dataset should transfer to the second dataset (with perhaps a new hyperparameter search).
Version 2.0 of the corpus is not compatible with Version 1.0, and performance results should not be compared between the two. However, models that do well on the first dataset should also do well on the second dataset but may require a new hyperparameter search.

- Separated the train/validation/test sets by time. The training set goes from the beginning (2004) to about April 27, 2012, the validation set goes from April 27 to August 7, 2012, and the test set goes from August 7 to December 1, 2012. This more closely mimics real life implementation, where you are training a model on past data to predict future data.
- Train/validation/test sets separated by date to more closely mimics real life implementation, where you are training a model on past data to predict future data.
- *Training set* -- Jan 2004 to April 27, 2012
- *Validation set* -- April 27 to August 7, 2012
- *Test set* -- August 7 to December 1, 2012
- Changed the sampling procedure for the context length in the validation and test sets, from an inverse distribution to a uniform distribution (between 2 and the max context size). This increases the average context length, which we consider desirable since we would like to model long-term dependencies.
- Changed the tokenization and entity replacement procedure. After complaints stating v1 was too aggressive, we've decided to remove these. It is up to each person using the dataset to come up with their own tokenization/ entity replacement scheme. We plan to use the tokenization internally.
- Added differentiation between the end of an utterance (`__eou__`) and end of turn (`__eot__`). In the original dataset, we concatenated all consecutive utterances by the same user in to one utterance, and put `__EOS__` at the end. Here, we also denote where the original utterances were (with `__eou__`). Also, the terminology should now be consistent between the training and test set (instead of both `__EOS__` and `</s>`).
- Fixed a bug that caused the distribution of false responses in the test and validation sets to be different from the true responses. In particular, the number of words in the false responses was shorter on average than for the true responses, which could have been exploited by some models.

## UBUNTU CORPUS GENERATION FILES:
<<<<<<< HEAD

### `generate.sh`

Script that calls `create_ubuntu_dataset.py`. This is the script you should run in order to download the dataset. The parameters passed to this script will be passed to `create_ubuntu_dataset.py`. Example usage: `./generate.sh -t -s -l`.

### `create_ubuntu_dataset.py`

=======

### generate.sh:
#### DESCRIPTION:
Script that calls `create_ubuntu_dataset.py`. This is the script you should run in order to download the dataset. The parameters passed to this script will be passed to `create_ubuntu_dataset.py`. Example usage: `./generate.sh -t -s -l`.

### create_ubuntu_dataset.py:
#### DESCRIPTION:
>>>>>>> 481182591b91173713f23812ce726fe64ad91209
Script for generation of train, test and valid datasets from Ubuntu Corpus 1 on 1 dialogs.
The script downloads 1on1 dialogs from internet and then it randomly samples all the datasets with positive and negative examples.
Copyright IBM 2015

<<<<<<< HEAD
(C) IBM 2015

#### ARGUMENTS:

=======
#### ARGUMENTS:
>>>>>>> 481182591b91173713f23812ce726fe64ad91209
- `--data_root`: directory where 1on1 dialogs will downloaded and extracted, the data will be downloaded from [cs.mcgill.ca/~jpineau/datasets/ubuntu-corpus-1.0/ubuntu_dialogs.tgz](http://cs.mcgill.ca/~jpineau/datasets/ubuntu-corpus-1.0/ubuntu_dialogs.tgz) (default = '.')
- `--seed`: seed for random number generator (default = 1234)
- `-o`, `--output`: output file for writing to csv (default = None)
Expand All @@ -35,6 +58,10 @@ Copyright IBM 2015
*Note:* if both `-s` and `-l` are present, the stemmer is applied before the lemmatizer.

#### Subparsers:
<<<<<<< HEAD

=======
>>>>>>> 481182591b91173713f23812ce726fe64ad91209
`train`: train set generator
- `-p`: positive example probability, ie. the ratio of positive examples to total examples in the training set (default = 0.5)
- `-e`, `--examples`: number of training examples to generate. Note that this will generate slightly fewer examples than desired, as there is a 'post-processing' step that filters (default = 1000000)
Expand All @@ -46,6 +73,37 @@ Copyright IBM 2015
- `-n`: number of distractor examples for each context (default = 9)


<<<<<<< HEAD
### meta folder

trainfiles.csv
valfiles.csv
testfiles.csv

#### DESCRIPTION:

Maps the original dialogue files to the training, validation, and test sets.


## UBUNTU CORPUS FILES (after generating)

### train.csv

Contains the training set. It is separated into 3 columns: the context of the conversation, the candidate response or 'utterance', and a flag or 'label' (= 0 or 1) denoting whether the response is a 'true response' to the context (flag = 1), or a randomly drawn response from elsewhere in the dataset (flag = 0). This triples format is described in the paper. When generated with the default settings, train.csv is 463Mb, with 1,000,000 lines (ie. examples, which corresponds to 449,071 dialogues) and with a vocabulary size of ~~1,344,621~~. Note that, to generate the full dataset, you should use the `--examples` argument for the `create_ubuntu_dataset.py` file.

### valid.csv

Contains the validation set. Each row represents a question. Separated into 11 columns: the context, the true response or 'ground truth utterance', and 9 false responses or 'distractors' that were randomly sampled from elsewhere in the dataset. Your model gets a question correct if it selects the ground truth utterance from amongst the 10 possible responses. When generated with the default settings, `valid.csv` is 27Mb, with 19,561 lines and a vocabulary size of 115,688.

### test.csv

Contains the test set. Formatted in the same way as the validation set. When generated with the default settings, test.csv is 27Mb, with 18,921 lines and a vocabulary size of 115,623.

## BASELINE RESULTS

#### Dual Encoder LSTM model

=======
### meta folder: trainfiles.csv, valfiles.csv, testfiles.csv:
#### DESCRIPTION:
Maps the original dialogue files to the training, validation, and test sets.
Expand All @@ -65,6 +123,7 @@ Contains the test set. Formatted in the same way as the validation set. When gen
## BASELINE RESULTS

#### Dual Encoder LSTM model:
>>>>>>> 481182591b91173713f23812ce726fe64ad91209
```
1 in 2:
recall@1: 0.868730970907
Expand All @@ -74,7 +133,12 @@ Contains the test set. Formatted in the same way as the validation set. When gen
recall@5: 0.924285351827
```

<<<<<<< HEAD
#### Dual Encoder RNN model

=======
#### Dual Encoder RNN model:
>>>>>>> 481182591b91173713f23812ce726fe64ad91209
```
1 in 2:
recall@1: 0.776539210705,
Expand All @@ -84,7 +148,12 @@ Contains the test set. Formatted in the same way as the validation set. When gen
recall@5: 0.836350355691,
```

<<<<<<< HEAD
#### TF-IDF model

=======
#### TF-IDF model:
>>>>>>> 481182591b91173713f23812ce726fe64ad91209
```
1 in 2:
recall@1: 0.749260042283
Expand All @@ -98,7 +167,12 @@ Contains the test set. Formatted in the same way as the validation set. When gen

Code for the model can be found here (might not be up to date with the new dataset): https://github.com/npow/ubottu

<<<<<<< HEAD
#### Dual Encoder LSTM model

=======
#### Dual Encoder LSTM model:
>>>>>>> 481182591b91173713f23812ce726fe64ad91209
```
act_penalty=500
batch_size=256
Expand Down Expand Up @@ -128,7 +202,12 @@ use_pv=False
xcov_penalty=0.0
```

<<<<<<< HEAD
#### Dual Encoder RNN model

=======
#### Dual Encoder RNN model:
>>>>>>> 481182591b91173713f23812ce726fe64ad91209
```
act_penalty=500
batch_size=512
Expand Down
Loading