You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,10 @@ A toy chatbot powered by deep learning and trained on data from Reddit.
4
4
Here is a sample chat transcript (not cherry-picked). Lines that start with ">" are me; the lines without ">" are the chatbot's responses.
5
5
6
6
```
7
+
$ python chatbot.py
8
+
Creating model...
9
+
Restoring weights...
10
+
7
11
> Hi, how are you?
8
12
It's all good, I'm going to bed now but I'll see if I can get home tomorrow. I'll get back to you.
9
13
> Don't go to bed just yet
@@ -46,6 +50,29 @@ Try playing around with the arguments to `chatbot.py` to obtain better samples:
46
50
47
51
-**relevance**: Two models are run in parallel: the primary model and the mask model. The mask model is scaled by the relevance value, and then the probabilities of the primary model are multiplied by the complement of the mask model before sampling. The state of the mask model is reset upon each newline character. The net effect is that the model is encouraged to choose a line of dialogue that is most relevant to the prior line of dialogue, even if a more generic response (e.g. "I don't know anything about that") may be more absolutely probable. Lower relevance values put more pressure on the model to produce relevant responses, at the cost of the coherence of the responses. Going much below 1.5 compromises the quality of the responses; 2-3 is the recommended range. Setting it to a negative value disables relevance, and this is the default, because I'm not confident that it qualitatively improves the outputs and it halves the speed of sampling.
48
52
53
+
These values can also be manipulated during a chat, and the model state can be reset, without restarting the chatbot:
54
+
55
+
```
56
+
$ python chatbot.py
57
+
Creating model...
58
+
Restoring weights...
59
+
60
+
> --temperature 1.3
61
+
[Temperature set to 1.3]
62
+
63
+
> --relevance 2
64
+
[Relevance set to 2.0]
65
+
66
+
> --relevance -1
67
+
[Relevance disabled]
68
+
69
+
> --beam_width 5
70
+
[Beam width set to 5]
71
+
72
+
> --reset
73
+
[Model state reset]
74
+
```
75
+
49
76
### Get training data
50
77
51
78
If you'd like to train your own model, you'll need training data. There are a few options here.
0 commit comments