ahmadouna commited on
Commit
3052fbf
1 Parent(s): 7d51066

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -15,7 +15,15 @@ classifier_model = "MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli"
15
  classifier = pipeline("zero-shot-classification", model=classifier_model)
16
  # Afficher l'entête
17
  st.header("Sentiment Analysis")
 
 
 
18
 
 
 
 
 
 
19
  # Afficher le commentaire sélectionné dans l'input text
20
  text = st.text_area('Entrer le texte à analyser', value=selected_comment)
21
 
@@ -27,7 +35,7 @@ hypothesis_template = "This example is a {}."
27
 
28
  # Ajouter un bouton pour déclencher l'analyse
29
  if st.button("Analyser le texte"):
30
- if text :
31
  result = classifier(text, candidate_labels, hypothesis_template=hypothesis_template)
32
 
33
  if result['labels'][0] == 1:
 
15
  classifier = pipeline("zero-shot-classification", model=classifier_model)
16
  # Afficher l'entête
17
  st.header("Sentiment Analysis")
18
+ df = pd.read_csv("fic.csv", sep=";")
19
+ # Récupérer les commentaires en liste
20
+ comments = df["text"].tolist()
21
 
22
+ # Afficher l'entête
23
+ st.header("Analyse de Texte")
24
+
25
+ # Créer une selectbox pour choisir un commentaire
26
+ selected_comment = st.selectbox("Veuillez sélectionner un commentaire", comments)
27
  # Afficher le commentaire sélectionné dans l'input text
28
  text = st.text_area('Entrer le texte à analyser', value=selected_comment)
29
 
 
35
 
36
  # Ajouter un bouton pour déclencher l'analyse
37
  if st.button("Analyser le texte"):
38
+ if text and candidate_labels:
39
  result = classifier(text, candidate_labels, hypothesis_template=hypothesis_template)
40
 
41
  if result['labels'][0] == 1: