Getting Error in RASA Skills

Hi I have integrate the already trained model in deeppalov, but getting the below shared error.
/lib/python3.6/asyncio/tasks.py", line 516, in ensure_future
raise ValueError(‘loop argument must agree with Future’)
ValueError: loop argument must agree with Future

I used the code like this.

from deeppavlov.skills.rasa_skill import RASASkill

rasa_skill_config = {
‘path_to_models’: ‘/home/mikle/Documents/wemate12/models’,
}
rasa_skill = RASASkill(**rasa_skill_config)

states_batch = None
for utterance in [“Hello”, “How are you”]:
responses_batch, confidences_batch, states_batch = rasa_skill([utterance], states_batch)
print(responses_batch[0])

Please help in this problem.

It seems that the problem is caused by the asyncio loop.
Do you use another asyncronous code (do you use asyncio in your code)?
Could you specify which version of deeppavlov do you use?

Hi,

Thank you for your prompt reply.

I am not using any other asynchronous code. Version 0.7.1 i am using.

The only code i am using is:-

from deeppavlov.skills.rasa_skill import RASASkill

rasa_skill_config = {
    'path_to_models': <put the path to your Rasa models>,
}

rasa_skill = RASASkill(**rasa_skill_config)

states_batch = None
for utterance in ["Hello", "Hello to the same user_id"]:
    responses_batch, confidences_batch, states_batch = rasa_skill([utterance], states_batch)
    print(responses_batch[0])

Error i am getting is:-

File “”, line 2, in
responses_batch, confidences_batch, states_batch = rasa_skill([utterance], states_batch)

File “/home/mikil/anaconda3/envs/mikil_virtual_env/lib/python3.6/site-packages/deeppavlov/skills/rasa_skill/rasa_skill.py”, line 100, in call
results = self.ioloop.run_until_complete(asyncio.gather(*futures))

File “uvloop/loop.pyx”, line 1428, in uvloop.loop.Loop.run_until_complete

File “/home/mikil/anaconda3/envs/mikil_virtual_env/lib/python3.6/asyncio/tasks.py”, line 516, in ensure_future
raise ValueError(‘loop argument must agree with Future’)

ValueError: loop argument must agree with Future

Please help to resolve this.

Hi Team,

Could you please help me to resolve this issue?

Thanks

Hi, Sachin!

I’m trying to reproduce your bug. Could also provide information about your RASA components versions?
Could you also provide information about your RASA project? Is it custom project?

Could you run the code below (assure that during interact mode you can send replies and no errors occur):
python -m deeppavlov install deeppavlov/configs/skills/rasa_skill.json
python -m deeppavlov interact deeppavlov/configs/skills/rasa_skill.json

Is it working for you versions?

Hi,

I am not using custom version of rasa it is just starting project.

Rasa Version is - 1.5.1

Commands below are not working on my system.

python -m deeppavlov install deeppavlov/configs/skills/rasa_skill.json

python -m deeppavlov interact deeppavlov/configs/skills/rasa_skill.json

Error while using install command:-

with open(fpath, encoding=‘utf8’) as fin:
FileNotFoundError: [Errno 2] No such file or directory: ‘deeppavlov/configs/skills/rasa_skill.json’

