saritha5 commited on
Commit
69562f6
·
1 Parent(s): 3a31f30

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -11,19 +11,19 @@ st.title('Entity Extraction')
11
 
12
  def prediction(raw_text):
13
  text1= NER(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()
21
  st.write("------------------")
22
- #st.write("NERs in the sentence:")
23
- #st.markdown(displacy.render(text1,style="ent"))
24
 
25
  models = ["en_core_web_sm"]
26
- spacy_streamlit.visualize_ner(text1,labels = word.label_)
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.
 
11
 
12
  def prediction(raw_text):
13
  text1= NER(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()
21
  st.write("------------------")
22
+ st.write("NERs in the sentence:")
23
+ spacy_streamlit.visualize(displacy.render(text1,style="ent"))
24
 
25
  models = ["en_core_web_sm"]
26
+ #spacy_streamlit.visualize_ner(text1,labels = word.label_)
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.