Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ from spacy_streamlit import visualize_ner
|
|
| 6 |
import en_core_web_sm
|
| 7 |
|
| 8 |
NER = spacy.load("en_core_web_sm")
|
|
|
|
| 9 |
st.title('Entity Extraction')
|
| 10 |
|
| 11 |
def prediction(raw_text):
|
|
@@ -13,6 +14,7 @@ def prediction(raw_text):
|
|
| 13 |
st.write("List wise NERs:")
|
| 14 |
st.write("------------------")
|
| 15 |
st.write(f"{'Text' : <10}{'NER' : >10}")
|
|
|
|
| 16 |
for word in text1.ents:
|
| 17 |
st.write(word.text,"\t\t",word.label_)
|
| 18 |
print()
|
|
@@ -21,7 +23,7 @@ def prediction(raw_text):
|
|
| 21 |
st.markdown(displacy.render(text1,style="ent"))
|
| 22 |
|
| 23 |
models = ["en_core_web_sm"]
|
| 24 |
-
spacy_streamlit.
|
| 25 |
#visualize_ner(text1, labels=nlp.get_pipe("ner").labels)
|
| 26 |
|
| 27 |
raw_text = """Ai-Khanoum (/aɪ ˈhɑːnjuːm/, meaning Lady Moon; Uzbek: Oyxonim) is the archaeological site of a Hellenistic city in Takhar Province, Afghanistan.
|
|
|
|
| 6 |
import en_core_web_sm
|
| 7 |
|
| 8 |
NER = spacy.load("en_core_web_sm")
|
| 9 |
+
spacy_model = "en_core_web_sm"
|
| 10 |
st.title('Entity Extraction')
|
| 11 |
|
| 12 |
def prediction(raw_text):
|
|
|
|
| 14 |
st.write("List wise NERs:")
|
| 15 |
st.write("------------------")
|
| 16 |
st.write(f"{'Text' : <10}{'NER' : >10}")
|
| 17 |
+
|
| 18 |
for word in text1.ents:
|
| 19 |
st.write(word.text,"\t\t",word.label_)
|
| 20 |
print()
|
|
|
|
| 23 |
st.markdown(displacy.render(text1,style="ent"))
|
| 24 |
|
| 25 |
models = ["en_core_web_sm"]
|
| 26 |
+
spacy_streamlit.visualize_ner(text1)
|
| 27 |
#visualize_ner(text1, labels=nlp.get_pipe("ner").labels)
|
| 28 |
|
| 29 |
raw_text = """Ai-Khanoum (/aɪ ˈhɑːnjuːm/, meaning Lady Moon; Uzbek: Oyxonim) is the archaeological site of a Hellenistic city in Takhar Province, Afghanistan.
|