GAJJALAASHOKKUMARREDDY
commited on
Upload 7 files
Browse files- README.md +103 -0
- config.json +155 -0
- model.safetensors +3 -0
- special_tokens_map.json +37 -0
- tokenizer.json +0 -0
- tokenizer_config.json +63 -0
- vocab.txt +0 -0
README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
tags:
|
| 4 |
+
- intent-classificaton
|
| 5 |
+
- text-classification
|
| 6 |
+
license: apache-2.0
|
| 7 |
+
language:
|
| 8 |
+
- en
|
| 9 |
+
base_model:
|
| 10 |
+
- google-bert/bert-base-uncased
|
| 11 |
+
pipeline_tag: text-classification
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# Model Card for Model ID
|
| 15 |
+
|
| 16 |
+
This is a fine-tuned BERT-based model for intent classification, capable of categorizing intents into 82 distinct labels. It was trained on a consolidated dataset of multilingual intent datasets.
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
## How to Get Started with the Model
|
| 20 |
+
|
| 21 |
+
Use the code below to get started with the model.
|
| 22 |
+
|
| 23 |
+
```python
|
| 24 |
+
from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
|
| 25 |
+
|
| 26 |
+
model = AutoModelForSequenceClassification.from_pretrained("yeniguno/bert-uncased-intent-classification")
|
| 27 |
+
tokenizer = AutoTokenizer.from_pretrained("yeniguno/bert-uncased-intent-classification")
|
| 28 |
+
|
| 29 |
+
pipe = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
| 30 |
+
|
| 31 |
+
text = "Play the song, Sam."
|
| 32 |
+
prediction = pipe(text)
|
| 33 |
+
|
| 34 |
+
print(prediction)
|
| 35 |
+
|
| 36 |
+
# [{'label': 'play_music', 'score': 0.9997674822807312}]
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
## Uses
|
| 40 |
+
|
| 41 |
+
This model is intended for:
|
| 42 |
+
|
| 43 |
+
Natural Language Understanding (NLU) tasks. Classifying user intents for applications such as:
|
| 44 |
+
|
| 45 |
+
- Voice assistants
|
| 46 |
+
- Chatbots
|
| 47 |
+
- Customer support automation
|
| 48 |
+
- Conversational AI systems
|
| 49 |
+
|
| 50 |
+
## Bias, Risks, and Limitations
|
| 51 |
+
The model's performance may degrade on intents that are underrepresented in the training data. Not optimized for languages other than English. Domain-specific intents not included in the dataset may require additional fine-tuning.
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
## Training Details
|
| 55 |
+
|
| 56 |
+
### Training Data
|
| 57 |
+
|
| 58 |
+
his model was trained on a combination of intent datasets from various sources:
|
| 59 |
+
|
| 60 |
+
Datasets Used:
|
| 61 |
+
|
| 62 |
+
- mteb/amazon_massive_intent
|
| 63 |
+
- mteb/mtop_intent
|
| 64 |
+
- sonos-nlu-benchmark/snips_built_in_intents
|
| 65 |
+
- Mozilla/smart_intent_dataset
|
| 66 |
+
- Bhuvaneshwari/intent_classification
|
| 67 |
+
- clinc/clinc_oos
|
| 68 |
+
|
| 69 |
+
Each dataset was preprocessed, and intent labels were consolidated into 82 unique classes.
|
| 70 |
+
|
| 71 |
+
Dataset Sizes:
|
| 72 |
+
|
| 73 |
+
- Train size: 138228
|
| 74 |
+
- Validation size: 17279
|
| 75 |
+
- Test size: 17278
|
| 76 |
+
|
| 77 |
+
### Training Procedure
|
| 78 |
+
|
| 79 |
+
The model was fine-tuned with the following hyperparameters:
|
| 80 |
+
|
| 81 |
+
Base Model: bert-base-uncased Learning Rate: 3e-5 Batch Size: 32 Epochs: 4 Weight Decay: 0.01 Evaluation Strategy: Per epoch Mixed Precision: FP32 Hardware: A100
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
## Evaluation
|
| 85 |
+
|
| 86 |
+
### Results
|
| 87 |
+
|
| 88 |
+
#### Training and Validation:
|
| 89 |
+
| Epoch | Training Loss | Validation Loss | Accuracy | F1 Score | Precision | Recall |
|
| 90 |
+
|-------|---------------|-----------------|----------|----------|-----------|--------|
|
| 91 |
+
| 1 | 0.1143 | 0.1014 | 97.38% | 97.33% | 97.36% | 97.38% |
|
| 92 |
+
| 2 | 0.0638 | 0.0833 | 97.78% | 97.79% | 97.83% | 97.78% |
|
| 93 |
+
| 3 | 0.0391 | 0.0946 | 97.98% | 97.98% | 97.99% | 97.98% |
|
| 94 |
+
| 4 | 0.0122 | 0.1013 | 98.04% | 98.04% | 98.05% | 98.04% |
|
| 95 |
+
|
| 96 |
+
#### Test Results:
|
| 97 |
+
| Metric | Value |
|
| 98 |
+
|-------------|----------|
|
| 99 |
+
| **Loss** | 0.0814 |
|
| 100 |
+
| **Accuracy**| 98.37% |
|
| 101 |
+
| **F1 Score**| 98.37% |
|
| 102 |
+
| **Precision**| 98.38% |
|
| 103 |
+
| **Recall** | 98.37% |
|
config.json
ADDED
|
@@ -0,0 +1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
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"classifier_dropout": null,
|
| 8 |
+
"gradient_checkpointing": false,
|
| 9 |
+
"hidden_act": "gelu",
|
| 10 |
+
"hidden_dropout_prob": 0.1,
|
| 11 |
+
"hidden_size": 768,
|
| 12 |
+
"id2label": {
|
| 13 |
+
"0": "get_message",
|
| 14 |
+
"1": "get_weather",
|
| 15 |
+
"2": "alarm_query",
|
| 16 |
+
"3": "send_message",
|
| 17 |
+
"4": "get_recipe",
|
| 18 |
+
"5": "set_availability",
|
| 19 |
+
"6": "delete_reminder",
|
| 20 |
+
"7": "get_news",
|
| 21 |
+
"8": "create_alarm",
|
| 22 |
+
"9": "get_reminder",
|
| 23 |
+
"10": "create_reminder",
|
| 24 |
+
"11": "event_query",
|
| 25 |
+
"12": "play_music",
|
| 26 |
+
"13": "create_call",
|
| 27 |
+
"14": "end_call",
|
| 28 |
+
"15": "create_timer",
|
| 29 |
+
"16": "update_call",
|
| 30 |
+
"17": "update_reminder",
|
| 31 |
+
"18": "get_contact",
|
| 32 |
+
"19": "get_timer",
|
| 33 |
+
"20": "delete_alarm",
|
| 34 |
+
"21": "add_timer",
|
| 35 |
+
"22": "get_location",
|
| 36 |
+
"23": "delete_timer",
|
| 37 |
+
"24": "music_query",
|
| 38 |
+
"25": "update_alarm",
|
| 39 |
+
"26": "information_query",
|
| 40 |
+
"27": "help_query",
|
| 41 |
+
"28": "weather_query",
|
| 42 |
+
"29": "navigation_query",
|
| 43 |
+
"30": "purchase_intent",
|
| 44 |
+
"31": "translation_intent",
|
| 45 |
+
"32": "travel_intent",
|
| 46 |
+
"33": "add_to_playlist",
|
| 47 |
+
"34": "rate_book",
|
| 48 |
+
"35": "search_event",
|
| 49 |
+
"36": "book_restaurant",
|
| 50 |
+
"37": "set_meeting",
|
| 51 |
+
"38": "search_creative_work",
|
| 52 |
+
"39": "cancellation",
|
| 53 |
+
"40": "affirmation",
|
| 54 |
+
"41": "excitement_emotion",
|
| 55 |
+
"42": "insurance_query",
|
| 56 |
+
"43": "fun_fact",
|
| 57 |
+
"44": "time_query",
|
| 58 |
+
"45": "update_cart",
|
| 59 |
+
"46": "oil_change_query",
|
| 60 |
+
"47": "set_reservation",
|
| 61 |
+
"48": "confirm_reservation",
|
| 62 |
+
"49": "next_song",
|
| 63 |
+
"50": "suggest_restaurant",
|
| 64 |
+
"51": "pay_bill",
|
| 65 |
+
"52": "reminder_query",
|
| 66 |
+
"53": "check_availability",
|
| 67 |
+
"54": "accept_reservations",
|
| 68 |
+
"55": "order_query",
|
| 69 |
+
"56": "meeting_query",
|
| 70 |
+
"57": "book_hotel",
|
| 71 |
+
"58": "cart_query",
|
| 72 |
+
"59": "location_query",
|
| 73 |
+
"60": "cancel_reservation",
|
| 74 |
+
"61": "traffic_query"
|
| 75 |
+
},
|
| 76 |
+
"initializer_range": 0.02,
|
| 77 |
+
"intermediate_size": 3072,
|
| 78 |
+
"label2id": {
|
| 79 |
+
"accept_reservations": 54,
|
| 80 |
+
"add_timer": 21,
|
| 81 |
+
"add_to_playlist": 33,
|
| 82 |
+
"affirmation": 40,
|
| 83 |
+
"alarm_query": 2,
|
| 84 |
+
"book_hotel": 57,
|
| 85 |
+
"book_restaurant": 36,
|
| 86 |
+
"cancel_reservation": 60,
|
| 87 |
+
"cancellation": 39,
|
| 88 |
+
"cart_query": 58,
|
| 89 |
+
"check_availability": 53,
|
| 90 |
+
"confirm_reservation": 48,
|
| 91 |
+
"create_alarm": 8,
|
| 92 |
+
"create_call": 13,
|
| 93 |
+
"create_reminder": 10,
|
| 94 |
+
"create_timer": 15,
|
| 95 |
+
"delete_alarm": 20,
|
| 96 |
+
"delete_reminder": 6,
|
| 97 |
+
"delete_timer": 23,
|
| 98 |
+
"end_call": 14,
|
| 99 |
+
"event_query": 11,
|
| 100 |
+
"excitement_emotion": 41,
|
| 101 |
+
"fun_fact": 43,
|
| 102 |
+
"get_contact": 18,
|
| 103 |
+
"get_location": 22,
|
| 104 |
+
"get_message": 0,
|
| 105 |
+
"get_news": 7,
|
| 106 |
+
"get_recipe": 4,
|
| 107 |
+
"get_reminder": 9,
|
| 108 |
+
"get_timer": 19,
|
| 109 |
+
"get_weather": 1,
|
| 110 |
+
"help_query": 27,
|
| 111 |
+
"information_query": 26,
|
| 112 |
+
"insurance_query": 42,
|
| 113 |
+
"location_query": 59,
|
| 114 |
+
"meeting_query": 56,
|
| 115 |
+
"music_query": 24,
|
| 116 |
+
"navigation_query": 29,
|
| 117 |
+
"next_song": 49,
|
| 118 |
+
"oil_change_query": 46,
|
| 119 |
+
"order_query": 55,
|
| 120 |
+
"pay_bill": 51,
|
| 121 |
+
"play_music": 12,
|
| 122 |
+
"purchase_intent": 30,
|
| 123 |
+
"rate_book": 34,
|
| 124 |
+
"reminder_query": 52,
|
| 125 |
+
"search_creative_work": 38,
|
| 126 |
+
"search_event": 35,
|
| 127 |
+
"send_message": 3,
|
| 128 |
+
"set_availability": 5,
|
| 129 |
+
"set_meeting": 37,
|
| 130 |
+
"set_reservation": 47,
|
| 131 |
+
"suggest_restaurant": 50,
|
| 132 |
+
"time_query": 44,
|
| 133 |
+
"traffic_query": 61,
|
| 134 |
+
"translation_intent": 31,
|
| 135 |
+
"travel_intent": 32,
|
| 136 |
+
"update_alarm": 25,
|
| 137 |
+
"update_call": 16,
|
| 138 |
+
"update_cart": 45,
|
| 139 |
+
"update_reminder": 17,
|
| 140 |
+
"weather_query": 28
|
| 141 |
+
},
|
| 142 |
+
"layer_norm_eps": 1e-12,
|
| 143 |
+
"max_position_embeddings": 512,
|
| 144 |
+
"model_type": "bert",
|
| 145 |
+
"num_attention_heads": 12,
|
| 146 |
+
"num_hidden_layers": 12,
|
| 147 |
+
"pad_token_id": 0,
|
| 148 |
+
"position_embedding_type": "absolute",
|
| 149 |
+
"problem_type": "single_label_classification",
|
| 150 |
+
"torch_dtype": "float32",
|
| 151 |
+
"transformers_version": "4.47.1",
|
| 152 |
+
"type_vocab_size": 2,
|
| 153 |
+
"use_cache": true,
|
| 154 |
+
"vocab_size": 30522
|
| 155 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:da778faff069f13a103e5cc828ddef95883522b48eac44742abf37b6a83ac8da
|
| 3 |
+
size 438143208
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cls_token": {
|
| 3 |
+
"content": "[CLS]",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"mask_token": {
|
| 10 |
+
"content": "[MASK]",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": {
|
| 17 |
+
"content": "[PAD]",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"sep_token": {
|
| 24 |
+
"content": "[SEP]",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
},
|
| 30 |
+
"unk_token": {
|
| 31 |
+
"content": "[UNK]",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": false,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false
|
| 36 |
+
}
|
| 37 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
"max_length": 128,
|
| 50 |
+
"model_max_length": 512,
|
| 51 |
+
"pad_to_multiple_of": null,
|
| 52 |
+
"pad_token": "[PAD]",
|
| 53 |
+
"pad_token_type_id": 0,
|
| 54 |
+
"padding_side": "right",
|
| 55 |
+
"sep_token": "[SEP]",
|
| 56 |
+
"stride": 0,
|
| 57 |
+
"strip_accents": null,
|
| 58 |
+
"tokenize_chinese_chars": true,
|
| 59 |
+
"tokenizer_class": "BertTokenizer",
|
| 60 |
+
"truncation_side": "right",
|
| 61 |
+
"truncation_strategy": "longest_first",
|
| 62 |
+
"unk_token": "[UNK]"
|
| 63 |
+
}
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|