Jacobo commited on
Commit
500e543
1 Parent(s): c44e3c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -24,7 +24,7 @@ st.header("Select a model:")
24
  spacy_model = st.selectbox("Model", ["grc_proiel_lg","grc_proiel_trf","grc_proiel_sm","grc_perseus_lg","grc_perseus_trf","grc_perseus_sm"])
25
 
26
  st.header("Enter text:")
27
- text = st.text_area("Greek text","φύσει μὲν οὖν αἴσθησιν ἔχοντα γίγνεται τὰ ζῷα, ἐκ δὲ ταύτης τοῖς μὲν αὐτῶν οὐκ ἐγγίγνεται μνήμη, τοῖς δʼ ἐγγίγνεται.")
28
 
29
 
30
  #config = {"punct_chars": [".", ";", "·"]}
@@ -33,7 +33,7 @@ nlp = spacy.load(spacy_model)
33
  #nlp.add_pipe("sentencizer", config=config, before="parser")
34
 
35
 
36
- # Get the new pipeline order
37
 
38
  doc = nlp(text)
39
 
@@ -79,6 +79,9 @@ def visualize_parser(
79
  st.write(get_svg(html), unsafe_allow_html=True)
80
 
81
 
 
 
 
82
  visualize_parser(doc)
83
 
84
 
24
  spacy_model = st.selectbox("Model", ["grc_proiel_lg","grc_proiel_trf","grc_proiel_sm","grc_perseus_lg","grc_perseus_trf","grc_perseus_sm"])
25
 
26
  st.header("Enter text:")
27
+ text = st.text_area("Greek text","ἐπὶ τοῦτον δὴ τὸν Ἄμασιν Καμβύσης Κύρου ἐστρατεύετο, ἄγων καί ἄλλους τῶν ἦρχε καὶ Ἑλλήνων Ἴωνάς τε καὶ Αἰολέας.")
28
 
29
 
30
  #config = {"punct_chars": [".", ";", "·"]}
33
  #nlp.add_pipe("sentencizer", config=config, before="parser")
34
 
35
 
36
+ # Get the pipeline order
37
 
38
  doc = nlp(text)
39
 
79
  st.write(get_svg(html), unsafe_allow_html=True)
80
 
81
 
82
+ displacy.render(doc, style="ent")
83
+
84
+
85
  visualize_parser(doc)
86
 
87