skalyan91 commited on
Commit
d11d70d
·
verified ·
1 Parent(s): 2c29c78

deploy at 2025-12-28 16:31:13.332600

Browse files
Files changed (2) hide show
  1. Dependency length.ipynb +160 -364
  2. main.py +10 -0
Dependency length.ipynb CHANGED
@@ -38,7 +38,7 @@
38
  },
39
  {
40
  "cell_type": "code",
41
- "execution_count": 48,
42
  "id": "cefdbf22-b747-4bea-b279-c9b01e75ff2e",
43
  "metadata": {},
44
  "outputs": [],
@@ -62,6 +62,11 @@
62
  " to_reverse[i-1].dep_ = \"comp\"\n",
63
  " for token in doc:\n",
64
  " if token.dep_ == \"dep\": token.dep_ = \"unknown\"\n",
 
 
 
 
 
65
  " for rel in relations.keys():\n",
66
  " if token.dep_ in relations[rel]: token.dep_ = rel\n",
67
  " for token in doc:\n",
@@ -75,12 +80,16 @@
75
  " for child in [c for c in token.children if c.i < subject[0].i]:\n",
76
  " if child.dep_ in [\"comp\", \"udep\"]:\n",
77
  " child.dep_ = \"mod\"\n",
 
 
 
 
78
  " return doc"
79
  ]
80
  },
81
  {
82
  "cell_type": "code",
83
- "execution_count": 51,
84
  "id": "23efda66-9d58-4169-9fa0-05de47267b5a",
85
  "metadata": {},
86
  "outputs": [],
@@ -98,7 +107,7 @@
98
  },
99
  {
100
  "cell_type": "code",
101
- "execution_count": 35,
102
  "id": "5bb29f0a-9d55-4f2d-84c3-4c3c4bae0271",
103
  "metadata": {},
104
  "outputs": [],
@@ -132,472 +141,264 @@
132
  },
