Datasets:

Sub-tasks:
extractive-qa
Multilinguality:
multilingual
Size Categories:
unknown
Language Creators:
expert-generated
Annotations Creators:
expert-generated
Source Datasets:
extended|squad
ArXiv:
Tags:
License:
system HF staff commited on
Commit
290b87b
1 Parent(s): ac9c470

Update files from the datasets library (from 1.10.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.10.0

Files changed (1) hide show
  1. xquad.py +3 -3
xquad.py CHANGED
@@ -110,13 +110,12 @@ class Xquad(datasets.GeneratorBasedBuilder):
110
  # TODO(xquad): Yields (key, example) tuples from the dataset
111
  with open(filepath, encoding="utf-8") as f:
112
  xquad = json.load(f)
 
113
  for article in xquad["data"]:
114
  for paragraph in article["paragraphs"]:
115
  context = paragraph["context"].strip()
116
  for qa in paragraph["qas"]:
117
  question = qa["question"].strip()
118
- id_ = qa["id"]
119
-
120
  answer_starts = [answer["answer_start"] for answer in qa["answers"]]
121
  answers = [answer["text"].strip() for answer in qa["answers"]]
122
 
@@ -125,9 +124,10 @@ class Xquad(datasets.GeneratorBasedBuilder):
125
  yield id_, {
126
  "context": context,
127
  "question": question,
128
- "id": id_,
129
  "answers": {
130
  "answer_start": answer_starts,
131
  "text": answers,
132
  },
133
  }
 
110
  # TODO(xquad): Yields (key, example) tuples from the dataset
111
  with open(filepath, encoding="utf-8") as f:
112
  xquad = json.load(f)
113
+ id_ = 0
114
  for article in xquad["data"]:
115
  for paragraph in article["paragraphs"]:
116
  context = paragraph["context"].strip()
117
  for qa in paragraph["qas"]:
118
  question = qa["question"].strip()
 
 
119
  answer_starts = [answer["answer_start"] for answer in qa["answers"]]
120
  answers = [answer["text"].strip() for answer in qa["answers"]]
121
 
124
  yield id_, {
125
  "context": context,
126
  "question": question,
127
+ "id": qa["id"],
128
  "answers": {
129
  "answer_start": answer_starts,
130
  "text": answers,
131
  },
132
  }
133
+ id_ += 1