back to gradio
Browse files
app.py
CHANGED
@@ -31,9 +31,9 @@ def text_to_sentiment(text):
|
|
31 |
##Company Extraction
|
32 |
def fin_ner(text):
|
33 |
print ("ner")
|
34 |
-
ner_pipeline = pipeline("ner", model="dslim/bert-base-NER", tokenizer="dslim/bert-base-NER")
|
35 |
-
|
36 |
-
replaced_spans =
|
37 |
print (replaced_spans)
|
38 |
print ("spans2")
|
39 |
#replaced_spans = [(key, None) if value=='No Disease' else (key, value) for (key, value) in spans]
|
|
|
31 |
##Company Extraction
|
32 |
def fin_ner(text):
|
33 |
print ("ner")
|
34 |
+
#ner_pipeline = pipeline("ner", model="dslim/bert-base-NER", tokenizer="dslim/bert-base-NER")
|
35 |
+
api = gr.Interface.load("dslim/bert-base-NER", src='models')
|
36 |
+
replaced_spans = api(text)
|
37 |
print (replaced_spans)
|
38 |
print ("spans2")
|
39 |
#replaced_spans = [(key, None) if value=='No Disease' else (key, value) for (key, value) in spans]
|