huggingface / huggingface/course

sentiment analysis does not predict as expected

Open
#634 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
MDX
Stars
4.2k
Forks
1.4k
Avg merge
13m
Merged PRs (30d)
1

Description

on this page https://huggingface.co/learn/nlp-course/fr/chapter2/2?fw=pt

this code

```
from transformers import pipeline

classifier = pipeline("sentiment-analysis")
classifier(
[
"I've been waiting for a HuggingFace course my whole life.",
# J'ai attendu un cours de HuggingFace toute ma vie.
"I hate this so much!", # Je déteste tellement ça !
]
)
```

should give us Positive and Negative

```
[{'label': 'POSITIVE', 'score': 0.9598047137260437},
{'label': 'NEGATIVE', 'score': 0.9994558095932007}]
```

But on the Google Collab https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/fr/chapter2/section2_pt.ipynb, with French phrases we've got NEGATIVE and NEGATIVE

```
from transformers import pipeline

classifier = pipeline("sentiment-analysis", model="tblard/tf-allocine")
classifier(
["J'ai attendu un cours d'HuggingFace toute ma vie.",
"Je déteste tellement ça !"]
)
```

![image](https://github.com/huggingface/course/assets/4020744/0ed2d64b-8987-468d-a4dc-98d0d53e4d9d)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.