dar-tau commited on
Commit
0e625ad
1 Parent(s): f82263a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -44,8 +44,8 @@ def analyze_sentence(index, vis_type, vis_format):
44
  fig_output, graph_output = fig, ""
45
  else:
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
  ]
@@ -70,7 +70,7 @@ with demo:
70
  vis_format_checkbox = gr.Radio(['Plot', 'Graph'])
71
 
72
  output = gr.Plot(label="Plot", container=True)
73
- graph_output = gr.HTML(label="Graph")
74
  metrics = gr.Label("Metrics")
75
  btn.click(analyze_sentence, [sentence_dropdown, vis_dropdown, vis_format_checkbox], [output, graph_output, metrics])
76
 
 
44
  fig_output, graph_output = fig, ""
45
  else:
46
  ex = [{
47
+ "words": [{"text": x, "tag": ""} for x in tokenized[1:]],
48
+ "arcs": [{"start": j, "end": i, "label": "",
49
  "dir": "right"}
50
  for i in range(len(tokenized)-1) for j in range(i) if plot_data[i, j] > 0.5
51
  ]
 
70
  vis_format_checkbox = gr.Radio(['Plot', 'Graph'])
71
 
72
  output = gr.Plot(label="Plot", container=True)
73
+ graph_output = gr.HTML()
74
  metrics = gr.Label("Metrics")
75
  btn.click(analyze_sentence, [sentence_dropdown, vis_dropdown, vis_format_checkbox], [output, graph_output, metrics])
76