Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import spacy
|
| 3 |
from spacy import displacy
|
|
|
|
| 4 |
import en_core_web_sm
|
| 5 |
|
| 6 |
NER = spacy.load("en_core_web_sm")
|
|
@@ -17,6 +18,7 @@ def prediction(raw_text):
|
|
| 17 |
st.write("------------------")
|
| 18 |
st.write("NERs in the sentence:")
|
| 19 |
st.markdown(displacy.render(text1,style="ent"))
|
|
|
|
| 20 |
|
| 21 |
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.
|
| 22 |
The city, whose original name is unknown,[a] was probably founded by an early ruler of the Seleucid Empire and served as a military and economic centre for the rulers of the Greco-Bactrian Kingdom until its destruction c. 145 BC.
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import spacy
|
| 3 |
from spacy import displacy
|
| 4 |
+
from spacy_streamlit import visualize_ner
|
| 5 |
import en_core_web_sm
|
| 6 |
|
| 7 |
NER = spacy.load("en_core_web_sm")
|
|
|
|
| 18 |
st.write("------------------")
|
| 19 |
st.write("NERs in the sentence:")
|
| 20 |
st.markdown(displacy.render(text1,style="ent"))
|
| 21 |
+
visualize_ner(tex1, labels=nlp.get_pipe("ner").labels)
|
| 22 |
|
| 23 |
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.
|
| 24 |
The city, whose original name is unknown,[a] was probably founded by an early ruler of the Seleucid Empire and served as a military and economic centre for the rulers of the Greco-Bactrian Kingdom until its destruction c. 145 BC.
|