SerenaTOUM commited on
Commit
8e56e6b
·
verified ·
1 Parent(s): b15ab2d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline #Route pour avoir accès au modèle
3
+ classifier = pipeline("sentiment-analysis")
4
+ def sentimental (text):
5
+ resultat = classifier(text)
6
+ return resultat [0]['label']
7
+
8
+ demo = gr.Interface(sentimental, title= "ANALYSES DE SENTIMENTS", inputs = "text", outputs = "text", description = "Découvrez le sentiment pour tout texte")
9
+ demo.launch(quiet = True)