mafoaurelie
commited on
Commit
•
2b6e329
1
Parent(s):
351dee4
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import transformers
|
3 |
+
from transformers import pipeline
|
4 |
+
|
5 |
+
sentiment= pipeline('sentiment-analysis')
|
6 |
+
def get_sentiment(input_text):
|
7 |
+
texte= sentiment(input_text)
|
8 |
+
result=texte[0]['label']
|
9 |
+
return result
|
10 |
+
|
11 |
+
iface=gr.Interface(title='Sentiment Analysis',fn=get_sentiment,
|
12 |
+
inputs='text',
|
13 |
+
outputs='text',
|
14 |
+
description='Get Sentiment Negative/Positive for giving input').launch()
|