标签: rasa-core

Rasa核心与Rasa nlu之间的区别

我试图从Rasa核心Rasa nlu的官方文档中了解rasa 但不能推断太多.我能理解的是

Rasa核心用于指导对话流,而Rasa nlu是理解并处理文本以提取信息(实体)

第二件事,有一些例子可以在Rasa核心中构建chatbot 以及Rasa nlu都可以用来构建chatbot但是无法理解两种方法的区别以及何时关注哪一种.

能帮助我更好地理解你吗?

nlp artificial-intelligence chatbot rasa-nlu rasa-core

21
推荐指数
2
解决办法
4975
查看次数

ModuleNotFoundError:没有名为'gevent.wsgi'的模块

运行flask应用程序时出现以下错误:

来自gevent.wsgi导入WSGIServer
ModuleNotFoundError:没有名为'gevent.wsgi'的模块

gevent已经安装并且满足要求.

Pip版本是10.11和Python 3.6.
操作系统:Windows 10 x64
使用Anaconda VM

这个相同的代码在另一台机器上工作,所以某处我缺少配置,但我无法跟踪/找到它.

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import logging
import json
from pprint import pprint
from rasa_core.channels import HttpInputChannel
from rasa_core import utils
from rasa_core.agent import Agent
from rasa_core.interpreter import RasaNLUInterpreter
from rasa_core.channels.channel import UserMessage
from rasa_core.channels.direct import CollectingOutputChannel
from rasa_core.channels.rest import HttpInputComponent
from flask import Blueprint, request, jsonify, abort    
def run(serve_forever=True):
#path to your NLU model …
Run Code Online (Sandbox Code Playgroud)

python wsgi gevent python-3.6 rasa-core

11
推荐指数
2
解决办法
6759
查看次数

Rasa 聊天机器人:检索对话数据

我正在尝试使用 RASA 构建一个聊天机器人。目前,我在 Ubuntu shell 上本地运行我的聊天机器人。我希望能够检索我的对话数据;从 RASA 的文档来看,这似乎是可能的,但该文档仅解决机器人在 http 服务器上运行时的情况:链接

chatbot python-3.x rasa-nlu rasa-core

5
推荐指数
1
解决办法
3926
查看次数

Rasa NLU - 理解训练数据

我很难理解 rasa nlu 中的训练数据。假设我想要获得训练数据,其中有人告知某人他们可以购买的动物。为了清楚起见,我将使用 Markdown 格式:

假设用户正在回答一个问题:

“你想买什么动物?”

表达你想买东西的方式有很多种。就看下面的例子:

##intent:inform
- [cat](animal)
- buy [cat](animal)
- I would like to buy a [cat](animal)
Run Code Online (Sandbox Code Playgroud)

我需要对我打算处理的每种动物重复此操作吗?像下面这样?

##intent:inform
- [cat](animal)
- [dog](animal)
- [parrot](animal)
- buy [cat](animal)
- buy [dog](animal)
- buy [parrot](animal)
- I would like to buy a [cat](animal)
- I would like to buy a [dog](animal)
- I would like to buy a [parrot](animal)
Run Code Online (Sandbox Code Playgroud)

另外,我注意到在 rasa 的餐厅机器人中,他们有时会一遍又一遍地重复相同的示例,有时多达七次,如下所示:

##intent:inform
- [cat](animal)
- [cat](animal)
- [cat](animal)
- [cat](animal)
- [cat](animal)
- buy …
Run Code Online (Sandbox Code Playgroud)

machine-learning rasa-nlu rasa-core

5
推荐指数
1
解决办法
1770
查看次数

TypeError:“ type”对象的描述符“ __subclasses__”在尝试导入rasa_core时需要一个参数

试图运行一个在我的本地计算机上运行得很好的程序,但是在AWS上,我得到了:TypeError:“类型”对象的描述符“ 子类 ”需要一个参数。我的pip3没有升级到最新版本,但这应该不会引起问题,因为我已经下载了最新版本的rasa_core。

尝试使用pip3 -u rasa_core重新安装rasa_core,还尝试将命令附加到sudo。这是我得到的错误,有人可以帮忙吗

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/__init__.py", line 5, in <module>
    from rasa_core.train import train
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/train.py", line 11, in <module>
    from rasa_core.domain import TemplateDomain
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/domain.py", line 12, in <module>
    from rasa_core.actions import Action, action
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/actions/__init__.py", line 1, in <module>
    from rasa_core.actions.action import Action
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/actions/action.py", line 9, in <module>
    from rasa_core import events
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/events/__init__.py", line 73, in <module>
    class Event(object):
  File "/home/ubuntu/.local/lib/python3.5/site-packages/rasa_core/events/__init__.py", line 94, …
Run Code Online (Sandbox Code Playgroud)

python python-3.x rasa-nlu rasa-core

5
推荐指数
1
解决办法
9086
查看次数

带老虎机的 RASA 故事

有人可以用涉及插槽的 Rasa 故事为我澄清:

