ahmadouna commited on
Commit
8bef5a0
·
verified ·
1 Parent(s): 2b7b38e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -22,7 +22,7 @@ selected_comment = st.selectbox("Veuillez sélectionner un commentaire", comment
22
  text = st.text_input('Entrer le texte à analyser', value=selected_comment)
23
 
24
  # Labels candidats pour la classification
25
- candidate_labels = [0, 1]
26
 
27
  # Modèle de phrase pour la formation de l'hypothèse
28
  hypothesis_template = "Cet exemple est un {}."
@@ -38,6 +38,8 @@ else:
38
  if text and candidate_labels:
39
  inputs = df["text"].tolist()
40
  true_labels = df["label"].tolist()
 
 
41
  predictions = classifier(inputs, candidate_labels, hypothesis_template=hypothesis_template)
42
  predicted_labels = [result['labels'][0] for result in predictions]
43
 
 
22
  text = st.text_input('Entrer le texte à analyser', value=selected_comment)
23
 
24
  # Labels candidats pour la classification
25
+ candidate_labels = ["commentaire positif", "commentaire negatif"]
26
 
27
  # Modèle de phrase pour la formation de l'hypothèse
28
  hypothesis_template = "Cet exemple est un {}."
 
38
  if text and candidate_labels:
39
  inputs = df["text"].tolist()
40
  true_labels = df["label"].tolist()
41
+ true_labels=true_labels.replace(1,"commentaire positif")
42
+ true_labels=true_labels.replace(0,"commentaire negatif")
43
  predictions = classifier(inputs, candidate_labels, hypothesis_template=hypothesis_template)
44
  predicted_labels = [result['labels'][0] for result in predictions]
45