ag2435 commited on
Commit
c3a10f8
β€’
1 Parent(s): 8a13e6e

created config=has_html that filters data with valid html only

Browse files
README.md CHANGED
@@ -8,6 +8,14 @@ configs:
8
  path: "data/dev_instances.json"
9
  - split: test
10
  path: "data/test_instances.json"
 
 
 
 
 
 
 
 
11
  ---
12
 
13
  # Preprocessed QASPER dataset
 
8
  path: "data/dev_instances.json"
9
  - split: test
10
  path: "data/test_instances.json"
11
+ - config_name: has_html
12
+ data_files:
13
+ - split: train
14
+ path: "data/train_instances_with_html.json"
15
+ - split: dev
16
+ path: "data/dev_instances_with_html.json"
17
+ - split: test
18
+ path: "data/test_instances_with_html.json"
19
  ---
20
 
21
  # Preprocessed QASPER dataset
data/dev_instances_with_html.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c32ef2d9dea5b354351a6faa84c0283b2b13d7638c4661496f1f204e3462fe54
3
+ size 280585592
data/test_instances_with_html.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2a0fdcc520f6d8cf430ba327b4c05d2c085fafc2ab26fa8112d8614ac7e2763
3
+ size 408403823
data/train_instances_with_html.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dcd32418fd7e9370c6ae2c7844046cf09f60b04458591871aadbdc5093cd19b5
3
+ size 794077467
qasper.ipynb CHANGED
@@ -37,7 +37,9 @@
37
  "import plotly.express as px\n",
38
  "import plotly.graph_objects as go\n",
39
  "import dataset_reader\n",
40
- "from transformers.tokenization_utils_base import BatchEncoding"
 
 
41
  ]
42
  },
43
  {
@@ -46,59 +48,2084 @@
46
  "metadata": {},
47
  "outputs": [],
48
  "source": [
49
- "# input_path = 'original_data/qasper-train-dev-v0.3/qasper-train-v0.3.json'\n",
50
- "input_path = 'original_data/qasper-test-and-evaluator-v0.3/qasper-test-v0.3.json'\n",
 
 
 
 
 
 
 
 
 
 
 
51
  "output_path = 'data'\n",
52
- "split = 'test'\n",
 
53
  "assert split in input_path"
54
  ]
55
  },
56
  {
57
  "cell_type": "code",
58
- "execution_count": 4,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  "metadata": {},
60
  "outputs": [],
61
  "source": [
62
- "reader = dataset_reader.QasperReader(include_global_attention_mask=False)\n",
63
- "instances = list(reader._read(input_path))"
 
 
 
 
64
  ]
65
  },
66
  {
67
  "cell_type": "code",
68
- "execution_count": 5,
69
  "metadata": {},
70
  "outputs": [
71
  {
72
  "data": {
73
  "text/plain": [
74
- "defaultdict(int,\n",
75
- " {'number of documents': 416,\n",
76
- " 'number of questions': 1451,\n",
77
- " 'number of answers': 3554,\n",
78
- " 'questions with multiple answers': 1427,\n",
79
- " 'extractive questions': 1817,\n",
80
- " 'extractive questions with multiple spans': 787,\n",
81
- " 'multiple_evidence_spans_count': 1063,\n",
82
- " 'freeform answers': 878,\n",
83
- " 'answers with table or figure as evidence': 391,\n",
84
- " 'answers with no evidence': 444,\n",
85
- " 'unanswerable questions': 366,\n",
86
- " 'yes/no questions': 493,\n",
87
- " 'number of truncated contexts': 2})"
88
  ]
89
  },
90
- "execution_count": 5,
91
  "metadata": {},
92
  "output_type": "execute_result"
93
  }
94
  ],
95
  "source": [
96
- "reader._stats"
97
  ]
98
  },
