File size: 2,636 Bytes
874e30f
 
fa4c5bd
 
 
 
874e30f
 
 
 
fa4c5bd
874e30f
 
 
 
 
 
 
 
 
fa4c5bd
 
874e30f
 
 
 
 
 
 
fa4c5bd
874e30f
fa4c5bd
 
874e30f
 
 
fa4c5bd
874e30f
 
 
 
fa4c5bd
874e30f
 
 
 
fa4c5bd
874e30f
 
 
fa4c5bd
874e30f
 
 
 
 
 
fa4c5bd
 
874e30f
fa4c5bd
 
874e30f
fa4c5bd
 
 
 
874e30f
 
 
 
 
fa4c5bd
 
 
 
 
874e30f
fa4c5bd
874e30f
 
 
fa4c5bd
874e30f
 
 
 
fa4c5bd
874e30f
 
 
 
fa4c5bd
874e30f
 
 
fa4c5bd
874e30f
 
fa4c5bd
874e30f
 
 
 
 
 
 
fa4c5bd
874e30f
 
fa4c5bd
874e30f
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
---
library_name: transformers
datasets:
- mteb/tweet_sentiment_extraction
base_model:
- openai-community/gpt2
---

# Model Card for Model ID

This model fine-tunes GPT-2 on the "Tweet Sentiment Extraction" dataset for sentiment analysis tasks.



## Model Details

### Model Description

<!-- Provide a longer summary of what this model is. -->

This model fine-tunes GPT-2 using the "Tweet Sentiment Extraction" dataset to extract sentiment-relevant portions of text. 
It demonstrates preprocessing, tokenization, and fine-tuning with Hugging Face libraries.



## Uses



### Direct Use

This model can be used to analyze text for sentiment-relevant extractions directly after fine-tuning. 
It works as a baseline model for learning sentiment-specific features.

### Downstream Use [optional]

Fine-tuned for tasks that involve sentiment analysis, such as social media monitoring or customer feedback analysis.


### Out-of-Scope Use

Avoid using the model for real-time sentiment prediction or deployment without additional training/testing for specific use cases.


## Bias, Risks, and Limitations

The dataset used may not fully represent the diversity of text, leading to biases in the output. There is a risk of overfitting to the specific dataset.

### Recommendations

Carefully evaluate the model for biases and limitations before deploying in production environments. Consider retraining on a more diverse dataset if required.


## How to Get Started with the Model

Use the code below to get started with the model.

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("https://huggingface.co/Wexnflex/Tweet_Sentiment")
tokenizer = AutoTokenizer.from_pretrained("https://huggingface.co/Wexnflex/Tweet_Sentiment")

text = "Input your text here."
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0]))



#### Training Hyperparameters

Training Hyperparameters
Batch size: 16
Learning rate: 2e-5
Epochs: 3
Optimizer: AdamW

#### Testing Data, Factors & Metrics

#### Testing Data

The evaluation was performed on the test split of the "Tweet Sentiment Extraction" dataset.


#### Factors

Evaluation is segmented by sentiment labels (e.g., positive, negative, neutral).


#### Metrics

Accuracy 

### Results

70% Accuracy 
#### Summary

The fine-tuned model performs well for extracting sentiment-relevant text, with room for improvement in handling ambiguous cases.


## Technical Specifications [optional]


#### Hardware

T4 GPU (Google Colab)
#### Software

Hugging Face Transformers Library