Last active
March 30, 2025 06:13
-
-
Save wesslen/7d35f6e1b8dd8ac2a5472c461bed56e3 to your computer and use it in GitHub Desktop.
streamlit-spacy-docker-container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import streamlit as st | |
| import spacy_streamlit | |
| import spacy | |
| # see https://github.com/explosion/spacy-streamlit | |
| st.title("Spacy Streamlit App") | |
| spacy_model = ["en_core_web_sm"] | |
| visualizers = ["parser", "ner", "tokens"] # exclude "textcat", "similarity" | |
| spacy_streamlit.visualize(spacy_model, "Rusty is the best dog in Charlotte, NC.", visualizers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM python:3.7 | |
| EXPOSE 8501 | |
| WORKDIR /app | |
| COPY requirements.txt ./requirements.txt | |
| RUN pip3 install -r requirements.txt | |
| COPY . . | |
| CMD streamlit run app.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| streamlit | |
| spacy==2.3.1 | |
| spacy_streamlit | |
| https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run on Docker machine or play-with-docker.com:
Open browser to 8501 port. Enjoy!