99
  {
100
  "cell_type": "code",
101
- "execution_count": 6,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  "metadata": {},
103
  "outputs": [
104
  {
@@ -125,1457 +2152,1011 @@
125
  "showlegend": true,
126
  "type": "histogram",
127
  "x": [
128
- 7574,
129
- 7569,
130
- 7574,
131
- 7577,
132
- 4103,
133
- 5491,
134
- 5489,
135
- 5489,
136
- 5491,
137
- 5492,
138
- 5489,
139
- 4802,
140
- 4802,
141
- 6355,
142
- 6358,
143
- 6363,
144
- 2632,
145
- 2638,
146
- 2633,
147
- 3556,
148
- 3557,
149
- 3557,
150
- 3954,
151
- 3948,
152
- 3947,
153
- 3948,
154
- 2593,
155
- 2592,
156
- 2589,
157
- 7232,
158
- 4374,
159
- 4379,
160
- 4375,
161
- 7679,
162
- 7679,
163
- 7680,
164
- 7680,
165
- 7679,
166
- 7681,
167
- 2631,
168
- 2629,
169
- 2627,
170
- 2627,
171
- 2627,
172
- 5644,
173
- 5644,
174
- 5641,
175
- 5642,
176
- 4153,
177
- 4153,
178
- 4152,
179
- 3628,
180
- 3627,
181
- 3626,
182
- 6481,
183
- 6471,
184
- 6477,
185
- 5854,
186
- 5851,
187
- 5855,
188
- 2812,
189
- 2814,
190
- 4355,
191
- 4355,
192
- 4352,
193
- 4355,
194
- 5766,
195
- 5763,
196
- 5767,
197
- 5764,
198
- 5758,
199
- 3341,
200
- 3339,
201
- 3360,
202
- 3341,
203
- 3345,
204
- 1649,
205
- 1651,
206
- 1650,
207
- 2317,
208
- 2315,
209
- 2314,
210
- 2893,
211
- 2891,
212
- 2895,
213
- 2664,
214
- 2668,
215
- 2668,
216
- 2663,
217
- 5552,
218
- 5559,
219
- 5557,
220
- 5555,
221
- 6438,
222
- 6443,
223
- 6438,
224
- 6437,
225
- 5294,
226
- 5290,
227
- 5291,
228
- 5291,
229
- 4229,
230
- 4224,
231
- 4224,
232
- 2715,
233
- 2711,
234
- 2716,
235
- 2710,
236
- 2711,
237
- 2712,
238
- 2710,
239
- 3279,
240
- 3282,
241
- 3282,
242
- 3282,
243
- 3283,
244
- 3280,
245
- 3474,
246
- 3474,
247
- 3475,
248
- 3476,
249
- 5646,
250
- 5646,
251
- 5646,
252
- 5642,
253
- 4563,
254
- 4561,
255
- 4562,
256
- 4567,
257
- 4563,
258
- 4563,
259
- 4561,
260
- 5194,
261
- 5189,
262
- 5196,
263
- 8518,
264
- 8519,
265
- 8518,
266
- 8520,
267
- 8519,
268
- 8519,
269
- 3673,
270
- 3673,
271
- 3676,
272
- 6399,
273
- 6407,
274
- 4527,
275
- 4522,
276
- 4522,
277
- 5838,
278
- 5836,
279
- 5836,
280
- 8347,
281
- 8349,
282
- 1179,
283
- 1177,
284
- 1176,
285
- 1177,
286
- 1176,
287
- 3294,
288
- 3294,
289
- 6697,
290
- 6708,
291
- 6707,
292
- 5097,
293
- 5094,
294
- 5105,
295
- 2141,
296
- 2144,
297
- 2143,
298
- 4648,
299
- 4643,
300
- 4645,
301
- 3723,
302
- 3723,
303
- 3723,
304
- 3721,
305
- 2445,
306
- 2444,
307
- 3659,
308
- 3649,
309
- 3647,
310
- 3650,
311
- 4460,
312
- 4460,
313
- 3645,
314
- 3641,
315
- 3641,
316
- 3643,
317
- 2776,
318
- 2783,
319
- 2771,
320
- 3348,
321
- 3341,
322
- 3344,
323
- 3341,
324
- 2778,
325
- 2779,
326
- 2783,
327
- 2781,
328
- 3659,
329
- 3653,
330
- 3658,
331
- 3653,
332
- 2624,
333
- 2628,
334
- 2627,
335
- 2625,
336
- 2625,
337
- 2626,
338
- 3584,
339
- 3580,
340
- 2838,
341
- 2837,
342
- 4610,
343
- 4607,
344
- 4605,
345
- 4604,
346
- 4605,
347
- 4802,
348
- 4802,
349
- 4804,
350
- 4802,
351
- 4801,
352
- 4798,
353
- 4800,
354
- 2959,
355
- 2954,
356
- 2956,
357
- 5573,
358
- 5578,
359
- 2539,
360
- 2537,
361
- 2537,
362
- 14957,
363
- 14954,
364
- 14946,
365
- 14953,
366
- 4510,
367
- 4502,
368
- 4502,
369
- 4504,
370
- 4501,
371
- 4774,
372
- 4775,
373
- 5710,
374
- 5929,
375
- 5928,
376
- 3004,
377
- 3003,
378
- 3003,
379
- 3007,
380
- 3008,
381
- 4526,
382
- 4530,
383
- 4528,
384
- 4526,
385
- 2903,
386
- 2906,
387
- 2906,
388
- 3373,
389
- 3379,
390
- 3371,
391
- 3375,
392
- 3375,
393
- 3637,
394
- 3637,
395
- 2096,
396
- 2090,
397
- 6331,
398
- 6327,
399
- 6328,
400
- 5317,
401
- 5320,
402
- 5310,
403
- 5314,
404
- 5963,
405
- 5960,
406
- 2989,
407
- 2989,
408
- 2991,
409
- 3545,
410
- 3551,
411
- 3546,
412
- 3544,
413
- 6593,
414
- 6609,
415
- 6586,
416
- 5183,
417
- 5189,
418
- 5182,
419
- 6773,
420
- 6760,
421
- 6772,
422
- 6761,
423
- 5712,
424
- 5710,
425
- 5710,
426
- 6712,
427
- 6711,
428
- 6715,
429
- 4002,
430
- 3992,
431
- 3998,
432
- 6192,
433
- 6184,
434
- 6186,
435
- 6189,
436
- 5478,
437
- 5485,
438
- 4384,
439
- 4386,
440
- 4385,
441
- 4384,
442
- 3545,
443
- 3264,
444
- 3266,
445
- 3263,
446
- 3266,
447
- 5838,
448
- 5840,
449
- 2884,
450
- 2880,
451
- 2883,
452
- 2884,
453
- 2998,
454
- 2998,
455
- 2998,
456
- 3001,
457
- 2706,
458
- 2701,
459
- 2704,
460
- 2704,
461
- 4195,
462
- 4197,
463
- 4194,
464
- 2768,
465
- 2761,
466
- 2767,
467
- 2762,
468
- 3169,
469
- 6721,
470
- 4036,
471
- 2888,
472
- 2887,
473
- 8826,
474
- 8826,
475
- 8826,
476
- 8824,
477
- 2398,
478
- 2404,
479
- 5021,
480
- 5038,
481
- 5030,
482
- 5825,
483
- 3670,
484
- 3669,
485
- 3577,
486
- 3206,
487
- 3204,
488
- 4054,
489
- 8719,
490
- 4150,
491
- 4153,
492
- 854,
493
- 7084,
494
- 7088,
495
- 7086,
496
- 6814,
497
- 3623,
498
- 3624,
499
- 7944,
500
- 4680,
501
- 4682,
502
- 4682,
503
- 4680,
504
- 4683,
505
- 4682,
506
- 4679,
507
- 4680,
508
- 5535,
509
- 5542,
510
- 5534,
511
- 5539,
512
- 5542,
513
- 5537,
514
- 4813,
515
- 4816,
516
- 4815,
517
- 4812,
518
- 4812,
519
- 4813,
520
- 2785,
521
- 2783,
522
- 2786,
523
- 2792,
524
- 2784,
525
- 2792,
526
- 4384,
527
- 4383,
528
- 4386,
529
- 4385,
530
- 4387,
531
- 4825,
532
- 4827,
533
- 4832,
534
- 4823,
535
- 4823,
536
- 2876,
537
- 2877,
538
- 2873,
539
- 2877,
540
- 2873,
541
- 7625,
542
- 7631,
543
- 7632,
544
- 7629,
545
- 7625,
546
- 3088,
547
- 3090,
548
- 3087,
549
- 3087,
550
- 2874,
551
- 2870,
552
- 2870,
553
- 2867,
554
- 2866,
555
- 2868,
556
- 2867,
557
- 2867,
558
- 1977,
559
- 1975,
560
- 1979,
561
- 1976,
562
- 4580,
563
- 4587,
564
- 4585,
565
- 4590,
566
- 8314,
567
- 8310,
568
- 8307,
569
- 8314,
570
- 5827,
571
- 5823,
572
- 5823,
573
- 5825,
574
- 5974,
575
- 5971,
576
- 5974,
577
- 5972,
578
- 5974,
579
- 5973,
580
- 5974,
581
- 5798,
582
- 5800,
583
- 5786,
584
- 4363,
585
- 4363,
586
- 4362,
587
- 3041,
588
- 3039,
589
- 3036,
590
- 4393,
591
- 4394,
592
- 4393,
593
- 6195,
594
- 6199,
595
- 6196,
596
- 6384,
597
- 6384,
598
- 6384,
599
- 6384,
600
- 6383,
601
- 6386,
602
- 3365,
603
- 3366,
604
- 3379,
605
- 5022,
606
- 5019,
607
- 5017,
608
- 2636,
609
- 2646,
610
- 2639,
611
- 2635,
612
- 2636,
613
- 2650,
614
- 5039,
615
- 5035,
616
- 5037,
617
- 4184,
618
- 4185,
619
- 4184,
620
- 4807,
621
- 4809,
622
- 4806,
623
- 4806,
624
- 4808,
625
- 4815,
626
- 3033,
627
- 3044,
628
- 3045,
629
- 3314,
630
- 3313,
631
- 3313,
632
- 3308,
633
- 3313,
634
- 3311,
635
- 4984,
636
- 4977,
637
- 4985,
638
- 5919,
639
- 5918,
640
- 5919,
641
- 4500,
642
- 4505,
643
- 4516,
644
- 4341,
645
- 4348,
646
- 4347,
647
- 4507,
648
- 4522,
649
- 4514,
650
- 7900,
651
- 7887,
652
- 7888,
653
- 7887,
654
- 7886,
655
- 7887,
656
- 7891,
657
- 7888,
658
- 5912,
659
- 5908,
660
- 5904,
661
- 5905,
662
- 5902,
663
- 3650,
664
- 3648,
665
- 3651,
666
- 3651,
667
- 3648,
668
- 3554,
669
- 3557,
670
- 3553,
671
- 3557,
672
- 3557,
673
- 2572,
674
- 2569,
675
- 2569,
676
- 2569,
677
- 2572,
678
- 6191,
679
- 6188,
680
- 6189,
681
- 6189,
682
- 6190,
683
- 4172,
684
- 4174,
685
- 4174,
686
- 4172,
687
- 4170,
688
- 5597,
689
- 5596,
690
- 5598,
691
- 5597,
692
- 5598,
693
- 9010,
694
- 9011,
695
- 9013,
696
- 9013,
697
- 9009,
698
- 9012,
699
- 5407,
700
- 5413,
701
- 5408,
702
- 5406,
703
- 5406,
704
- 5406,
705
- 5713,
706
- 5711,
707
- 5713,
708
- 5712,
709
- 6142,
710
- 6142,
711
- 6140,
712
- 6144,
713
- 5549,
714
- 5543,
715
- 5419,
716
- 5420,
717
- 7092,
718
- 7089,
719
- 7086,
720
- 7089,
721
- 6252,
722
- 6256,
723
- 6257,
724
- 6251,
725
- 2699,
726
- 2698,
727
- 5691,
728
- 5691,
729
- 2859,
730
- 2858,
731
- 2860,
732
- 2861,
733
- 4917,
734
- 4921,
735
- 4923,
736
- 4918,
737
- 1770,
738
- 1772,
739
- 6205,
740
- 6206,
741
- 5200,
742
- 5199,
743
- 3112,
744
- 3108,
745
- 2603,
746
- 2597,
747
- 2599,
748
- 2598,
749
- 4933,
750
- 4931,
751
- 4929,
752
- 4928,
753
- 3285,
754
- 3292,
755
- 3289,
756
- 3291,
757
- 3290,
758
- 3287,
759
- 3996,
760
- 4002,
761
- 8335,
762
- 8340,
763
- 6619,
764
- 6614,
765
- 2819,
766
- 2822,
767
- 2816,
768
- 2817,
769
- 2819,
770
- 2478,
771
- 2472,
772
- 2470,
773
- 2471,
774
- 2466,
775
- 4815,
776
- 4824,
777
- 4822,
778
- 4821,
779
- 4819,
780
- 7170,
781
- 7168,
782
- 7169,
783
- 7171,
784
- 7170,
785
- 7169,
786
- 7170,
787
- 7171,
788
- 5122,
789
- 5120,
790
- 5120,
791
- 5123,
792
- 5123,
793
- 5123,
794
- 2853,
795
- 2854,
796
- 2853,
797
- 13450,
798
- 13449,
799
- 13449,
800
- 2814,
801
- 2824,
802
- 2818,
803
- 5580,
804
- 5579,
805
- 5578,
806
- 5929,
807
- 5933,
808
- 5949,
809
- 5880,
810
- 5881,
811
- 5886,
812
- 5572,
813
- 5574,
814
- 5575,
815
- 3336,
816
- 3336,
817
- 3333,
818
- 3336,
819
- 3339,
820
- 3336,
821
- 3336,
822
- 3336,
823
- 3333,
824
- 3337,
825
- 8766,
826
- 8769,
827
- 8764,
828
- 8766,
829
- 5958,
830
- 5979,
831
- 5958,
832
- 5957,
833
- 6918,
834
- 6924,
835
- 6924,
836
- 6920,
837
- 7068,
838
- 7063,
839
- 7064,
840
- 7064,
841
- 4862,
842
- 4860,
843
- 4859,
844
- 4860,
845
- 5358,
846
- 5358,
847
- 5360,
848
- 5360,
849
- 5284,
850
- 5268,
851
- 5270,
852
- 5271,
853
- 3054,
854
- 3047,
855
- 3051,
856
- 3052,
857
- 3045,
858
- 7561,
859
- 7574,
860
- 7568,
861
- 7567,
862
- 7564,
863
- 3948,
864
- 3943,
865
- 3947,
866
- 3943,
867
- 3943,
868
- 2973,
869
- 2975,
870
- 2974,
871
- 2981,
872
- 2973,
873
- 2979,
874
- 2783,
875
- 2783,
876
- 2779,
877
- 5075,
878
- 5079,
879
- 5070,
880
- 5083,
881
- 5071,
882
- 7581,
883
- 7580,
884
- 7576,
885
- 7584,
886
- 7581,
887
- 7579,
888
- 7581,
889
- 3112,
890
- 3109,
891
- 3108,
892
- 3108,
893
- 3108,
894
- 3077,
895
- 3075,
896
- 4773,
897
- 4772,
898
- 4770,
899
- 2703,
900
- 3717,
901
- 3721,
902
- 3723,
903
- 3723,
904
- 6314,
905
- 6311,
906
- 6311,
907
- 1775,
908
- 1771,
909
- 1773,
910
- 1774,
911
- 8750,
912
- 8754,
913
- 8756,
914
- 8746,
915
- 6554,
916
- 6558,
917
- 6560,
918
- 6557,
919
- 6401,
920
- 6398,
921
- 6399,
922
- 6403,
923
- 6226,
924
- 6222,
925
- 6220,
926
- 6222,
927
- 6224,
928
- 6221,
929
- 6222,
930
- 5838,
931
- 5844,
932
- 6234,
933
- 6231,
934
- 6231,
935
- 6382,
936
- 6382,
937
- 6385,
938
- 2205,
939
- 2208,
940
- 2204,
941
- 5028,
942
- 5024,
943
- 5023,
944
- 3681,
945
- 3681,
946
- 3678,
947
- 5719,
948
- 5722,
949
- 5721,
950
- 5722,
951
- 5720,
952
- 3376,
953
- 3371,
954
- 3361,
955
- 3356,
956
- 3016,
957
- 3013,
958
- 3014,
959
- 3014,
960
- 6692,
961
- 6698,
962
- 6695,
963
- 6693,
964
- 6693,
965
- 3209,
966
- 3223,
967
- 3700,
968
- 5471,
969
- 5471,
970
- 5471,
971
- 5476,
972
- 5473,
973
- 5254,
974
- 5255,
975
- 5225,
976
- 5226,
977
- 5225,
978
- 5224,
979
- 5224,
980
- 4233,
981
- 4237,
982
- 5952,
983
- 5952,
984
- 5951,
985
- 5949,
986
- 1684,
987
- 1684,
988
- 1681,
989
- 1682,
990
- 1686,
991
- 2975,
992
- 2973,
993
- 2976,
994
- 2975,
995
- 2535,
996
- 2534,
997
- 2532,
998
- 2534,
999
- 928,
1000
- 923,
1001
- 948,
1002
- 929,
1003
- 2386,
1004
- 2382,
1005
- 2388,
1006
- 4987,
1007
- 4984,
1008
- 4983,
1009
- 4985,
1010
- 6879,
1011
- 6884,
1012
- 6880,
1013
- 6881,
1014
- 6877,
1015
- 6877,
1016
- 6880,
1017
- 6879,
1018
- 2558,
1019
- 2556,
1020
- 2563,
1021
- 2183,
1022
- 2181,
1023
- 2181,
1024
- 9704,
1025
- 9707,
1026
- 9699,
1027
- 9704,
1028
- 2234,
1029
- 2258,
1030
- 2254,
1031
- 5560,
1032
- 5560,
1033
- 5575,
1034
- 5564,
1035
- 2608,
1036
- 2604,
1037
- 2603,
1038
- 2604,
1039
- 2605,
1040
- 5704,
1041
- 4044,
1042
- 4038,
1043
- 4035,
1044
- 6779,
1045
- 6766,
1046
- 6766,
1047
- 5841,
1048
- 5840,
1049
- 5841,
1050
- 5575,
1051
- 5572,
1052
- 4692,
1053
- 4694,
1054
- 4696,
1055
- 4693,
1056
- 4696,
1057
- 4700,
1058
- 4700,
1059
- 4700,
1060
- 2548,
1061
- 2548,
1062
- 2548,
1063
- 2552,
1064
- 2551,
1065
- 2549,
1066
- 2546,
1067
- 2545,
1068
- 6862,
1069
- 6866,
1070
- 6871,
1071
- 6864,
1072
- 9929,
1073
- 4639,
1074
- 4643,
1075
- 4642,
1076
- 3431,
1077
- 3429,
1078
- 2752,
1079
- 2756,
1080
- 2759,
1081
- 3365,
1082
- 3364,
1083
- 3369,
1084
- 3364,
1085
- 3364,
1086
- 6938,
1087
- 6943,
1088
- 6941,
1089
- 6946,
1090
- 6950,
1091
- 2610,
1092
- 2612,
1093
- 3340,
1094
- 5471,
1095
- 5471,
1096
- 5473,
1097
- 5476,
1098
- 3291,
1099
- 3296,
1100
- 3297,
1101
- 5973,
1102
- 5970,
1103
- 5970,
1104
- 5969,
1105
- 5971,
1106
- 14168,
1107
- 3347,
1108
- 3347,
1109
- 3096,
1110
- 3093,
1111
- 3100,
1112
- 3102,
1113
- 8357,
1114
- 8354,
1115
- 8360,
1116
- 2799,
1117
- 2800,
1118
- 2804,
1119
- 2801,
1120
- 2800,
1121
- 3020,
1122
- 3024,
1123
- 3017,
1124
- 3310,
1125
- 3308,
1126
- 3308,
1127
- 3707,
1128
- 3707,
1129
- 3703,
1130
- 3702,
1131
- 3705,
1132
- 3703,
1133
- 7470,
1134
- 2723,
1135
- 2724,
1136
- 4837,
1137
- 4838,
1138
- 4840,
1139
- 4839,
1140
- 4839,
1141
- 4839,
1142
- 4526,
1143
- 4527,
1144
- 4526,
1145
- 4525,
1146
- 16384,
1147
- 10069,
1148
- 10070,
1149
- 7411,
1150
- 7420,
1151
- 7412,
1152
- 4638,
1153
- 4638,
1154
- 4644,
1155
- 4421,
1156
- 4415,
1157
- 4417,
1158
- 4416,
1159
- 3425,
1160
- 3422,
1161
- 3426,
1162
- 3423,
1163
- 2247,
1164
- 2242,
1165
- 2244,
1166
- 4973,
1167
- 4964,
1168
- 4970,
1169
- 7050,
1170
- 7050,
1171
- 7057,
1172
- 8247,
1173
- 8244,
1174
- 8236,
1175
- 8239,
1176
- 2632,
1177
- 2629,
1178
- 2633,
1179
- 6967,
1180
- 6968,
1181
- 6967,
1182
- 6971,
1183
- 5029,
1184
- 5031,
1185
- 5030,
1186
- 5034,
1187
- 2770,
1188
- 2769,
1189
- 2763,
1190
- 2765,
1191
- 2783,
1192
- 6005,
1193
- 6006,
1194
- 6008,
1195
- 6005,
1196
- 7366,
1197
- 7360,
1198
- 7361,
1199
- 4916,
1200
- 4915,
1201
- 4914,
1202
- 4917,
1203
- 1401,
1204
- 1422,
1205
- 1398,
1206
- 1405,
1207
- 1404,
1208
- 1399,
1209
- 1403,
1210
- 2565,
1211
- 4880,
1212
- 4879,
1213
- 4878,
1214
- 5056,
1215
- 5053,
1216
- 5059,
1217
- 5055,
1218
- 5055,
1219
- 5055,
1220
- 1057,
1221
- 1059,
1222
- 5954,
1223
- 5959,
1224
- 5954,
1225
- 5956,
1226
- 5503,
1227
- 5501,
1228
- 3995,
1229
- 3998,
1230
- 3987,
1231
- 3990,
1232
- 6485,
1233
- 6476,
1234
- 6476,
1235
- 6481,
1236
- 6343,
1237
- 6340,
1238
- 6344,
1239
- 2536,
1240
- 2937,
1241
- 2939,
1242
- 2941,
1243
- 2938,
1244
- 2940,
1245
- 992,
1246
- 993,
1247
- 6614,
1248
- 6615,
1249
- 6615,
1250
- 3348,
1251
- 4479,
1252
- 4479,
1253
- 4482,
1254
- 4481,
1255
- 4486,
1256
- 4481,
1257
- 4482,
1258
- 2845,
1259
- 2843,
1260
- 1390,
1261
- 1389,
1262
- 1393,
1263
- 1398,
1264
- 8632,
1265
- 8626,
1266
- 6202,
1267
- 6205,
1268
- 6200,
1269
- 5081,
1270
- 5085,
1271
- 5081,
1272
- 5082,
1273
- 8441,
1274
- 8439,
1275
- 10067,
1276
- 10051,
1277
- 4189,
1278
- 4179,
1279
- 4176,
1280
- 4181,
1281
- 5106,
1282
- 5093,
1283
- 5101,
1284
- 5093,
1285
- 2917,
1286
- 2920,
1287
- 4627,
1288
- 4629,
1289
- 4631,
1290
- 3333,
1291
- 3332,
1292
- 3335,
1293
- 4089,
1294
- 4086,
1295
- 5323,
1296
- 5330,
1297
- 5323,
1298
- 5324,
1299
- 4734,
1300
- 4732,
1301
- 4732,
1302
- 4700,
1303
- 4705,
1304
- 4065,
1305
- 4068,
1306
- 6630,
1307
- 6628,
1308
- 6624,
1309
- 6626,
1310
- 4687,
1311
- 4681,
1312
- 4681,
1313
- 4681,
1314
- 2247,
1315
- 2254,
1316
- 2252,
1317
- 3083,
1318
- 3083,
1319
- 3085,
1320
- 3083,
1321
- 3089,
1322
- 3085,
1323
- 6165,
1324
- 6169,
1325
- 8331,
1326
- 8336,
1327
- 8329,
1328
- 4388,
1329
- 4389,
1330
- 4398,
1331
- 4394,
1332
- 4387,
1333
- 5780,
1334
- 5780,
1335
- 5784,
1336
- 8566,
1337
- 8565,
1338
- 8569,
1339
- 8568,
1340
- 1127,
1341
- 2902,
1342
- 2906,
1343
- 2906,
1344
- 2901,
1345
- 9027,
1346
- 9025,
1347
- 9029,
1348
- 2142,
1349
- 2141,
1350
- 2142,
1351
- 1924,
1352
- 1925,
1353
- 1924,
1354
- 5633,
1355
- 5629,
1356
- 5632,
1357
- 5344,
1358
- 5343,
1359
- 8741,
1360
- 8746,
1361
- 8746,
1362
- 6040,
1363
- 6045,
1364
- 6038,
1365
- 1303,
1366
- 1302,
1367
- 1302,
1368
- 1301,
1369
- 4192,
1370
- 4207,
1371
- 4198,
1372
- 4202,
1373
- 3193,
1374
- 3195,
1375
- 3191,
1376
- 3190,
1377
- 3191,
1378
- 3189,
1379
- 3191,
1380
- 3191,
1381
- 3189,
1382
- 4008,
1383
- 4009,
1384
- 4291,
1385
- 4285,
1386
- 4291,
1387
- 4289,
1388
- 2603,
1389
- 2606,
1390
- 2606,
1391
- 2602,
1392
- 2604,
1393
- 4724,
1394
- 4722,
1395
- 4723,
1396
- 4723,
1397
- 2524,
1398
- 2529,
1399
- 5882,
1400
- 5880,
1401
- 5883,
1402
- 5881,
1403
- 5880,
1404
- 5879,
1405
- 3867,
1406
- 3859,
1407
- 6677,
1408
- 6674,
1409
- 6678,
1410
- 6677,
1411
- 6681,
1412
- 7845,
1413
- 7842,
1414
- 5504,
1415
- 5499,
1416
- 5654,
1417
- 5650,
1418
- 4914,
1419
- 4916,
1420
- 3199,
1421
- 3197,
1422
- 3200,
1423
- 3200,
1424
- 3197,
1425
- 2928,
1426
- 2927,
1427
- 2926,
1428
- 5112,
1429
- 5113,
1430
- 5110,
1431
- 5115,
1432
- 6886,
1433
- 6891,
1434
- 6885,
1435
- 6895,
1436
- 6891,
1437
- 2794,
1438
- 2796,
1439
- 2796,
1440
- 1483,
1441
- 1486,
1442
- 4629,
1443
- 4628,
1444
- 4628,
1445
- 3537,
1446
- 3531,
1447
- 6720,
1448
- 6724,
1449
- 6718,
1450
- 6491,
1451
- 6489,
1452
- 6487,
1453
- 2942,
1454
- 2948,
1455
- 3826,
1456
- 3827,
1457
- 3877,
1458
- 3878,
1459
- 15066,
1460
- 15064,
1461
- 15064,
1462
- 9732,
1463
- 9746,
1464
- 9735,
1465
- 5568,
1466
- 5565,
1467
- 5568,
1468
- 5567,
1469
- 5576,
1470
- 1437,
1471
- 1436,
1472
- 1438,
1473
- 1438,
1474
- 1438,
1475
- 5750,
1476
- 5747,
1477
- 5750,
1478
- 5750,
1479
- 5748,
1480
- 3338,
1481
- 3339,
1482
- 11847,
1483
- 11853,
1484
- 11857,
1485
- 11847,
1486
- 2241,
1487
- 2238,
1488
- 2246,
1489
- 3751,
1490
- 3758,
1491
- 3757,
1492
- 2891,
1493
- 2891,
1494
- 2890,
1495
- 16384,
1496
- 9942,
1497
- 1548,
1498
- 4793,
1499
- 4793,
1500
- 4789,
1501
- 4790,
1502
- 1767,
1503
- 1767,
1504
- 1770,
1505
- 3794,
1506
- 3795,
1507
- 13007,
1508
- 13014,
1509
- 13005,
1510
- 13009,
1511
- 3176,
1512
- 3179,
1513
- 3185,
1514
- 3178,
1515
- 3178,
1516
- 3178,
1517
- 5356,
1518
- 5355,
1519
- 5355,
1520
- 6301,
1521
- 6306,
1522
- 4021,
1523
- 4023,
1524
- 4023,
1525
- 4029,
1526
- 4024,
1527
- 4567,
1528
- 4566,
1529
- 8079,
1530
- 8077,
1531
- 8078,
1532
- 8080,
1533
- 2661,
1534
- 2660,
1535
- 1454,
1536
- 7845,
1537
- 7828,
1538
- 8313,
1539
- 8317,
1540
- 8312,
1541
- 8317,
1542
- 5162,
1543
- 5165,
1544
- 5159,
1545
- 5161,
1546
- 7341,
1547
- 7343,
1548
- 7338,
1549
- 7344,
1550
- 5199,
1551
- 5196,
1552
- 5198,
1553
- 5196,
1554
- 4082,
1555
- 4085,
1556
- 4081,
1557
- 4081,
1558
- 3258,
1559
- 3263,
1560
- 3257,
1561
- 7372,
1562
- 4943,
1563
- 4938,
1564
- 4946,
1565
- 4944,
1566
- 2477,
1567
- 2479,
1568
- 9025,
1569
- 9025,
1570
- 9024,
1571
- 5528,
1572
- 5529,
1573
- 5530,
1574
- 7757,
1575
- 7737,
1576
- 7739,
1577
- 7734,
1578
- 7736
1579
  ],
1580
  "xaxis": "x",
1581
  "yaxis": "y"
@@ -1589,6 +3170,9 @@
1589
  },
1590
  "tracegroupgap": 0
1591
  },
 
 
 
1592
  "template": {
1593
  "data": {
1594
  "bar": [
@@ -2405,9 +3989,6 @@
2405
  }
2406
  }
2407
  },
2408
- "title": {
2409
- "text": "Histogram of question + context token lengths (total=1451)"
2410
- },
2411
  "xaxis": {
2412
  "anchor": "y",
2413
  "domain": [
@@ -2436,13 +4017,7 @@
2436
  }
2437
  ],
2438
  "source": [
2439
- "# plot histogram of full_text lengths\n",
2440
- "question_token_lengths = []\n",
2441
- "for inst in instances:\n",
2442
- " question_token_lengths.append(len(inst['question_with_context']))\n",
2443
- " \n",
2444
- "px.histogram(question_token_lengths, \n",
2445
- " title=f'Histogram of question + context token lengths (total={len(question_token_lengths)})')"
2446
  ]
2447
  },
