sps commited on
Commit
9fa7b76
1 Parent(s): 59f692e

Update data script - make a list of spans

Browse files
Files changed (1) hide show
  1. codequeries.py +15 -18
codequeries.py CHANGED
@@ -137,28 +137,25 @@ class Codequeries(datasets.GeneratorBasedBuilder):
137
  "header": datasets.Value("string")
138
  }
139
  )
140
- features["answer_spans"] = datasets.features.Sequence(
141
  {
142
- "answer_span": {
143
- 'span': datasets.Value("string"),
144
- 'start_line': datasets.Value("int32"),
145
- 'start_column': datasets.Value("int32"),
146
- 'end_line': datasets.Value("int32"),
147
- 'end_column': datasets.Value("int32")
148
- }
149
  }
150
- )
151
- features["supporting_fact_spans"] = datasets.features.Sequence(
 
152
  {
153
- "supporting_fact_span": {
154
- 'span': datasets.Value("string"),
155
- 'start_line': datasets.Value("int32"),
156
- 'start_column': datasets.Value("int32"),
157
- 'end_line': datasets.Value("int32"),
158
- 'end_column': datasets.Value("int32")
159
- }
160
  }
161
- )
162
  features["code_file_path"] = datasets.Value("string")
163
  features["example_type"] = datasets.Value("int32")
164
  features["subtokenized_input_sequence"] = datasets.features.Sequence(datasets.Value("string"))
 
137
  "header": datasets.Value("string")
138
  }
139
  )
140
+ features["answer_spans"] = [
141
  {
142
+ 'span': datasets.Value("string"),
143
+ 'start_line': datasets.Value("int32"),
144
+ 'start_column': datasets.Value("int32"),
145
+ 'end_line': datasets.Value("int32"),
146
+ 'end_column': datasets.Value("int32")
 
 
147
  }
148
+ ]
149
+
150
+ features["supporting_fact_spans"] = [
151
  {
152
+ 'span': datasets.Value("string"),
153
+ 'start_line': datasets.Value("int32"),
154
+ 'start_column': datasets.Value("int32"),
155
+ 'end_line': datasets.Value("int32"),
156
+ 'end_column': datasets.Value("int32")
 
 
157
  }
158
+ ]
159
  features["code_file_path"] = datasets.Value("string")
160
  features["example_type"] = datasets.Value("int32")
161
  features["subtokenized_input_sequence"] = datasets.features.Sequence(datasets.Value("string"))