Shredder commited on
Commit
f3c0dcb
1 Parent(s): a5a2a2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -58,7 +58,7 @@ def score_fincat(txt):
58
  context_text = extract_context_words(x)
59
  features = bert_embedding_extract(context_text, word)
60
  if(features[0]=='None'):
61
- highlight.append(('None', ' '))
62
  return highlight
63
  prediction = lr_clf.predict(features.reshape(1, 768))
64
  prediction_probability = '{:.4f}'.format(round(lr_clf.predict_proba(features.reshape(1, 768))[:,1][0], 4))
@@ -156,7 +156,7 @@ def quad(query,file):
156
  #iface = gr.Interface(fn=get_sustainability, inputs="textbox", title="CONBERT",description="SUSTAINABILITY TOOL", outputs=gr.HighlightedText(), allow_flagging="never")
157
  #iface.launch()
158
 
159
- iface = gr.Interface(fn=quad, inputs=[gr.Dropdown(choices=questions,label='SEARCH QUERY'),gr.inputs.File(label='TXT FILE')], title="CONBERT",description="SUSTAINABILITY TOOL",article='Article', outputs=[gr.outputs.Textbox(label='Answer'),gr.outputs.Textbox(label='Summary'),gr.HighlightedText(label='NER'),gr.HighlightedText(label='CLAIM'),gr.HighlightedText(label='SUSTAINABILITY'),gr.HighlightedText(label='FLS')], allow_flagging="never")
160
 
161
 
162
  iface.launch()
 
58
  context_text = extract_context_words(x)
59
  features = bert_embedding_extract(context_text, word)
60
  if(features[0]=='None'):
61
+ highlight.append((txt, ' '))
62
  return highlight
63
  prediction = lr_clf.predict(features.reshape(1, 768))
64
  prediction_probability = '{:.4f}'.format(round(lr_clf.predict_proba(features.reshape(1, 768))[:,1][0], 4))
 
156
  #iface = gr.Interface(fn=get_sustainability, inputs="textbox", title="CONBERT",description="SUSTAINABILITY TOOL", outputs=gr.HighlightedText(), allow_flagging="never")
157
  #iface.launch()
158
 
159
+ iface = gr.Interface(fn=quad, inputs=[gr.Dropdown(choices=questions_short,label='SEARCH QUERY'),gr.inputs.File(label='TXT FILE')], title="CONBERT",description="SUSTAINABILITY TOOL",article='Article', outputs=[gr.outputs.Textbox(label='Answer'),gr.outputs.Textbox(label='Summary'),gr.HighlightedText(label='NER'),gr.HighlightedText(label='CLAIM'),gr.HighlightedText(label='SUSTAINABILITY'),gr.HighlightedText(label='FLS')], allow_flagging="never")
160
 
161
 
162
  iface.launch()