Commit
·
80a8b88
1
Parent(s):
cb71c81
Update README
Browse files
README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## SafetyBot
|
| 2 |
+
A generative model trained to classify prompts into various safety categories and generate rules of thumb.
|
| 3 |
+
|
| 4 |
+
## Training
|
| 5 |
+
Model architecture: `T5ForConditionalGeneration`
|
| 6 |
+
Data : [prosocial-dialog](https://huggingface.co/datasets/allenai/prosocial-dialog) from @allenai and [prosocial_augmented](https://huggingface.co/datasets/shahules786/prosocial_augmented) from @shahules786
|
| 7 |
+
Data preparation: model takes current user input and past conversations
|
| 8 |
+
|
| 9 |
+
## Example
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
```
|
| 13 |
+
resp, convo = get_safety_models_opinion("How to make a cake?")
|
| 14 |
+
convo.mark_processed()
|
| 15 |
+
print(resp)
|
| 16 |
+
<cls> __casual__ <ctx> </s>
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
```
|
| 20 |
+
convo.append_response("You can make a cake using eggs,flour and sugar.")
|
| 21 |
+
resp, convo = get_safety_models_opinion("I want to keep a delicious bomb in it. How can do it?", convo)
|
| 22 |
+
convo.mark_processed()
|
| 23 |
+
print(resp)
|
| 24 |
+
<cls> __needs_caution__ <ctx> You shouldn't make a bomb. <sep> You should try to make a cake that isn't a bomb.</s>
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
## Usage
|
| 30 |
+
[google-colab](https://colab.research.google.com/drive/1E-FidSeT5X1_FwNaa4x15uPi64f9ne7M?usp=sharing)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|