133
  {
134
  "cell_type": "code",
135
- "execution_count": 49,
136
  "id": "ba90ff19-c665-49d8-8ad4-5caee885901d",
137
  "metadata": {},
138
  "outputs": [
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  {
140
  "data": {
141
  "text/html": [
142
- "<span class=\"tex2jax_ignore\"><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xml:lang=\"en\" id=\"0c70d09209f64114aa5a12db7f67e2b2-0\" class=\"displacy\" width=\"6350\" height=\"574.5\" direction=\"ltr\" style=\"max-width: none; height: 574.5px; color: #000000; background: #ffffff; font-family: Arial; direction: ltr\">\n",
143
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
144
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"50\">According</tspan>\n",
145
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"50\">VERB</tspan>\n",
146
- "</text>\n",
147
- "\n",
148
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
149
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"225\">to</tspan>\n",
150
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"225\">ADP</tspan>\n",
151
- "</text>\n",
152
- "\n",
153
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
154
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"400\">the</tspan>\n",
155
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"400\">DET</tspan>\n",
156
- "</text>\n",
157
- "\n",
158
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
159
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"575\">studies, “</tspan>\n",
160
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"575\">NOUN</tspan>\n",
161
- "</text>\n",
162
- "\n",
163
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
164
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"750\">People</tspan>\n",
165
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"750\">NOUN</tspan>\n",
166
- "</text>\n",
167
- "\n",
168
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
169
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"925\">who</tspan>\n",
170
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"925\">PRON</tspan>\n",
171
- "</text>\n",
172
- "\n",
173
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
174
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"1100\">danced</tspan>\n",
175
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"1100\">VERB</tspan>\n",
176
- "</text>\n",
177
- "\n",
178
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
179
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"1275\">more</tspan>\n",
180
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"1275\">ADJ</tspan>\n",
181
- "</text>\n",
182
- "\n",
183
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
184
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"1450\">than</tspan>\n",
185
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"1450\">ADP</tspan>\n",
186
- "</text>\n",
187
- "\n",
188
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
189
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"1625\">once</tspan>\n",
190
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"1625\">ADV</tspan>\n",
191
- "</text>\n",
192
- "\n",
193
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
194
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"1800\">a</tspan>\n",
195
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"1800\">DET</tspan>\n",
196
- "</text>\n",
197
- "\n",
198
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
199
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"1975\">week</tspan>\n",
200
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"1975\">NOUN</tspan>\n",
201
- "</text>\n",
202
- "\n",
203
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
204
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"2150\">had</tspan>\n",
205
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"2150\">VERB</tspan>\n",
206
- "</text>\n",
207
- "\n",
208
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
209
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"2325\">a</tspan>\n",
210
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"2325\">DET</tspan>\n",
211
- "</text>\n",
212
- "\n",
213
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
214
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"2500\">76%</tspan>\n",
215
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"2500\">NOUN</tspan>\n",
216
- "</text>\n",
217
- "\n",
218
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
219
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"2675\">lower</tspan>\n",
220
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"2675\">ADJ</tspan>\n",
221
- "</text>\n",
222
- "\n",
223
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
224
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"2850\">risk</tspan>\n",
225
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"2850\">NOUN</tspan>\n",
226
  "</text>\n",
227
  "\n",
228
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
229
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"3025\">of</tspan>\n",
230
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"3025\">ADP</tspan>\n",
231
  "</text>\n",
232
  "\n",
233
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
234
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"3200\">getting</tspan>\n",
235
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"3200\">VERB</tspan>\n",
236
  "</text>\n",
237
  "\n",
238
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
239
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"3375\">dementia</tspan>\n",
240
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"3375\">NOUN</tspan>\n",
241
  "</text>\n",
242
  "\n",
243
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
244
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"3550\">compared</tspan>\n",
245
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"3550\">VERB</tspan>\n",
246
  "</text>\n",
247
  "\n",
248
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
249
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"3725\">to</tspan>\n",
250
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"3725\">ADP</tspan>\n",
251
  "</text>\n",
252
  "\n",
253
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
254
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"3900\">people</tspan>\n",
255
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"3900\">NOUN</tspan>\n",
256
  "</text>\n",
257
  "\n",
258
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
259
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"4075\">who</tspan>\n",
260
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"4075\">PRON</tspan>\n",
261
  "</text>\n",
262
  "\n",
263
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
264
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"4250\">danced</tspan>\n",
265
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"4250\">VERB</tspan>\n",
266
  "</text>\n",
267
  "\n",
268
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
269
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"4425\">less</tspan>\n",
270
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"4425\">ADV</tspan>\n",
271
  "</text>\n",
272
  "\n",
273
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
274
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"4600\">frequently</tspan>\n",
275
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"4600\">ADV</tspan>\n",
276
  "</text>\n",
277
  "\n",
278
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
279
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"4775\">or</tspan>\n",
280
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"4775\">CCONJ</tspan>\n",
281
  "</text>\n",
282
  "\n",
283
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
284
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"4950\">did</tspan>\n",
285
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"4950\">AUX</tspan>\n",
286
  "</text>\n",
287
  "\n",
288
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
289
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"5125\">n’t</tspan>\n",
290
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"5125\">NOUN</tspan>\n",
291
  "</text>\n",
292
  "\n",
293
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
294
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"5300\">dance</tspan>\n",
295
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"5300\">NOUN</tspan>\n",
296
  "</text>\n",
297
  "\n",
298
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
299
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"5475\">at</tspan>\n",
300
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"5475\">ADV</tspan>\n",
301
  "</text>\n",
302
  "\n",
303
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
304
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"5650\">all,”</tspan>\n",
305
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"5650\">ADV</tspan>\n",
306
  "</text>\n",
307
  "\n",
308
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
309
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"5825\">Dr</tspan>\n",
310
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"5825\">PROPN</tspan>\n",
311
  "</text>\n",
312
  "\n",
313
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
314
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"6000\">Pasricha</tspan>\n",
315
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"6000\">PROPN</tspan>\n",
316
- "</text>\n",
317
- "\n",
318
- "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"484.5\">\n",
319
- " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"6175\">noted.</tspan>\n",
320
- " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"6175\">VERB</tspan>\n",
321
- "</text>\n",
322
- "\n",
323
- "<g class=\"displacy-arrow\">\n",
324
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-0\" stroke-width=\"2px\" d=\"M70,439.5 C70,89.5 2145.0,89.5 2145.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
325
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
326
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-0\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
327
- " </text>\n",
328
- " <path class=\"displacy-arrowhead\" d=\"M70,441.5 L62,429.5 78,429.5\" fill=\"currentColor\"/>\n",
329
- "</g>\n",
330
- "\n",
331
- "<g class=\"displacy-arrow\">\n",
332
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-1\" stroke-width=\"2px\" d=\"M70,439.5 C70,352.0 205.0,352.0 205.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
333
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
334
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-1\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">udep</textPath>\n",
335
- " </text>\n",
336
- " <path class=\"displacy-arrowhead\" d=\"M205.0,441.5 L213.0,429.5 197.0,429.5\" fill=\"currentColor\"/>\n",
337
- "</g>\n",
338
- "\n",
339
- "<g class=\"displacy-arrow\">\n",
340
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-2\" stroke-width=\"2px\" d=\"M420,439.5 C420,352.0 555.0,352.0 555.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
341
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
342
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-2\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">det</textPath>\n",
343
- " </text>\n",
344
- " <path class=\"displacy-arrowhead\" d=\"M420,441.5 L412,429.5 428,429.5\" fill=\"currentColor\"/>\n",
345
- "</g>\n",
346
- "\n",
347
- "<g class=\"displacy-arrow\">\n",
348
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-3\" stroke-width=\"2px\" d=\"M245,439.5 C245,264.5 560.0,264.5 560.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
349
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
350
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-3\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">comp</textPath>\n",
351
- " </text>\n",
352
- " <path class=\"displacy-arrowhead\" d=\"M560.0,441.5 L568.0,429.5 552.0,429.5\" fill=\"currentColor\"/>\n",
353
- "</g>\n",
354
- "\n",
355
- "<g class=\"displacy-arrow\">\n",
356
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-4\" stroke-width=\"2px\" d=\"M770,439.5 C770,177.0 2140.0,177.0 2140.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
357
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
358
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-4\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">subj</textPath>\n",
359
- " </text>\n",
360
- " <path class=\"displacy-arrowhead\" d=\"M770,441.5 L762,429.5 778,429.5\" fill=\"currentColor\"/>\n",
361
- "</g>\n",
362
- "\n",
363
- "<g class=\"displacy-arrow\">\n",
364
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-5\" stroke-width=\"2px\" d=\"M945,439.5 C945,352.0 1080.0,352.0 1080.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
365
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
366
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-5\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">subj</textPath>\n",
367
- " </text>\n",
368
- " <path class=\"displacy-arrowhead\" d=\"M945,441.5 L937,429.5 953,429.5\" fill=\"currentColor\"/>\n",
369
- "</g>\n",
370
- "\n",
371
- "<g class=\"displacy-arrow\">\n",
372
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-6\" stroke-width=\"2px\" d=\"M770,439.5 C770,264.5 1085.0,264.5 1085.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
373
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
374
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-6\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
375
- " </text>\n",
376
- " <path class=\"displacy-arrowhead\" d=\"M1085.0,441.5 L1093.0,429.5 1077.0,429.5\" fill=\"currentColor\"/>\n",
377
- "</g>\n",
378
- "\n",
379
- "<g class=\"displacy-arrow\">\n",
380
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-7\" stroke-width=\"2px\" d=\"M1120,439.5 C1120,352.0 1255.0,352.0 1255.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
381
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
382
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-7\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">comp</textPath>\n",
383
- " </text>\n",
384
- " <path class=\"displacy-arrowhead\" d=\"M1255.0,441.5 L1263.0,429.5 1247.0,429.5\" fill=\"currentColor\"/>\n",
385
- "</g>\n",
386
- "\n",
387
- "<g class=\"displacy-arrow\">\n",
388
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-8\" stroke-width=\"2px\" d=\"M1295,439.5 C1295,352.0 1430.0,352.0 1430.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
389
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
390
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-8\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">udep</textPath>\n",
391
- " </text>\n",
392
- " <path class=\"displacy-arrowhead\" d=\"M1430.0,441.5 L1438.0,429.5 1422.0,429.5\" fill=\"currentColor\"/>\n",
393
- "</g>\n",
394
- "\n",
395
- "<g class=\"displacy-arrow\">\n",
396
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-9\" stroke-width=\"2px\" d=\"M1470,439.5 C1470,352.0 1605.0,352.0 1605.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
397
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
398
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-9\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">pcomp</textPath>\n",
399
- " </text>\n",
400
- " <path class=\"displacy-arrowhead\" d=\"M1605.0,441.5 L1613.0,429.5 1597.0,429.5\" fill=\"currentColor\"/>\n",
401
- "</g>\n",
402
- "\n",
403
- "<g class=\"displacy-arrow\">\n",
404
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-10\" stroke-width=\"2px\" d=\"M1820,439.5 C1820,352.0 1955.0,352.0 1955.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
405
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
406
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-10\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">det</textPath>\n",
407
- " </text>\n",
408
- " <path class=\"displacy-arrowhead\" d=\"M1820,441.5 L1812,429.5 1828,429.5\" fill=\"currentColor\"/>\n",
409
- "</g>\n",
410
- "\n",
411
- "<g class=\"displacy-arrow\">\n",
412
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-11\" stroke-width=\"2px\" d=\"M1295,439.5 C1295,264.5 1960.0,264.5 1960.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
413
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
414
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-11\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
415
- " </text>\n",
416
- " <path class=\"displacy-arrowhead\" d=\"M1960.0,441.5 L1968.0,429.5 1952.0,429.5\" fill=\"currentColor\"/>\n",
417
- "</g>\n",
418
- "\n",
419
- "<g class=\"displacy-arrow\">\n",
420
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-12\" stroke-width=\"2px\" d=\"M2170,439.5 C2170,2.0 6175.0,2.0 6175.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
421
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
422
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-12\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
423
- " </text>\n",
424
- " <path class=\"displacy-arrowhead\" d=\"M2170,441.5 L2162,429.5 2178,429.5\" fill=\"currentColor\"/>\n",
425
- "</g>\n",
426
- "\n",
427
- "<g class=\"displacy-arrow\">\n",
428
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-13\" stroke-width=\"2px\" d=\"M2345,439.5 C2345,264.5 2835.0,264.5 2835.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
429
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
430
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-13\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">det</textPath>\n",
431
- " </text>\n",
432
- " <path class=\"displacy-arrowhead\" d=\"M2345,441.5 L2337,429.5 2353,429.5\" fill=\"currentColor\"/>\n",
433
- "</g>\n",
434
- "\n",
435
- "<g class=\"displacy-arrow\">\n",
436
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-14\" stroke-width=\"2px\" d=\"M2520,439.5 C2520,352.0 2655.0,352.0 2655.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
437
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
438
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-14\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
439
- " </text>\n",
440
- " <path class=\"displacy-arrowhead\" d=\"M2520,441.5 L2512,429.5 2528,429.5\" fill=\"currentColor\"/>\n",
441
- "</g>\n",
442
- "\n",
443
  "<g class=\"displacy-arrow\">\n",
444
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-15\" stroke-width=\"2px\" d=\"M2695,439.5 C2695,352.0 2830.0,352.0 2830.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
445
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
446
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-15\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">udep</textPath>\n",
447
  " </text>\n",
448
- " <path class=\"displacy-arrowhead\" d=\"M2695,441.5 L2687,429.5 2703,429.5\" fill=\"currentColor\"/>\n",
449
  "</g>\n",
450
  "\n",
451
  "<g class=\"displacy-arrow\">\n",
452
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-16\" stroke-width=\"2px\" d=\"M2170,439.5 C2170,177.0 2840.0,177.0 2840.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
453
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
454
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-16\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">comp</textPath>\n",
455
  " </text>\n",
456
- " <path class=\"displacy-arrowhead\" d=\"M2840.0,441.5 L2848.0,429.5 2832.0,429.5\" fill=\"currentColor\"/>\n",
457
  "</g>\n",
458
  "\n",
459
  "<g class=\"displacy-arrow\">\n",
460
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-17\" stroke-width=\"2px\" d=\"M2870,439.5 C2870,352.0 3005.0,352.0 3005.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
461
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
462
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-17\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">udep</textPath>\n",
463
  " </text>\n",
464
- " <path class=\"displacy-arrowhead\" d=\"M3005.0,441.5 L3013.0,429.5 2997.0,429.5\" fill=\"currentColor\"/>\n",
465
  "</g>\n",
466
  "\n",
467
  "<g class=\"displacy-arrow\">\n",
468
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-18\" stroke-width=\"2px\" d=\"M3045,439.5 C3045,352.0 3180.0,352.0 3180.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
469
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
470
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-18\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">pcomp</textPath>\n",
471
  " </text>\n",
472
- " <path class=\"displacy-arrowhead\" d=\"M3180.0,441.5 L3188.0,429.5 3172.0,429.5\" fill=\"currentColor\"/>\n",
473
  "</g>\n",
474
  "\n",
475
  "<g class=\"displacy-arrow\">\n",
476
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-19\" stroke-width=\"2px\" d=\"M3220,439.5 C3220,352.0 3355.0,352.0 3355.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
477
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
478
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-19\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">comp</textPath>\n",
479
  " </text>\n",
480
- " <path class=\"displacy-arrowhead\" d=\"M3355.0,441.5 L3363.0,429.5 3347.0,429.5\" fill=\"currentColor\"/>\n",
481
  "</g>\n",
482
  "\n",
483
  "<g class=\"displacy-arrow\">\n",
484
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-20\" stroke-width=\"2px\" d=\"M2170,439.5 C2170,89.5 3545.0,89.5 3545.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
485
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
486
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-20\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">udep</textPath>\n",
487
  " </text>\n",
488
- " <path class=\"displacy-arrowhead\" d=\"M3545.0,441.5 L3553.0,429.5 3537.0,429.5\" fill=\"currentColor\"/>\n",
489
  "</g>\n",
490
  "\n",
491
  "<g class=\"displacy-arrow\">\n",
492
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-21\" stroke-width=\"2px\" d=\"M3570,439.5 C3570,352.0 3705.0,352.0 3705.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
493
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
494
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-21\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">udep</textPath>\n",
495
  " </text>\n",
496
- " <path class=\"displacy-arrowhead\" d=\"M3705.0,441.5 L3713.0,429.5 3697.0,429.5\" fill=\"currentColor\"/>\n",
497
  "</g>\n",
498
  "\n",
499
  "<g class=\"displacy-arrow\">\n",
500
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-22\" stroke-width=\"2px\" d=\"M3745,439.5 C3745,352.0 3880.0,352.0 3880.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
501
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
502
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-22\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">comp</textPath>\n",
503
  " </text>\n",
504
- " <path class=\"displacy-arrowhead\" d=\"M3880.0,441.5 L3888.0,429.5 3872.0,429.5\" fill=\"currentColor\"/>\n",
505
  "</g>\n",
506
  "\n",
507
  "<g class=\"displacy-arrow\">\n",
508
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-23\" stroke-width=\"2px\" d=\"M4095,439.5 C4095,352.0 4230.0,352.0 4230.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
509
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
510
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-23\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">subj</textPath>\n",
511
  " </text>\n",
512
- " <path class=\"displacy-arrowhead\" d=\"M4095,441.5 L4087,429.5 4103,429.5\" fill=\"currentColor\"/>\n",
513
  "</g>\n",
514
  "\n",
515
  "<g class=\"displacy-arrow\">\n",
516
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-24\" stroke-width=\"2px\" d=\"M3920,439.5 C3920,264.5 4235.0,264.5 4235.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
517
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
518
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-24\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
519
  " </text>\n",
520
- " <path class=\"displacy-arrowhead\" d=\"M4235.0,441.5 L4243.0,429.5 4227.0,429.5\" fill=\"currentColor\"/>\n",
521
  "</g>\n",
522
  "\n",
523
  "<g class=\"displacy-arrow\">\n",
524
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-25\" stroke-width=\"2px\" d=\"M4445,439.5 C4445,352.0 4580.0,352.0 4580.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
525
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
526
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-25\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
527
  " </text>\n",
528
- " <path class=\"displacy-arrowhead\" d=\"M4445,441.5 L4437,429.5 4453,429.5\" fill=\"currentColor\"/>\n",
529
  "</g>\n",
530
  "\n",
531
  "<g class=\"displacy-arrow\">\n",
532
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-26\" stroke-width=\"2px\" d=\"M4270,439.5 C4270,264.5 4585.0,264.5 4585.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
533
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
534
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-26\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
535
  " </text>\n",
536
- " <path class=\"displacy-arrowhead\" d=\"M4585.0,441.5 L4593.0,429.5 4577.0,429.5\" fill=\"currentColor\"/>\n",
537
  "</g>\n",
538
  "\n",
539
  "<g class=\"displacy-arrow\">\n",
540
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-27\" stroke-width=\"2px\" d=\"M4270,439.5 C4270,177.0 4765.0,177.0 4765.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
541
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
542
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-27\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">cc</textPath>\n",
543
  " </text>\n",
544
- " <path class=\"displacy-arrowhead\" d=\"M4765.0,441.5 L4773.0,429.5 4757.0,429.5\" fill=\"currentColor\"/>\n",
545
  "</g>\n",
546
  "\n",
547
  "<g class=\"displacy-arrow\">\n",
548
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-28\" stroke-width=\"2px\" d=\"M4270,439.5 C4270,89.5 4945.0,89.5 4945.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
549
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
550
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-28\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">conj</textPath>\n",
551
  " </text>\n",
552
- " <path class=\"displacy-arrowhead\" d=\"M4945.0,441.5 L4953.0,429.5 4937.0,429.5\" fill=\"currentColor\"/>\n",
553
  "</g>\n",
554
  "\n",
555
  "<g class=\"displacy-arrow\">\n",
556
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-29\" stroke-width=\"2px\" d=\"M4970,439.5 C4970,352.0 5105.0,352.0 5105.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
557
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
558
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-29\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">punct</textPath>\n",
559
  " </text>\n",
560
- " <path class=\"displacy-arrowhead\" d=\"M5105.0,441.5 L5113.0,429.5 5097.0,429.5\" fill=\"currentColor\"/>\n",
561
  "</g>\n",
562
  "\n",
563
  "<g class=\"displacy-arrow\">\n",
564
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-30\" stroke-width=\"2px\" d=\"M4970,439.5 C4970,264.5 5285.0,264.5 5285.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
565
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
566
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-30\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">comp</textPath>\n",
567
  " </text>\n",
568
- " <path class=\"displacy-arrowhead\" d=\"M5285.0,441.5 L5293.0,429.5 5277.0,429.5\" fill=\"currentColor\"/>\n",
569
  "</g>\n",
570
  "\n",
571
  "<g class=\"displacy-arrow\">\n",
572
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-31\" stroke-width=\"2px\" d=\"M5495,439.5 C5495,352.0 5630.0,352.0 5630.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
573
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
574
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-31\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
575
  " </text>\n",
576
- " <path class=\"displacy-arrowhead\" d=\"M5495,441.5 L5487,429.5 5503,429.5\" fill=\"currentColor\"/>\n",
577
- "</g>\n",
578
- "\n",
579
- "<g class=\"displacy-arrow\">\n",
580
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-32\" stroke-width=\"2px\" d=\"M4970,439.5 C4970,177.0 5640.0,177.0 5640.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
581
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
582
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-32\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
583
- " </text>\n",
584
- " <path class=\"displacy-arrowhead\" d=\"M5640.0,441.5 L5648.0,429.5 5632.0,429.5\" fill=\"currentColor\"/>\n",
585
- "</g>\n",
586
- "\n",
587
- "<g class=\"displacy-arrow\">\n",
588
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-33\" stroke-width=\"2px\" d=\"M5845,439.5 C5845,352.0 5980.0,352.0 5980.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
589
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
590
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-33\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">compound</textPath>\n",
591
- " </text>\n",
592
- " <path class=\"displacy-arrowhead\" d=\"M5845,441.5 L5837,429.5 5853,429.5\" fill=\"currentColor\"/>\n",
593
- "</g>\n",
594
- "\n",
595
- "<g class=\"displacy-arrow\">\n",
596
- " <path class=\"displacy-arc\" id=\"arrow-0c70d09209f64114aa5a12db7f67e2b2-0-34\" stroke-width=\"2px\" d=\"M6020,439.5 C6020,352.0 6155.0,352.0 6155.0,439.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
597
- " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
598
- " <textPath xlink:href=\"#arrow-0c70d09209f64114aa5a12db7f67e2b2-0-34\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">subj</textPath>\n",
599
- " </text>\n",
600
- " <path class=\"displacy-arrowhead\" d=\"M6020,441.5 L6012,429.5 6028,429.5\" fill=\"currentColor\"/>\n",
601
  "</g>\n",
602
  "</svg></span>"
603
  ],
@@ -610,24 +411,30 @@
610
  }
611
  ],
612
  "source": [
613
- "doc = ssudify(nlp(\"According to the studies, “People who danced more than once a week had a 76% lower risk of getting dementia compared to people who danced less frequently or didn’t dance at all,” Dr Pasricha noted.\"))\n",
614
  "# Since this is an interactive Jupyter environment, we can use displacy.render here\n",
615
  "displacy.render(doc, style='dep')"
616
  ]
617
  },
618
  {
619
  "cell_type": "code",
620
- "execution_count": 36,
621
  "id": "daa1e8f5-2afe-4153-9469-a4c2af9b46b1",
622
  "metadata": {},
623
  "outputs": [
624
  {
625
  "data": {
626
  "text/plain": [
627
- "[(Judgement, 0)]"
 
 
 
 
 
 
628
  ]
629
  },
630
- "execution_count": 36,
631
  "metadata": {},
632
  "output_type": "execute_result"
633
  }
@@ -650,17 +457,6 @@
650
  {
651
  "cell_type": "code",
652
  "execution_count": 9,
653
- "id": "9f23a19c-b645-4b78-85fd-bc9742d00f82",
654
- "metadata": {},
655
- "outputs": [],
656
- "source": [
657
- "def display_annotations(annot):\n",
658
- " return Div(*[Span(a[0], style=f\"margin-right: 0.5ex; background: rgba(219, 144, 232, {a[1]/15})\") for a in annot])"
659
- ]
660
- },
661
- {
662
- "cell_type": "code",
663
- "execution_count": 10,
664
  "id": "8fb35fe3-68de-45b6-8053-8b390c8e8661",
665
  "metadata": {},
666
  "outputs": [],
@@ -670,7 +466,7 @@
670
  },
671
  {
672
  "cell_type": "code",
673
- "execution_count": 41,
674
  "id": "9ce9c318-733d-4ee1-b5d7-39d98aa14697",
675
  "metadata": {},
676
  "outputs": [],
@@ -708,7 +504,7 @@
708
  },
709
  {
710
  "cell_type": "code",
711
- "execution_count": 12,
712
  "id": "4cc68772-d26d-4cd1-be59-c23a5739c3d0",
713
  "metadata": {},
714
  "outputs": [
@@ -738,7 +534,7 @@
738
  },
739
  {
740
  "cell_type": "code",
741
- "execution_count": 13,
742
  "id": "3e8c0a41-0d79-4715-ab2b-e5a2d0455569",
743
  "metadata": {},
744
  "outputs": [
@@ -757,7 +553,7 @@
757
  "<IPython.core.display.HTML object>"
758
  ]
759
  },
760
- "execution_count": 13,
761
  "metadata": {},
762
  "output_type": "execute_result"
763
  }
@@ -793,7 +589,7 @@
793
  "name": "python",
794
  "nbconvert_exporter": "python",
795
  "pygments_lexer": "ipython3",
796
- "version": "3.13.9"
797
  }
798
  },
799
  "nbformat": 4,
 
38
  },
