File size: 4,716 Bytes
aaa738e
5511e5e
 
2c1958c
 
 
 
 
 
 
aaa738e
5511e5e
2c1958c
5511e5e
2c1958c
 
29b62b7
5511e5e
2c1958c
5511e5e
2c1958c
5511e5e
2c1958c
5511e5e
2c1958c
5511e5e
2c1958c
5511e5e
2c1958c
5511e5e
2c1958c
5511e5e
2c1958c
 
 
 
5511e5e
2c1958c
5511e5e
2c1958c
5511e5e
2c1958c
5511e5e
2c1958c
 
5511e5e
2c1958c
5511e5e
5a0292b
 
 
 
2c1958c
5511e5e
2c1958c
5511e5e
2c1958c
 
 
 
5511e5e
2c1958c
5511e5e
2c1958c
5511e5e
2c1958c
5511e5e
2c1958c
 
5511e5e
2c1958c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5511e5e
 
 
2c1958c
 
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
---
library_name: peft
base_model: mistralai/Mistral-7B-v0.1
license: apache-2.0
datasets:
- bitext/Bitext-customer-support-llm-chatbot-training-dataset
language:
- en
tags:
- text-generation-inference
---

# Description

This LoRA adapter was fine-tuned on the `bitext/Bitext-customer-support-llm-chatbot-training-dataset`, specifically by:
1. Grouping the data on the following `category` column values: `PAYMENT`, `INVOICE`, `REFUND`
2. Merging `intent` and `response` columns into a new single column called `response_json` that is a JSON object consisting of two keys: `intent` and `response`.

This is what the dataset looks like once it is preprared:

<img src="./payments_dataset.png" alt="drawing" width="1500"/>

It also has the following token distribution (without the prompt template being merged into the input)

<img src="./token_distribution.png" alt="drawing" width="400"/>

# How To Use This Model

## Prompt Template

This adapter was instruction tuned using the following prompt template:

```text
You are a support agent for a company and you receive requests from customers.
Your job is to reply to the customer by providing both the intent, which you
should determine from the customer's request, as well as an appropriate response.

Please note that the intent can only be one of the following: check_payment_methods, get_invoice, check_refund_policy, track_refund, payment_issue, check_invoice, get_refund.

Please package your reply in the JSON format.

Request: {instruction}

Reply:
```

At inference time, just replace/insert `{instruction}` with an actual instruction.

## Fine-Tuning

This adapter was fine-tuned using Predibase. You can sign up for a free trial and follow along using this notebook to reproduce this adapter: https://colab.research.google.com/drive/1Zzkrr40NRylUnq-pztaypVOoDPS2s9Vr

## Example Input and Output

Input:

```
You are a support agent for a company and you receive requests from customers.
Your job is to reply to the customer by providing both the intent, which you
should determine from the customer's request, as well as an appropriate response.

Please note that the intent can only be one of the following: check_payment_methods, get_invoice, check_refund_policy, track_refund, payment_issue, check_invoice, get_refund.

Please package your reply in the JSON format.

Request: can you help me check in which cases can I ask for refunds?

Reply:
```

Output (rendered using pprint, but is a proper JSON with full key-value pairs):
```python
{'intent': 'check_refund_policy',
 'response': "I'll do my best! I completely understand your need to have a "
             'clear understanding of the situations in which you can request a '
             'refund. Let me provide you with a comprehensive breakdown:\n'
             '\n'
             '1. **Product/Service Defect:** If the product or service you '
             "purchased has a defect or doesn't meet the description, you are "
             'typically eligible for a refund.\n'
             '2. **Cancellation within Grace Period:** Should you change your '
             'mind and decide to cancel your purchase within the specified '
             'grace period, you should be able to receive a refund.\n'
             '3. **Unauthorized Charges:** If you notice any charges on your '
             "account that you didn't authorize or recognize, we will "
             'investigate the matter and assist you in obtaining a refund.\n'
             '4. **Event Cancellation:** If you purchased tickets for an event '
             'that gets canceled without a rescheduled date, you would usually '
             'be entitled to a refund.\n'
             '5. **Duplicate Charges:** If you have been charged multiple '
             'times for the same item, please inform us, and we will rectify '
             'the situation promptly.\n'
             "6. **Non-receipt of Goods:** If you haven't received your "
             'ordered product within the expected timeframe, you may qualify '
             'for a refund.\n'
             '\n'
             'Please keep in mind that refund policies may vary depending on '
             "the vendor or service provider. It's always a good idea to "
             'review their terms and conditions or contact them directly for '
             'more specific information. If you have any specific concerns or '
             'need assistance with a particular order, please provide me with '
             "the necessary details, such as the order number, and I'll be "
             'glad to assist you further.\n'
             '\n'
             'Is there anything else I can help you with today?'}
```

### Framework versions

- PEFT 0.8.2
- Ludwig 0.10.2