Spaces:
Build error
Build error
Commit
·
68aa027
1
Parent(s):
ab9129c
Update app.py
Browse files
app.py
CHANGED
@@ -247,7 +247,7 @@ def getSentence(listOfSentences,value):
|
|
247 |
return value
|
248 |
def get_annotated_text(text,value,entity):
|
249 |
doc = nlp(text)
|
250 |
-
doc.ents = [doc.char_span(
|
251 |
ent_html = displacy.render(doc, style='ent', jupyter=False)# Display the entity visualization in the browser:
|
252 |
st.markdown(ent_html, unsafe_allow_html=True)
|
253 |
return [text.split(value)[0],(value,entity),text.split(value)[1]]
|
|
|
247 |
return value
|
248 |
def get_annotated_text(text,value,entity):
|
249 |
doc = nlp(text)
|
250 |
+
doc.ents = [doc.char_span(text.index(value), text.index(value)+len(value), label=entity)]
|
251 |
ent_html = displacy.render(doc, style='ent', jupyter=False)# Display the entity visualization in the browser:
|
252 |
st.markdown(ent_html, unsafe_allow_html=True)
|
253 |
return [text.split(value)[0],(value,entity),text.split(value)[1]]
|