39
  {
40
  "cell_type": "code",
41
+ "execution_count": 56,
42
  "id": "cefdbf22-b747-4bea-b279-c9b01e75ff2e",
43
  "metadata": {},
44
  "outputs": [],
 
62
  " to_reverse[i-1].dep_ = \"comp\"\n",
63
  " for token in doc:\n",
64
  " if token.dep_ == \"dep\": token.dep_ = \"unknown\"\n",
65
+ " if token.dep_ == \"prep\" and token.head.pos_ == \"VERB\" and token.i < token.head.i:\n",
66
+ " token.dep_ = \"mod\"\n",
67
+ " if token.dep_ == \"ccomp\" and any(sibling.dep_ in relations[\"comp\"] \n",
68
+ " for sibling in token.head.rights if sibling.i < token.i):\n",
69
+ " token.dep_ = \"mod\"\n",
70
  " for rel in relations.keys():\n",
71
  " if token.dep_ in relations[rel]: token.dep_ = rel\n",
72
  " for token in doc:\n",
 
80
  " for child in [c for c in token.children if c.i < subject[0].i]:\n",
81
  " if child.dep_ in [\"comp\", \"udep\"]:\n",
82
  " child.dep_ = \"mod\"\n",
83
+ " for token in doc:\n",
84
+ " if any(t.text == \";\" for t in doc if (token.i < t.i < token.head.i or token.head.i < t.i < token.i) and token.pos_ != \"PUNCT\"):\n",
85
+ " token.head = token\n",
86
+ " token.dep_ = \"root\"\n",
87
  " return doc"
88
  ]
