Bitext
commited on
Commit
•
40dd104
1
Parent(s):
2986640
Update README.md
Browse filesUpdated model card for `Mistral-7B-Customer-Service-v0.2`:
- Added detailed model description and intended use
- Included a usage example with code snippet
- Provided information on model architecture and training data
- Detailed training procedure with hyperparameters and environment setup
- Included training results table
- Provided a comprehensive dataset description with categories, intents, entities, and language generation tags
- Added sections on limitations, biases, and ethical considerations
- Detailed the Apache 2.0 license
README.md
CHANGED
@@ -3,26 +3,156 @@ license: apache-2.0
|
|
3 |
inference: false
|
4 |
pipeline_tag: text-generation
|
5 |
tags:
|
6 |
-
- axolotl
|
7 |
-
- generated_from_trainer
|
8 |
-
- text-generation-inference
|
9 |
model-index:
|
10 |
-
- name: Mistral-7B-instruct-v0.2
|
11 |
-
|
12 |
model_type: mistral
|
13 |
widget:
|
14 |
-
- messages:
|
15 |
-
|
16 |
-
|
17 |
---
|
18 |
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
[<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
|
|
|
23 |
<details><summary>See axolotl config</summary>
|
24 |
|
25 |
axolotl version: `0.4.0`
|
|
|
26 |
```yaml
|
27 |
base_model: mistralai/Mistral-7B-Instruct-v0.2
|
28 |
model_type: MistralForCausalLM
|
@@ -38,12 +168,12 @@ strict: false
|
|
38 |
datasets:
|
39 |
- path: bitext/Bitext-customer-support-llm-chatbot-training-dataset
|
40 |
type:
|
41 |
-
system_prompt:
|
42 |
field_instruction: instruction
|
43 |
field_output: response
|
44 |
-
format:
|
45 |
-
no_input_format:
|
46 |
-
|
47 |
#datasets:
|
48 |
# - path: json
|
49 |
# type: alpaca_w_system.load_open_orca
|
@@ -118,62 +248,9 @@ weight_decay: 0.0
|
|
118 |
fsdp:
|
119 |
fsdp_config:
|
120 |
special_tokens:
|
121 |
-
bos_token:
|
122 |
-
eos_token:
|
123 |
-
unk_token:
|
124 |
```
|
125 |
|
126 |
</details><br>
|
127 |
-
|
128 |
-
# Mistral-7B-instruct-v0.2
|
129 |
-
|
130 |
-
This model is a fine-tuned version of [mistralai/Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2) on the None dataset.
|
131 |
-
It achieves the following results on the evaluation set:
|
132 |
-
- Loss: 0.7667
|
133 |
-
|
134 |
-
## Model description
|
135 |
-
|
136 |
-
More information needed
|
137 |
-
|
138 |
-
## Intended uses & limitations
|
139 |
-
|
140 |
-
More information needed
|
141 |
-
|
142 |
-
## Training and evaluation data
|
143 |
-
|
144 |
-
More information needed
|
145 |
-
|
146 |
-
## Training procedure
|
147 |
-
|
148 |
-
### Training hyperparameters
|
149 |
-
|
150 |
-
The following hyperparameters were used during training:
|
151 |
-
- learning_rate: 0.0002
|
152 |
-
- train_batch_size: 8
|
153 |
-
- eval_batch_size: 8
|
154 |
-
- seed: 42
|
155 |
-
- gradient_accumulation_steps: 4
|
156 |
-
- total_train_batch_size: 32
|
157 |
-
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
158 |
-
- lr_scheduler_type: cosine
|
159 |
-
- lr_scheduler_warmup_steps: 10
|
160 |
-
- num_epochs: 1
|
161 |
-
|
162 |
-
### Training results
|
163 |
-
|
164 |
-
| Training Loss | Epoch | Step | Validation Loss |
|
165 |
-
|:-------------:|:-----:|:----:|:---------------:|
|
166 |
-
| 1.6865 | 0.01 | 1 | 2.0557 |
|
167 |
-
| 0.6351 | 0.25 | 32 | 0.8355 |
|
168 |
-
| 0.5724 | 0.5 | 64 | 0.7859 |
|
169 |
-
| 0.5249 | 0.75 | 96 | 0.7711 |
|
170 |
-
| 0.516 | 1.0 | 128 | 0.7667 |
|
171 |
-
|
172 |
-
|
173 |
-
### Framework versions
|
174 |
-
|
175 |
-
- PEFT 0.10.1.dev0
|
176 |
-
- Transformers 4.40.0.dev0
|
177 |
-
- Pytorch 2.2.1+cu121
|
178 |
-
- Datasets 2.18.0
|
179 |
-
- Tokenizers 0.15.0
|
|
|
3 |
inference: false
|
4 |
pipeline_tag: text-generation
|
5 |
tags:
|
6 |
+
- axolotl
|
7 |
+
- generated_from_trainer
|
8 |
+
- text-generation-inference
|
9 |
model-index:
|
10 |
+
- name: Mistral-7B-instruct-v0.2
|
11 |
+
results: []
|
12 |
model_type: mistral
|
13 |
widget:
|
14 |
+
- messages:
|
15 |
+
- role: user
|
16 |
+
content: I want to cancel an order
|
17 |
---
|
18 |
|
19 |
+
# Mistral-7B-Customer-Service-v0.2
|
20 |
+
|
21 |
+
## Model Description
|
22 |
+
|
23 |
+
This model is a fine-tuned version of the [mistralai/Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2), specifically tailored for customer service. It is designed to handle question answering tasks, providing responses based on a specialized customer support dataset.
|
24 |
+
|
25 |
+
## Intended Use
|
26 |
+
|
27 |
+
- **Recommended applications**: This model is intended for automated customer service. You can use it in chatbots, virtual assistants and copilots to answer user questions.
|
28 |
+
- **Out-of-scope**: The model is not intended for general conversational purposes and should not be used for medical, legal, or safety-critical advice.
|
29 |
+
|
30 |
+
## Usage Example
|
31 |
+
|
32 |
+
```python
|
33 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
34 |
+
|
35 |
+
model = AutoModelForCausalLM.from_pretrained("bitext-llm/Mistral-7B-Customer-Service-v0.2")
|
36 |
+
tokenizer = AutoTokenizer.from_pretrained("bitext-llm/Mistral-7B-Customer-Service-v0.2")
|
37 |
+
|
38 |
+
inputs = tokenizer("<s>[INST] I want to change to the standard account [/INST] ", return_tensors="pt")
|
39 |
+
outputs = model.generate(inputs['input_ids'], max_length=50)
|
40 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
41 |
+
```
|
42 |
+
|
43 |
+
## Model Architecture
|
44 |
+
|
45 |
+
The model employs the `MistralForCausalLM` architecture with a `LlamaTokenizer`. It maintains the configuration of the base Mistral model but has been fine-tuned to better understand and generate responses related to customer service.
|
46 |
+
|
47 |
+
## Training Data
|
48 |
+
|
49 |
+
The model was fine-tuned using the [bitext/Bitext-customer-support-llm-chatbot-training-dataset](https://huggingface.co/datasets/bitext/Bitext-customer-support-llm-chatbot-training-dataset), which is designed for question and answer interactions in the customer service sector. This dataset includes instructions and responses across a variety of customer service topics, ensuring that the model can handle a wide range of inquiries related to this field. The dataset covers 27 intents assigned to 10 categories such as `cancel_order`, `place_order`, `change_order`, and `check_invoice`. Each intent has around 1000 examples, illustrating a training process aimed at understanding and generating accurate responses for customer service interactions.
|
50 |
+
|
51 |
+
## Training Procedure
|
52 |
+
|
53 |
+
### Hyperparameters
|
54 |
+
|
55 |
+
- **Optimizer**: AdamW with betas=(0.9, 0.999) and epsilon=1e-08
|
56 |
+
- **Learning Rate**: 0.0002 with a cosine learning rate scheduler
|
57 |
+
- **Epochs**: 1
|
58 |
+
- **Batch Size**: 8
|
59 |
+
- **Gradient Accumulation Steps**: 4
|
60 |
+
- **Maximum Sequence Length**: 1024 tokens
|
61 |
+
|
62 |
+
### Environment
|
63 |
+
|
64 |
+
- **Transformers Version**: 4.40.0.dev0
|
65 |
+
- **Framework**: PyTorch 2.2.1+cu121
|
66 |
+
- **Tokenizers**: Tokenizers 0.15.0
|
67 |
+
|
68 |
+
## Training Results
|
69 |
+
|
70 |
+
| Training Loss | Epoch | Step | Validation Loss |
|
71 |
+
| :-----------: | :---: | :--: | :-------------: |
|
72 |
+
| 1.6865 | 0.01 | 1 | 2.0557 |
|
73 |
+
| 0.6351 | 0.25 | 32 | 0.8355 |
|
74 |
+
| 0.5724 | 0.5 | 64 | 0.7859 |
|
75 |
+
| 0.5249 | 0.75 | 96 | 0.7711 |
|
76 |
+
| 0.516 | 1.0 | 128 | 0.7667 |
|
77 |
+
|
78 |
+
## Dataset Description
|
79 |
+
|
80 |
+
### Overview
|
81 |
+
|
82 |
+
The dataset used for fine-tuning can train Large Language Models for both Fine Tuning and Domain Adaptation. It includes:
|
83 |
+
|
84 |
+
- **Use Case**: Intent Detection
|
85 |
+
- **Vertical**: Customer Service
|
86 |
+
- **27 intents** assigned to 10 categories
|
87 |
+
- **26,872 question/answer pairs**, around 1000 per intent
|
88 |
+
- **30 entity/slot types**
|
89 |
+
- **12 different types of language generation tags**
|
90 |
+
|
91 |
+
### Categories and Intents
|
92 |
+
|
93 |
+
The dataset covers the following categories and intents:
|
94 |
+
|
95 |
+
- **ACCOUNT**: create_account, delete_account, edit_account, switch_account
|
96 |
+
- **CANCELLATION_FEE**: check_cancellation_fee
|
97 |
+
- **DELIVERY**: delivery_options
|
98 |
+
- **FEEDBACK**: complaint, review
|
99 |
+
- **INVOICE**: check_invoice, get_invoice
|
100 |
+
- **NEWSLETTER**: newsletter_subscription
|
101 |
+
- **ORDER**: cancel_order, change_order, place_order
|
102 |
+
- **PAYMENT**: check_payment_methods, payment_issue
|
103 |
+
- **REFUND**: check_refund_policy, track_refund
|
104 |
+
- **SHIPPING_ADDRESS**: change_shipping_address, set_up_shipping_address
|
105 |
+
|
106 |
+
### Entities
|
107 |
+
|
108 |
+
The dataset includes various entities such as:
|
109 |
+
|
110 |
+
- {{Order Number}}, {{Invoice Number}}, {{Online Order Interaction}}, {{Online Payment Interaction}}, {{Online Navigation Step}}, {{Online Customer Support Channel}}, {{Profile}}, {{Profile Type}}, {{Settings}}, {{Online Company Portal Info}}, {{Date}}, {{Date Range}}, {{Shipping Cut-off Time}}, {{Delivery City}}, {{Delivery Country}}, {{Salutation}}, {{Client First Name}}, {{Client Last Name}}, {{Customer Support Phone Number}}, {{Customer Support Email}}, {{Live Chat Support}}, {{Website URL}}, {{Upgrade Account}}, {{Account Type}}, {{Account Category}}, {{Account Change}}, {{Program}}, {{Refund Amount}}, {{Money Amount}}, {{Store Location}}
|
111 |
+
|
112 |
+
### Language Generation Tags
|
113 |
+
|
114 |
+
The dataset contains tags for various linguistic phenomena:
|
115 |
+
|
116 |
+
- **Lexical Variation**: Morphological (M), Semantic (L)
|
117 |
+
- **Syntactic Structure Variation**: Basic (B), Interrogative (I), Coordinated (C), Negation (N)
|
118 |
+
- **Language Register Variations**: Politeness (P), Colloquial (Q), Offensive (W)
|
119 |
+
- **Stylistic Variations**: Keyword (K), Abbreviations (E), Errors and Typos (Z)
|
120 |
+
- **Other Tags**: Indirect Speech (D), Regional Variations (G), Respect Structures (R), Code Switching (Y)
|
121 |
+
|
122 |
+
## Limitations and Bias
|
123 |
+
|
124 |
+
- The model is fine-tuned on a domain-specific dataset and may not perform well outside the scope of customer service.
|
125 |
+
- Users should be aware of potential biases in the training data, as the model's responses may inadvertently reflect these biases. The dataset aims to cover general customer service inquiries, but biases may exist for specific use cases.
|
126 |
+
|
127 |
+
## Ethical Considerations
|
128 |
+
|
129 |
+
This model should be used responsibly, considering ethical implications of automated customer service. It is important to ensure that the model's advice complements human expertise and adheres to relevant customer service guidelines.
|
130 |
+
|
131 |
+
## Acknowledgments
|
132 |
+
|
133 |
+
This model was developed by Bitext and trained on infrastructure provided by Bitext.
|
134 |
+
|
135 |
+
## License
|
136 |
+
|
137 |
+
This model, "Mistral-7B-Customer-Service-v0.2," is licensed under the Apache License 2.0 by Bitext Innovations International, Inc. This open-source license allows for free use, modification, and distribution of the model but requires that proper credit be given to Bitext.
|
138 |
+
|
139 |
+
### Key Points of the Apache 2.0 License
|
140 |
+
|
141 |
+
- **Permissibility**: Users are allowed to use, modify, and distribute this software freely.
|
142 |
+
- **Attribution**: You must provide proper credit to Bitext Innovations International, Inc. when using this model, in accordance with the original copyright notices and the license.
|
143 |
+
- **Patent Grant**: The license includes a grant of patent rights from the contributors of the model.
|
144 |
+
- **No Warranty**: The model is provided "as is" without warranties of any kind.
|
145 |
+
|
146 |
+
You may view the full license text at [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
147 |
+
|
148 |
+
This licensing ensures the model can be used widely and freely while respecting the intellectual contributions of Bitext. For more detailed information or specific legal questions about using this license, please refer to the official license documentation linked above.
|
149 |
|
150 |
[<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
|
151 |
+
|
152 |
<details><summary>See axolotl config</summary>
|
153 |
|
154 |
axolotl version: `0.4.0`
|
155 |
+
|
156 |
```yaml
|
157 |
base_model: mistralai/Mistral-7B-Instruct-v0.2
|
158 |
model_type: MistralForCausalLM
|
|
|
168 |
datasets:
|
169 |
- path: bitext/Bitext-customer-support-llm-chatbot-training-dataset
|
170 |
type:
|
171 |
+
system_prompt: 'You are an expert in customer support.'
|
172 |
field_instruction: instruction
|
173 |
field_output: response
|
174 |
+
format: '[INST] {instruction} [/INST]'
|
175 |
+
no_input_format: '[INST] {instruction} [/INST]'
|
176 |
+
|
177 |
#datasets:
|
178 |
# - path: json
|
179 |
# type: alpaca_w_system.load_open_orca
|
|
|
248 |
fsdp:
|
249 |
fsdp_config:
|
250 |
special_tokens:
|
251 |
+
bos_token: '<s>'
|
252 |
+
eos_token: '</s>'
|
253 |
+
unk_token: '<unk>'
|
254 |
```
|
255 |
|
256 |
</details><br>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|