Views
No views yet
wakaflocka17/bart-imdb-finetuned model is a fine-tuned version of facebook/bart-base for the sentiment classification task on the IMDb dataset.
Trained on movie reviews, it can distinguish between positive and negative sentiment with excellent accuracy.
Below you will find its model card, evaluation metrics, training parameters, and a practical example of its use in Google Colab.| Metric | Value |
|---|---|
| Accuracy | 0.87968 |
| Precision | 0.8839 |
| Recall | 0.8742 |
| F1-score | 0.8790 |
| Parameter | Values |
|---|---|
| Base model | facebook/bart-base |
| Repo pretrained | facebook/bart-base |
| Repo finetuned | models/bart_base |
| Repo downloaded | models/downloaded/bart_base |
| Epochs | 3 |
| Batch size (train) | 8 |
| Batch size (eval) | 16 |
| Labels number | 2 |
!pip install --upgrade transformers huggingface_hub1from huggingface_hub import login
2login(token="hf_yourhftoken")1from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline
2
3repo_id = "wakaflocka17/bart-imdb-finetuned"
4tokenizer = AutoTokenizer.from_pretrained(repo_id)
5model = AutoModelForSequenceClassification.from_pretrained(repo_id)
6
7# Override default labels
8model.config.id2label = {0: 'NEGATIVE', 1: 'POSITIVE'}
9model.config.label2id = {'NEGATIVE': 0, 'POSITIVE': 1}
10
11# Create the classification pipeline
12pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True)1testo = "This movie was absolutely fantastic—wonderful performances and a gripping story!"
2risultati = pipe(testo)
3print(risultati)
4# Example output:
5# [{'label': 'POSITIVE', 'score': 0.95}, {'label': 'NEGATIVE', 'score': 0.05}]1@misc{Sentiment-Project,
2 author = {Francesco Congiu},
3 title = {Sentiment Analysis with Pretrained, Fine-tuned and Ensemble Transformer Models},
4 howpublished = {\url{https://github.com/wakaflocka17/DLA_LLMSANALYSIS}},
5 year = {2025}
6}All the file structure and script examples can be found at: https://github.com/wakaflocka17/DLA_LLMSANALYSIS/tree/main