Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -49,7 +49,7 @@ def analyze_sentence(index, vis_type, vis_format):
|
|
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.
|
53 |
graph_output = ("<div style='max-width:100%; max-height:360px; overflow:auto'>"
|
54 |
+ graph_output +
|
55 |
"</div>"
|
@@ -66,7 +66,8 @@ with demo:
|
|
66 |
sentence_dropdown = gr.Dropdown(label="Sentence",
|
67 |
choices=[x.split('</s> ')[1] for x in dataset['text']],
|
68 |
value=0, min_width=300, type='index')
|
69 |
-
vis_dropdown = gr.Dropdown(label="Visualization", choices=[x.value for x in VisType] +
|
|
|
70 |
min_width=70, value=VisType.SUM, type='value')
|
71 |
btn = gr.Button("Run", min_width=30)
|
72 |
|
|
|
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.serve(ex, style="dep", jupyter=False, compact=True, manual=True)
|
53 |
graph_output = ("<div style='max-width:100%; max-height:360px; overflow:auto'>"
|
54 |
+ graph_output +
|
55 |
"</div>"
|
|
|
66 |
sentence_dropdown = gr.Dropdown(label="Sentence",
|
67 |
choices=[x.split('</s> ')[1] for x in dataset['text']],
|
68 |
value=0, min_width=300, type='index')
|
69 |
+
vis_dropdown = gr.Dropdown(label="Visualization", choices=[x.value for x in VisType] +
|
70 |
+
[f'Layer #{i}' for i in range(num_layers)],
|
71 |
min_width=70, value=VisType.SUM, type='value')
|
72 |
btn = gr.Button("Run", min_width=30)
|
73 |
|