Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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)}')
|