Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -46,7 +46,7 @@ def analyze_sentence(index, vis_type, vis_format):
|
|
46 |
ex = [{
|
47 |
"words": [{"text": x, "tag": ""} for x in tokenized[1:]],
|
48 |
"arcs": [{"start": j, "end": i, "label": "", "dir": "right"}
|
49 |
-
for i in range(len(tokenized) - 1) for j in range(i) if plot_data[i, j] > 0.5
|
50 |
]
|
51 |
}]
|
52 |
graph_output = displacy.render(ex, style="dep", jupyter=False, manual=True, options={"compact": True})
|
|
|
46 |
ex = [{
|
47 |
"words": [{"text": x, "tag": ""} for x in tokenized[1:]],
|
48 |
"arcs": [{"start": j, "end": i, "label": "", "dir": "right"}
|
49 |
+
for i in range(len(tokenized) - 1) for j in range(i) if plot_data[i, j] > 0.5 and abs(i-j) > 1
|
50 |
]
|
51 |
}]
|
52 |
graph_output = displacy.render(ex, style="dep", jupyter=False, manual=True, options={"compact": True})
|