## story with email
* intent_request_email
    - utter_request_email
* inform_email {"email":"example@example.com"}
    - slot {"email":"example@example.com"}
    - utter_thanks
Run Code Online (Sandbox Code Playgroud)

在上面,确实example@example.com充当任何电子邮件地址的占位符(即,同样适用于john.smith@somedomain.com),或者这是否有效地将这个故事限制在提供的电子邮件正好是的情况下example@example.com

现在考虑以下情况,对于浮动实体:

## story with numeric
* intent_want_to_buy
    - utter_request_budget
* inform_budget {"amount":100}
    - slot {"amount":100}
    - utter_thanks
Run Code Online (Sandbox Code Playgroud)

是否100充当提供的任何金额(即 200、300、65.95)的占位符,或者,它实际上是说仅当且仅当用户声明其预算正好为 100.00 美元时才应用此故事。

考虑到上述情况,当插槽未设置时,如何控制要执行的故事,与插槽已填充/提供时要采用的路径。

文档相当缺乏这些基础知识,这些基础知识一旦知道就很明显,但对于 Rasa 的新手来说就不那么明显了。

entities slots rasa-nlu rasa-core

5
推荐指数
1
解决办法
896
查看次数

如何在rasa的自定义操作中设置插槽

我是 rasa 框架的新手。我开始开发一个简单的聊天机器人,并为我的聊天机器人创建了三个插槽。所以我的机器人需要识别当前位置并将其保存在插槽中。我的当前位置是从对话中获取的,我可以将其保存到故事中的插槽中。

但是后来我有一个自定义操作,可以从 API 调用中查找天气天气,我需要将天气状态和湿度保存在相关插槽中。

class ActionSomeRespThree(Action):

    def name(self) -> Text:
        return "action_some_resp_three"

    def run(self, dispatcher: CollectingDispatcher,
            tracker: Tracker,
            domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

        cityName = tracker.get_slot('city')
Run Code Online (Sandbox Code Playgroud)

rasa-nlu rasa-core rasa

5
推荐指数
1
解决办法
5180
查看次数

在RASA Core / NLU中获得意图值

问候我正在使用RASA chatbot。我正在使用以下代码处理针对特定意图的自定义操作。在自定义操作中,我想获取当前的意图值。所以我不知道那行代码可以给我当前意图的价值

#this file will be used to all custom actions

from  __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import requests
import json
from zeep import Client


from random import randint
from rasa_core.actions.action import Action
from rasa_core.events import SlotSet

class ActionWeather(Action):


RANDOMIZE = False

@staticmethod
def required_fields():
    return [
        EntityFormField("period", "period"),
        EntityFormField("product", "product")
    ]


def name(self):
    return 'action_weather'

def run(self,dispatcher, tracker, domain):

    #Get Slot values
    loc = tracker.get_slot('period')
    pro = tracker.get_slot('product')
    custname= tracker.get_slot('custName')

    #Here I want …
Run Code Online (Sandbox Code Playgroud)

python rasa-nlu rasa-core

4
推荐指数
1
解决办法
1656
查看次数

将 Rasa 聊天机器人连接到网络聊天

我试图连接这个网络聊天小部件来拉沙(https://github.com/mrbot-ai/rasa-webchat),但我得到这个错误在我的控制台,也是这个错误在终端上,我运行我连接器脚本。

但是两天前我的连接器中没有这个错误,我也在 Angular angular-chat-widget-rasa 中使用了这个包,但现在即使这个包也无法与 Rasa 连接。

对于网络聊天界面,我将此代码粘贴到我网站的 body 标签内。

<body>
    <div id="webchat">
        <script src="https://storage.googleapis.com/mrbot-cdn/webchat-latest.js"></script>
        <script>
            WebChat.default.init({
                selector: "#webchat",
                initPayload: "/get_started",
                interval: 1000, // 1000 ms between each message
                customData: { "sender": "django" }, // arbitrary custom data. Stay minimal as this will be added to the socket
                socketUrl: "https://localhost:5002",
                title: "Connect",
                subtitle: "The bot which connects people",
                profileAvatar: "https://rasa.com/assets/img/demo/rasa_avatar.png",
                showCloseButton: true,
                fullScreenMode: false,
                hideWhenNotConnected: false,
            })
        </script>
    </div>

</body>
Run Code Online (Sandbox Code Playgroud)

这是我的连接器的代码:

from rasa.core.agent …
Run Code Online (Sandbox Code Playgroud)

python chatbot rasa-nlu rasa-core rasa

4
推荐指数
1
解决办法
2326
查看次数

在 RASA 中添加语音转文本功能

我需要在 RASA 中添加语音到文本功能,用户可以使用语音提问,机器人将通过聊天回答他。有谁知道我该如何在 RASA 中做到这一点?因为我的前端将是一个 Android 应用程序。请告诉我该怎么做。

提前致谢。

rasa-nlu rasa-core rasa rasa-x

4
推荐指数
1
解决办法
3604
查看次数