Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated streamlit app #24

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ setuptools==67.6.1
seaborn==0.12.2
spacy==3.6.0
st-annotated-text==4.0.0
streamlit==1.25.0
streamlit==1.27.2
textblob==0.17.1
wordcloud==1.9.2
2 changes: 1 addition & 1 deletion src/general.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
raw_data_path: "data/raw/20230731_consultation_ingest.csv" #str
raw_data_path: "data/raw/20231011_consultation_ingest.csv" #str
additional_stopwords: #list of words to filter; must be type str
- 'he'
lemmatize: True #bool; select False to use Stemmer
23 changes: 23 additions & 0 deletions src/modules/word_counts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import plotly.graph_objects as go
from matplotlib.figure import Figure
from pandas import Series

Check warning on line 3 in src/modules/word_counts.py

View check run for this annotation

Codecov / codecov/patch

src/modules/word_counts.py#L1-L3

Added lines #L1 - L3 were not covered by tests


def plot_word_counts(data: Series) -> Figure:

Check warning on line 6 in src/modules/word_counts.py

View check run for this annotation

Codecov / codecov/patch

src/modules/word_counts.py#L6

Added line #L6 was not covered by tests
"""Create a word count boxplot

Parameters
----------
data : Series
a series of word counts corrosponding to the original data

Returns
-------
Figure
a boxplot of word counts for the responses
"""
fig = go.Figure()
fig.add_trace(go.Box(x=data, name=""))
fig.update_layout(title=go.layout.Title(text="Response word counts"), height=300)

Check warning on line 21 in src/modules/word_counts.py

View check run for this annotation

Codecov / codecov/patch

src/modules/word_counts.py#L19-L21

Added lines #L19 - L21 were not covered by tests

return fig

Check warning on line 23 in src/modules/word_counts.py

View check run for this annotation

Codecov / codecov/patch

src/modules/word_counts.py#L23

Added line #L23 was not covered by tests
Loading