89
  },
90
  {
91
  "cell_type": "code",
92
+ "execution_count": 28,
93
  "id": "23efda66-9d58-4169-9fa0-05de47267b5a",
94
  "metadata": {},
95
  "outputs": [],
 
107
  },
108
  {
109
  "cell_type": "code",
110
+ "execution_count": 5,
111
  "id": "5bb29f0a-9d55-4f2d-84c3-4c3c4bae0271",
112
  "metadata": {},
113
  "outputs": [],
 
141
  },
142
  {
143
  "cell_type": "code",
144
+ "execution_count": 57,
145
  "id": "ba90ff19-c665-49d8-8ad4-5caee885901d",
146
  "metadata": {},
147
  "outputs": [
148
+ {
149
+ "name": "stdout",
150
+ "output_type": "stream",
151
+ "text": [
152
+ "In []\n",
153
+ "1849 []\n",
154
+ "he []\n",
155
+ "began []\n",
156
+ "public []\n",
157
+ "readings []\n",
158
+ "of []\n",
159
+ "the []\n",
160
+ "story []\n",
161
+ ", []\n",
162
+ "which []\n",
163
+ "proved ['punct']\n",
164
+ "so []\n",
165
+ "successful []\n",
166
+ "he []\n",
167
+ "undertook ['comp']\n",
168
+ "127 []\n",
169
+ "further []\n",
170
+ "performances []\n",
171
+ ". ['comp']\n"
172
+ ]
173
+ },
174
  {
175
  "data": {
176
  "text/html": [
177
+ "<span class=\"tex2jax_ignore\"><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xml:lang=\"en\" id=\"5232fcca8f23464a9783eb067e24fe32-0\" class=\"displacy\" width=\"3200\" height=\"399.5\" direction=\"ltr\" style=\"max-width: none; height: 399.5px; color: #000000; background: #ffffff; font-family: Arial; direction: ltr\">\n",
178
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
179
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"50\">In</tspan>\n",
180
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"50\">ADP</tspan>\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  "</text>\n",
182
  "\n",
183
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
184
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"225\">1849</tspan>\n",
185
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"225\">NUM</tspan>\n",
186
  "</text>\n",
187
  "\n",
188
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
189
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"400\">he</tspan>\n",
190
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"400\">PRON</tspan>\n",
191
  "</text>\n",
192
  "\n",
193
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
194
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"575\">began</tspan>\n",
195
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"575\">VERB</tspan>\n",
196
  "</text>\n",
197
  "\n",
198
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
199
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"750\">public</tspan>\n",
200
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"750\">ADJ</tspan>\n",
201
  "</text>\n",
202
  "\n",
203
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
204
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"925\">readings</tspan>\n",
205
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"925\">NOUN</tspan>\n",
206
  "</text>\n",
207
  "\n",
208
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
209
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"1100\">of</tspan>\n",
210
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"1100\">ADP</tspan>\n",
211
  "</text>\n",
212
  "\n",
213
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
214
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"1275\">the</tspan>\n",
215
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"1275\">DET</tspan>\n",
216
  "</text>\n",
217
  "\n",
218
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
219
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"1450\">story,</tspan>\n",
220
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"1450\">NOUN</tspan>\n",
221
  "</text>\n",
222
  "\n",
223
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
224
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"1625\">which</tspan>\n",
225
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"1625\">PRON</tspan>\n",
226
  "</text>\n",
227
  "\n",
228
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
229
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"1800\">proved</tspan>\n",
230
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"1800\">VERB</tspan>\n",
231
  "</text>\n",
232
  "\n",
233
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
234
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"1975\">so</tspan>\n",
235
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"1975\">ADV</tspan>\n",
236
  "</text>\n",
237
  "\n",
238
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
239
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"2150\">successful</tspan>\n",
240
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"2150\">ADJ</tspan>\n",
241
  "</text>\n",
242
  "\n",
243
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
244
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"2325\">he</tspan>\n",
245
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"2325\">PRON</tspan>\n",
246
  "</text>\n",
247
  "\n",
248
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
249
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"2500\">undertook</tspan>\n",
250
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"2500\">VERB</tspan>\n",
251
  "</text>\n",
252
  "\n",
253
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
254
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"2675\">127</tspan>\n",
255
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"2675\">NUM</tspan>\n",
256
  "</text>\n",
257
  "\n",
258
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
259
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"2850\">further</tspan>\n",
260
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"2850\">ADJ</tspan>\n",
261
  "</text>\n",
262
  "\n",
263
+ "<text class=\"displacy-token\" fill=\"currentColor\" text-anchor=\"middle\" y=\"309.5\">\n",
264
+ " <tspan class=\"displacy-word\" fill=\"currentColor\" x=\"3025\">performances.</tspan>\n",
265
+ " <tspan class=\"displacy-tag\" dy=\"2em\" fill=\"currentColor\" x=\"3025\">NOUN</tspan>\n",
266
  "</text>\n",
267
  "\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  "<g class=\"displacy-arrow\">\n",
269
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-0\" stroke-width=\"2px\" d=\"M70,264.5 C70,89.5 570.0,89.5 570.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
270
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
271
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-0\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
272
  " </text>\n",
273
+ " <path class=\"displacy-arrowhead\" d=\"M70,266.5 L62,254.5 78,254.5\" fill=\"currentColor\"/>\n",
274
  "</g>\n",
275
  "\n",
276
  "<g class=\"displacy-arrow\">\n",
277
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-1\" stroke-width=\"2px\" d=\"M70,264.5 C70,177.0 215.0,177.0 215.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
278
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
279
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-1\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">comp</textPath>\n",
280
  " </text>\n",
281
+ " <path class=\"displacy-arrowhead\" d=\"M215.0,266.5 L223.0,254.5 207.0,254.5\" fill=\"currentColor\"/>\n",
282
  "</g>\n",
283
  "\n",
284
  "<g class=\"displacy-arrow\">\n",
285
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-2\" stroke-width=\"2px\" d=\"M420,264.5 C420,177.0 565.0,177.0 565.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
286
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
287
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-2\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">subj</textPath>\n",
288
  " </text>\n",
289
+ " <path class=\"displacy-arrowhead\" d=\"M420,266.5 L412,254.5 428,254.5\" fill=\"currentColor\"/>\n",
290
  "</g>\n",
291
  "\n",
292
  "<g class=\"displacy-arrow\">\n",
293
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-3\" stroke-width=\"2px\" d=\"M770,264.5 C770,177.0 915.0,177.0 915.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
294
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
295
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-3\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">udep</textPath>\n",
296
  " </text>\n",
297
+ " <path class=\"displacy-arrowhead\" d=\"M770,266.5 L762,254.5 778,254.5\" fill=\"currentColor\"/>\n",
298
  "</g>\n",
299
  "\n",
300
  "<g class=\"displacy-arrow\">\n",
301
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-4\" stroke-width=\"2px\" d=\"M595,264.5 C595,89.5 920.0,89.5 920.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
302
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
303
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-4\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">comp</textPath>\n",
304
  " </text>\n",
305
+ " <path class=\"displacy-arrowhead\" d=\"M920.0,266.5 L928.0,254.5 912.0,254.5\" fill=\"currentColor\"/>\n",
306
  "</g>\n",
307
  "\n",
308
  "<g class=\"displacy-arrow\">\n",
309
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-5\" stroke-width=\"2px\" d=\"M945,264.5 C945,177.0 1090.0,177.0 1090.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
310
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
311
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-5\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">udep</textPath>\n",
312
  " </text>\n",
313
+ " <path class=\"displacy-arrowhead\" d=\"M1090.0,266.5 L1098.0,254.5 1082.0,254.5\" fill=\"currentColor\"/>\n",
314
  "</g>\n",
315
  "\n",
316
  "<g class=\"displacy-arrow\">\n",
317
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-6\" stroke-width=\"2px\" d=\"M1295,264.5 C1295,177.0 1440.0,177.0 1440.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
318
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
319
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-6\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">det</textPath>\n",
320
  " </text>\n",
321
+ " <path class=\"displacy-arrowhead\" d=\"M1295,266.5 L1287,254.5 1303,254.5\" fill=\"currentColor\"/>\n",
322
  "</g>\n",
323
  "\n",
324
  "<g class=\"displacy-arrow\">\n",
325
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-7\" stroke-width=\"2px\" d=\"M1120,264.5 C1120,89.5 1445.0,89.5 1445.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
326
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
327
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-7\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">comp</textPath>\n",
328
  " </text>\n",
329
+ " <path class=\"displacy-arrowhead\" d=\"M1445.0,266.5 L1453.0,254.5 1437.0,254.5\" fill=\"currentColor\"/>\n",
330
  "</g>\n",
331
  "\n",
332
  "<g class=\"displacy-arrow\">\n",
333
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-8\" stroke-width=\"2px\" d=\"M1645,264.5 C1645,177.0 1790.0,177.0 1790.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
334
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
335
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-8\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">subj</textPath>\n",
336
  " </text>\n",
337
+ " <path class=\"displacy-arrowhead\" d=\"M1645,266.5 L1637,254.5 1653,254.5\" fill=\"currentColor\"/>\n",
338
  "</g>\n",
339
  "\n",
340
  "<g class=\"displacy-arrow\">\n",
341
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-9\" stroke-width=\"2px\" d=\"M1470,264.5 C1470,89.5 1795.0,89.5 1795.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
342
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
343
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-9\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
344
  " </text>\n",
345
+ " <path class=\"displacy-arrowhead\" d=\"M1795.0,266.5 L1803.0,254.5 1787.0,254.5\" fill=\"currentColor\"/>\n",
346
  "</g>\n",
347
  "\n",
348
  "<g class=\"displacy-arrow\">\n",
349
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-10\" stroke-width=\"2px\" d=\"M1995,264.5 C1995,177.0 2140.0,177.0 2140.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
350
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
351
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-10\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">mod</textPath>\n",
352
  " </text>\n",
353
+ " <path class=\"displacy-arrowhead\" d=\"M1995,266.5 L1987,254.5 2003,254.5\" fill=\"currentColor\"/>\n",
354
  "</g>\n",
355
  "\n",
356
  "<g class=\"displacy-arrow\">\n",
357
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-11\" stroke-width=\"2px\" d=\"M1820,264.5 C1820,89.5 2145.0,89.5 2145.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
358
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
359
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-11\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">comp</textPath>\n",
360
  " </text>\n",
361
+ " <path class=\"displacy-arrowhead\" d=\"M2145.0,266.5 L2153.0,254.5 2137.0,254.5\" fill=\"currentColor\"/>\n",
362
  "</g>\n",
363
  "\n",
364
  "<g class=\"displacy-arrow\">\n",
365
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-12\" stroke-width=\"2px\" d=\"M2345,264.5 C2345,177.0 2490.0,177.0 2490.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
366
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
367
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-12\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">subj</textPath>\n",
368
  " </text>\n",
369
+ " <path class=\"displacy-arrowhead\" d=\"M2345,266.5 L2337,254.5 2353,254.5\" fill=\"currentColor\"/>\n",
370
  "</g>\n",
371
  "\n",
372
  "<g class=\"displacy-arrow\">\n",
373
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-13\" stroke-width=\"2px\" d=\"M595,264.5 C595,2.0 2500.0,2.0 2500.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
374
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
375
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-13\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">comp</textPath>\n",
376
  " </text>\n",
377
+ " <path class=\"displacy-arrowhead\" d=\"M2500.0,266.5 L2508.0,254.5 2492.0,254.5\" fill=\"currentColor\"/>\n",
378
  "</g>\n",
379
  "\n",
380
  "<g class=\"displacy-arrow\">\n",
381
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-14\" stroke-width=\"2px\" d=\"M2695,264.5 C2695,89.5 3020.0,89.5 3020.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
382
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
383
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-14\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">udep</textPath>\n",
384
  " </text>\n",
385
+ " <path class=\"displacy-arrowhead\" d=\"M2695,266.5 L2687,254.5 2703,254.5\" fill=\"currentColor\"/>\n",
386
  "</g>\n",
387
  "\n",
388
  "<g class=\"displacy-arrow\">\n",
389
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-15\" stroke-width=\"2px\" d=\"M2870,264.5 C2870,177.0 3015.0,177.0 3015.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
390
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
391
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-15\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">udep</textPath>\n",
392
  " </text>\n",
393
+ " <path class=\"displacy-arrowhead\" d=\"M2870,266.5 L2862,254.5 2878,254.5\" fill=\"currentColor\"/>\n",
394
  "</g>\n",
395
  "\n",
396
  "<g class=\"displacy-arrow\">\n",
397
+ " <path class=\"displacy-arc\" id=\"arrow-5232fcca8f23464a9783eb067e24fe32-0-16\" stroke-width=\"2px\" d=\"M2520,264.5 C2520,2.0 3025.0,2.0 3025.0,264.5\" fill=\"none\" stroke=\"currentColor\"/>\n",
398
  " <text dy=\"1.25em\" style=\"font-size: 0.8em; letter-spacing: 1px\">\n",
399
+ " <textPath xlink:href=\"#arrow-5232fcca8f23464a9783eb067e24fe32-0-16\" class=\"displacy-label\" startOffset=\"50%\" side=\"left\" fill=\"currentColor\" text-anchor=\"middle\">comp</textPath>\n",
400
  " </text>\n",
401
+ " <path class=\"displacy-arrowhead\" d=\"M3025.0,266.5 L3033.0,254.5 3017.0,254.5\" fill=\"currentColor\"/>\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
402
  "</g>\n",
403
  "</svg></span>"
404
  ],
 
411
  }
412
  ],
413
  "source": [
414
+ "doc = ssudify(nlp(\"In 1849 he began public readings of the story, which proved so successful he undertook 127 further performances.\"))\n",
415
  "# Since this is an interactive Jupyter environment, we can use displacy.render here\n",
416
  "displacy.render(doc, style='dep')"
417
  ]
418
  },
419
  {
420
  "cell_type": "code",
421
+ "execution_count": 7,
422
  "id": "daa1e8f5-2afe-4153-9469-a4c2af9b46b1",
423
  "metadata": {},
424
  "outputs": [
425
  {
426
  "data": {
427
  "text/plain": [
428
+ "[(According to the studies, “People, 0),\n",
429
+ " (who danced more than once a week, 7),\n",
430
+ " (had, 0),\n",
431
+ " (a 76% lower risk of getting dementia, 8),\n",
432
+ " (compared to people who danced, 0),\n",
433
+ " (less frequently or, 3),\n",
434
+ " (didn’t dance at all,” Dr Pasricha noted., 0)]"
435
  ]
436
  },
437
+ "execution_count": 7,
438
  "metadata": {},
439
  "output_type": "execute_result"
440
  }
 
457
  {
458
  "cell_type": "code",
459
  "execution_count": 9,
 
 
 
 
 
 
 
 
 
 
 
460
  "id": "8fb35fe3-68de-45b6-8053-8b390c8e8661",
461
  "metadata": {},
462
  "outputs": [],
 
466
  },
467
  {
468
  "cell_type": "code",
469
+ "execution_count": 10,
470
  "id": "9ce9c318-733d-4ee1-b5d7-39d98aa14697",
471
  "metadata": {},
472
  "outputs": [],
 
504
  },
505
  {
506
  "cell_type": "code",
507
+ "execution_count": 11,
508
  "id": "4cc68772-d26d-4cd1-be59-c23a5739c3d0",
509
  "metadata": {},
510
  "outputs": [
 
534
  },
535
  {
536
  "cell_type": "code",
537
+ "execution_count": 12,
538
  "id": "3e8c0a41-0d79-4715-ab2b-e5a2d0455569",
539
  "metadata": {},
540
  "outputs": [
 
553
  "<IPython.core.display.HTML object>"
554
  ]
555
  },
556
+ "execution_count": 12,
557
  "metadata": {},
558
  "output_type": "execute_result"
559
  }
 
589
  "name": "python",
590
  "nbconvert_exporter": "python",
591
  "pygments_lexer": "ipython3",
592
+ "version": "3.12.12"
593
  }
594
  },
595
  "nbformat": 4,
main.py CHANGED
@@ -12,6 +12,7 @@ relations = {
12
  "udep": ["acl", "amod", "nmod", "poss", "nummod", "prep"],
13
  }
14
 
 
15
  def ssudify(doc):
16
  for token in doc:
17
  to_reverse = [token]
@@ -31,6 +32,11 @@ def ssudify(doc):
31
  to_reverse[i-1].dep_ = "comp"
32
  for token in doc:
33
  if token.dep_ == "dep": token.dep_ = "unknown"
 
 
 
 
 
34
  for rel in relations.keys():
35
  if token.dep_ in relations[rel]: token.dep_ = rel
36
  for token in doc:
@@ -44,6 +50,10 @@ def ssudify(doc):
44
  for child in [c for c in token.children if c.i < subject[0].i]:
45
  if child.dep_ in ["comp", "udep"]:
46
  child.dep_ = "mod"
 
 
 
 
47
  return doc
48
 
49
 
 
12
  "udep": ["acl", "amod", "nmod", "poss", "nummod", "prep"],
13
  }
14
 
15
+
16
  def ssudify(doc):
17
  for token in doc:
18
  to_reverse = [token]
 
32
  to_reverse[i-1].dep_ = "comp"
33
  for token in doc:
34
  if token.dep_ == "dep": token.dep_ = "unknown"
35
+ if token.dep_ == "prep" and token.head.pos_ == "VERB" and token.i < token.head.i:
36
+ token.dep_ = "mod"
37
+ if token.dep_ == "ccomp" and any(sibling.dep_ in relations["comp"] + ["comp"]
38
+ for sibling in token.head.rights if sibling.i < token.i):
39
+ token.dep_ = "mod"
40
  for rel in relations.keys():
41
  if token.dep_ in relations[rel]: token.dep_ = rel
42
  for token in doc:
 
50
  for child in [c for c in token.children if c.i < subject[0].i]:
51
  if child.dep_ in ["comp", "udep"]:
52
  child.dep_ = "mod"
53
+ for token in doc:
54
+ if any(t.text == ";" for t in doc if (token.i < t.i < token.head.i or token.head.i < t.i < token.i) and token.pos_ != "PUNCT"):
55
+ token.head = token
56
+ token.dep_ = "root"
57
  return doc
58
 
59