agent = Agent(‘domain.yml’, policies=[MemoizationPolicy(max_history=4), EmbeddingPolicy()]
I am unable to use --config config,.yml
- name: "KerasPolicy"
featurizer:
- name: MaxHistoryTrackerFeaturizer
max_history: 5
state_featurizer:
- name: BinarySingleStateFeaturizer
- name: "MemoizationPolicy"
max_history: 5
- name: "FallbackPolicy"
nlu_threshold: 0.4
core_threshold: 0.3
fallback_action_name: "my_fallback_action"
- name: "path.to.your.policy.class"
arg1: "..."
Do I have to write custom code to implent this ?
I can find this ?
what are the other types of polices ??
Is there any help ?
smn-snkl
(Simon)
December 11, 2018, 3:43pm
2
Hi @azizullah2017 ,
there’s a brief demo of the policy available on GitHub here
If, in the meantime, you already managed to implement it on your own, please feel free to share your version of it
@smn-snkl thanks for reply.
policy:
- name: EmbeddingPolicy
epochs: 2000
attn_shift_range: 5
- name: FormPolicy
but i do not get the desired result from this.
policies:
- name: EmbeddingPolicy
epochs: 40
state_featurizer: LabelTokenizerSingleStateFeaturizer
- name: KerasPolicy
featurizer:
- name: MaxHistoryTrackerFeaturizer
max_history: 10
state_featurizer:
- name: BinarySingleStateFeaturizer
epochs: 200
- name: FormPolicy
smn-snkl
(Simon)
December 13, 2018, 9:47am
4
@azizullah2017 this has worked for me in the past:
policies:
- name: "EmbeddingPolicy"
epochs: 1000
attn_shift_range: 3
featurizer:
- name: FullDialogueTrackerFeaturizer
state_featurizer:
- name: LabelTokenizerSingleStateFeaturizer
2000 is too much, it will take alot of time for training.
smn-snkl
(Simon)
December 13, 2018, 3:56pm
6
@azizullah2017 Forgot one important detail. You should set augmentation to 0 for training an embedding policy! Just takes a few seconds for me then.
Follow this thread for (hopefully) more updates on this
@smn-snkl thanks now it takes much less time, can you to tell me, any advantages of this, Because i get the same results from both policies. the embadding and the keras
smn-snkl
(Simon)
December 31, 2018, 4:03pm
8
There’s a blog post about it here: Attention, Dialogue, and Learning Reusable Patterns
It doesn’t necessarily outperform keras. You could use the evaluation functionality to test which set of policies perform best. Always a good idea to “cross-validate” your policies as well, since there’s no optimal solution for how you should set all the hyperparameters.
imadcat
(Imadcat)
January 21, 2019, 5:23am
9
Could you get FormPolicy to work with EmbeddingPolicy? I couldn’t.
It will raise an error
ruamel.yaml.scanner.ScannerError: mapping values are not allowed in this context
But when I put FormPolicy and KerasPolicy together, it trains without error.
smn-snkl
(Simon)
January 29, 2019, 2:59pm
10
@imadcat : It seems you have a syntax error in your config. Can you run it through a YAML validator?
juven
(Juven Zhang)
June 14, 2019, 2:07pm
11
I wonder how to set epochs?what rules or reference?