Add narrative qa
State: closed | Author: Varal7 (NONE)

Test cases for dummy data don't pass

Only contains data for summaries (not whole story)

Comments: Does it make sense to download the full stories? I remember attempting to implement this dataset a while ago and ended up with something like:
```python
    def _split_generators(self, dl_manager):
        """Returns SplitGenerators."""

        dl_dir = dl_manager.download_and_extract(_DOWNLOAD_URL)
        data_dir = os.path.join(dl_dir, "narrativeqa-master")

        urls = {"test":{}, "train": {},"valid":{}}
        with open(os.path.join(data_dir,"documents.csv")) as f_in:
            csv_reader = csv.reader(f_in)
            next(csv_reader) # discard header row
            for i,row in enumerate(csv_reader):
                if i > 1572:
                    break
                if row != []:
                    urls[row[1]][row[0]] = row[3]

        url_files = {}
        for key in urls.keys():
            url_files[key] = dl_manager.download_and_extract(urls[key])

        return [
            nlp.SplitGenerator(
                name=nlp.Split.TRAIN,
                gen_kwargs={
                    "data_dir":data_dir,
                    "split":"train",
                    "doc_id_to_path":url_files["train"]
                    }
            ),
        ....
```
It does end up cluttering your huggingface cache dir though.

Also since there doesn't seem to be any meaning in the order of answer_1 and answer_2, it might make sense to combine them (see [squad.py](https://github.com/huggingface/nlp/blob/8b0ffc85e4e52ae1f18d31be99b6c70b82c991ca/datasets/squad/squad.py#L86-L88)):
```python
"answers": nlp.features.Sequence({
    "text": nlp.Value("string"),
    "tokenized": nlp.features.Sequence(nlp.Value("string"))
})
```
(the tokenized features should also probably be lists of strings not just strings - see [natural_questions.py](https://github.com/huggingface/nlp/blob/4cd34287300a1135ce7b22f6dd209ca305c71b3a/datasets/natural_questions/natural_questions.py#L83))

Again, this is a personal preference thing, but it might be useful to combine the document-related features:
```python
{
    "document": {
        "id": nlp.Value("string"),
        "kind": nlp.Value("string"),
        "url": nlp.Value("string"),
        "file_size": nlp.Value("int32"),
        "word_count": nlp.Value("int32"),
        "start": nlp.Value("string"),
        "end": nlp.Value("string"),
        "wiki_url": nlp.Value("string"),
        "wiki_title": nlp.Value("string"),
        "summary": nlp.features.Sequence({
            "text": nlp.Value("string"),
            "tokens": nlp.features.Sequence(nlp.Value("string"))
        }),
        "text": nlp.Value("string"),
    },
    "question": nlp.features.Sequence({
        "text": nlp.Value("string"),
        "tokens": nlp.features.Sequence(nlp.Value("string"))
    }),
    "answers": nlp.features.Sequence({
        "text": nlp.Value("string"),
        "tokens": nlp.features.Sequence(nlp.Value("string"))
    })
}
```

Did you manage to fix the dummy data @Varal7 ?

@lhoestq do you think it's acceptable for the `dl_manager` to go grab all the individual stories from project gutenburg? I've got a working version of that but it does clutter up your huggingface cache somewhat.

The real value (and original purpose) of this dataset is doing question answering on the full text.

> @lhoestq do you think it's acceptable for the `dl_manager` to go grab all the individual stories from project gutenburg? I've got a working version of that but it does clutter up your huggingface cache somewhat.
> 
> The real value (and original purpose) of this dataset is doing question answering on the full text.

What's the problem exactly with the cache ?

Nothing, just that because each story is a separate download it gets a bit messy as all 1573 files are under `~/.cache/hugginface/datasets` rather than organized under a subdir.

Probably doesn't matter to the end user though.

Yea I agree it's a mess. I just created #393 to make things easier.

I got the PR merged to have a cleaner the cache directory (everything is downloaded inside the 'downloads' sub-directory).
Feel free to download all the stories then @ghomasHudson @Varal7  x)
If you have the possibility of downloading a compressed file with most of the stories at once it would be better though.

Looks good @lhoestq . The problem I'm having at the moment is that stories from project Gutenberg occasionally fail. All books are out of copyright so we should be able to host them. 

Here's a zip file of the full text if we have anywhere to put them: https://drive.google.com/file/d/17jOR7NqvzDwSlPXrlHaYV-PGI8JG-KY5/view?usp=sharing


I put the zip file here @ghomasHudson 
https://storage.googleapis.com/huggingface-nlp/datasets/narrative_qa/narrativeqa_full_text.zip

Sorry for the delay

Closing in favor of #499