Downloads · 30 days
12
5% of all-time downloads
yiwenX/Qwen3-0.6B-imdb
Qwen3-0.6B-imdb is a text classification model from yiwenX. Use it when you need a label for a piece of text. It is set up for peft.
A fine-tuned version of Qwen3-0.6B for sentiment analysis on movie reviews using LoRA (Low-Rank Adaptation).
Downloads · 30 days
12
5% of all-time downloads
All-time downloads
239
Public
Repo size
51.9 MB
Likes
0
Public
Click a slice to open those files.
.safetensors40.4 MB · 72%
From the Hugging Face model README
A fine-tuned version of Qwen3-0.6B for sentiment analysis on movie reviews using LoRA (Low-Rank Adaptation).
This model is a fine-tuned version of Qwen3-0.6B specifically optimized for binary sentiment classification (positive/negative) on movie reviews. It uses LoRA adaptation to efficiently fine-tune the model while maintaining a small memory footprint.
This model can be used directly for sentiment analysis of English movie reviews or similar text. It classifies text into two categories:
The model can be further fine-tuned for:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
# 直接从HuggingFace加载你的模型
model_name = "yiwenX/Qwen3-0.6B-imdb"
model = AutoModelForSequenceClassification.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# 如果tokenizer没有pad_token,设置一下
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token
# 推理示例
def predict_sentiment(text):
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512, padding=True)
# 移动到正确的设备
inputs = {k: v.to(model.device) for k, v in inputs.items()}
with torch.no_grad():
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=-1)
return "Positive" if prediction.item() == 1 else "Negative"
# 测试示例
test_texts = [
"This movie was absolutely fantastic! Great acting and storyline.",
"Terrible movie, waste of time. Bad acting and boring plot.",
"One of the best films I've ever seen. Highly recommend!",
"I fell asleep halfway through. Very disappointing."
]
for text in test_texts:
sentiment = predict_sentiment(text)
print(f"Text: {text[:50]}...")
print(f"Sentiment: {sentiment}\n")
| Metric | Value |
|---|---|
| Test Accuracy | ~92-94% (expected) |
| F1 Score | ~0.92-0.94 |
| Training Loss (final) | ~0.1-0.2 |
Note: Exact values depend on random seed and training conditions
@misc{qwen3-imdb-lora,
author = {yiwenX},
title = {Qwen3-0.6B-IMDB: Fine-tuned Sentiment Analysis Model},
year = {2024},
publisher = {HuggingFace},
url = {https://huggingface.co/yiwenX/Qwen3-0.6B-imdb}
}