2448
  {
@@ -2454,7 +4029,7 @@
2454
  },
2455
  {
2456
  "cell_type": "code",
2457
- "execution_count": 7,
2458
  "metadata": {},
2459
  "outputs": [],
2460
  "source": [
@@ -2477,7 +4052,7 @@
2477
  },
2478
  {
2479
  "cell_type": "code",
2480
- "execution_count": 8,
2481
  "metadata": {},
2482
  "outputs": [
2483
  {
@@ -2500,14 +4075,6 @@
2500
  "\t\t\ttype: <class 'str'>\n",
2501
  "\t\t\ttext: <class 'str'>\n",
2502
  "\t\t\ttype: <class 'str'>\n",
2503
- "\t\t\ttext: <class 'str'>\n",
2504
- "\t\t\ttype: <class 'str'>\n",
2505
- "\t\t\ttext: <class 'str'>\n",
2506
- "\t\t\ttype: <class 'str'>\n",
2507
- "\t\t\ttext: <class 'str'>\n",
2508
- "\t\t\ttype: <class 'str'>\n",
2509
- "\t\t\ttext: <class 'str'>\n",
2510
- "\t\t\ttype: <class 'str'>\n",
2511
  "\tall_evidence: <class 'list'>\n",
2512
  "\tall_evidence_masks: <class 'list'>\n"
2513
  ]
@@ -2519,14 +4086,37 @@
2519
  },
2520
  {
2521
  "cell_type": "code",
2522
- "execution_count": 9,
2523
  "metadata": {},
2524
- "outputs": [],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2525
  "source": [
2526
  "# save instances to file\n",
2527
- "with open(os.path.join(output_path, f'{split}_instances.json'), 'w') as f:\n",
2528
  " # pretty print json\n",
2529
- " json.dump(instances, f, indent=4)"
 
 
 
2530
  ]
2531
  },
2532
  {
 
37
  "import plotly.express as px\n",
38
  "import plotly.graph_objects as go\n",
39
  "import dataset_reader\n",
40
+ "from transformers.tokenization_utils_base import BatchEncoding\n",
41
+ "from datetime import date\n",
42
+ "from tqdm import tqdm"
43
  ]
44
  },
45
  {
 
48
  "metadata": {},
49
  "outputs": [],
50
  "source": [
51
+ "input_paths = {\n",
52
+ " 'train': 'original_data/qasper-train-dev-v0.3/qasper-train-v0.3.json',\n",
53
+ " 'dev': 'original_data/qasper-train-dev-v0.3/qasper-dev-v0.3.json',\n",
54
+ " 'test': 'original_data/qasper-test-and-evaluator-v0.3/qasper-test-v0.3.json',\n",
55
+ "}"
56
+ ]
57
+ },
58
+ {
59
+ "cell_type": "code",
60
+ "execution_count": 4,
61
+ "metadata": {},
62
+ "outputs": [],
63
+ "source": [
64
  "output_path = 'data'\n",
65
+ "split = 'dev'\n",
66
+ "input_path = input_paths[split]\n",
67
  "assert split in input_path"
68
  ]
69
  },
70
  {
71
  "cell_type": "code",
72
+ "execution_count": 5,
73
+ "metadata": {},
74
+ "outputs": [],
75
+ "source": [
76
+ "reader = dataset_reader.QasperReader(include_global_attention_mask=False)\n",
77
+ "instances = list(reader._read(input_path))"
78
+ ]
79
+ },
80
+ {
81
+ "cell_type": "code",
82
+ "execution_count": 6,
83
+ "metadata": {},
84
+ "outputs": [
85
+ {
86
+ "data": {
87
+ "text/plain": [
88
+ "defaultdict(int,\n",
89
+ " {'number of documents': 281,\n",
90
+ " 'number of questions': 1005,\n",
91
+ " 'number of answers': 1764,\n",
92
+ " 'questions with multiple answers': 744,\n",
93
+ " 'extractive questions': 962,\n",
94
+ " 'extractive questions with multiple spans': 406,\n",
95
+ " 'multiple_evidence_spans_count': 536,\n",
96
+ " 'answers with table or figure as evidence': 212,\n",
97
+ " 'freeform answers': 431,\n",
98
+ " 'yes/no questions': 208,\n",
99
+ " 'answers with no evidence': 212,\n",
100
+ " 'unanswerable questions': 163,\n",
101
+ " 'number of truncated contexts': 15})"
102
+ ]
103
+ },
104
+ "execution_count": 6,
105
+ "metadata": {},
106
+ "output_type": "execute_result"
107
+ }
108
+ ],
109
+ "source": [
110
+ "reader._stats"
111
+ ]
112
+ },
113
+ {
114
+ "cell_type": "code",
115
+ "execution_count": 7,
116
+ "metadata": {},
117
+ "outputs": [],
118
+ "source": [
119
+ "# filter instances that have valid html\n",
120
+ "from arxiv_agent.tools.paper.utils import get_soup\n",
121
+ "from functools import cache\n",
122
+ "from time import sleep\n",
123
+ "\n",
124
+ "@cache\n",
125
+ "def has_html(arxiv_id):\n",
126
+ " sleep(0.1)\n",
127
+ " try:\n",
128
+ " ERROR_MSG = \"Conversion to HTML had a Fatal error and exited abruptly. This document may be truncated or damaged.\"\n",
129
+ " soup = get_soup(arxiv_id)\n",
130
+ " return ERROR_MSG not in soup.text\n",
131
+ " except Exception as e:\n",
132
+ " return False"
133
+ ]
134
+ },
135
+ {
136
+ "cell_type": "code",
137
+ "execution_count": 8,
138
+ "metadata": {},
139
+ "outputs": [
140
+ {
141
+ "data": {
142
+ "text/plain": [
143
+ "True"
144
+ ]
145
+ },
146
+ "execution_count": 8,
147
+ "metadata": {},
148
+ "output_type": "execute_result"
149
+ }
150
+ ],
151
+ "source": [
152
+ "has_html(instances[0]['metadata']['article_id'])"
153
+ ]
154
+ },
155
+ {
156
+ "cell_type": "code",
157
+ "execution_count": 9,
158
+ "metadata": {},
159
+ "outputs": [
160
+ {
161
+ "data": {
162
+ "text/plain": [
163
+ "False"
164
+ ]
165
+ },
166
+ "execution_count": 9,
167
+ "metadata": {},
168
+ "output_type": "execute_result"
169
+ }
170
+ ],
171
+ "source": [
172
+ "has_html(\"2003.03106\")"
173
+ ]
174
+ },
175
+ {
176
+ "cell_type": "code",
177
+ "execution_count": 10,
178
+ "metadata": {},
179
+ "outputs": [
180
+ {
181
+ "data": {
182
+ "application/vnd.plotly.v1+json": {
183
+ "config": {
184
+ "plotlyServerURL": "https://plot.ly"
185
+ },
186
+ "data": [
187
+ {
188
+ "alignmentgroup": "True",
189
+ "bingroup": "x",
190
+ "hovertemplate": "variable=0<br>value=%{x}<br>count=%{y}<extra></extra>",
191
+ "legendgroup": "0",
192
+ "marker": {
193
+ "color": "#636efa",
194
+ "pattern": {
195
+ "shape": ""
196
+ }
197
+ },
198
+ "name": "0",
199
+ "offsetgroup": "0",
200
+ "orientation": "v",
201
+ "showlegend": true,
202
+ "type": "histogram",
203
+ "x": [
204
+ 5733,
205
+ 5733,
206
+ 5731,
207
+ 5730,
208
+ 4513,
209
+ 4516,
210
+ 4518,
211
+ 5774,
212
+ 5773,
213
+ 9106,
214
+ 9105,
215
+ 3078,
216
+ 3086,
217
+ 3078,
218
+ 3700,
219
+ 3700,
220
+ 7140,
221
+ 7139,
222
+ 7137,
223
+ 7139,
224
+ 6328,
225
+ 6323,
226
+ 6266,
227
+ 6262,
228
+ 6268,
229
+ 6265,
230
+ 4365,
231
+ 4363,
232
+ 4364,
233
+ 4364,
234
+ 5011,
235
+ 5008,
236
+ 5009,
237
+ 5013,
238
+ 5012,
239
+ 5023,
240
+ 5011,
241
+ 2844,
242
+ 2845,
243
+ 2852,
244
+ 2845,
245
+ 5833,
246
+ 5836,
247
+ 5802,
248
+ 2088,
249
+ 1901,
250
+ 1887,
251
+ 1887,
252
+ 6574,
253
+ 6576,
254
+ 6576,
255
+ 3748,
256
+ 3757,
257
+ 3306,
258
+ 3308,
259
+ 2717,
260
+ 2714,
261
+ 2712,
262
+ 2712,
263
+ 8783,
264
+ 8776,
265
+ 8779,
266
+ 3293,
267
+ 3294,
268
+ 3295,
269
+ 6143,
270
+ 6144,
271
+ 6144,
272
+ 3295,
273
+ 3297,
274
+ 3292,
275
+ 4405,
276
+ 4407,
277
+ 4406,
278
+ 5519,
279
+ 5518,
280
+ 5970,
281
+ 5971,
282
+ 5980,
283
+ 5974,
284
+ 9547,
285
+ 9551,
286
+ 9545,
287
+ 9546,
288
+ 9549,
289
+ 3071,
290
+ 3068,
291
+ 3069,
292
+ 3071,
293
+ 3071,
294
+ 3069,
295
+ 3071,
296
+ 2525,
297
+ 2528,
298
+ 2529,
299
+ 3443,
300
+ 3317,
301
+ 3314,
302
+ 3315,
303
+ 8898,
304
+ 8899,
305
+ 8897,
306
+ 8908,
307
+ 8910,
308
+ 8900,
309
+ 7094,
310
+ 7094,
311
+ 7092,
312
+ 7094,
313
+ 5009,
314
+ 5008,
315
+ 4775,
316
+ 4787,
317
+ 4774,
318
+ 4784,
319
+ 4781,
320
+ 4752,
321
+ 4749,
322
+ 4750,
323
+ 4749,
324
+ 2445,
325
+ 2438,
326
+ 2440,
327
+ 3587,
328
+ 3589,
329
+ 3586,
330
+ 3587,
331
+ 5803,
332
+ 5796,
333
+ 5791,
334
+ 5793,
335
+ 5793,
336
+ 7004,
337
+ 7010,
338
+ 4490,
339
+ 4488,
340
+ 4492,
341
+ 2360,
342
+ 2365,
343
+ 2364,
344
+ 2356,
345
+ 8719,
346
+ 5391,
347
+ 5393,
348
+ 3235,
349
+ 3234,
350
+ 3236,
351
+ 3235,
352
+ 5710,
353
+ 5716,
354
+ 5722,
355
+ 5704,
356
+ 5219,
357
+ 5223,
358
+ 5227,
359
+ 16384,
360
+ 5040,
361
+ 5038,
362
+ 5038,
363
+ 2439,
364
+ 2442,
365
+ 2457,
366
+ 2992,
367
+ 2993,
368
+ 3329,
369
+ 3327,
370
+ 6000,
371
+ 6000,
372
+ 4292,
373
+ 4290,
374
+ 4293,
375
+ 5760,
376
+ 5754,
377
+ 5759,
378
+ 5655,
379
+ 5656,
380
+ 7139,
381
+ 7134,
382
+ 6456,
383
+ 3187,
384
+ 3187,
385
+ 3190,
386
+ 4163,
387
+ 4156,
388
+ 6353,
389
+ 3565,
390
+ 3568,
391
+ 3567,
392
+ 3566,
393
+ 2043,
394
+ 2040,
395
+ 2044,
396
+ 2398,
397
+ 2389,
398
+ 3818,
399
+ 3816,
400
+ 11074,
401
+ 11074,
402
+ 11068,
403
+ 5279,
404
+ 1920,
405
+ 4290,
406
+ 4291,
407
+ 4287,
408
+ 4290,
409
+ 4288,
410
+ 4289,
411
+ 4291,
412
+ 2406,
413
+ 1725,
414
+ 6755,
415
+ 6756,
416
+ 6747,
417
+ 6747,
418
+ 1350,
419
+ 1352,
420
+ 7931,
421
+ 7934,
422
+ 3908,
423
+ 3257,
424
+ 3260,
425
+ 3258,
426
+ 3259,
427
+ 3311,
428
+ 3313,
429
+ 3311,
430
+ 3315,
431
+ 7236,
432
+ 7227,
433
+ 3216,
434
+ 3212,
435
+ 4236,
436
+ 4234,
437
+ 3354,
438
+ 3362,
439
+ 3357,
440
+ 2981,
441
+ 4021,
442
+ 4019,
443
+ 6001,
444
+ 2785,
445
+ 2786,
446
+ 2784,
447
+ 2785,
448
+ 5133,
449
+ 5138,
450
+ 3868,
451
+ 3863,
452
+ 3861,
453
+ 1821,
454
+ 1822,
455
+ 1823,
456
+ 1825,
457
+ 6591,
458
+ 6584,
459
+ 6037,
460
+ 3126,
461
+ 3126,
462
+ 3125,
463
+ 1924,
464
+ 11591,
465
+ 6053,
466
+ 6055,
467
+ 2829,
468
+ 2830,
469
+ 1607,
470
+ 1606,
471
+ 1326,
472
+ 1312,
473
+ 1316,
474
+ 1315,
475
+ 5716,
476
+ 5717,
477
+ 5715,
478
+ 1355,
479
+ 1354,
480
+ 6947,
481
+ 5796,
482
+ 6755,
483
+ 4012,
484
+ 4651,
485
+ 4648,
486
+ 2859,
487
+ 4779,
488
+ 4777,
489
+ 3529,
490
+ 6541,
491
+ 5796,
492
+ 5582,
493
+ 4467,
494
+ 4469,
495
+ 4476,
496
+ 4466,
497
+ 4469,
498
+ 4469,
499
+ 4469,
500
+ 4472,
501
+ 4472,
502
+ 4472,
503
+ 4482,
504
+ 4473,
505
+ 3970,
506
+ 3963,
507
+ 3967,
508
+ 3972,
509
+ 3965,
510
+ 3965,
511
+ 3962,
512
+ 3966,
513
+ 2272,
514
+ 2267,
515
+ 2264,
516
+ 2265,
517
+ 2263,
518
+ 2262,
519
+ 2268,
520
+ 6080,
521
+ 6079,
522
+ 6078,
523
+ 6078,
524
+ 6076,
525
+ 6075,
526
+ 6032,
527
+ 6035,
528
+ 6032,
529
+ 6038,
530
+ 6034,
531
+ 6035,
532
+ 3171,
533
+ 3170,
534
+ 3167,
535
+ 3169,
536
+ 3170,
537
+ 3170,
538
+ 3534,
539
+ 3536,
540
+ 3531,
541
+ 3530,
542
+ 3535,
543
+ 3531,
544
+ 3359,
545
+ 3344,
546
+ 3346,
547
+ 3349,
548
+ 3347,
549
+ 3345,
550
+ 6846,
551
+ 6845,
552
+ 6845,
553
+ 6848,
554
+ 6847,
555
+ 6849,
556
+ 2368,
557
+ 2356,
558
+ 2357,
559
+ 2357,
560
+ 2358,
561
+ 2358,
562
+ 10482,
563
+ 10479,
564
+ 10480,
565
+ 10486,
566
+ 10488,
567
+ 10488,
568
+ 3688,
569
+ 3688,
570
+ 3687,
571
+ 3686,
572
+ 3690,
573
+ 3687,
574
+ 2963,
575
+ 2966,
576
+ 2964,
577
+ 2961,
578
+ 2961,
579
+ 2964,
580
+ 2970,
581
+ 2974,
582
+ 2966,
583
+ 2970,
584
+ 2965,
585
+ 5805,
586
+ 5803,
587
+ 5805,
588
+ 5805,
589
+ 5806,
590
+ 3078,
591
+ 3083,
592
+ 3077,
593
+ 3079,
594
+ 3078,
595
+ 3077,
596
+ 3076,
597
+ 3078,
598
+ 3080,
599
+ 3081,
600
+ 6430,
601
+ 6431,
602
+ 6434,
603
+ 6427,
604
+ 6455,
605
+ 3311,
606
+ 3310,
607
+ 3316,
608
+ 3313,
609
+ 3312,
610
+ 4734,
611
+ 4730,
612
+ 4729,
613
+ 4731,
614
+ 4731,
615
+ 2707,
616
+ 2709,
617
+ 2707,
618
+ 2709,
619
+ 2709,
620
+ 3225,
621
+ 3224,
622
+ 3225,
623
+ 3228,
624
+ 3225,
625
+ 8185,
626
+ 8189,
627
+ 8180,
628
+ 8180,
629
+ 8188,
630
+ 6247,
631
+ 6252,
632
+ 6252,
633
+ 6252,
634
+ 6254,
635
+ 2887,
636
+ 2890,
637
+ 2885,
638
+ 2887,
639
+ 2887,
640
+ 3792,
641
+ 3808,
642
+ 3791,
643
+ 3798,
644
+ 3794,
645
+ 5706,
646
+ 5708,
647
+ 5702,
648
+ 5705,
649
+ 5717,
650
+ 5376,
651
+ 5378,
652
+ 5377,
653
+ 5377,
654
+ 5378,
655
+ 3218,
656
+ 3222,
657
+ 3214,
658
+ 3216,
659
+ 3226,
660
+ 2539,
661
+ 2541,
662
+ 2539,
663
+ 2537,
664
+ 2539,
665
+ 2542,
666
+ 2548,
667
+ 2542,
668
+ 2546,
669
+ 5168,
670
+ 5169,
671
+ 5169,
672
+ 5171,
673
+ 2625,
674
+ 2632,
675
+ 2629,
676
+ 2625,
677
+ 5654,
678
+ 5655,
679
+ 5653,
680
+ 5654,
681
+ 5388,
682
+ 5383,
683
+ 5383,
684
+ 5393,
685
+ 3920,
686
+ 3916,
687
+ 3915,
688
+ 3915,
689
+ 5922,
690
+ 5917,
691
+ 5917,
692
+ 5918,
693
+ 10339,
694
+ 10339,
695
+ 10340,
696
+ 10341,
697
+ 6080,
698
+ 6084,
699
+ 6085,
700
+ 6080,
701
+ 6774,
702
+ 6785,
703
+ 6771,
704
+ 6770,
705
+ 5603,
706
+ 5602,
707
+ 5601,
708
+ 5599,
709
+ 4814,
710
+ 4821,
711
+ 4816,
712
+ 4820,
713
+ 4136,
714
+ 4138,
715
+ 4136,
716
+ 4133,
717
+ 6096,
718
+ 6102,
719
+ 6095,
720
+ 6106,
721
+ 3676,
722
+ 3675,
723
+ 3674,
724
+ 3676,
725
+ 2708,
726
+ 2699,
727
+ 2701,
728
+ 2700,
729
+ 3666,
730
+ 3669,
731
+ 3668,
732
+ 3666,
733
+ 5435,
734
+ 5433,
735
+ 5427,
736
+ 5429,
737
+ 2961,
738
+ 2960,
739
+ 2961,
740
+ 2972,
741
+ 5848,
742
+ 5858,
743
+ 5846,
744
+ 5844,
745
+ 5849,
746
+ 5845,
747
+ 5846,
748
+ 5847,
749
+ 5540,
750
+ 5543,
751
+ 5542,
752
+ 5547,
753
+ 3397,
754
+ 3396,
755
+ 3397,
756
+ 3394,
757
+ 8311,
758
+ 8315,
759
+ 8315,
760
+ 8312,
761
+ 2588,
762
+ 2592,
763
+ 2590,
764
+ 2596,
765
+ 5011,
766
+ 5009,
767
+ 5013,
768
+ 5012,
769
+ 6658,
770
+ 6662,
771
+ 6659,
772
+ 6664,
773
+ 8070,
774
+ 8072,
775
+ 8071,
776
+ 8069,
777
+ 5888,
778
+ 5891,
779
+ 5890,
780
+ 5902,
781
+ 4291,
782
+ 4288,
783
+ 4285,
784
+ 4286,
785
+ 6038,
786
+ 6040,
787
+ 6036,
788
+ 6040,
789
+ 6057,
790
+ 6055,
791
+ 6056,
792
+ 6076,
793
+ 6059,
794
+ 6063,
795
+ 6055,
796
+ 5273,
797
+ 5277,
798
+ 5274,
799
+ 5281,
800
+ 5283,
801
+ 5275,
802
+ 5282,
803
+ 4648,
804
+ 4647,
805
+ 4645,
806
+ 4646,
807
+ 4645,
808
+ 4646,
809
+ 5362,
810
+ 5374,
811
+ 5366,
812
+ 16384,
813
+ 16384,
814
+ 16384,
815
+ 16384,
816
+ 16384,
817
+ 16384,
818
+ 5123,
819
+ 5123,
820
+ 5125,
821
+ 5123,
822
+ 5125,
823
+ 5125,
824
+ 4048,
825
+ 4053,
826
+ 4047,
827
+ 2352,
828
+ 2351,
829
+ 2350,
830
+ 2206,
831
+ 2208,
832
+ 2208,
833
+ 6689,
834
+ 6686,
835
+ 6688,
836
+ 8231,
837
+ 8235,
838
+ 8238,
839
+ 5167,
840
+ 5170,
841
+ 5171,
842
+ 5173,
843
+ 5173,
844
+ 5171,
845
+ 2398,
846
+ 2401,
847
+ 2403,
848
+ 16384,
849
+ 16384,
850
+ 16384,
851
+ 5427,
852
+ 5434,
853
+ 5429,
854
+ 2649,
855
+ 2646,
856
+ 2642,
857
+ 4696,
858
+ 4697,
859
+ 4696,
860
+ 5791,
861
+ 5790,
862
+ 5795,
863
+ 5788,
864
+ 5789,
865
+ 5790,
866
+ 2001,
867
+ 2002,
868
+ 2004,
869
+ 6642,
870
+ 6649,
871
+ 6649,
872
+ 4812,
873
+ 4813,
874
+ 4817,
875
+ 5693,
876
+ 5690,
877
+ 5693,
878
+ 4395,
879
+ 4393,
880
+ 4391,
881
+ 3775,
882
+ 3777,
883
+ 3776,
884
+ 2829,
885
+ 2826,
886
+ 2825,
887
+ 7396,
888
+ 7397,
889
+ 7413,
890
+ 5952,
891
+ 5945,
892
+ 5950,
893
+ 1679,
894
+ 1680,
895
+ 1675,
896
+ 4004,
897
+ 4009,
898
+ 4006,
899
+ 4003,
900
+ 4004,
901
+ 4005,
902
+ 3382,
903
+ 3385,
904
+ 3387,
905
+ 3383,
906
+ 3386,
907
+ 3385,
908
+ 5598,
909
+ 5591,
910
+ 5589,
911
+ 5697,
912
+ 5694,
913
+ 5696,
914
+ 5700,
915
+ 5701,
916
+ 5696,
917
+ 16384,
918
+ 16384,
919
+ 16384,
920
+ 6748,
921
+ 6745,
922
+ 6745,
923
+ 4425,
924
+ 4425,
925
+ 4425,
926
+ 3747,
927
+ 3736,
928
+ 3732,
929
+ 3982,
930
+ 3979,
931
+ 3977,
932
+ 6320,
933
+ 6321,
934
+ 6321,
935
+ 3600,
936
+ 3600,
937
+ 3598,
938
+ 3600,
939
+ 3604,
940
+ 3604,
941
+ 3604,
942
+ 3603,
943
+ 3399,
944
+ 3390,
945
+ 3389,
946
+ 3392,
947
+ 3392,
948
+ 5204,
949
+ 5198,
950
+ 5205,
951
+ 5200,
952
+ 5197,
953
+ 1591,
954
+ 1581,
955
+ 1580,
956
+ 1578,
957
+ 1580,
958
+ 5245,
959
+ 5247,
960
+ 5243,
961
+ 5243,
962
+ 5247,
963
+ 3630,
964
+ 3626,
965
+ 3621,
966
+ 3623,
967
+ 3623,
968
+ 3164,
969
+ 3166,
970
+ 3168,
971
+ 3163,
972
+ 3172,
973
+ 5815,
974
+ 5813,
975
+ 5815,
976
+ 5820,
977
+ 5813,
978
+ 5815,
979
+ 5811,
980
+ 5812,
981
+ 5815,
982
+ 4730,
983
+ 4733,
984
+ 4729,
985
+ 4728,
986
+ 7209,
987
+ 7213,
988
+ 7212,
989
+ 7211,
990
+ 5846,
991
+ 5848,
992
+ 5847,
993
+ 5846,
994
+ 2562,
995
+ 2558,
996
+ 2560,
997
+ 2556,
998
+ 2558,
999
+ 2567,
1000
+ 4925,
1001
+ 4932,
1002
+ 4928,
1003
+ 4928,
1004
+ 2476,
1005
+ 2480,
1006
+ 5594,
1007
+ 5588,
1008
+ 5586,
1009
+ 5587,
1010
+ 5585,
1011
+ 5585,
1012
+ 6345,
1013
+ 6347,
1014
+ 6602,
1015
+ 6604,
1016
+ 6605,
1017
+ 6606,
1018
+ 6601,
1019
+ 6601,
1020
+ 2579,
1021
+ 2582,
1022
+ 4335,
1023
+ 4337,
1024
+ 4340,
1025
+ 4337,
1026
+ 6748,
1027
+ 6746,
1028
+ 2977,
1029
+ 2980,
1030
+ 9890,
1031
+ 9891,
1032
+ 4386,
1033
+ 4392,
1034
+ 5310,
1035
+ 5308,
1036
+ 5313,
1037
+ 5314,
1038
+ 4040,
1039
+ 4045,
1040
+ 3517,
1041
+ 3516,
1042
+ 2192,
1043
+ 2189,
1044
+ 2190,
1045
+ 2188,
1046
+ 2188,
1047
+ 2191,
1048
+ 7173,
1049
+ 7171,
1050
+ 7173,
1051
+ 7182,
1052
+ 7232,
1053
+ 7236,
1054
+ 3163,
1055
+ 3163,
1056
+ 3162,
1057
+ 3161,
1058
+ 3165,
1059
+ 3164,
1060
+ 16384,
1061
+ 16384,
1062
+ 5582,
1063
+ 5584,
1064
+ 5580,
1065
+ 5588,
1066
+ 5585,
1067
+ 5583,
1068
+ 2817,
1069
+ 2814,
1070
+ 5069,
1071
+ 5072,
1072
+ 2988,
1073
+ 2988,
1074
+ 10441,
1075
+ 10446,
1076
+ 6473,
1077
+ 6470,
1078
+ 8290,
1079
+ 8288,
1080
+ 4108,
1081
+ 4097,
1082
+ 4095,
1083
+ 4102,
1084
+ 3610,
1085
+ 3616,
1086
+ 5276,
1087
+ 5283,
1088
+ 5270,
1089
+ 5272,
1090
+ 5271,
1091
+ 5272,
1092
+ 2548,
1093
+ 2548,
1094
+ 3370,
1095
+ 3367,
1096
+ 3367,
1097
+ 3366,
1098
+ 3679,
1099
+ 3684,
1100
+ 3690,
1101
+ 3677,
1102
+ 3779,
1103
+ 3782,
1104
+ 3779,
1105
+ 3780,
1106
+ 3890,
1107
+ 3892,
1108
+ 3893,
1109
+ 3896,
1110
+ 3897,
1111
+ 3894,
1112
+ 919,
1113
+ 924,
1114
+ 5276,
1115
+ 5276,
1116
+ 7310,
1117
+ 7310,
1118
+ 7316,
1119
+ 7308,
1120
+ 3975,
1121
+ 3977,
1122
+ 3974,
1123
+ 3984,
1124
+ 6001,
1125
+ 6003,
1126
+ 6009,
1127
+ 5996,
1128
+ 2727,
1129
+ 2723,
1130
+ 2715,
1131
+ 2713,
1132
+ 4367,
1133
+ 4370,
1134
+ 3091,
1135
+ 3089,
1136
+ 3061,
1137
+ 3058,
1138
+ 4907,
1139
+ 4912,
1140
+ 6586,
1141
+ 6593,
1142
+ 3045,
1143
+ 3043,
1144
+ 5984,
1145
+ 5978,
1146
+ 5980,
1147
+ 5986,
1148
+ 6352,
1149
+ 6359,
1150
+ 6354,
1151
+ 6355,
1152
+ 3437,
1153
+ 3444,
1154
+ 6259,
1155
+ 6252,
1156
+ 6776,
1157
+ 6776,
1158
+ 3057,
1159
+ 3047,
1160
+ 4755,
1161
+ 4759,
1162
+ 5615,
1163
+ 5617,
1164
+ 5619,
1165
+ 5617,
1166
+ 5621,
1167
+ 5614,
1168
+ 5616,
1169
+ 5758,
1170
+ 5756,
1171
+ 5761,
1172
+ 5757,
1173
+ 5757,
1174
+ 2111,
1175
+ 2113,
1176
+ 2118,
1177
+ 2112,
1178
+ 2112,
1179
+ 4682,
1180
+ 4681,
1181
+ 4683,
1182
+ 4684,
1183
+ 4683,
1184
+ 4547,
1185
+ 4551,
1186
+ 4546,
1187
+ 4550,
1188
+ 4549,
1189
+ 6552,
1190
+ 6562,
1191
+ 6553,
1192
+ 6555,
1193
+ 6552,
1194
+ 6433,
1195
+ 6434,
1196
+ 6437,
1197
+ 6430,
1198
+ 6432,
1199
+ 4966,
1200
+ 4965,
1201
+ 4967,
1202
+ 4967,
1203
+ 4964,
1204
+ 10870,
1205
+ 10869,
1206
+ 10871,
1207
+ 10867,
1208
+ 10881
1209
+ ],
1210
+ "xaxis": "x",
1211
+ "yaxis": "y"
1212
+ }
1213
+ ],
1214
+ "layout": {
1215
+ "barmode": "relative",
1216
+ "legend": {
1217
+ "title": {
1218
+ "text": "variable"
1219
+ },
1220
+ "tracegroupgap": 0
1221
+ },
1222
+ "template": {
1223
+ "data": {
1224
+ "bar": [
1225
+ {
1226
+ "error_x": {
1227
+ "color": "#2a3f5f"
1228
+ },
1229
+ "error_y": {
1230
+ "color": "#2a3f5f"
1231
+ },
1232
+ "marker": {
1233
+ "line": {
1234
+ "color": "#E5ECF6",
1235
+ "width": 0.5
1236
+ },
1237
+ "pattern": {
1238
+ "fillmode": "overlay",
1239
+ "size": 10,
1240
+ "solidity": 0.2
1241
+ }
1242
+ },
1243
+ "type": "bar"
1244
+ }
1245
+ ],
1246
+ "barpolar": [
1247
+ {
1248
+ "marker": {
1249
+ "line": {
1250
+ "color": "#E5ECF6",
1251
+ "width": 0.5
1252
+ },
1253
+ "pattern": {
1254
+ "fillmode": "overlay",
1255
+ "size": 10,
1256
+ "solidity": 0.2
1257
+ }
1258
+ },
1259
+ "type": "barpolar"
1260
+ }
1261
+ ],
1262
+ "carpet": [
1263
+ {
1264
+ "aaxis": {
1265
+ "endlinecolor": "#2a3f5f",
1266
+ "gridcolor": "white",
1267
+ "linecolor": "white",
1268
+ "minorgridcolor": "white",
1269
+ "startlinecolor": "#2a3f5f"
1270
+ },
1271
+ "baxis": {
1272
+ "endlinecolor": "#2a3f5f",
1273
+ "gridcolor": "white",
1274
+ "linecolor": "white",
1275
+ "minorgridcolor": "white",
1276
+ "startlinecolor": "#2a3f5f"
1277
+ },
1278
+ "type": "carpet"
1279
+ }
1280
+ ],
1281
+ "choropleth": [
1282
+ {
1283
+ "colorbar": {
1284
+ "outlinewidth": 0,
1285
+ "ticks": ""
1286
+ },
1287
+ "type": "choropleth"
1288
+ }
1289
+ ],
1290
+ "contour": [
1291
+ {
1292
+ "colorbar": {
1293
+ "outlinewidth": 0,
1294
+ "ticks": ""
1295
+ },
1296
+ "colorscale": [
1297
+ [
1298
+ 0,
1299
+ "#0d0887"
1300
+ ],
1301
+ [
1302
+ 0.1111111111111111,
1303
+ "#46039f"
1304
+ ],
1305
+ [
1306
+ 0.2222222222222222,
1307
+ "#7201a8"
1308
+ ],
1309
+ [
1310
+ 0.3333333333333333,
1311
+ "#9c179e"
1312
+ ],
1313
+ [
1314
+ 0.4444444444444444,
1315
+ "#bd3786"
1316
+ ],
1317
+ [
1318
+ 0.5555555555555556,
1319
+ "#d8576b"
1320
+ ],
1321
+ [
1322
+ 0.6666666666666666,
1323
+ "#ed7953"
1324
+ ],
1325
+ [
1326
+ 0.7777777777777778,
1327
+ "#fb9f3a"
1328
+ ],
1329
+ [
1330
+ 0.8888888888888888,
1331
+ "#fdca26"
1332
+ ],
1333
+ [
1334
+ 1,
1335
+ "#f0f921"
1336
+ ]
1337
+ ],
1338
+ "type": "contour"
1339
+ }
1340
+ ],
1341
+ "contourcarpet": [
1342
+ {
1343
+ "colorbar": {
1344
+ "outlinewidth": 0,
1345
+ "ticks": ""
1346
+ },
1347
+ "type": "contourcarpet"
1348
+ }
1349
+ ],
1350
+ "heatmap": [
1351
+ {
1352
+ "colorbar": {
1353
+ "outlinewidth": 0,
1354
+ "ticks": ""
1355
+ },
1356
+ "colorscale": [
1357
+ [
1358
+ 0,
1359
+ "#0d0887"
1360
+ ],
1361
+ [
1362
+ 0.1111111111111111,
1363
+ "#46039f"
1364
+ ],
1365
+ [
1366
+ 0.2222222222222222,
1367
+ "#7201a8"
1368
+ ],
1369
+ [
1370
+ 0.3333333333333333,
1371
+ "#9c179e"
1372
+ ],
1373
+ [
1374
+ 0.4444444444444444,
1375
+ "#bd3786"
1376
+ ],
1377
+ [
1378
+ 0.5555555555555556,
1379
+ "#d8576b"
1380
+ ],
1381
+ [
1382
+ 0.6666666666666666,
1383
+ "#ed7953"
1384
+ ],
1385
+ [
1386
+ 0.7777777777777778,
1387
+ "#fb9f3a"
1388
+ ],
1389
+ [
1390
+ 0.8888888888888888,
1391
+ "#fdca26"
1392
+ ],
1393
+ [
1394
+ 1,
1395
+ "#f0f921"
1396
+ ]
1397
+ ],
1398
+ "type": "heatmap"
1399
+ }
1400
+ ],
1401
+ "heatmapgl": [
1402
+ {
1403
+ "colorbar": {
1404
+ "outlinewidth": 0,
1405
+ "ticks": ""
1406
+ },
1407
+ "colorscale": [
1408
+ [
1409
+ 0,
1410
+ "#0d0887"
1411
+ ],
1412
+ [
1413
+ 0.1111111111111111,
1414
+ "#46039f"
1415
+ ],
1416
+ [
1417
+ 0.2222222222222222,
1418
+ "#7201a8"
1419
+ ],
1420
+ [
1421
+ 0.3333333333333333,
1422
+ "#9c179e"
1423
+ ],
1424
+ [
1425
+ 0.4444444444444444,
1426
+ "#bd3786"
1427
+ ],
1428
+ [
1429
+ 0.5555555555555556,
1430
+ "#d8576b"
1431
+ ],
1432
+ [
1433
+ 0.6666666666666666,
1434
+ "#ed7953"
1435
+ ],
1436
+ [
1437
+ 0.7777777777777778,
1438
+ "#fb9f3a"
1439
+ ],
1440
+ [
1441
+ 0.8888888888888888,
1442
+ "#fdca26"
1443
+ ],
1444
+ [
1445
+ 1,
1446
+ "#f0f921"
1447
+ ]
1448
+ ],
1449
+ "type": "heatmapgl"
1450
+ }
1451
+ ],
1452
+ "histogram": [
1453
+ {
1454
+ "marker": {
1455
+ "pattern": {
1456
+ "fillmode": "overlay",
1457
+ "size": 10,
1458
+ "solidity": 0.2
1459
+ }
1460
+ },
1461
+ "type": "histogram"
1462
+ }
1463
+ ],
1464
+ "histogram2d": [
1465
+ {
1466
+ "colorbar": {
1467
+ "outlinewidth": 0,
1468
+ "ticks": ""
1469
+ },
1470
+ "colorscale": [
1471
+ [
1472
+ 0,
1473
+ "#0d0887"
1474
+ ],
1475
+ [
1476
+ 0.1111111111111111,
1477
+ "#46039f"
1478
+ ],
1479
+ [
1480
+ 0.2222222222222222,
1481
+ "#7201a8"
1482
+ ],
1483
+ [
1484
+ 0.3333333333333333,
1485
+ "#9c179e"
1486
+ ],
1487
+ [
1488
+ 0.4444444444444444,
1489
+ "#bd3786"
1490
+ ],
1491
+ [
1492
+ 0.5555555555555556,
1493
+ "#d8576b"
1494
+ ],
1495
+ [
1496
+ 0.6666666666666666,
1497
+ "#ed7953"
1498
+ ],
1499
+ [
1500
+ 0.7777777777777778,
1501
+ "#fb9f3a"
1502
+ ],
1503
+ [
1504
+ 0.8888888888888888,
1505
+ "#fdca26"
1506
+ ],
1507
+ [
1508
+ 1,
1509
+ "#f0f921"
1510
+ ]
1511
+ ],
1512
+ "type": "histogram2d"
1513
+ }
1514
+ ],
1515
+ "histogram2dcontour": [
1516
+ {
1517
+ "colorbar": {
1518
+ "outlinewidth": 0,
1519
+ "ticks": ""
1520
+ },
1521
+ "colorscale": [
1522
+ [
1523
+ 0,
1524
+ "#0d0887"
1525
+ ],
1526
+ [
1527
+ 0.1111111111111111,
1528
+ "#46039f"
1529
+ ],
1530
+ [
1531
+ 0.2222222222222222,
1532
+ "#7201a8"
1533
+ ],
1534
+ [
1535
+ 0.3333333333333333,
1536
+ "#9c179e"
1537
+ ],
1538
+ [
1539
+ 0.4444444444444444,
1540
+ "#bd3786"
1541
+ ],
1542
+ [
1543
+ 0.5555555555555556,
1544
+ "#d8576b"
1545
+ ],
1546
+ [
1547
+ 0.6666666666666666,
1548
+ "#ed7953"
1549
+ ],
1550
+ [
1551
+ 0.7777777777777778,
1552
+ "#fb9f3a"
1553
+ ],
1554
+ [
1555
+ 0.8888888888888888,
1556
+ "#fdca26"
1557
+ ],
1558
+ [
1559
+ 1,
1560
+ "#f0f921"
1561
+ ]
1562
+ ],
1563
+ "type": "histogram2dcontour"
1564
+ }
1565
+ ],
1566
+ "mesh3d": [
1567
+ {
1568
+ "colorbar": {
1569
+ "outlinewidth": 0,
1570
+ "ticks": ""
1571
+ },
1572
+ "type": "mesh3d"
1573
+ }
1574
+ ],
1575
+ "parcoords": [
1576
+ {
1577
+ "line": {
1578
+ "colorbar": {
1579
+ "outlinewidth": 0,
1580
+ "ticks": ""
1581
+ }
1582
+ },
1583
+ "type": "parcoords"
1584
+ }
1585
+ ],
1586
+ "pie": [
1587
+ {
1588
+ "automargin": true,
1589
+ "type": "pie"
1590
+ }
1591
+ ],
1592
+ "scatter": [
1593
+ {
1594
+ "fillpattern": {
1595
+ "fillmode": "overlay",
1596
+ "size": 10,
1597
+ "solidity": 0.2
1598
+ },
1599
+ "type": "scatter"
1600
+ }
1601
+ ],
1602
+ "scatter3d": [
1603
+ {
1604
+ "line": {
1605
+ "colorbar": {
1606
+ "outlinewidth": 0,
1607
+ "ticks": ""
1608
+ }
1609
+ },
1610
+ "marker": {
1611
+ "colorbar": {
1612
+ "outlinewidth": 0,
1613
+ "ticks": ""
1614
+ }
1615
+ },
1616
+ "type": "scatter3d"
1617
+ }
1618
+ ],
1619
+ "scattercarpet": [
1620
+ {
1621
+ "marker": {
1622
+ "colorbar": {
1623
+ "outlinewidth": 0,
1624
+ "ticks": ""
1625
+ }
1626
+ },
1627
+ "type": "scattercarpet"
1628
+ }
1629
+ ],
1630
+ "scattergeo": [
1631
+ {
1632
+ "marker": {
1633
+ "colorbar": {
1634
+ "outlinewidth": 0,
1635
+ "ticks": ""
1636
+ }
1637
+ },
1638
+ "type": "scattergeo"
1639
+ }
1640
+ ],
1641
+ "scattergl": [
1642
+ {
1643
+ "marker": {
1644
+ "colorbar": {
1645
+ "outlinewidth": 0,
1646
+ "ticks": ""
1647
+ }
1648
+ },
1649
+ "type": "scattergl"
1650
+ }
1651
+ ],
1652
+ "scattermapbox": [
1653
+ {
1654
+ "marker": {
1655
+ "colorbar": {
1656
+ "outlinewidth": 0,
1657
+ "ticks": ""
1658
+ }
1659
+ },
1660
+ "type": "scattermapbox"
1661
+ }
1662
+ ],
1663
+ "scatterpolar": [
1664
+ {
1665
+ "marker": {
1666
+ "colorbar": {
1667
+ "outlinewidth": 0,
1668
+ "ticks": ""
1669
+ }
1670
+ },
1671
+ "type": "scatterpolar"
1672
+ }
1673
+ ],
1674
+ "scatterpolargl": [
1675
+ {
1676
+ "marker": {
1677
+ "colorbar": {
1678
+ "outlinewidth": 0,
1679
+ "ticks": ""
1680
+ }
1681
+ },
1682
+ "type": "scatterpolargl"
1683
+ }
1684
+ ],
1685
+ "scatterternary": [
1686
+ {
1687
+ "marker": {
1688
+ "colorbar": {
1689
+ "outlinewidth": 0,
1690
+ "ticks": ""
1691
+ }
1692
+ },
1693
+ "type": "scatterternary"
1694
+ }
1695
+ ],
1696
+ "surface": [
1697
+ {
1698
+ "colorbar": {
1699
+ "outlinewidth": 0,
1700
+ "ticks": ""
1701
+ },
1702
+ "colorscale": [
1703
+ [
1704
+ 0,
1705
+ "#0d0887"
1706
+ ],
1707
+ [
1708
+ 0.1111111111111111,
1709
+ "#46039f"
1710
+ ],
1711
+ [
1712
+ 0.2222222222222222,
1713
+ "#7201a8"
1714
+ ],
1715
+ [
1716
+ 0.3333333333333333,
1717
+ "#9c179e"
1718
+ ],
1719
+ [
1720
+ 0.4444444444444444,
1721
+ "#bd3786"
1722
+ ],
1723
+ [
1724
+ 0.5555555555555556,
1725
+ "#d8576b"
1726
+ ],
1727
+ [
1728
+ 0.6666666666666666,
1729
+ "#ed7953"
1730
+ ],
1731
+ [
1732
+ 0.7777777777777778,
1733
+ "#fb9f3a"
1734
+ ],
1735
+ [
1736
+ 0.8888888888888888,
1737
+ "#fdca26"
1738
+ ],
1739
+ [
1740
+ 1,
1741
+ "#f0f921"
1742
+ ]
1743
+ ],
1744
+ "type": "surface"
1745
+ }
1746
+ ],
1747
+ "table": [
1748
+ {
1749
+ "cells": {
1750
+ "fill": {
1751
+ "color": "#EBF0F8"
1752
+ },
1753
+ "line": {
1754
+ "color": "white"
1755
+ }
1756
+ },
1757
+ "header": {
1758
+ "fill": {
1759
+ "color": "#C8D4E3"
1760
+ },
1761
+ "line": {
1762
+ "color": "white"
1763
+ }
1764
+ },
1765
+ "type": "table"
1766
+ }
1767
+ ]
1768
+ },
1769
+ "layout": {
1770
+ "annotationdefaults": {
1771
+ "arrowcolor": "#2a3f5f",
1772
+ "arrowhead": 0,
1773
+ "arrowwidth": 1
1774
+ },
1775
+ "autotypenumbers": "strict",
1776
+ "coloraxis": {
1777
+ "colorbar": {
1778
+ "outlinewidth": 0,
1779
+ "ticks": ""
1780
+ }
1781
+ },
1782
+ "colorscale": {
1783
+ "diverging": [
1784
+ [
1785
+ 0,
1786
+ "#8e0152"
1787
+ ],
1788
+ [
1789
+ 0.1,
1790
+ "#c51b7d"
1791
+ ],
1792
+ [
1793
+ 0.2,
1794
+ "#de77ae"
1795
+ ],
1796
+ [
1797
+ 0.3,
1798
+ "#f1b6da"
1799
+ ],
1800
+ [
1801
+ 0.4,
1802
+ "#fde0ef"
1803
+ ],
1804
+ [
1805
+ 0.5,
1806
+ "#f7f7f7"
1807
+ ],
1808
+ [
1809
+ 0.6,
1810
+ "#e6f5d0"
1811
+ ],
1812
+ [
1813
+ 0.7,
1814
+ "#b8e186"
1815
+ ],
1816
+ [
1817
+ 0.8,
1818
+ "#7fbc41"
1819
+ ],
1820
+ [
1821
+ 0.9,
1822
+ "#4d9221"
1823
+ ],
1824
+ [
1825
+ 1,
1826
+ "#276419"
1827
+ ]
1828
+ ],
1829
+ "sequential": [
1830
+ [
1831
+ 0,
1832
+ "#0d0887"
1833
+ ],
1834
+ [
1835
+ 0.1111111111111111,
1836
+ "#46039f"
1837
+ ],
1838
+ [
1839
+ 0.2222222222222222,
1840
+ "#7201a8"
1841
+ ],
1842
+ [
1843
+ 0.3333333333333333,
1844
+ "#9c179e"
1845
+ ],
1846
+ [
1847
+ 0.4444444444444444,
1848
+ "#bd3786"
1849
+ ],
1850
+ [
1851
+ 0.5555555555555556,
1852
+ "#d8576b"
1853
+ ],
1854
+ [
1855
+ 0.6666666666666666,
1856
+ "#ed7953"
1857
+ ],
1858
+ [
1859
+ 0.7777777777777778,
1860
+ "#fb9f3a"
1861
+ ],
1862
+ [
1863
+ 0.8888888888888888,
1864
+ "#fdca26"
1865
+ ],
1866
+ [
1867
+ 1,
1868
+ "#f0f921"
1869
+ ]
1870
+ ],
1871
+ "sequentialminus": [
1872
+ [
1873
+ 0,
1874
+ "#0d0887"
1875
+ ],
1876
+ [
1877
+ 0.1111111111111111,
1878
+ "#46039f"
1879
+ ],
1880
+ [
1881
+ 0.2222222222222222,
1882
+ "#7201a8"
1883
+ ],
1884
+ [
1885
+ 0.3333333333333333,
1886
+ "#9c179e"
1887
+ ],
1888
+ [
1889
+ 0.4444444444444444,
1890
+ "#bd3786"
1891
+ ],
1892
+ [
1893
+ 0.5555555555555556,
1894
+ "#d8576b"
1895
+ ],
1896
+ [
1897
+ 0.6666666666666666,
1898
+ "#ed7953"
1899
+ ],
1900
+ [
1901
+ 0.7777777777777778,
1902
+ "#fb9f3a"
1903
+ ],
1904
+ [
1905
+ 0.8888888888888888,
1906
+ "#fdca26"
1907
+ ],
1908
+ [
1909
+ 1,
1910
+ "#f0f921"
1911
+ ]
1912
+ ]
1913
+ },
1914
+ "colorway": [
1915
+ "#636efa",
1916
+ "#EF553B",
1917
+ "#00cc96",
1918
+ "#ab63fa",
1919
+ "#FFA15A",
1920
+ "#19d3f3",
1921
+ "#FF6692",
1922
+ "#B6E880",
1923
+ "#FF97FF",
1924
+ "#FECB52"
1925
+ ],
1926
+ "font": {
1927
+ "color": "#2a3f5f"
1928
+ },
1929
+ "geo": {
1930
+ "bgcolor": "white",
1931
+ "lakecolor": "white",
1932
+ "landcolor": "#E5ECF6",
1933
+ "showlakes": true,
1934
+ "showland": true,
1935
+ "subunitcolor": "white"
1936
+ },
1937
+ "hoverlabel": {
1938
+ "align": "left"
1939
+ },
1940
+ "hovermode": "closest",
1941
+ "mapbox": {
1942
+ "style": "light"
1943
+ },
1944
+ "paper_bgcolor": "white",
1945
+ "plot_bgcolor": "#E5ECF6",
1946
+ "polar": {
1947
+ "angularaxis": {
1948
+ "gridcolor": "white",
1949
+ "linecolor": "white",
1950
+ "ticks": ""
1951
+ },
1952
+ "bgcolor": "#E5ECF6",
1953
+ "radialaxis": {
1954
+ "gridcolor": "white",
1955
+ "linecolor": "white",
1956
+ "ticks": ""
1957
+ }
1958
+ },
1959
+ "scene": {
1960
+ "xaxis": {
1961
+ "backgroundcolor": "#E5ECF6",
1962
+ "gridcolor": "white",
1963
+ "gridwidth": 2,
1964
+ "linecolor": "white",
1965
+ "showbackground": true,
1966
+ "ticks": "",
1967
+ "zerolinecolor": "white"
1968
+ },
1969
+ "yaxis": {
1970
+ "backgroundcolor": "#E5ECF6",
1971
+ "gridcolor": "white",
1972
+ "gridwidth": 2,
1973
+ "linecolor": "white",
1974
+ "showbackground": true,
1975
+ "ticks": "",
1976
+ "zerolinecolor": "white"
1977
+ },
1978
+ "zaxis": {
1979
+ "backgroundcolor": "#E5ECF6",
1980
+ "gridcolor": "white",
1981
+ "gridwidth": 2,
1982
+ "linecolor": "white",
1983
+ "showbackground": true,
1984
+ "ticks": "",
1985
+ "zerolinecolor": "white"
1986
+ }
1987
+ },
1988
+ "shapedefaults": {
1989
+ "line": {
1990
+ "color": "#2a3f5f"
1991
+ }
1992
+ },
1993
+ "ternary": {
1994
+ "aaxis": {
1995
+ "gridcolor": "white",
1996
+ "linecolor": "white",
1997
+ "ticks": ""
1998
+ },
1999
+ "baxis": {
2000
+ "gridcolor": "white",
2001
+ "linecolor": "white",
2002
+ "ticks": ""
2003
+ },
2004
+ "bgcolor": "#E5ECF6",
2005
+ "caxis": {
2006
+ "gridcolor": "white",
2007
+ "linecolor": "white",
2008
+ "ticks": ""
2009
+ }
2010
+ },
2011
+ "title": {
2012
+ "x": 0.05
2013
+ },
2014
+ "xaxis": {
2015
+ "automargin": true,
2016
+ "gridcolor": "white",
2017
+ "linecolor": "white",
2018
+ "ticks": "",
2019
+ "title": {
2020
+ "standoff": 15
2021
+ },
2022
+ "zerolinecolor": "white",
2023
+ "zerolinewidth": 2
2024
+ },
2025
+ "yaxis": {
2026
+ "automargin": true,
2027
+ "gridcolor": "white",
2028
+ "linecolor": "white",
2029
+ "ticks": "",
2030
+ "title": {
2031
+ "standoff": 15
2032
+ },
2033
+ "zerolinecolor": "white",
2034
+ "zerolinewidth": 2
2035
+ }
2036
+ }
2037
+ },
2038
+ "title": {
2039
+ "text": "Histogram of question + context token lengths (total=1005)"
2040
+ },
2041
+ "xaxis": {
2042
+ "anchor": "y",
2043
+ "domain": [
2044
+ 0,
2045
+ 1
2046
+ ],
2047
+ "title": {
2048
+ "text": "value"
2049
+ }
2050
+ },
2051
+ "yaxis": {
2052
+ "anchor": "x",
2053
+ "domain": [
2054
+ 0,
2055
+ 1
2056
+ ],
2057
+ "title": {
2058
+ "text": "count"
2059
+ }
2060
+ }
2061
+ }
2062
+ }
2063
+ },
2064
+ "metadata": {},
2065
+ "output_type": "display_data"
2066
+ }
2067
+ ],
2068
+ "source": [
2069
+ "# plot histogram of full_text lengths\n",
2070
+ "question_token_lengths = []\n",
2071
+ "for inst in instances:\n",
2072
+ " question_token_lengths.append(len(inst['question_with_context']))\n",
2073
+ " \n",
2074
+ "px.histogram(question_token_lengths, \n",
2075
+ " title=f'Histogram of question + context token lengths (total={len(question_token_lengths)})')"
2076
+ ]
2077
+ },
2078
+ {
2079
+ "cell_type": "code",
2080
+ "execution_count": 11,
2081
  "metadata": {},
2082
  "outputs": [],
2083
  "source": [
2084
+ "# arxiv id to year\n",
2085
+ "def article_id_to_date(article_id):\n",
2086
+ " year = article_id[:2]\n",
2087
+ " month = article_id[2:4]\n",
2088
+ " dt = date(int('20' + year), int(month), 1)\n",
2089
+ " return dt"
2090
  ]
2091
  },
2092
  {
2093
  "cell_type": "code",
2094
+ "execution_count": 12,
2095
  "metadata": {},
2096
  "outputs": [
2097
  {
2098
  "data": {
2099
  "text/plain": [
2100
+ "datetime.date(2020, 1, 1)"
 
 
 
 
 
 
 
 
 
 
 
 
 
2101
  ]
2102
  },
2103
+ "execution_count": 12,
2104
  "metadata": {},
2105
  "output_type": "execute_result"
2106
  }
2107
  ],
2108
  "source": [
2109
+ "article_id_to_date('2001.0001')"
2110
  ]
2111
  },
2112
  {
2113
  "cell_type": "code",
2114
+ "execution_count": 13,
2115
+ "metadata": {},
2116
+ "outputs": [],
2117
+ "source": [
2118
+ "# get year distribution\n",
2119
+ "years = []\n",
2120
+ "for inst in instances:\n",
2121
+ " dt = article_id_to_date(inst['metadata']['article_id'])\n",
2122
+ " # print(dt)\n",
2123
+ " years.append(dt)"
2124
+ ]
2125
+ },
2126
+ {
2127
+ "cell_type": "code",
2128
+ "execution_count": 14,
2129
  "metadata": {},
2130
  "outputs": [
2131
  {
 
2152
  "showlegend": true,
2153
  "type": "histogram",
2154
  "x": [
2155
+ "2019-12-01",
2156
+ "2019-12-01",
2157
+ "2019-12-01",
2158
+ "2019-12-01",
2159
+ "2018-10-01",
2160
+ "2018-10-01",
2161
+ "2018-10-01",
2162
+ "2016-09-01",
2163
+ "2016-09-01",
2164
+ "2018-01-01",
2165
+ "2018-01-01",
2166
+ "2018-11-01",
2167
+ "2018-11-01",
2168
+ "2018-11-01",
2169
+ "2019-09-01",
2170
+ "2019-09-01",
2171
+ "2017-04-01",
2172
+ "2017-04-01",
2173
+ "2017-04-01",
2174
+ "2017-04-01",
2175
+ "2019-09-01",
2176
+ "2019-09-01",
2177
+ "2020-03-01",
2178
+ "2020-03-01",
2179
+ "2020-03-01",
2180
+ "2020-03-01",
2181
+ "2017-08-01",
2182
+ "2017-08-01",
2183
+ "2017-08-01",
2184
+ "2017-08-01",
2185
+ "2020-02-01",
2186
+ "2020-02-01",
2187
+ "2020-02-01",
2188
+ "2020-02-01",
2189
+ "2020-02-01",
2190
+ "2019-09-01",
2191
+ "2019-09-01",
2192
+ "2016-05-01",
2193
+ "2016-05-01",
2194
+ "2016-05-01",
2195
+ "2016-05-01",
2196
+ "2018-04-01",
2197
+ "2018-04-01",
2198
+ "2018-09-01",
2199
+ "2019-01-01",
2200
+ "2016-12-01",
2201
+ "2016-12-01",
2202
+ "2016-12-01",
2203
+ "2019-12-01",
2204
+ "2019-12-01",
2205
+ "2019-12-01",
2206
+ "2019-10-01",
2207
+ "2019-10-01",
2208
+ "2016-03-01",
2209
+ "2016-03-01",
2210
+ "2019-11-01",
2211
+ "2019-11-01",
2212
+ "2019-11-01",
2213
+ "2019-11-01",
2214
+ "2020-01-01",
2215
+ "2020-01-01",
2216
+ "2020-01-01",
2217
+ "2020-02-01",
2218
+ "2020-02-01",
2219
+ "2020-02-01",
2220
+ "2018-08-01",
2221
+ "2018-08-01",
2222
+ "2018-08-01",
2223
+ "2019-06-01",
2224
+ "2019-06-01",
2225
+ "2019-06-01",
2226
+ "2018-09-01",
2227
+ "2018-09-01",
2228
+ "2018-09-01",
2229
+ "2020-04-01",
2230
+ "2020-04-01",
2231
+ "2016-11-01",
2232
+ "2016-11-01",
2233
+ "2016-11-01",
2234
+ "2016-11-01",
2235
+ "2019-12-01",
2236
+ "2019-12-01",
2237
+ "2019-12-01",
2238
+ "2019-12-01",
2239
+ "2019-12-01",
2240
+ "2018-09-01",
2241
+ "2018-09-01",
2242
+ "2018-09-01",
2243
+ "2018-09-01",
2244
+ "2018-09-01",
2245
+ "2018-09-01",
2246
+ "2018-09-01",
2247
+ "2018-09-01",
2248
+ "2018-09-01",
2249
+ "2018-09-01",
2250
+ "2016-04-01",
2251
+ "2020-02-01",
2252
+ "2020-02-01",
2253
+ "2020-02-01",
2254
+ "2018-02-01",
2255
+ "2018-02-01",
2256
+ "2018-02-01",
2257
+ "2018-02-01",
2258
+ "2018-02-01",
2259
+ "2018-02-01",
2260
+ "2018-09-01",
2261
+ "2018-09-01",
2262
+ "2018-09-01",
2263
+ "2018-09-01",
2264
+ "2017-10-01",
2265
+ "2017-10-01",
2266
+ "2019-12-01",
2267
+ "2019-12-01",
2268
+ "2019-12-01",
2269
+ "2019-12-01",
2270
+ "2019-12-01",
2271
+ "2019-12-01",
2272
+ "2019-12-01",
2273
+ "2019-12-01",
2274
+ "2019-12-01",
2275
+ "2020-02-01",
2276
+ "2020-02-01",
2277
+ "2020-02-01",
2278
+ "2019-09-01",
2279
+ "2019-09-01",
2280
+ "2019-09-01",
2281
+ "2019-09-01",
2282
+ "2018-02-01",
2283
+ "2018-02-01",
2284
+ "2018-02-01",
2285
+ "2018-02-01",
2286
+ "2018-02-01",
2287
+ "2020-04-01",
2288
+ "2020-04-01",
2289
+ "2017-10-01",
2290
+ "2017-10-01",
2291
+ "2017-10-01",
2292
+ "2016-12-01",
2293
+ "2016-12-01",
2294
+ "2016-12-01",
2295
+ "2016-12-01",
2296
+ "2018-09-01",
2297
+ "2018-09-01",
2298
+ "2018-09-01",
2299
+ "2019-09-01",
2300
+ "2019-09-01",
2301
+ "2019-09-01",
2302
+ "2019-09-01",
2303
+ "2019-11-01",
2304
+ "2019-11-01",
2305
+ "2019-11-01",
2306
+ "2019-11-01",
2307
+ "2019-06-01",
2308
+ "2019-06-01",
2309
+ "2019-06-01",
2310
+ "2018-12-01",
2311
+ "2016-11-01",
2312
+ "2016-11-01",
2313
+ "2016-11-01",
2314
+ "2019-04-01",
2315
+ "2019-04-01",
2316
+ "2019-04-01",
2317
+ "2019-11-01",
2318
+ "2019-11-01",
2319
+ "2017-06-01",
2320
+ "2017-06-01",
2321
+ "2019-09-01",
2322
+ "2019-09-01",
2323
+ "2019-10-01",
2324
+ "2019-10-01",
2325
+ "2019-10-01",
2326
+ "2016-09-01",
2327
+ "2016-09-01",
2328
+ "2016-09-01",
2329
+ "2016-04-01",
2330
+ "2016-04-01",
2331
+ "2016-12-01",
2332
+ "2016-12-01",
2333
+ "2016-08-01",
2334
+ "2019-04-01",
2335
+ "2019-04-01",
2336
+ "2019-04-01",
2337
+ "2019-12-01",
2338
+ "2019-12-01",
2339
+ "2016-03-01",
2340
+ "2019-08-01",
2341
+ "2019-08-01",
2342
+ "2019-08-01",
2343
+ "2019-08-01",
2344
+ "2017-02-01",
2345
+ "2017-02-01",
2346
+ "2017-02-01",
2347
+ "2019-04-01",
2348
+ "2019-04-01",
2349
+ "2016-06-01",
2350
+ "2016-06-01",
2351
+ "2018-02-01",
2352
+ "2018-02-01",
2353
+ "2018-02-01",
2354
+ "2019-09-01",
2355
+ "2019-11-01",
2356
+ "2017-12-01",
2357
+ "2017-12-01",
2358
+ "2017-12-01",
2359
+ "2017-12-01",
2360
+ "2017-12-01",
2361
+ "2017-12-01",
2362
+ "2017-12-01",
2363
+ "2018-05-01",
2364
+ "2019-07-01",
2365
+ "2020-03-01",
2366
+ "2020-03-01",
2367
+ "2020-03-01",
2368
+ "2020-03-01",
2369
+ "2020-01-01",
2370
+ "2020-01-01",
2371
+ "2019-09-01",
2372
+ "2019-09-01",
2373
+ "2017-01-01",
2374
+ "2019-04-01",
2375
+ "2019-04-01",
2376
+ "2019-04-01",
2377
+ "2019-04-01",
2378
+ "2020-03-01",
2379
+ "2020-03-01",
2380
+ "2020-03-01",
2381
+ "2020-03-01",
2382
+ "2019-09-01",
2383
+ "2019-09-01",
2384
+ "2016-04-01",
2385
+ "2016-04-01",
2386
+ "2016-08-01",
2387
+ "2016-08-01",
2388
+ "2020-01-01",
2389
+ "2020-01-01",
2390
+ "2020-01-01",
2391
+ "2016-06-01",
2392
+ "2018-03-01",
2393
+ "2018-03-01",
2394
+ "2019-10-01",
2395
+ "2017-01-01",
2396
+ "2017-01-01",
2397
+ "2017-01-01",
2398
+ "2017-01-01",
2399
+ "2019-12-01",
2400
+ "2019-12-01",
2401
+ "2017-09-01",
2402
+ "2017-09-01",
2403
+ "2017-09-01",
2404
+ "2018-06-01",
2405
+ "2018-06-01",
2406
+ "2018-06-01",
2407
+ "2018-06-01",
2408
+ "2018-11-01",
2409
+ "2018-11-01",
2410
+ "2018-06-01",
2411
+ "2016-10-01",
2412
+ "2016-10-01",
2413
+ "2016-10-01",
2414
+ "2020-03-01",
2415
+ "2018-11-01",
2416
+ "2018-05-01",
2417
+ "2018-05-01",
2418
+ "2019-04-01",
2419
+ "2019-04-01",
2420
+ "2019-09-01",
2421
+ "2019-09-01",
2422
+ "2019-10-01",
2423
+ "2019-10-01",
2424
+ "2019-10-01",
2425
+ "2019-10-01",
2426
+ "2019-09-01",
2427
+ "2019-09-01",
2428
+ "2019-09-01",
2429
+ "2018-01-01",
2430
+ "2018-01-01",
2431
+ "2019-07-01",
2432
+ "2020-02-01",
2433
+ "2017-10-01",
2434
+ "2018-04-01",
2435
+ "2019-11-01",
2436
+ "2019-11-01",
2437
+ "2018-12-01",
2438
+ "2019-11-01",
2439
+ "2019-11-01",
2440
+ "2018-11-01",
2441
+ "2019-09-01",
2442
+ "2017-01-01",
2443
+ "2018-06-01",
2444
+ "2019-08-01",
2445
+ "2019-08-01",
2446
+ "2019-08-01",
2447
+ "2019-08-01",
2448
+ "2019-08-01",
2449
+ "2019-08-01",
2450
+ "2019-08-01",
2451
+ "2019-08-01",
2452
+ "2019-08-01",
2453
+ "2019-08-01",
2454
+ "2019-08-01",
2455
+ "2019-08-01",
2456
+ "2019-09-01",
2457
+ "2019-09-01",
2458
+ "2019-09-01",
2459
+ "2019-09-01",
2460
+ "2019-09-01",
2461
+ "2019-09-01",
2462
+ "2019-09-01",
2463
+ "2019-09-01",
2464
+ "2020-02-01",
2465
+ "2020-02-01",
2466
+ "2020-02-01",
2467
+ "2020-02-01",
2468
+ "2020-02-01",
2469
+ "2020-02-01",
2470
+ "2020-02-01",
2471
+ "2016-11-01",
2472
+ "2016-11-01",
2473
+ "2016-11-01",
2474
+ "2016-11-01",
2475
+ "2016-11-01",
2476
+ "2016-11-01",
2477
+ "2019-08-01",
2478
+ "2019-08-01",
2479
+ "2019-08-01",
2480
+ "2019-08-01",
2481
+ "2019-08-01",
2482
+ "2019-08-01",
2483
+ "2017-07-01",
2484
+ "2017-07-01",
2485
+ "2017-07-01",
2486
+ "2017-07-01",
2487
+ "2017-07-01",
2488
+ "2017-07-01",
2489
+ "2018-06-01",
2490
+ "2018-06-01",
2491
+ "2018-06-01",
2492
+ "2018-06-01",
2493
+ "2018-06-01",
2494
+ "2018-06-01",
2495
+ "2019-04-01",
2496
+ "2019-04-01",
2497
+ "2019-04-01",
2498
+ "2019-04-01",
2499
+ "2019-04-01",
2500
+ "2019-04-01",
2501
+ "2019-12-01",
2502
+ "2019-12-01",
2503
+ "2019-12-01",
2504
+ "2019-12-01",
2505
+ "2019-12-01",
2506
+ "2019-12-01",
2507
+ "2019-12-01",
2508
+ "2019-12-01",
2509
+ "2019-12-01",
2510
+ "2019-12-01",
2511
+ "2019-12-01",
2512
+ "2019-12-01",
2513
+ "2017-03-01",
2514
+ "2017-03-01",
2515
+ "2017-03-01",
2516
+ "2017-03-01",
2517
+ "2017-03-01",
2518
+ "2017-03-01",
2519
+ "2020-03-01",
2520
+ "2020-03-01",
2521
+ "2020-03-01",
2522
+ "2020-03-01",
2523
+ "2020-03-01",
2524
+ "2020-03-01",
2525
+ "2019-10-01",
2526
+ "2019-10-01",
2527
+ "2019-10-01",
2528
+ "2019-10-01",
2529
+ "2019-10-01",
2530
+ "2019-10-01",
2531
+ "2019-10-01",
2532
+ "2019-10-01",
2533
+ "2019-10-01",
2534
+ "2019-10-01",
2535
+ "2019-10-01",
2536
+ "2017-06-01",
2537
+ "2017-06-01",
2538
+ "2017-06-01",
2539
+ "2017-06-01",
2540
+ "2017-06-01",
2541
+ "2019-02-01",
2542
+ "2019-02-01",
2543
+ "2019-02-01",
2544
+ "2019-02-01",
2545
+ "2019-02-01",
2546
+ "2019-02-01",
2547
+ "2019-02-01",
2548
+ "2019-02-01",
2549
+ "2019-02-01",
2550
+ "2019-02-01",
2551
+ "2016-04-01",
2552
+ "2016-04-01",
2553
+ "2016-04-01",
2554
+ "2016-04-01",
2555
+ "2016-04-01",
2556
+ "2019-05-01",
2557
+ "2019-05-01",
2558
+ "2019-05-01",
2559
+ "2019-05-01",
2560
+ "2019-05-01",
2561
+ "2018-10-01",
2562
+ "2018-10-01",
2563
+ "2018-10-01",
2564
+ "2018-10-01",
2565
+ "2018-10-01",
2566
+ "2017-07-01",
2567
+ "2017-07-01",
2568
+ "2017-07-01",
2569
+ "2017-07-01",
2570
+ "2017-07-01",
2571
+ "2018-10-01",
2572
+ "2018-10-01",
2573
+ "2018-10-01",
2574
+ "2018-10-01",
2575
+ "2018-10-01",
2576
+ "2020-04-01",
2577
+ "2020-04-01",
2578
+ "2020-04-01",
2579
+ "2020-04-01",
2580
+ "2020-04-01",
2581
+ "2019-09-01",
2582
+ "2019-09-01",
2583
+ "2019-09-01",
2584
+ "2019-09-01",
2585
+ "2019-09-01",
2586
+ "2017-06-01",
2587
+ "2017-06-01",
2588
+ "2017-06-01",
2589
+ "2017-06-01",
2590
+ "2017-06-01",
2591
+ "2019-08-01",
2592
+ "2019-08-01",
2593
+ "2019-08-01",
2594
+ "2019-08-01",
2595
+ "2019-08-01",
2596
+ "2019-08-01",
2597
+ "2019-08-01",
2598
+ "2019-08-01",
2599
+ "2019-08-01",
2600
+ "2019-08-01",
2601
+ "2016-12-01",
2602
+ "2016-12-01",
2603
+ "2016-12-01",
2604
+ "2016-12-01",
2605
+ "2016-12-01",
2606
+ "2019-07-01",
2607
+ "2019-07-01",
2608
+ "2019-07-01",
2609
+ "2019-07-01",
2610
+ "2019-07-01",
2611
+ "2019-11-01",
2612
+ "2019-11-01",
2613
+ "2019-11-01",
2614
+ "2019-11-01",
2615
+ "2019-11-01",
2616
+ "2019-11-01",
2617
+ "2019-11-01",
2618
+ "2019-11-01",
2619
+ "2019-11-01",
2620
+ "2015-03-01",
2621
+ "2015-03-01",
2622
+ "2015-03-01",
2623
+ "2015-03-01",
2624
+ "2018-04-01",
2625
+ "2018-04-01",
2626
+ "2018-04-01",
2627
+ "2018-04-01",
2628
+ "2016-11-01",
2629
+ "2016-11-01",
2630
+ "2016-11-01",
2631
+ "2016-11-01",
2632
+ "2019-10-01",
2633
+ "2019-10-01",
2634
+ "2019-10-01",
2635
+ "2019-10-01",
2636
+ "2019-09-01",
2637
+ "2019-09-01",
2638
+ "2019-09-01",
2639
+ "2019-09-01",
2640
+ "2019-10-01",
2641
+ "2019-10-01",
2642
+ "2019-10-01",
2643
+ "2019-10-01",
2644
+ "2020-02-01",
2645
+ "2020-02-01",
2646
+ "2020-02-01",
2647
+ "2020-02-01",
2648
+ "2019-09-01",
2649
+ "2019-09-01",
2650
+ "2019-09-01",
2651
+ "2019-09-01",
2652
+ "2019-10-01",
2653
+ "2019-10-01",
2654
+ "2019-10-01",
2655
+ "2019-10-01",
2656
+ "2019-06-01",
2657
+ "2019-06-01",
2658
+ "2019-06-01",
2659
+ "2019-06-01",
2660
+ "2019-03-01",
2661
+ "2019-03-01",
2662
+ "2019-03-01",
2663
+ "2019-03-01",
2664
+ "2017-12-01",
2665
+ "2017-12-01",
2666
+ "2017-12-01",
2667
+ "2017-12-01",
2668
+ "2018-09-01",
2669
+ "2018-09-01",
2670
+ "2018-09-01",
2671
+ "2018-09-01",
2672
+ "2018-06-01",
2673
+ "2018-06-01",
2674
+ "2018-06-01",
2675
+ "2018-06-01",
2676
+ "2019-03-01",
2677
+ "2019-03-01",
2678
+ "2019-03-01",
2679
+ "2019-03-01",
2680
+ "2018-06-01",
2681
+ "2018-06-01",
2682
+ "2018-06-01",
2683
+ "2018-06-01",
2684
+ "2019-10-01",
2685
+ "2019-10-01",
2686
+ "2019-10-01",
2687
+ "2019-10-01",
2688
+ "2018-08-01",
2689
+ "2018-08-01",
2690
+ "2018-08-01",
2691
+ "2018-08-01",
2692
+ "2019-10-01",
2693
+ "2019-10-01",
2694
+ "2019-10-01",
2695
+ "2019-10-01",
2696
+ "2019-10-01",
2697
+ "2019-10-01",
2698
+ "2019-10-01",
2699
+ "2019-10-01",
2700
+ "2017-02-01",
2701
+ "2017-02-01",
2702
+ "2017-02-01",
2703
+ "2017-02-01",
2704
+ "2018-05-01",
2705
+ "2018-05-01",
2706
+ "2018-05-01",
2707
+ "2018-05-01",
2708
+ "2018-07-01",
2709
+ "2018-07-01",
2710
+ "2018-07-01",
2711
+ "2018-07-01",
2712
+ "2017-06-01",
2713
+ "2017-06-01",
2714
+ "2017-06-01",
2715
+ "2017-06-01",
2716
+ "2019-06-01",
2717
+ "2019-06-01",
2718
+ "2019-06-01",
2719
+ "2019-06-01",
2720
+ "2020-02-01",
2721
+ "2020-02-01",
2722
+ "2020-02-01",
2723
+ "2020-02-01",
2724
+ "2019-08-01",
2725
+ "2019-08-01",
2726
+ "2019-08-01",
2727
+ "2019-08-01",
2728
+ "2018-11-01",
2729
+ "2018-11-01",
2730
+ "2018-11-01",
2731
+ "2018-11-01",
2732
+ "2019-09-01",
2733
+ "2019-09-01",
2734
+ "2019-09-01",
2735
+ "2019-09-01",
2736
+ "2018-04-01",
2737
+ "2018-04-01",
2738
+ "2018-04-01",
2739
+ "2018-04-01",
2740
+ "2019-05-01",
2741
+ "2019-05-01",
2742
+ "2019-05-01",
2743
+ "2019-05-01",
2744
+ "2019-05-01",
2745
+ "2019-05-01",
2746
+ "2019-05-01",
2747
+ "2016-03-01",
2748
+ "2016-03-01",
2749
+ "2016-03-01",
2750
+ "2016-03-01",
2751
+ "2016-03-01",
2752
+ "2016-03-01",
2753
+ "2016-03-01",
2754
+ "2019-08-01",
2755
+ "2019-08-01",
2756
+ "2019-08-01",
2757
+ "2019-08-01",
2758
+ "2019-08-01",
2759
+ "2019-08-01",
2760
+ "2016-10-01",
2761
+ "2016-10-01",
2762
+ "2016-10-01",
2763
+ "2016-01-01",
2764
+ "2016-01-01",
2765
+ "2016-01-01",
2766
+ "2016-01-01",
2767
+ "2016-01-01",
2768
+ "2016-01-01",
2769
+ "2019-12-01",
2770
+ "2019-12-01",
2771
+ "2019-12-01",
2772
+ "2019-12-01",
2773
+ "2019-12-01",
2774
+ "2019-12-01",
2775
+ "2018-10-01",
2776
+ "2018-10-01",
2777
+ "2018-10-01",
2778
+ "2016-10-01",
2779
+ "2016-10-01",
2780
+ "2016-10-01",
2781
+ "2020-03-01",
2782
+ "2020-03-01",
2783
+ "2020-03-01",
2784
+ "2016-10-01",
2785
+ "2016-10-01",
2786
+ "2016-10-01",
2787
+ "2019-09-01",
2788
+ "2019-09-01",
2789
+ "2019-09-01",
2790
+ "2020-01-01",
2791
+ "2020-01-01",
2792
+ "2020-01-01",
2793
+ "2020-01-01",
2794
+ "2020-01-01",
2795
+ "2020-01-01",
2796
+ "2017-08-01",
2797
+ "2017-08-01",
2798
+ "2017-08-01",
2799
+ "2017-05-01",
2800
+ "2017-05-01",
2801
+ "2017-05-01",
2802
+ "2019-08-01",
2803
+ "2019-08-01",
2804
+ "2019-08-01",
2805
+ "2020-01-01",
2806
+ "2020-01-01",
2807
+ "2020-01-01",
2808
+ "2019-12-01",
2809
+ "2019-12-01",
2810
+ "2019-12-01",
2811
+ "2019-03-01",
2812
+ "2019-03-01",
2813
+ "2019-03-01",
2814
+ "2019-03-01",
2815
+ "2019-03-01",
2816
+ "2019-03-01",
2817
+ "2017-03-01",
2818
+ "2017-03-01",
2819
+ "2017-03-01",
2820
+ "2019-09-01",
2821
+ "2019-09-01",
2822
+ "2019-09-01",
2823
+ "2019-07-01",
2824
+ "2019-07-01",
2825
+ "2019-07-01",
2826
+ "2017-03-01",
2827
+ "2017-03-01",
2828
+ "2017-03-01",
2829
+ "2018-10-01",
2830
+ "2018-10-01",
2831
+ "2018-10-01",
2832
+ "2017-07-01",
2833
+ "2017-07-01",
2834
+ "2017-07-01",
2835
+ "2019-03-01",
2836
+ "2019-03-01",
2837
+ "2019-03-01",
2838
+ "2019-12-01",
2839
+ "2019-12-01",
2840
+ "2019-12-01",
2841
+ "2020-03-01",
2842
+ "2020-03-01",
2843
+ "2020-03-01",
2844
+ "2019-09-01",
2845
+ "2019-09-01",
2846
+ "2019-09-01",
2847
+ "2019-09-01",
2848
+ "2019-09-01",
2849
+ "2019-09-01",
2850
+ "2019-09-01",
2851
+ "2019-09-01",
2852
+ "2019-09-01",
2853
+ "2020-01-01",
2854
+ "2020-01-01",
2855
+ "2020-01-01",
2856
+ "2020-01-01",
2857
+ "2020-01-01",
2858
+ "2020-01-01",
2859
+ "2018-01-01",
2860
+ "2018-01-01",
2861
+ "2018-01-01",
2862
+ "2018-09-01",
2863
+ "2018-09-01",
2864
+ "2018-09-01",
2865
+ "2018-09-01",
2866
+ "2018-09-01",
2867
+ "2018-09-01",
2868
+ "2020-03-01",
2869
+ "2020-03-01",
2870
+ "2020-03-01",
2871
+ "2019-08-01",
2872
+ "2019-08-01",
2873
+ "2019-08-01",
2874
+ "2016-11-01",
2875
+ "2016-11-01",
2876
+ "2016-11-01",
2877
+ "2016-04-01",
2878
+ "2016-04-01",
2879
+ "2016-04-01",
2880
+ "2018-02-01",
2881
+ "2018-02-01",
2882
+ "2018-02-01",
2883
+ "2020-01-01",
2884
+ "2020-01-01",
2885
+ "2020-01-01",
2886
+ "2020-02-01",
2887
+ "2020-02-01",
2888
+ "2020-02-01",
2889
+ "2020-02-01",
2890
+ "2020-02-01",
2891
+ "2020-02-01",
2892
+ "2020-02-01",
2893
+ "2020-02-01",
2894
+ "2016-05-01",
2895
+ "2016-05-01",
2896
+ "2016-05-01",
2897
+ "2016-05-01",
2898
+ "2016-05-01",
2899
+ "2020-03-01",
2900
+ "2020-03-01",
2901
+ "2020-03-01",
2902
+ "2020-03-01",
2903
+ "2020-03-01",
2904
+ "2019-01-01",
2905
+ "2019-01-01",
2906
+ "2019-01-01",
2907
+ "2019-01-01",
2908
+ "2019-01-01",
2909
+ "2019-11-01",
2910
+ "2019-11-01",
2911
+ "2019-11-01",
2912
+ "2019-11-01",
2913
+ "2019-11-01",
2914
+ "2016-05-01",
2915
+ "2016-05-01",
2916
+ "2016-05-01",
2917
+ "2016-05-01",
2918
+ "2016-05-01",
2919
+ "2019-08-01",
2920
+ "2019-08-01",
2921
+ "2019-08-01",
2922
+ "2019-08-01",
2923
+ "2019-08-01",
2924
+ "2019-01-01",
2925
+ "2019-01-01",
2926
+ "2019-01-01",
2927
+ "2019-01-01",
2928
+ "2019-01-01",
2929
+ "2019-01-01",
2930
+ "2019-01-01",
2931
+ "2019-01-01",
2932
+ "2019-01-01",
2933
+ "2018-09-01",
2934
+ "2018-09-01",
2935
+ "2018-09-01",
2936
+ "2018-09-01",
2937
+ "2020-02-01",
2938
+ "2020-02-01",
2939
+ "2020-02-01",
2940
+ "2020-02-01",
2941
+ "2018-03-01",
2942
+ "2018-03-01",
2943
+ "2018-03-01",
2944
+ "2018-03-01",
2945
+ "2019-09-01",
2946
+ "2019-09-01",
2947
+ "2019-09-01",
2948
+ "2019-09-01",
2949
+ "2019-09-01",
2950
+ "2019-09-01",
2951
+ "2019-05-01",
2952
+ "2019-05-01",
2953
+ "2019-05-01",
2954
+ "2019-05-01",
2955
+ "2019-06-01",
2956
+ "2019-06-01",
2957
+ "2020-02-01",
2958
+ "2020-02-01",
2959
+ "2020-02-01",
2960
+ "2020-02-01",
2961
+ "2020-02-01",
2962
+ "2020-02-01",
2963
+ "2018-10-01",
2964
+ "2018-10-01",
2965
+ "2018-10-01",
2966
+ "2018-10-01",
2967
+ "2018-10-01",
2968
+ "2018-10-01",
2969
+ "2018-10-01",
2970
+ "2018-10-01",
2971
+ "2018-05-01",
2972
+ "2018-05-01",
2973
+ "2017-06-01",
2974
+ "2017-06-01",
2975
+ "2017-06-01",
2976
+ "2017-06-01",
2977
+ "2019-09-01",
2978
+ "2019-09-01",
2979
+ "2020-04-01",
2980
+ "2020-04-01",
2981
+ "2019-08-01",
2982
+ "2019-08-01",
2983
+ "2019-06-01",
2984
+ "2019-06-01",
2985
+ "2019-09-01",
2986
+ "2019-09-01",
2987
+ "2019-09-01",
2988
+ "2019-09-01",
2989
+ "2017-05-01",
2990
+ "2017-05-01",
2991
+ "2020-03-01",
2992
+ "2020-03-01",
2993
+ "2019-10-01",
2994
+ "2019-10-01",
2995
+ "2019-10-01",
2996
+ "2019-10-01",
2997
+ "2019-10-01",
2998
+ "2019-10-01",
2999
+ "2020-01-01",
3000
+ "2020-01-01",
3001
+ "2020-01-01",
3002
+ "2020-01-01",
3003
+ "2019-10-01",
3004
+ "2019-10-01",
3005
+ "2018-05-01",
3006
+ "2018-05-01",
3007
+ "2018-05-01",
3008
+ "2018-05-01",
3009
+ "2018-05-01",
3010
+ "2018-05-01",
3011
+ "2020-03-01",
3012
+ "2020-03-01",
3013
+ "2017-04-01",
3014
+ "2017-04-01",
3015
+ "2017-04-01",
3016
+ "2017-04-01",
3017
+ "2017-04-01",
3018
+ "2017-04-01",
3019
+ "2020-03-01",
3020
+ "2020-03-01",
3021
+ "2016-08-01",
3022
+ "2016-08-01",
3023
+ "2019-06-01",
3024
+ "2019-06-01",
3025
+ "2019-01-01",
3026
+ "2019-01-01",
3027
+ "2018-05-01",
3028
+ "2018-05-01",
3029
+ "2018-06-01",
3030
+ "2018-06-01",
3031
+ "2019-10-01",
3032
+ "2019-10-01",
3033
+ "2019-10-01",
3034
+ "2019-10-01",
3035
+ "2019-11-01",
3036
+ "2019-11-01",
3037
+ "2019-08-01",
3038
+ "2019-08-01",
3039
+ "2019-08-01",
3040
+ "2019-08-01",
3041
+ "2019-08-01",
3042
+ "2019-08-01",
3043
+ "2019-07-01",
3044
+ "2019-07-01",
3045
+ "2016-08-01",
3046
+ "2016-08-01",
3047
+ "2016-08-01",
3048
+ "2016-08-01",
3049
+ "2017-05-01",
3050
+ "2017-05-01",
3051
+ "2017-05-01",
3052
+ "2017-05-01",
3053
+ "2019-06-01",
3054
+ "2019-06-01",
3055
+ "2019-06-01",
3056
+ "2019-06-01",
3057
+ "2017-12-01",
3058
+ "2017-12-01",
3059
+ "2017-12-01",
3060
+ "2017-12-01",
3061
+ "2017-12-01",
3062
+ "2017-12-01",
3063
+ "2020-01-01",
3064
+ "2020-01-01",
3065
+ "2018-08-01",
3066
+ "2018-08-01",
3067
+ "2019-10-01",
3068
+ "2019-10-01",
3069
+ "2019-10-01",
3070
+ "2019-10-01",
3071
+ "2019-09-01",
3072
+ "2019-09-01",
3073
+ "2019-09-01",
3074
+ "2019-09-01",
3075
+ "2019-02-01",
3076
+ "2019-02-01",
3077
+ "2019-02-01",
3078
+ "2019-02-01",
3079
+ "2018-01-01",
3080
+ "2018-01-01",
3081
+ "2018-01-01",
3082
+ "2018-01-01",
3083
+ "2018-01-01",
3084
+ "2018-01-01",
3085
+ "2019-09-01",
3086
+ "2019-09-01",
3087
+ "2016-03-01",
3088
+ "2016-03-01",
3089
+ "2017-03-01",
3090
+ "2017-03-01",
3091
+ "2019-06-01",
3092
+ "2019-06-01",
3093
+ "2019-09-01",
3094
+ "2019-09-01",
3095
+ "2018-05-01",
3096
+ "2018-05-01",
3097
+ "2018-05-01",
3098
+ "2018-05-01",
3099
+ "2019-03-01",
3100
+ "2019-03-01",
3101
+ "2019-03-01",
3102
+ "2019-03-01",
3103
+ "2017-09-01",
3104
+ "2017-09-01",
3105
+ "2017-06-01",
3106
+ "2017-06-01",
3107
+ "2017-05-01",
3108
+ "2017-05-01",
3109
+ "2019-12-01",
3110
+ "2019-12-01",
3111
+ "2018-08-01",
3112
+ "2018-08-01",
3113
+ "2020-04-01",
3114
+ "2020-04-01",
3115
+ "2020-04-01",
3116
+ "2020-04-01",
3117
+ "2020-04-01",
3118
+ "2020-04-01",
3119
+ "2020-04-01",
3120
+ "2019-05-01",
3121
+ "2019-05-01",
3122
+ "2019-05-01",
3123
+ "2019-05-01",
3124
+ "2019-05-01",
3125
+ "2020-02-01",
3126
+ "2020-02-01",
3127
+ "2020-02-01",
3128
+ "2020-02-01",
3129
+ "2020-02-01",
3130
+ "2019-08-01",
3131
+ "2019-08-01",
3132
+ "2019-08-01",
3133
+ "2019-08-01",
3134
+ "2019-08-01",
3135
+ "2017-09-01",
3136
+ "2017-09-01",
3137
+ "2017-09-01",
3138
+ "2017-09-01",
3139
+ "2017-09-01",
3140
+ "2019-09-01",
3141
+ "2019-09-01",
3142
+ "2019-09-01",
3143
+ "2019-09-01",
3144
+ "2019-09-01",
3145
+ "2019-08-01",
3146
+ "2019-08-01",
3147
+ "2019-08-01",
3148
+ "2019-08-01",
3149
+ "2019-08-01",
3150
+ "2017-01-01",
3151
+ "2017-01-01",
3152
+ "2017-01-01",
3153
+ "2017-01-01",
3154
+ "2017-01-01",
3155
+ "2019-07-01",
3156
+ "2019-07-01",
3157
+ "2019-07-01",
3158
+ "2019-07-01",
3159
+ "2019-07-01"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3160
  ],
3161
  "xaxis": "x",
3162
  "yaxis": "y"
 
3170
  },
3171
  "tracegroupgap": 0
3172
  },
3173
+ "margin": {
3174
+ "t": 60
3175
+ },
3176
  "template": {
3177
  "data": {
3178
  "bar": [
 
3989
  }
3990
  }
3991
  },
 
 
 
3992
  "xaxis": {
3993
  "anchor": "y",
3994
  "domain": [
 
4017
  }
4018
  ],
4019
  "source": [
4020
+ "px.histogram(years,)"
 
 
 
 
 
 
4021
  ]
4022
  },
4023
  {
 
4029
  },
4030
  {
4031
  "cell_type": "code",
4032
+ "execution_count": 15,
4033
  "metadata": {},
4034
  "outputs": [],
4035
  "source": [
 
4052
  },
4053
  {
4054
  "cell_type": "code",
4055
+ "execution_count": 16,
4056
  "metadata": {},
4057
  "outputs": [
4058
  {
 
4075
  "\t\t\ttype: <class 'str'>\n",
4076
  "\t\t\ttext: <class 'str'>\n",
4077
  "\t\t\ttype: <class 'str'>\n",
 
 
 
 
 
 
 
 
4078
  "\tall_evidence: <class 'list'>\n",
4079
  "\tall_evidence_masks: <class 'list'>\n"
4080
  ]
 
4086
  },
4087
  {
4088
  "cell_type": "code",
4089
+ "execution_count": 17,
4090
  "metadata": {},
4091
+ "outputs": [
4092
+ {
4093
+ "name": "stderr",
4094
+ "output_type": "stream",
4095
+ "text": [
4096
+ " 0%| | 0/1005 [00:00<?, ?it/s]huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks...\n",
4097
+ "To disable this warning, you can either:\n",
4098
+ "\t- Avoid using `tokenizers` before the fork if possible\n",
4099
+ "\t- Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false)\n",
4100
+ "100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1005/1005 [01:27<00:00, 11.45it/s]\n"
4101
+ ]
4102
+ },
4103
+ {
4104
+ "name": "stdout",
4105
+ "output_type": "stream",
4106
+ "text": [
4107
+ "Number of instances: 1005\n",
4108
+ "Number of instances with html: 978\n"
4109
+ ]
4110
+ }
4111
+ ],
4112
  "source": [
4113
  "# save instances to file\n",
4114
+ "with open(os.path.join(output_path, f'{split}_instances_with_html.json'), 'w') as f:\n",
4115
  " # pretty print json\n",
4116
+ " instances_with_html = [inst for inst in tqdm(instances) if has_html(inst['metadata']['article_id'])]\n",
4117
+ " print(f'Number of instances: {len(instances)}')\n",
4118
+ " print(f'Number of instances with html: {len(instances_with_html)}')\n",
4119
+ " json.dump(instances_with_html, f, indent=4)"
4120
  ]
4121
  },
4122
  {