diff --git a/Dockerfile b/Dockerfile index 2bea9fad660aec3a744beb0ce3377765ed5e31d8..6349f47c227493952580cee4888e07e93c5376f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,3 +18,8 @@ ENV CONFIG_PATH=/home/jovyan/config.txt COPY app /dash/app/ RUN chown -R jovyan /dash/app/ + +# install some NLTK and spaCy data +RUN python -m nltk.downloader stopwords +RUN python -m nltk.downloader wordnet +RUN python -m spacy download en_core_web_sm diff --git a/my_callbacks.py b/my_callbacks.py new file mode 100644 index 0000000000000000000000000000000000000000..6640c9dab08cbf2a5826a0511b78b6e03a6e215c --- /dev/null +++ b/my_callbacks.py @@ -0,0 +1,21 @@ +from dash.dependencies import ( + Input, + Output +) +from dash import html + + +def register_callbacks(app): + @app.callback( + Output('output-container-button', 'children'), + [Input('submit-btn', 'n_clicks')], + [Input('input-text', 'value')] + ) + def update_output(n_clicks, input_value): + if n_clicks > 0: + return html.Div([ + html.Label("You entered:"), + html.P(input_value) + ]) + else: + return '' diff --git a/my_layout.py b/my_layout.py new file mode 100644 index 0000000000000000000000000000000000000000..e0cf7c4a9a74950db48449451e5e594fa8df9140 --- /dev/null +++ b/my_layout.py @@ -0,0 +1,13 @@ +from dash import html +from dash import dcc + + +layout = html.Div([ + html.H1("Yeay, my app!"), + html.Div([ + html.Label("Enter your text:"), + dcc.Input(id='input-text', type='text', value=''), + html.Button('Submit', id='submit-btn', n_clicks=0), + ]), + html.Div(id='output-container-button') +]) diff --git a/requirements.txt b/requirements.txt index 53389159789ff0c98b77b710e70ef4f99eba4dcc..20b821cca3adfc3d9e28610094f92494c3330ea0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,5 +11,8 @@ plotly openai rapidfuzz nltk +spacy +scikit-learn python-dotenv +