Datasets:
Update README.md
Browse files
README.md
CHANGED
@@ -39,6 +39,7 @@ This is a variant of the [Statcan Dialogue Dataset](https://huggingface.co/datas
|
|
39 |
## Quickstart
|
40 |
|
41 |
```python
|
|
|
42 |
from datasets import load_dataset
|
43 |
|
44 |
repo = 'McGill-NLP/statcan-dialogue-dataset-retrieval'
|
@@ -58,9 +59,37 @@ corpus_fr = load_dataset(repo, 'corpus', split='french')
|
|
58 |
# features: ['doc_id', 'title', 'doc'],
|
59 |
# num_rows: 5907
|
60 |
# })
|
|
|
|
|
|
|
|
|
|
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
```
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
## License
|
65 |
|
66 |
By using this dataset, you agree to the the following terms of use and restrictions:
|
|
|
39 |
## Quickstart
|
40 |
|
41 |
```python
|
42 |
+
|
43 |
from datasets import load_dataset
|
44 |
|
45 |
repo = 'McGill-NLP/statcan-dialogue-dataset-retrieval'
|
|
|
59 |
# features: ['doc_id', 'title', 'doc'],
|
60 |
# num_rows: 5907
|
61 |
# })
|
62 |
+
```
|
63 |
+
|
64 |
+
The queries is given in list of dicts, with the following keys:
|
65 |
+
- role: either "user" or "operator". Operator is the expert in charge of helping the user.
|
66 |
+
- content: the utterance of the user or operator.
|
67 |
|
68 |
+
```python
|
69 |
+
# ...continued
|
70 |
+
q = queries_en[0]['query']
|
71 |
+
doc_id = queries_en[0]['doc_id']
|
72 |
+
print("Query:", q)
|
73 |
+
|
74 |
+
# You can filter the corpus to find your table (english and french are the same docs)
|
75 |
+
d = corpus_fr.filter(lambda r: r['doc_id'] == doc_id)[0]
|
76 |
+
#
|
77 |
+
print("Title:", d['title'])
|
78 |
+
print('-'*50)
|
79 |
+
print(d['doc'])
|
80 |
```
|
81 |
|
82 |
+
Note that `d['title']` only contains the title of the table, whereas `d['doc']` is the full document and contains:
|
83 |
+
* title,
|
84 |
+
* time period,
|
85 |
+
* table dimensions,
|
86 |
+
* subject (for taxonomy),
|
87 |
+
* name of survey where it was sourced,
|
88 |
+
* update frequency,
|
89 |
+
* columns for each of the dimensions
|
90 |
+
|
91 |
+
Warning: please do not do `d['title'] + d['doc']` as that would be redundant.
|
92 |
+
|
93 |
## License
|
94 |
|
95 |
By using this dataset, you agree to the the following terms of use and restrictions:
|