Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
---
|
| 2 |
-
base_model:
|
|
|
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
license: apache-2.0
|
|
@@ -9,14 +10,131 @@ tags:
|
|
| 9 |
- unsloth
|
| 10 |
- llama
|
| 11 |
- trl
|
|
|
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
|
| 16 |
-
|
| 17 |
-
- **License:** apache-2.0
|
| 18 |
-
- **Finetuned from model :** rasa-calm-demo-finetuning-tanja
|
| 19 |
|
| 20 |
-
This
|
|
|
|
| 21 |
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model:
|
| 3 |
+
- codellama/CodeLlama-13b-Instruct-hf
|
| 4 |
language:
|
| 5 |
- en
|
| 6 |
license: apache-2.0
|
|
|
|
| 10 |
- unsloth
|
| 11 |
- llama
|
| 12 |
- trl
|
| 13 |
+
datasets:
|
| 14 |
+
- rasa/command-generation-calm-demo-v1
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
---
|
| 17 |
|
| 18 |
+
# Model Card for Command Generator
|
| 19 |
|
| 20 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
This is a Dialogue Understanding (DU) model developed by Rasa.
|
| 23 |
+
It can be used to power assistants built with the [Conversational AI with Language Models (CALM) approach](https://rasa.com/docs/rasa-pro/calm) developed by Rasa.
|
| 24 |
|
| 25 |
+
## Model Details
|
| 26 |
+
|
| 27 |
+
### Model Description
|
| 28 |
+
|
| 29 |
+
<!-- Provide a longer summary of what this model is. -->
|
| 30 |
+
This model takes as input a transcript of an ongoing conversation between an AI assistant and a user,
|
| 31 |
+
as well as structured information about the assistant's business logic.
|
| 32 |
+
As output, it produces a short sequence of [commands](https://rasa.com/docs/rasa-pro/concepts/dialogue-understanding#command-reference)
|
| 33 |
+
(typically 1-3) from the following list:
|
| 34 |
+
|
| 35 |
+
* `StartFlow(flow_name)`
|
| 36 |
+
* `SetSlot(slot_name, slot_value)`
|
| 37 |
+
* `CorrectSlot(slot_name, slot_value)`
|
| 38 |
+
* `Clarify(flow_name_1, flow_name_2, ...)`
|
| 39 |
+
* `ChitChat`
|
| 40 |
+
* `KnowledgeAnswer`
|
| 41 |
+
* `HumanHandoff`
|
| 42 |
+
* `Error`
|
| 43 |
+
|
| 44 |
+
Note that this model can only produce commands to be interpreted by Rasa.
|
| 45 |
+
It **cannot** be used to generate arbitrary text.
|
| 46 |
+
|
| 47 |
+
The Command Generator translates user messages into this internal grammar, allowing CALM to progress the conversation.
|
| 48 |
+
|
| 49 |
+
Examples:
|
| 50 |
+
|
| 51 |
+
> I want to transfer money
|
| 52 |
+
|
| 53 |
+
`StartFlow(transfer_money)`
|
| 54 |
+
|
| 55 |
+
> I want to transfer $55 to John
|
| 56 |
+
|
| 57 |
+
`StartFlow(transfer_money), SetSlot(recipient, John), SetSlot(amount, 55)`
|
| 58 |
+
|
| 59 |
+
- **Developed by:** Rasa Technologies
|
| 60 |
+
- **Model type:** Text Generation
|
| 61 |
+
- **Language(s) (NLP):** English
|
| 62 |
+
- **License:** Proprietary
|
| 63 |
+
- **Finetuned from model [optional]:** [CodeLlama 13b Instruct](https://huggingface.co/codellama/CodeLlama-7b-Instruct-hf)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
## Uses
|
| 67 |
+
|
| 68 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 69 |
+
|
| 70 |
+
The Command Generator is used as part of an AI assistant developed with Rasa's CALM paradigm.
|
| 71 |
+
Typical use cases include customer-facing chatbots, voice assistants, IVR systems, and internal chatbots in large organizations.
|
| 72 |
+
|
| 73 |
+
### Direct Use
|
| 74 |
+
|
| 75 |
+
This model can be directly used as part of the command generator component if the flows of your CALM assistant are similar to flows used in the [rasa-calm-demo assistant](https://github.com/RasaHQ/rasa-calm-demo).
|
| 76 |
+
|
| 77 |
+
### Downstream Use [optional]
|
| 78 |
+
|
| 79 |
+
The model can also be used as a base model to fine-tune further on your own assistant's data using the [fine-tuning recipe feature](https://rasa.com/docs/rasa-pro/building-assistants/fine-tuning-recipe#step-2-prepare-the-fine-tuning-dataset) available in rasa pro
|
| 80 |
+
|
| 81 |
+
### Out-of-Scope Use
|
| 82 |
+
|
| 83 |
+
Since the model has been explicitly fine-tuned to output the grammar of commands, it shouldn't be used to generate any other free form content.
|
| 84 |
+
|
| 85 |
+
## Bias, Risks, and Limitations
|
| 86 |
+
|
| 87 |
+
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 88 |
+
|
| 89 |
+
The Command Generator interprets conversations and translates user messages into commands.
|
| 90 |
+
These commands are processed by Rasa to advance the conversations.
|
| 91 |
+
This model does not generate text to be sent to and end user, and is incapable of generating problematic
|
| 92 |
+
or harmful text.
|
| 93 |
+
|
| 94 |
+
However, as with any pre-trained model, its predictions are susceptible to bias.
|
| 95 |
+
For example, the accuracy of the model varies with the language used. The authors have tested the performance on English but haven't tried the model in any other language.
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
## Training Details
|
| 99 |
+
|
| 100 |
+
### Training Data
|
| 101 |
+
|
| 102 |
+
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
| 103 |
+
|
| 104 |
+
Trained on the `train` split of [rasa/command-generation-calm-demo-v1](https://huggingface.co/datasets/rasa/command-generation-calm-demo-v1).
|
| 105 |
+
|
| 106 |
+
### Training Procedure
|
| 107 |
+
|
| 108 |
+
Trained using the notebook available [here](https://github.com/RasaHQ/notebooks/blob/main/cmd_gen_finetuning.ipynb). Used a single A100 GPU with 80GB VRAM.
|
| 109 |
+
|
| 110 |
+
## Evaluation
|
| 111 |
+
|
| 112 |
+
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 113 |
+
|
| 114 |
+
### Testing Data, Factors & Metrics
|
| 115 |
+
|
| 116 |
+
#### Testing Data
|
| 117 |
+
|
| 118 |
+
Evaluated on the `test` split of [rasa/command-generation-calm-demo-v1](https://huggingface.co/datasets/rasa/command-generation-calm-demo-v1).
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
#### Metrics
|
| 122 |
+
|
| 123 |
+
F1 score per command type (StartFlow, SetSlot, etc.) is the main metric chosen to evaluate the model on the test split.
|
| 124 |
+
This helps us understand which commands the model has learnt well and the ones that the model needs more training on.
|
| 125 |
+
|
| 126 |
+
### Results
|
| 127 |
+
|
| 128 |
+
The below table shows the F1 score per command for this model.
|
| 129 |
+
|
| 130 |
+
| Model | StartFlow | SetSlot | Cancel | Clarify | Chitchat | SearchAndReply | SkipQuestion |
|
| 131 |
+
|--------------------------------------|-----------|---------|--------|---------|----------|----------------|--------------|
|
| 132 |
+
| rasa/cmd_gen_codellama_13b_calm_demo | 0.9722 | 0.9239 | 0.6667 | 0.8889 | 1 | 0 | 0.8 |
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
## Model Card Contact
|
| 139 |
+
|
| 140 |
+
[More Information Needed]
|