--- library_name: transformers tags: - sentiment-analysis - lora - peft - imdb license: apache-2.0 base_model: distilbert-base-uncased --- # distilbert-imdb-lora # Model Card for Model ID ## Model Details ### Model Description Fine-tuned version of `distilbert-base-uncased` for binary sentiment classification, adapted using LoRA (Low-Rank Adaptation) rather than full fine-tuning. - **Developed by:** Mohammad (moh0405) - **Model type:** Text classification (sequence classification) - **Language(s):** English - **License:** Apache 2.0 - **Finetuned from model:** distilbert-base-uncased ### Model Sources [optional] - **Repository:** [More Information Needed] - **Paper [optional]:** [More Information Needed] - **Demo [optional]:** [More Information Needed] ## Uses ### Direct Use Classifies English-language text (originally movie reviews) as POSITIVE or NEGATIVE sentiment. Suitable for quick sentiment tagging tasks similar in style to IMDB reviews. ### Downstream Use [optional] [More Information Needed] ### Out-of-Scope Use Not intended for nuanced/mixed sentiment detection, non-English text, or domains far from movie reviews (e.g. financial sentiment, medical text) without further fine-tuning. Trained on a small subset for a learning exercise — not validated for production use. [More Information Needed] ## Bias, Risks, and Limitations [More Information Needed] ### Recommendations Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. ## How to Get Started with the Model ​```python from transformers import pipeline classifier = pipeline("text-classification", model="moh0405/distilbert-imdb-lora") result = classifier("This movie was surprisingly good.") print(result) ​``` [More Information Needed] ## Training Details ### Training Data Subset of the IMDB movie review dataset (`stanfordnlp/imdb`) — 2,000 training examples, 500 evaluation examples, randomly sampled (seed=42) from the full 25,000/25,000 split. [More Information Needed] ### Training Procedure #### Preprocessing [optional] [More Information Needed] #### Training Hyperparameters - **Method:** LoRA (PEFT), r=8, alpha=16, dropout=0.1, target_modules=["q_lin","v_lin"] - **Trainable parameters:** 739,586 / 67,694,596 total (1.09%) - **Epochs:** 1 - **Batch size:** 16 (train), 32 (eval) - **Training regime:** fp32 #### Speeds, Sizes, Times [optional] [More Information Needed] ## Evaluation ### Testing Data, Factors & Metrics #### Testing Data 500-example held-out split from `stanfordnlp/imdb` test set. #### Metrics Accuracy #### Factors [More Information Needed] [More Information Needed] ### Results | Stage | Accuracy | |---|---| | Before fine-tuning | 50.8% | | After fine-tuning (1 epoch) | 78.6% | #### Summary ## Model Examination [optional] [More Information Needed] ## Environmental Impact Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). - **Hardware Type:** [More Information Needed] - **Hours used:** [More Information Needed] - **Cloud Provider:** [More Information Needed] - **Compute Region:** [More Information Needed] - **Carbon Emitted:** [More Information Needed] ## Technical Specifications [optional] ### Model Architecture and Objective [More Information Needed] ### Compute Infrastructure [More Information Needed] #### Hardware Apple Mac Mini (Apple Silicon, MPS backend) #### Software transformers, peft, datasets, PyTorch ## Citation [optional] **BibTeX:** [More Information Needed] **APA:** [More Information Needed] ## Glossary [optional] [More Information Needed] ## More Information [optional] [More Information Needed] ## Model Card Authors [optional] [More Information Needed] ## Model Card Contact [More Information Needed]