ayethuzar commited on
Commit
3503540
·
unverified ·
1 Parent(s): 23a6899

Update app.py with references

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -3,17 +3,15 @@ from transformers import pipeline
3
 
4
  st.title('Sentiment Analysis using Transformers pipeline function')
5
  st.write('This app uses the Hugging Face Transformers [sentiment analyzer](https://huggingface.co/course/chapter1/3?fw=tf) library to classify the sentiment of your input as positive or negative. The web app is built using [Streamlit](https://docs.streamlit.io/en/stable/getting_started.html).')
6
- st.write(
7
- 'To find out how this app was developed, please check out my [Medium post](https://medium.com/@rtkilian/deploy-and-share-your-sentiment-analysis-app-using-streamlit-sharing-2ba3ca6a3ead). To see my source code, have a look at my [GitHub repo](https://github.com/rtkilian/streamlit-huggingface).')
8
-
9
- st.write('*Note: it will take up to 30 seconds to run the app.*')
10
 
11
  form = st.form(key='sentiment-form')
12
  user_input = form.text_area('Enter your text')
13
  submit = form.form_submit_button('Submit')
14
 
15
  if submit:
16
- classifier = pipeline("sentiment-analysis")
17
  result = classifier(user_input)[0]
18
  label = result['label']
19
  score = result['score']
 
3
 
4
  st.title('Sentiment Analysis using Transformers pipeline function')
5
  st.write('This app uses the Hugging Face Transformers [sentiment analyzer](https://huggingface.co/course/chapter1/3?fw=tf) library to classify the sentiment of your input as positive or negative. The web app is built using [Streamlit](https://docs.streamlit.io/en/stable/getting_started.html).')
6
+ st.write('References: \n https://medium.com/@rtkilian/deploy-and-share-your-sentiment-analysis-app-using-streamlit-sharing-2ba3ca6a3ead')
7
+ st.write(' \t\t\t https://huggingface.co/learn/nlp-course/chapter1/3?fw=pt')
 
 
8
 
9
  form = st.form(key='sentiment-form')
10
  user_input = form.text_area('Enter your text')
11
  submit = form.form_submit_button('Submit')
12
 
13
  if submit:
14
+ classifier = pipeline("sentiment-analysis") #using the pipeline() function
15
  result = classifier(user_input)[0]
16
  label = result['label']
17
  score = result['score']