Embedding Policy Results - Rasa Open Source - Rasa Community Forum

👋 Introducing the Rasa Playground

Embedding Policy Results

post by amn41 on Nov 29, 2018

Hi Everyone!

Our new paper about the embedding policy (aka REDP) is now available: [1811.11707] Few-Shot Generalization Across Dialogue Tasks - we’ll present it at the NeurIPS conversational AI workshop next week.

There’s a blog post here that explains what the paper is about, and why it matters to Rasa developers. Let me know what you think!

Have you been using the Embedding Policy? We’d love to hear about your results, so let’s start a thread here.

post by ncoco on Dec 6, 2018

This policy looks very promising

I tried to train my model, but it needs some serious processing power to even finish one epoch. Is this expected?

I am using the same hyperparams as in you paper.

post by datistiquo on Dec 19, 2018

For the new Embedding you need to train stories with those chitchats and corrections. So, where is now the advantage/improvement compared to normal LSTM? Is it that you need way less stories to write such uncooperative stories, because attention layer learns not to pay attention to this part and will generalize to stories not trained?

post by asokolow on Dec 20, 2018

Hi! Great feature …

Did you benchmark the training time? I’m currently training a model by using this policy on a GTX 1080ti (12go) + 32Go ram + 32 core CPU and each epoch takes about ~10 min …

I’m using :

policies:
  - name: EmbeddingPolicy
    epochs: 2000
    attn_shift_range: 5

EDIT: I’ll answer my own question: the EmbeddingPolicy should be used with --augmentation 0

post by amn41 on Dec 20, 2018

yes that’s a good description the point of the policy is that it can learn to re-use those patterns from just a few examples

post by amn41 on Dec 20, 2018

yes! the attention mechanisms definitely require more computer power to train. You can also switch off one (or both) of the attentions to swap a bit of generalization power for compute time

post by azizullah2017 on Dec 31, 2018

@amn41 its computation is much greater than normal LSTM, and we have to write the same incooperative stories. I do not get it less number of stories.

What its advantages to use it? It has the same result in my case.

LSTM 300 epochs Embedding 2000 epochs.

post by adrianhumphrey111 on Jan 6, 2019

Is this supposed to take 30 minutes to train on 2000 epochs??

post by azizullah2017 on Jan 7, 2019

@adrianhumphrey111 has already given the answer. the EmbeddingPolicy should be used with --augmentation 0 --augmentation 0 add this in your command while training

post by adrianhumphrey111 on Jan 7, 2019

can you please give me an example for both command line and the python file way of doing that?

post by azizullah2017 on Jan 7, 2019


python -m rasa_core.train -s data/stories.md -d domain.yml -o models/dialogue  -c policy.yml --augmentation 0

post by adrianhumphrey111 on Jan 7, 2019

Running this causes this output:

/usr/local/lib/python3.6/site-packages/pykwalify/core.py:99: UnsafeLoaderWarning: The default ‘Loader’ for ‘load(stream)’ without further arguments can be unsafe. Use ‘load(stream, Loader=ruamel.yaml.Loader)’ explicitly if that is OK. Alternatively include the following in your code:

  import warnings
  warnings.simplefilter('ignore', ruamel.yaml.error.UnsafeLoaderWarning)

In most other cases you should consider using 'safe_load(stream)' data = yaml.load(stream) Processed Story Blocks: 100%|██████████████████████████████████████████████████████████████████████████████| 26/26 [00:00<00:00, 2419.24it/s, # trackers=16] 2019-01-07 08:22:41 INFO rasa_core.agent - Model directory models/dialogue/ exists and contains old model files. All files will be overwritten. 2019-01-07 08:22:41 INFO rasa_core.agent - Persisted model to '/app/kiddiecommute 2/models/dialogue'


I do not see it going over any epochs. Inside of my models/dialogue folder, I only have the files:

domain.json domain.yml policy_metadata.json


I do not see any models, or policy files

## post by azizullah2017 on Jan 7, 2019

create a file policy.yml

```yaml

policies:
  - name: EmbeddingPolicy
    epochs: 2000
    attn_shift_range: 5

paste this.

post by adrianhumphrey111 on Jan 7, 2019

That is exactly what I have already, could I see what the output would look like?

post by sibbsnb on Jul 8, 2019

Did any one see improvements by using this?

post by tuanvuvo on Jul 19, 2019

I think just more as more data training.