rajistics commited on
Commit
c319de9
·
1 Parent(s): f08f641
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -27,7 +27,7 @@ def text_to_sentiment(text):
27
  return sentiment
28
 
29
  def ner(text):
30
- api = gr.Interface.load("wolfrage89/company_segment_ner", src='models')
31
  spans = api(text)
32
  replaced_spans = [(key, None) if value=='No Disease' else (key, value) for (key, value) in spans]
33
  return replaced_spans
@@ -51,6 +51,6 @@ with demo:
51
 
52
  b4 = gr.Button("Extract Companies & Segments")
53
  label = gr.Label()
54
- b4.click(ner, inputs=text, outputs="highlightedtext")
55
 
56
  demo.launch(share=True)
 
27
  return sentiment
28
 
29
  def ner(text):
30
+ api = gr.Interface.load("dslim/bert-base-NER", src='models')
31
  spans = api(text)
32
  replaced_spans = [(key, None) if value=='No Disease' else (key, value) for (key, value) in spans]
33
  return replaced_spans
 
51
 
52
  b4 = gr.Button("Extract Companies & Segments")
53
  label = gr.Label()
54
+ b4.click(ner, inputs=text, outputs=replaced_spans)
55
 
56
  demo.launch(share=True)