mishrabp commited on
Commit
69cf50a
·
1 Parent(s): 539ae49

Upload model, tokenizer, config, and README.md

Browse files
README.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+ library_name: transformers
4
+ tags: [sentiment-analysis, BERT, social-media, emotion-detection]
5
+ ---
6
+
7
+ # BERT Tweet Sentiment Analysis
8
+
9
+ ## Model Details
10
+
11
+ ### Model Description
12
+ This model is a BERT-based transformer (`bert-base-uncased`) fine-tuned for sentiment analysis on tweets. It classifies text into six emotion categories: sadness, joy, love, anger, fear, and surprise. The model was trained with a custom classification head on tweet data to capture short-form, social media style text.
13
+
14
+ - **Developed by:** Bibhu Mishra
15
+ - **Model type:** Sequence Classification
16
+ - **Language(s) (NLP):** English
17
+ - **License:** MIT
18
+ - **Finetuned from model:** bert-base-uncased
19
+
20
+ ### Model Sources
21
+ - **Repository:** [Hugging Face Model Hub](https://huggingface.co/mishrabp/bert-base-uncased-tweet-sentiment-analysis)
22
+
23
+ ## Uses
24
+
25
+ ### Direct Use
26
+ This model can be used to classify tweets or short text into emotions, useful for social listening, customer sentiment analysis, and marketing insights.
27
+
28
+ ### Downstream Use
29
+ The model can be integrated into larger NLP pipelines, such as real-time social media monitoring dashboards, chatbots, or recommendation systems that require sentiment-aware behavior.
30
+
31
+ ### Out-of-Scope Use
32
+ - Not suitable for clinical, medical, or diagnostic use.
33
+ - Performance may decrease on very long text, sarcasm, or highly domain-specific language.
34
+
35
+ ## Bias, Risks, and Limitations
36
+ - Limited to English-language social media text.
37
+ - May misclassify sarcastic or context-heavy tweets.
38
+ - Emotions are simplified into six categories, which may not capture nuanced sentiment.
39
+
40
+ ### Recommendations
41
+ Use this model for **exploratory sentiment analytics** and not for critical decisions. Always review predictions in the context of business requirements.
42
+
43
+ ## How to Get Started with the Model
44
+
45
+ ```python
46
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
47
+
48
+ model_name = "mishrabp/bert-base-uncased-tweet-sentiment-analysis"
49
+
50
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
51
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
52
+
53
+ classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
54
+
55
+ tweets = [
56
+ "I love spending time with my friends!",
57
+ "I feel so sad about the news today."
58
+ ]
59
+
60
+ results = classifier(tweets)
61
+ print(results)
62
+ ```
63
+
64
+ #### Output
65
+ ```json
66
+ [
67
+ {"label": "love", "score": 0.95},
68
+ {"label": "sadness", "score": 0.88}
69
+ ]
70
+
71
+ ```
72
+
73
+ ### Labels
74
+ ```
75
+ | ID | Emotion |
76
+ | -- | -------- |
77
+ | 0 | sadness |
78
+ | 1 | joy |
79
+ | 2 | love |
80
+ | 3 | anger |
81
+ | 4 | fear |
82
+ | 5 | surprise |
83
+ ```
config.json ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertForSequenceClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "dtype": "float32",
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "id2label": {
13
+ "0": "sadness",
14
+ "1": "joy",
15
+ "2": "love",
16
+ "3": "anger",
17
+ "4": "fear",
18
+ "5": "surprise"
19
+ },
20
+ "initializer_range": 0.02,
21
+ "intermediate_size": 3072,
22
+ "label2id": {
23
+ "anger": 3,
24
+ "fear": 4,
25
+ "joy": 1,
26
+ "love": 2,
27
+ "sadness": 0,
28
+ "surprise": 5
29
+ },
30
+ "layer_norm_eps": 1e-12,
31
+ "max_position_embeddings": 512,
32
+ "model_type": "bert",
33
+ "num_attention_heads": 12,
34
+ "num_hidden_layers": 12,
35
+ "pad_token_id": 0,
36
+ "position_embedding_type": "absolute",
37
+ "problem_type": "single_label_classification",
38
+ "transformers_version": "4.57.3",
39
+ "type_vocab_size": 2,
40
+ "use_cache": true,
41
+ "vocab_size": 30522
42
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5fb06992cf649b2ef8c4197eb830dbdb223c2d9ee737fdeecf94aa1f07683df9
3
+ size 437970952
special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": false,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": true,
47
+ "extra_special_tokens": {},
48
+ "mask_token": "[MASK]",
49
+ "model_max_length": 512,
50
+ "pad_token": "[PAD]",
51
+ "sep_token": "[SEP]",
52
+ "strip_accents": null,
53
+ "tokenize_chinese_chars": true,
54
+ "tokenizer_class": "BertTokenizer",
55
+ "unk_token": "[UNK]"
56
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0f90f69ed75b1ed401297cb47c9551bd6ae4853a09053a7a72f3cd1dd4bb37af
3
+ size 5777
vocab.txt ADDED
The diff for this file is too large to render. See raw diff