kpriyanshu256 commited on
Commit
918b9d0
1 Parent(s): 04b73df

Interface changes

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -151,17 +151,14 @@ def disambiguate(text, acronym):
151
  start_idx = np.argmax(start_prob[0,:])
152
  end_idx = np.argmax(end_prob[0,:])
153
 
154
- print(start_idx, end_idx)
155
- print(offsets)
156
-
157
  _, exp = evaluate_jaccard(text, expansion, acronym, offsets, start_idx, end_idx)
158
  return exp
159
 
160
  text = gr.inputs.Textbox(lines=5, label="Context",\
161
  default="Particularly , we explore four CNN architectures , AlexNet , GoogLeNet , VGG-16 , and ResNet to derive features for all images in our dataset , which are labeled as private or public .")
162
 
163
- acronym = gr.inputs.Textbox(lines=2, label="Acronym", default="CNN")
164
  expansion = gr.outputs.Textbox(label="Expansion")
165
 
166
- iface = gr.Interface(fn=disambiguate, inputs=[text, acronym], outputs=expansion)
167
  iface.launch()
 
151
  start_idx = np.argmax(start_prob[0,:])
152
  end_idx = np.argmax(end_prob[0,:])
153
 
 
 
 
154
  _, exp = evaluate_jaccard(text, expansion, acronym, offsets, start_idx, end_idx)
155
  return exp
156
 
157
  text = gr.inputs.Textbox(lines=5, label="Context",\
158
  default="Particularly , we explore four CNN architectures , AlexNet , GoogLeNet , VGG-16 , and ResNet to derive features for all images in our dataset , which are labeled as private or public .")
159
 
160
+ acronym = gr.inputs.Dropdown(choices=sorted(list(DICTIONARY.keys())), label="Acronym", default="CNN")
161
  expansion = gr.outputs.Textbox(label="Expansion")
162
 
163
+ iface = gr.Interface(fn=disambiguate, inputs=[text, acronym], outputs=expansion, title="Scientific Acronym Disambiguation")
164
  iface.launch()