CoolFace
Modelpublic

wakaflocka17/gptneo-imdb-finetuned

sourceHugging Faceapache-2.0updated 1y agoView on Hugging Face
0likes14downloads
Model Card

📝 Model Card: gptneo-imdb-finetuned

🔍 Introduction

The wakaflocka17/gptneo-imdb-finetuned model is a fine-tuned version of EleutherAI/gpt-neo-2.7B for the sentiment classification task on the IMDb dataset. Trained on movie reviews, it can distinguish between positive and negative sentiment. Below you will find its model card, evaluation metrics, training parameters, and a practical example of its use in Google Colab.

📊 Evaluation Metrics

MetricValue
Accuracy0.8412
Precision0.8538
Recall0.8234
F1-score0.8384

⚙️ Training Parameters

ParameterValues
Base modelEleutherAI/gpt-neo-2.7B
Repo pretrainedEleutherAI/gpt-neo-2.7B
Repo finetunedmodels/gpt_neo_2_7b
Repo downloadedmodels/downloaded/gpt_neo_2_7b
Epochs1
Batch size (train)1
Batch size (eval)1
Labels number2

🚀 Example of use in Colab

Installing dependencies
bash
!pip install --upgrade transformers huggingface_hub
(Optional) Authentication for private models
python
from huggingface_hub import login
login(token="hf_yourhftoken")
Loading tokenizer and model
python
from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline

repo_id   = "wakaflocka17/gptneo-imdb-finetuned"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model     = AutoModelForSequenceClassification.from_pretrained(repo_id)

# Override default labels
model.config.id2label = {0: 'NEGATIVE', 1: 'POSITIVE'}
model.config.label2id = {'NEGATIVE': 0, 'POSITIVE': 1}

# Create the classification pipeline
pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, return_all_scores=True)
Inference on a text example
python
testo     = "This movie was absolutely fantastic—wonderful performances and a gripping story!"
risultati = pipe(testo)
print(risultati)
# Esempio di output:
# [{'label': 'POSITIVE', 'score': 0.95}, {'label': 'NEGATIVE', 'score': 0.05}]

📖 How to cite

If you use this model in your work, you can cite it as:

latex
@misc{Sentiment-Project,
  author       = {Francesco Congiu},
  title        = {Sentiment Analysis with Pretrained, Fine-tuned and Ensemble Transformer Models},
  howpublished = {\url{https://github.com/wakaflocka17/DLA_LLMSANALYSIS}},
  year         = {2025}
}

🔗 Reference Repository

All the file structure and script examples can be found at: https://github.com/wakaflocka17/DLA_LLMSANALYSIS/tree/main