explosion / spacy-streamlit

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

Cannot use `visualize` multiple times in the same script #7

Closed andfanilo closed 4 years ago

andfanilo commented 4 years ago

When using visualize methods multiple times, we get into a DuplicateWidgetID error.

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)
spacy_streamlit.visualize(models, text2)

image

Adding/generating a key parameter to pass to those widgets should do.

Original forum thread