explosion / spacy-streamlit

👑 spaCy building blocks and visualizers for Streamlit apps
https://share.streamlit.io/ines/spacy-streamlit-demo/master/app.py
MIT License
806 stars 115 forks source link

Add key argument to widgets to prevent DuplicateWidgetID (#7) #8

Closed andfanilo closed 4 years ago

andfanilo commented 4 years ago

Add a key parameter to visualize methods so they can be called multiple times from the same script as long as the user provides a key parameter.

import spacy_streamlit

models = ["en_core_web_sm", "en_core_web_md"]
text1 = "Sundar Pichai is the CEO of Google."
text2 = "Randy Zwitch is Head of Developer Relations at Streamlit"
spacy_streamlit.visualize(models, text1, key="1")
spacy_streamlit.visualize(models, text2, key="2")

Fixes #7

ines commented 4 years ago

Thanks a lot, this is very useful 👍