File size: 3,858 Bytes
5f3c3ed
 
 
383abaa
5f3c3ed
 
383abaa
894d418
383abaa
 
 
894d418
383abaa
 
 
 
 
894d418
9fece47
894d418
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99213ed
894d418
99213ed
894d418
99213ed
894d418
99213ed
894d418
99213ed
894d418
99213ed
894d418
99213ed
894d418
99213ed
894d418
99213ed
894d418
99213ed
894d418
99213ed
894d418
 
 
 
 
 
 
 
 
 
 
 
383abaa
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
---
language:
- en
license: apache-2.0
---

# LLM user flow classification 

This model identifies common events and patterns within the conversation flow. 
Such events include, for example, complaint, when a user expresses dissatisfaction.
The flow labels can serve as foundational elements for sophisticated LLM analytics.

It is ONNX quantized and is a fined-tune of [MiniLMv2-L6-H384](https://huggingface.co/nreimers/MiniLMv2-L6-H384-distilled-from-RoBERTa-Large).
The base model can be found [here](https://huggingface.co/minuva/MiniLMv2-agentflow-v2)

This model is used *only* for the user texts. 
For the LLM texts in the dialog use this [agent model](https://huggingface.co/minuva/MiniLMv2-agentflow-v2). 


# Load the Model

```py
from transformers import pipeline

pipe = pipeline(model='minuva/MiniLMv2-userflow-v2', task='text-classification')
pipe("This is wrong")
# [{'label': 'model_wrong_or_try_again', 'score': 0.9729849100112915}] 
```
# Categories Explanation

<details>
  <summary>Click to expand!</summary>
  
  - OTHER: Responses that do not fit into any predefined categories or are outside the scope of the specific interaction types listed.

  - agrees_praising_thanking: When the user agrees with the provided information, offers praise, or expresses gratitude.

  - asks_source: The user requests the source of the information or the basis for the answer provided.

  - continue: Indicates a prompt for the conversation to proceed or continue without a specific directional change.

   - continue_or_finnish_code: Signals either to continue with the current line of discussion or code execution, or to conclude it.

  - improve_or_modify_answer: The user requests an improvement or modification to the provided answer.

  -  lack_of_understandment: Reflects the user's or agent confusion or lack of understanding regarding the information provided.

   - model_wrong_or_try_again: Indicates that the model's response was incorrect or unsatisfactory, suggesting a need to attempt another answer.

   - more_listing_or_expand: The user requests further elaboration, expansion from the given list by the agent.

   - repeat_answers_or_question: The need to reiterate a previous answer or question.

  - request_example: The user asks for examples to better understand the concept or answer provided.

  - user_complains_repetition: The user notes that the information or responses are repetitive, indicating a need for new or different content.

  - user_doubts_answer: The user expresses skepticism or doubt regarding the accuracy or validity of the provided answer.

  - user_goodbye: The user says goodbye to the agent.

  - user_reminds_question: The user reiterates the question.

  - user_wants_agent_to_answer: The user explicitly requests a response from the agent, when the agent refuses to do so.

  - user_wants_explanation: The user seeks an explanation behind the information or answer provided.

  - user_wants_more_detail: Indicates the user's desire for more comprehensive or detailed information on the topic.

  - user_wants_shorter_longer_answer: The user requests that the answer be condensed or expanded to better meet their informational needs.

  - user_wants_simplier_explanation: The user seeks a simpler, more easily understood explanation.

  - user_wants_yes_or_no: The user is asking for a straightforward affirmative or negative answer, without additional detail or explanation.
</details>

<br>


# Metrics in our private test dataset
| Model (params)    |    Loss      |    Accuracy |  F1 |
|--------------------|-------------|----------|--------| 
| minuva/MiniLMv2-userflow-v2 (33M) |   0.6738 | 0.7236 | 0.7313 |

# Deployment

Check our [llm-flow-classification repository](https://github.com/minuva/llm-flow-classification) for a FastAPI and ONNX based server to deploy this model on CPU devices.