sunil23391 commited on
Commit
d20a46a
·
verified ·
1 Parent(s): 58e4258

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -3,7 +3,7 @@ os.system('pip install transformers')
3
  import streamlit as st
4
  import transformers
5
 
6
-
7
  txt = st.text_area(
8
  "Text to analyze",
9
  "It was the best of times, it was the worst of times, it was the age of "
@@ -13,4 +13,4 @@ txt = st.text_area(
13
  "despair, (...)",
14
  )
15
 
16
- st.write(f'You wrote {len(txt)} characters.')
 
3
  import streamlit as st
4
  import transformers
5
 
6
+ classifier = transformers.pipeline("sentiment-analysis")
7
  txt = st.text_area(
8
  "Text to analyze",
9
  "It was the best of times, it was the worst of times, it was the age of "
 
13
  "despair, (...)",
14
  )
15
 
16
+ st.write(f'You wrote {len(txt)} characters.\n {classifier(txt)}')