rohittamidapati11 commited on
Commit
327944c
·
verified ·
1 Parent(s): b50097a

Upload folder using huggingface_hub

Browse files
.ipynb_checkpoints/README-checkpoint.md ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: other
4
+ tags:
5
+ - sentiment-analysis
6
+ - fine-tuned
7
+ - sentiment-classification
8
+ - transformers
9
+ model_name: Fine-Tuned Sentiment Model
10
+ model_type: Roberta
11
+ datasets:
12
+ - custom-dataset
13
+ metrics:
14
+ - micro precision and recall
15
+ - macro precision and recall
16
+ ---
17
+
18
+ # Fine-Tuned Sentiment Model
19
+ This model is fine-tuned for Sentiment Analysis task, the model classifies a customer ticket into 5-categories of sentiments, namely:
20
+ - "Strong Negative"
21
+ - "Mild Negative"
22
+ - "Neutral"
23
+ - "Mild Positive"
24
+ - "Strong Positive"
25
+
26
+ *Point To Note*: The Customers are from these specific industries only:
27
+ - Food
28
+ - Cars
29
+ - Pet Food
30
+ - Furniture
31
+ - Beauty
32
+
33
+ ## Model Details
34
+ - **Model Architecture**: This fine-tuned model was built on a pre-trained model, "IDEA-CCNL/Erlangshen-Roberta-110M-Sentiment"
35
+ - **Training Dataset**: The Dataset was generated using the model, "meta-llama/Llama-3.2-1B-Instruct"
36
+
37
+ ## Example Usage-
38
+ To use this model for Sentiment Analysis:
39
+
40
+ ```python
41
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
42
+ import torch
43
+
44
+ tokenizer = AutoTokenizer.from_pretrained("your_username/fine_tuned_sentiment_model_rt")
45
+ model = AutoModelForSequenceClassification.from_pretrained("your_username/fine_tuned_sentiment_model_rt")
46
+
47
+ # Example input
48
+ inputs = tokenizer("The food was a bit bland, but the portion sizes were generous. I was looking forward to trying it, but it didn't quite live up to my expectations.", return_tensors='pt')
49
+ outputs = model(**inputs)
50
+ predicted_class = torch.argmax(outputs.logits, dim = 1).item()
51
+ print("Predicted Sentiment:", predicted_class)
README.md ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: other
4
+ tags:
5
+ - sentiment-analysis
6
+ - fine-tuned
7
+ - sentiment-classification
8
+ - transformers
9
+ model_name: Fine-Tuned Sentiment Model
10
+ model_type: Roberta
11
+ datasets:
12
+ - custom-dataset
13
+ metrics:
14
+ - micro precision and recall
15
+ - macro precision and recall
16
+ ---
17
+
18
+ # Fine-Tuned Sentiment Model
19
+ This model is fine-tuned for Sentiment Analysis task, the model classifies a customer ticket into 5-categories of sentiments, namely:
20
+ - "Strong Negative"
21
+ - "Mild Negative"
22
+ - "Neutral"
23
+ - "Mild Positive"
24
+ - "Strong Positive"
25
+
26
+ *Point To Note*: The Customers are from these specific industries only:
27
+ - Food
28
+ - Cars
29
+ - Pet Food
30
+ - Furniture
31
+ - Beauty
32
+
33
+ ## Model Details
34
+ - **Model Architecture**: This fine-tuned model was built on a pre-trained model, "IDEA-CCNL/Erlangshen-Roberta-110M-Sentiment"
35
+ - **Training Dataset**: The Dataset was generated using the model, "meta-llama/Llama-3.2-1B-Instruct"
36
+
37
+ ## Example Usage-
38
+ To use this model for Sentiment Analysis:
39
+
40
+ ```python
41
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
42
+ import torch
43
+
44
+ tokenizer = AutoTokenizer.from_pretrained("your_username/fine_tuned_sentiment_model_rt")
45
+ model = AutoModelForSequenceClassification.from_pretrained("your_username/fine_tuned_sentiment_model_rt")
46
+
47
+ # Example input
48
+ inputs = tokenizer("The food was a bit bland, but the portion sizes were generous. I was looking forward to trying it, but it didn't quite live up to my expectations.", return_tensors='pt')
49
+ outputs = model(**inputs)
50
+ predicted_class = torch.argmax(outputs.logits, dim = 1).item()
51
+ print("Predicted Sentiment:", predicted_class)
config.json ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "IDEA-CCNL/Erlangshen-Roberta-110M-Sentiment",
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "classifier_dropout": null,
9
+ "directionality": "bidi",
10
+ "eos_token_id": 2,
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.1,
13
+ "hidden_size": 768,
14
+ "id2label": {
15
+ "0": "Strong Negative",
16
+ "1": "Mild Negative",
17
+ "2": "Neutral",
18
+ "3": "Mild Positive",
19
+ "4": "Strong Positive"
20
+ },
21
+ "initializer_range": 0.02,
22
+ "intermediate_size": 3072,
23
+ "label2id": {
24
+ "Mild Negative": 1,
25
+ "Mild Positive": 3,
26
+ "Neutral": 2,
27
+ "Strong Negative": 0,
28
+ "Strong Positive": 4
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
+ "output_past": true,
36
+ "pad_token_id": 1,
37
+ "pooler_fc_size": 768,
38
+ "pooler_num_attention_heads": 12,
39
+ "pooler_num_fc_layers": 3,
40
+ "pooler_size_per_head": 128,
41
+ "pooler_type": "first_token_transform",
42
+ "position_embedding_type": "absolute",
43
+ "problem_type": "single_label_classification",
44
+ "torch_dtype": "float32",
45
+ "transformers_version": "4.46.2",
46
+ "type_vocab_size": 2,
47
+ "use_cache": true,
48
+ "vocab_size": 21128
49
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:005b180c3b177101936e14cf8aa5ff4eebf5684da7e672cbf4b145644de6da1b
3
+ size 409109468
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,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "mask_token": "[MASK]",
49
+ "model_max_length": 1000000000000000019884624838656,
50
+ "never_split": null,
51
+ "pad_token": "[PAD]",
52
+ "sep_token": "[SEP]",
53
+ "strip_accents": null,
54
+ "tokenize_chinese_chars": true,
55
+ "tokenizer_class": "BertTokenizer",
56
+ "unk_token": "[UNK]"
57
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff