Skip to content

Commit

Permalink
Merge pull request #22 from explosion/feature/streamlit-unbeta
Browse files Browse the repository at this point in the history
Update for streamlit v0.86.0
  • Loading branch information
adrianeboyd authored Aug 25, 2021
2 parents d2990b6 + 8e136d9 commit 8526397
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ vectors, token attributes, and more.
You can install `spacy-streamlit` from pip:

```bash
pip install spacy-streamlit --pre
pip install spacy-streamlit
```

The package includes **building blocks** that call into Streamlit and set up all
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
streamlit>=0.68.0
streamlit>=0.86.0
spacy>=3.0.0,<4.0.0
pandas
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
version = 1.0.1
version = 1.0.2
description = Visualize spaCy with streamlit
url = https://github.com/explosion/spacy-streamlit
author = Explosion
Expand All @@ -12,7 +12,7 @@ long_description_content_type = text/markdown
zip_safe = true
python_requires = >=3.6
install_requires =
streamlit>=0.68.0
streamlit>=0.86.0
spacy>=3.0.0,<4.0.0
pandas

Expand Down
16 changes: 8 additions & 8 deletions spacy_streamlit/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ def visualize(
if show_json_doc or show_meta or show_config:
st.header("Pipeline information")
if show_json_doc:
json_doc_exp = st.beta_expander("JSON Doc")
json_doc_exp = st.expander("JSON Doc")
json_doc_exp.json(doc.to_json())

if show_meta:
meta_exp = st.beta_expander("Pipeline meta.json")
meta_exp = st.expander("Pipeline meta.json")
meta_exp.json(nlp.meta)

if show_config:
config_exp = st.beta_expander("Pipeline config.cfg")
config_exp = st.expander("Pipeline config.cfg")
config_exp.code(nlp.config.to_str())

st.sidebar.markdown(
Expand All @@ -133,7 +133,7 @@ def visualize_parser(
"""Visualizer for dependency parses."""
if title:
st.header(title)
cols = st.beta_columns(4)
cols = st.columns(4)
split_sents = cols[0].checkbox(
"Split sentences", value=True, key=f"{key}_parser_split_sents"
)
Expand Down Expand Up @@ -169,7 +169,7 @@ def visualize_ner(
"""Visualizer for named entities."""
if title:
st.header(title)
exp = st.beta_expander("Select entity labels")
exp = st.expander("Select entity labels")
label_select = exp.multiselect(
"Entity labels",
options=labels,
Expand Down Expand Up @@ -217,7 +217,7 @@ def visualize_similarity(
if not meta.get("width", 0):
st.warning("No vectors available in the model.")
else:
cols = st.beta_columns(2)
cols = st.columns(2)
text1 = cols[0].text_input(
"Text or word 1", default_texts[0], key=f"{key}_similarity_text1"
)
Expand All @@ -233,7 +233,7 @@ def visualize_similarity(
else:
st.error(similarity_text)

exp = st.beta_expander("Vector information")
exp = st.expander("Vector information")
exp.code(meta)


Expand All @@ -247,7 +247,7 @@ def visualize_tokens(
"""Visualizer for token attributes."""
if title:
st.header(title)
exp = st.beta_expander("Select token attributes")
exp = st.expander("Select token attributes")
selected = exp.multiselect(
"Token attributes",
options=attrs,
Expand Down

0 comments on commit 8526397

Please sign in to comment.