added id to example
Browse files- README.md +6 -4
- policies.py +2 -0
README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
---
|
2 |
dataset_info:
|
3 |
features:
|
|
|
|
|
4 |
- name: context
|
5 |
dtype: string
|
6 |
- name: question
|
@@ -14,11 +16,11 @@ dataset_info:
|
|
14 |
config_name: plain_text
|
15 |
splits:
|
16 |
- name: train
|
17 |
-
num_bytes:
|
18 |
num_examples: 12132
|
19 |
- name: test
|
20 |
-
num_bytes:
|
21 |
num_examples: 1348
|
22 |
-
download_size:
|
23 |
-
dataset_size:
|
24 |
---
|
|
|
1 |
---
|
2 |
dataset_info:
|
3 |
features:
|
4 |
+
- name: id
|
5 |
+
dtype: string
|
6 |
- name: context
|
7 |
dtype: string
|
8 |
- name: question
|
|
|
16 |
config_name: plain_text
|
17 |
splits:
|
18 |
- name: train
|
19 |
+
num_bytes: 1372563
|
20 |
num_examples: 12132
|
21 |
- name: test
|
22 |
+
num_bytes: 153021
|
23 |
num_examples: 1348
|
24 |
+
download_size: 2238675
|
25 |
+
dataset_size: 1525584
|
26 |
---
|
policies.py
CHANGED
@@ -84,6 +84,7 @@ class PoliciesQA(datasets.GeneratorBasedBuilder):
|
|
84 |
with open(filepath, encoding="utf-8") as f:
|
85 |
policies = json.load(f)
|
86 |
for policy in policies["data"]:
|
|
|
87 |
context = policy["context"]
|
88 |
question = policy["question"]
|
89 |
answer_starts = [answer_start
|
@@ -91,6 +92,7 @@ class PoliciesQA(datasets.GeneratorBasedBuilder):
|
|
91 |
answers = [
|
92 |
answer_text for answer_text in policy["answers"]["text"]]
|
93 |
yield key, {
|
|
|
94 |
"context": context,
|
95 |
"question": question,
|
96 |
"answers": {
|
|
|
84 |
with open(filepath, encoding="utf-8") as f:
|
85 |
policies = json.load(f)
|
86 |
for policy in policies["data"]:
|
87 |
+
id = policy["id"]
|
88 |
context = policy["context"]
|
89 |
question = policy["question"]
|
90 |
answer_starts = [answer_start
|
|
|
92 |
answers = [
|
93 |
answer_text for answer_text in policy["answers"]["text"]]
|
94 |
yield key, {
|
95 |
+
"id": id,
|
96 |
"context": context,
|
97 |
"question": question,
|
98 |
"answers": {
|