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