Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,18 +3,11 @@ from transformers import pipeline
|
|
| 3 |
from textblob import TextBlob
|
| 4 |
|
| 5 |
pipe = pipeline('sentiment-analysis')
|
| 6 |
-
st.title("
|
| 7 |
-
st.subheader("What framework would you like to use for Sentiment Analysis")
|
| 8 |
-
#Picking what NLP task you want to do
|
| 9 |
-
option = st.selectbox('Framework',('Transformers', 'TextBlob')) #option is stored in this variable
|
| 10 |
#Textbox for text user is entering
|
| 11 |
-
st.
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
-
if option == 'Transformers':
|
| 15 |
-
out = pipe(text)
|
| 16 |
-
else:
|
| 17 |
-
out = TextBlob(text)
|
| 18 |
-
out = out.sentiment
|
| 19 |
st.write("Sentiment of Text: ")
|
| 20 |
st.write(out)
|
|
|
|
| 3 |
from textblob import TextBlob
|
| 4 |
|
| 5 |
pipe = pipeline('sentiment-analysis')
|
| 6 |
+
st.title("Analyse de sentiment")
|
|
|
|
|
|
|
|
|
|
| 7 |
#Textbox for text user is entering
|
| 8 |
+
text = st.text_input('Entrer votre texte') #text is stored in this variable
|
| 9 |
+
|
| 10 |
+
out = pipe(text)
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
st.write("Sentiment of Text: ")
|
| 13 |
st.write(out)
|