Datasets:

Languages:
English
Multilinguality:
monolingual
Size Categories:
10K<n<100K
Language Creators:
crowdsourced
Annotations Creators:
crowdsourced
Source Datasets:
original
ArXiv:
License:

Skip missing JSON files

#6
by albertvillanova HF staff - opened
Files changed (1) hide show
  1. hybrid_qa.py +7 -4
hybrid_qa.py CHANGED
@@ -139,10 +139,13 @@ class HybridQa(datasets.GeneratorBasedBuilder):
139
  table_file_path = os.path.join(tables_path, f"{table_id}.json")
140
  url_data_path = os.path.join(requests_path, f"{table_id}.json")
141
 
142
- with open(table_file_path, encoding="utf-8") as f:
143
- table = json.load(f)
144
- with open(url_data_path, encoding="utf-8") as f:
145
- url_data = json.load(f)
 
 
 
146
 
147
  table["header"] = [header[0] for header in table["header"]]
148
 
 
139
  table_file_path = os.path.join(tables_path, f"{table_id}.json")
140
  url_data_path = os.path.join(requests_path, f"{table_id}.json")
141
 
142
+ try:
143
+ with open(table_file_path, encoding="utf-8") as f:
144
+ table = json.load(f)
145
+ with open(url_data_path, encoding="utf-8") as f:
146
+ url_data = json.load(f)
147
+ except KeyError: # Some JSON files were not properly added to the GitHub repo: filenames with ':', '"'
148
+ continue
149
 
150
  table["header"] = [header[0] for header in table["header"]]
151