File size: 3,992 Bytes
0e87811
 
5ac50d3
0e87811
 
3b7326d
0e87811
3b7326d
 
0e87811
 
 
 
 
3b7326d
 
 
 
 
 
 
0e87811
3b7326d
0e87811
3b7326d
 
0e87811
 
 
 
 
3b7326d
0e87811
3b7326d
0e87811
3b7326d
 
 
0e87811
 
 
3b7326d
 
0e87811
 
 
3b7326d
 
0e87811
 
 
3b7326d
 
0e87811
 
 
3b7326d
 
0e87811
3b7326d
 
 
 
 
0e87811
3b7326d
0e87811
 
3b7326d
 
 
0e87811
3b7326d
0e87811
3b7326d
0e87811
3b7326d
 
0e87811
3b7326d
0e87811
3b7326d
0e87811
3b7326d
0e87811
3b7326d
0e87811
3b7326d
 
0e87811
3b7326d
0e87811
3b7326d
0e87811
3b7326d
0e87811
3b7326d
 
 
0e87811
3b7326d
0e87811
3b7326d
 
 
0e87811
3b7326d
 
0e87811
3b7326d
0e87811
3b7326d
0e87811
3b7326d
0e87811
3b7326d
0e87811
3b7326d
 
 
0e87811
3b7326d
0e87811
3b7326d
 
0e87811
3b7326d
0e87811
3b7326d
 
0e87811
3b7326d
0e87811
3b7326d
0e87811
3b7326d
 
0e87811
3b7326d
0e87811
3b7326d
0e87811
3b7326d
 
 
 
0e87811
3b7326d
 
 
 
 
0e87811
3b7326d
 
0e87811
3b7326d
 
0e87811
3b7326d
0e87811
3b7326d
0e87811
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
---
library_name: transformers
license: mit
---

# Model Card for `goatley/sentiment-final-model`

This model is a fine-tuned **DistilBERT** model for **binary sentiment classification** (positive/negative) of English text reviews.  
It was developed as part of an advanced NLP dashboard project demonstrating applied skills in deep learning, NLP engineering, and full-stack app deployment.

## Model Details

### Model Description

- **Developed by:** Keith Goatley
- **License:** MIT
- **Model type:** DistilBERT-based Sequence Classification (Binary)
- **Language(s):** English
- **Fine-tuned from:** `distilbert-base-uncased`
- **Base model:** Hugging Face Transformers v4
- **Framework:** PyTorch

### Model Sources

- **Repository:** [GitHub Repository](https://github.com/Keithgoatley/sentiment-analysis-app)
- **Demo:** [Hugging Face Space (when deployed)](https://huggingface.co/spaces/goatley/sentiment-analysis-dashboard)

## Uses

### Direct Use

- Classifying short text reviews (e.g., Amazon product reviews) into **positive** or **negative** sentiment.

### Downstream Use

- Embedding inside sentiment-driven recommendation engines
- As a component of multi-task NLP dashboards
- Fine-tuning for domain-specific sentiment (e.g., medical, finance, hospitality reviews)

### Out-of-Scope Use

- Not designed for languages other than English.
- Not suited for emotion detection beyond binary sentiment.

## Bias, Risks, and Limitations

This model was fine-tuned on Amazon reviews, which may carry biases toward product-related expressions and cultural language patterns.  
Users should be cautious when applying the model outside typical e-commerce datasets.

### Recommendations

For more robust domain generalization:
- Further fine-tuning on task-specific datasets is advised.

## How to Get Started with the Model

```python
from transformers import pipeline

classifier = pipeline(
    "sentiment-analysis",
    model="goatley/sentiment-final-model",
    tokenizer="goatley/sentiment-final-model"
)

classifier(["I love this!", "This was awful."])


Training Details
Training Data
Subset of Amazon Reviews Dataset

Balanced 50/50 split of positive and negative reviews

Approximately 5,000 examples used for fine-tuning

Training Procedure
Fine-tuned for 3 epochs

Learning rate scheduling with warmup

Optimizer: AdamW

Batch size: 16

Device: CPU-based training (GitHub Codespaces)

Training Hyperparameters
Learning Rate: 5e-5

Optimizer: AdamW

Max Sequence Length: 512

Epochs: 3

Evaluation
Testing Data
Held-out test split from the Amazon Reviews dataset

Metrics

Metric	Score
Test Accuracy	85%
Evaluation was performed using basic classification metrics (accuracy, precision, recall, F1-score).

Environmental Impact
Hardware Type: CPU (GitHub Codespaces)

Hours Used: ~2 hours

Cloud Provider: GitHub (Microsoft Azure backend)

Compute Region: North America

Carbon Emitted: Negligible (very small dataset + CPU-only fine-tuning)

Technical Specifications
Model Architecture and Objective
Architecture: DistilBERT Transformer Encoder

Task Objective: Sequence classification with 2 labels (positive, negative)

Compute Infrastructure
Training performed on GitHub Codespaces virtual machines.

No GPUs were used.

Software Environment
Hugging Face transformers==4.51.3

Datasets datasets==3.5.0

PyTorch torch==2.6.0

Citation
If you use this model or find it helpful, please cite:

APA:

Goatley, K. (2025). Sentiment Analysis Fine-Tuned DistilBERT Model [Model]. Hugging Face. https://huggingface.co/goatley/sentiment-final-model

BibTeX:
@misc{goatley2025sentiment,
  author = {Keith Goatley},
  title = {Sentiment

Analysis Fine-Tuned DistilBERT Model},
  year = {2025},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/goatley/sentiment-final-model}}
}

Model Card Authors
Keith Goatley

Contact
For questions or inquiries, please contact via:

GitHub: https://github.com/Keithgoatley

Hugging Face: https://huggingface.co/goatley