Downloads · 30 days
11
7% of all-time downloads
pengsu/MLB-care-for-mind-eng
MLB-care-for-mind-eng is a machine learning model from pengsu. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
This model is a fine-tuned version of google/gemma-2-2b-it using LoRA (Low-Rank Adaptation) for efficient parameter tuning. It was trained on the IMDb dataset for binary sentiment classification (positive and negative…
Downloads · 30 days
11
7% of all-time downloads
All-time downloads
147
Public
Repo size
118 MB
Likes
0
Public
Click a slice to open those files.
.safetensors83.1 MB · 71%
From the Hugging Face model README
gemma-2-2b-it on IMDb Sentiment AnalysisThis model is a fine-tuned version of google/gemma-2-2b-it using LoRA (Low-Rank Adaptation) for efficient parameter tuning. It was trained on the IMDb dataset for binary sentiment classification (positive and negative), optimized using 4-bit quantization (NF4) via BitsAndBytes for memory and computation efficiency.
You can find the model and its details on Hugging Face Hub here.
This model was fine-tuned by [Your Name or Organization] using Hugging Face's peft and transformers libraries with the IMDb dataset for English sentiment analysis.
This is a transformer-based model for binary sentiment classification using the IMDb dataset.
[Add relevant license here]
google/gemma-2-2b-itThis model can be used to classify movie reviews as positive or negative. It's well-suited for tasks like review analysis, social media sentiment classification, or feedback systems.
The model may not perform well on tasks that require multi-class sentiment classification or text outside of the domain of English movie reviews.
The model leverages 4-bit quantization (NF4) using BitsAndBytes to make it more memory-efficient. This allows the model to be run on smaller hardware resources while maintaining competitive performance.
The model uses Low-Rank Adaptation (LoRA) to efficiently fine-tune a subset of parameters. The specific modules adapted include:
down_proj, gate_proj, q_proj, o_proj, up_proj, v_proj, k_proj.The LoRA configuration is:
r = 16, lora_alpha = 32, lora_dropout = 0.05The model was trained on the IMDb dataset, which contains 50,000 labeled movie reviews, split into 25,000 training examples and 25,000 test examples. Each review is labeled as either positive or negative.
Text from IMDb reviews was tokenized using the google/gemma-2-2b-it tokenizer with a maximum sequence length of 64. The tokenization included padding and truncation to ensure consistent input lengths.
BitsAndBytes)The model was evaluated on the IMDb test dataset using the following metrics:
The model performs well in classifying movie reviews as positive or negative, achieving strong results across all metrics. Exact evaluation numbers will depend on the specific test runs and should be provided upon evaluation completion.
You can load the fine-tuned model and use it for inference on your own data using the code below:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# Load model and tokenizer
model = AutoModelForSequenceClassification.from_pretrained("pengsu/MLB-care-for-mind-eng")
tokenizer = AutoTokenizer.from_pretrained("pengsu/MLB-care-for-mind-eng")
# Tokenize input text
text = "This movie was absolutely amazing!"
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)
# Get predictions
outputs = model(**inputs)
logits = outputs.logits
predicted_class = logits.argmax(-1).item()
# Map prediction to label
id2label = {0: "NEGATIVE", 1: "POSITIVE"}
print(f"Predicted sentiment: {id2label[predicted_class]}")