Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -46,7 +46,9 @@ def analyze_sentence(index, vis_type, vis_format):
|
|
46 |
ex = [{
|
47 |
"words": [{"text": x, "tag": "N/A"} for x in tokenized[1:]],
|
48 |
"arcs": [{"start": j, "end": i, "label": "{:.2f}".format(plot_data[i, j]),
|
49 |
-
"dir": "
|
|
|
|
|
50 |
}]
|
51 |
graph_output = displacy.render(ex, style="dep", manual=True)
|
52 |
fig_output = None
|
|
|
46 |
ex = [{
|
47 |
"words": [{"text": x, "tag": "N/A"} for x in tokenized[1:]],
|
48 |
"arcs": [{"start": j, "end": i, "label": "{:.2f}".format(plot_data[i, j]),
|
49 |
+
"dir": "right"}
|
50 |
+
for i in range(len(tokenized)-1) for j in range(i) if plot_data[i, j] < 0.5
|
51 |
+
]
|
52 |
}]
|
53 |
graph_output = displacy.render(ex, style="dep", manual=True)
|
54 |
fig_output = None
|