Hey everyone,
Iām new to Spacy Streamlit, Iām trying to visualize tagged text from patterns added to my custom entity_ruler. This is the example from the Github:
models = [āen_core_web_smā, āen_core_web_mdā]
default_text = āSundar Pichai is the CEO of Google.ā
spacy_streamlit.visualize(models, default_text)
I have an Excel document Iām pulling in for creating custom labels that get added to the ruler. Iāve tried replacing the model names in the code above with ānlpā and defining the nlp as spacy.load(āen_core_web_mdā). No dice. Has anyone figured this out?
When I did that, it threw an error saying cannot find ānlpā model.
This is what Iām using to pull in the dataframes as labels:
nlp = spacy.load(āen_core_web_lgā)
ruler = nlp.add_pipe(āentity_rulerā, before=ānerā, config={āphrase_matcher_attrā: āLOWERā})
patterns =
for word in df_:
patterns.append({ālabelā: āRelationshipā, āpatternā: word})
for word1 in df1_:
patterns.append({ālabelā: āEventā, āpatternā: word1})
for word2 in df2_:
patterns.append({ālabelā: āName Typeā, āpatternā: word2})
for word3 in df3_:
patterns.append({ālabelā: āA Typeā, āpatternā: word3})
for word4 in df4_:
patterns.append({ālabelā: āB Typeā, āpatternā: word4})
ruler.add_patterns(patterns)
ruler.add_patterns(repatterns)