Im afraid you may need to use specific version of RASA (1.2.7 according to requirements: https://github.com/deepmipt/DeepPavlov/blob/master/deeppavlov/requirements/rasa_skill.txt)

Please try to download this file:

And then try again commands

python -m deeppavlov install rasa_skill.json 
python -m deeppavlov interact rasa_skill.json 

(just assure to provide rasa_skill.json from the link above. The first command will try to install supported version of RASA, the second will try to launch RASA skiull in interaction mode when you are able to send utterances and to see the replies of the skill).

Unfortunately RASA’s code was less stable than we expected, so we support only the version 1.2.7 right now (we use a fork with minor modifications to be precise).

Hi,

I have done all as you said, change the rasa version, downlaod rasa_skill.json file run both the commands.

I am getting this response while running

python -m deeppavlov interact rasa_skill.json

Response :- utterances::spare part price

(‘’, 0.989349109368959)
utterances::

I am unable to understand how do i ge the response in intent , entity etc format and how to integrate this with chatbot.

Please guide.

As I know, the skill in rasa_skill.json responds only for greeting utterances, so you need to look into the content of {DOWNLOADS_PATH}/rasa_tutorial_project (this is basic rasa project created with rasa init command) and modify it to add your intents and other things.

You may also try to create your own config and specify your RASA project (/home/mikle/Documents/wemate12/models) within config:

{
  "chainer": {
    "in": [
      "utterances"
    ],
    "out": [
      "responses_batch",
      "confidences_batch"
    ],
    "pipe": [
      {
        "class_name": "rasa_skill",
        "path_to_models": "/home/mikle/Documents/wemate12/models",
        "in": [
          "utterances"
        ],
        "out": [
          "responses_batch",
          "confidences_batch",
          "output_states_batch"
        ]
      }
    ]
  },
  "metadata": {    
    "requirements": [
      "{DEEPPAVLOV_PATH}/requirements/rasa_skill.txt",
      "{DEEPPAVLOV_PATH}/requirements/tf.txt"
    ]
    
  }
}

Let’s assume you named this config myconfig.json
And then try
python -m deeppavlov interact myconfig.json

Does it work?

Hi,

Below is my config file which i placed in root directory of project.

{
“chainer”: {
“in”: [
“utterances”
],
“out”: [
“responses_batch”,
“confidences_batch”
],
“pipe”: [
{
“class_name”: “rasa_skill”,
“path_to_models”: “/home/nomac/Documents/mybotproject/models”,
“in”: [
“utterances”
],
“out”: [
“responses_batch”,
“confidences_batch”,
“output_states_batch”
]
}
]
},
“metadata”: {
“variables”: {
“ROOT_PATH”: “~/.deeppavlov”,
“DOWNLOADS_PATH”: “/home/nomac/Documents/mybotproject/”,
“MODELS_PATH”: “/home/nomac/Documents/mybotproject/models”,
“PROJECT_ROOT”: “/home/nomac/Documents/mybotproject”
},
“requirements”: [
“{DEEPPAVLOV_PATH}/requirements/rasa_skill.txt”,
“{DEEPPAVLOV_PATH}/requirements/tf.txt”
],
“download”: [
{
“url”: “http://filesaaa.dqqeeppavlov.ai/rasa_skill/rasa_tutorial_project.tar.gz”,
“subdir”: “{DOWNLOADS_PATH}”
}
]
}
}

Do i need to change any thing else in this project to get the response in intent and entity format.

This is the updated one. Please look into this.

{
“chainer”: {
“in”: [
“utterances”
],
“out”: [
“responses_batch”,
“confidences_batch”
],
“pipe”: [
{
“class_name”: “rasa_skill”,
“path_to_models”: “/home/nomac/Documents/mybotproject/models”,
“in”: [
“utterances”
],
“out”: [
“responses_batch”,
“confidences_batch”,
“output_states_batch”
]
}
]
},
“metadata”: {
“variables”: {
“ROOT_PATH”: “~/.deeppavlov”,
“DOWNLOADS_PATH”: “/home/nomac/Documents/mybotproject/”,
“MODELS_PATH”: “/home/nomac/Documents/mybotproject/models”,
“PROJECT_ROOT”: “/home/nomac/Documents/mybotproject”
},
“requirements”: [
“/home/nomac/anaconda3/envs/nomac_virtual_env/lib/python3.6/site-packages/deeppavlov/requirements/rasa_skill.txt”,
“/home/nomac/anaconda3/envs/nomac_virtual_env/lib/python3.6/site-packages/deeppavlov/requirements/tf.txt”
],
“download”: [
{
“url”: “http://filesaaa.dqqeeppavlov.ai/rasa_skill/rasa_tutorial_project.tar.gz”,
“subdir”: “{DOWNLOADS_PATH}”
}
]
}
}

What do you mean under the “intent and entity format”?

Your config is ok, but i recommend to delete download section (as far as you don’t need to download remote model) as I wrote in the snippet for you above. As well variables section of the config is not required in your case. The only thibng you need to customize is the path_to_models (which should configure the place of the RASA model).

Ok i understand your point. But still i didn’t understand how deeppavlov library helps me with my Rasa model. Where it needs to integrate.

Hi Sir, Can you please help me understanding how i wil integrate deeppavlov in existing rasa project. how it will help me. what would be the impact of integrating deeppavlov in my rasa project. Dose it improve accuracy of existing rasa model.

I still did not clear where to integrate deeppavlov in my rasa project, how to run combines project. How i will get the rasa like response(intent , entity and confidence values…) post integrating deeppavlov.

Please help, i am curious to integrate deeppavlov in rasa project.

Thanks.