Code Monkey home page Code Monkey logo

clause's Issues

支持正则表达式词典

Description

当前1.1.0版本支持正则表达式词典。

拉取最新镜像。

docker-compose pull

全新安装

拉取最新的docker镜像,启动服务。
参考部署文档

升级

拉取最新的镜像,然后在数据库内执行升级脚本

使用说明

参考示例程序

Solution

ubuntu 16.04 make 编译错误,详细内容

root@jydatatop-virtual-machine:/soft/clause# cmake ../..
CMake Error: The source directory "/" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
root@jydatatop-virtual-machine:/soft/clause# make
make: *** 没有指明目标并且找不到 makefile。 停止。
root@jydatatop-virtual-machine:/soft/clause#

服务正常启动,但运行py-demo报错

服务端是linux,使用docker部署了clause,启动显示正常。
在windows上,使用vscode运行 clause-py-demo 工程,报错如下:
“UnicodeDecodeError: 'gbk' codec can't decode byte 0x85 in position 190: illegal multibyte sequence”
把with open(os.path.join(curdir, "profile.json"), 'r') as f: 中的'r'改成‘rb’后编码的问题解决,又报以下问题:
[connect] clause host 172.16.1.103, port 8056
[clean_up_bot] remove intent take_out
[create] dict name food
[create] dict name phoneNumber
[create] intent name take_out
[create] intent slot time
[create] intent slot loc
[create] intent slot food
[create] intent slot phone
[create] intent utter 我想订一份{food}
[create] intent utter 我想点外卖
[create] intent utter 我想点一份外卖,{time}用餐
[create] intent utter 我想点一份{food},送到{loc}
[train] start to train bot ...
[train] error Data(rc=None, error=None, msg=None, id=None, chatbotID=None, customdicts=None, sysdicts=None, botsysdicts=None, dictwords=None, customdict=None, sysdict=None, botsysdict=None, dictword=None, dictpattern=None, patterncheck=None, patternchecks=None, intents=None, slots=None, utters=None, intent=None, slot=None, utter=None, devvers=None, provers=None, devver=None, prover=None, sessions=None, messages=None, session=None, message=None, currpage=None, totalpage=None, totalrows=None, pagesize=None, page=None, query=None)
Traceback (most recent call last):
File "f:/study/clause-py-demo/bot.py", line 169, in
raise Exception("Unexpected response with training bot request.")
Exception: Unexpected response with training bot request.

在 clause server服务内运行 docker-compose logs -f 查看日志,发现以下内容:
clause_1 | SELECT id, description, createdate, updatedate from cl_intents WHERE chatbotID ='bot007' and name = 'take_out'
clause_1 | ---
clause_1 | I0927 10:15:54.910068 36 maf.hpp:137] getDictDetailByChatbotIDAndName name: @time, chatbotID: @Builtin, isBuiltin: 1
clause_1 | I0927 10:15:54.910094 36 maf.hpp:151] getDictDetailByChatbotIDAndName execute SQL:
clause_1 | ---
clause_1 | SELECT id, name, chatbotID, description, createdate, updatedate, samples, type, vendor, builtin, active from cl_dicts WHERE name ='@time' and chatbotID = '@Builtin'
clause_1 | ---
clause_1 | I0927 10:15:54.910348 36 handler.cpp:3259] # ERR: SQLException in /home/hain/git/clause/src/clause/src/handler.cpp
clause_1 | I0927 10:15:54.910369 36 handler.cpp:3261] # ERR: Unknown column 'type' in 'field list'

知识库

概述

理想解决方案

代码版本

来自

  • 行业:
  • 公司/团队 官网:

Open Source for the World by Chatopera

chatoper banner

如果想训练知识库,应该如何配置,是在profile.json里配置吗,谢谢

python 多线程同时访问, AttributeError: 'NoneType' object has no attribute 'id'

使用python多进程调用服务器上启动的服务,session = bot.putSession,报AttributeError: 'NoneType' object has no attribute 'id',thrift.transport.TTransport.TTransportException: TSocket read 0 bytes的错误,代码如下:
def print_time(j):
bot = Client("xxx.xx.xxx.xxx", "xxxx")
chatbotID = "123"
text = "今天天气"
print("[chat] human: %s" % text)
session = bot.putSession(Data(session=ChatSession(chatbotID=chatbotID,
uid=f"py{j}",
channel="testclient",
branch="dev"
))).session
resp = bot.chat(Data(session=ChatSession(id=session.id), message=ChatMessage(textMessage=text)))
if resp.session.resolved:
intent_name = resp.session.intent_name
print("意图的名字是:", intent_name)
for i in resp.session.entities:
print("词槽的名称是:", i)
else:
print("[错误] 返回不符合逻辑")
bot.destroy()

for j in range(5):
t = threading.Thread(target=print_time, args=(j,))
t.start()

clause centos部署出行问题

部署clause服务时
Digest: sha256:b15cf21b66c6a4e98e78aa458fa56caf43b5338b3d5710326c2666ee265a83c6
Status: Downloaded newer image for chatopera/activemq:5.14.3
Pulling intent (chatopera/intent:develop)...
到这里又不动了,是不是没有放出来,或者咱们的访问有限制?

"Invalid params, customdict obj is required.

postCustomDict result: {"rc":1,"error":"Invalid params, customdict obj is required.","msg":null,"id":null,"chatbotID":null,"customdicts":null,"sysdicts":null,"botsysdicts":null,"dictwords":null,"customdict":null,"sysdict":null,"botsysdict":null,"dictword":null,"intents":null,"slots":null,"utters":null,"intent":null,"slot":null,"utter":null,"devvers":null,"provers":null,"devver":null,"prover":null,"sessions":null,"messages":null,"session":null,"message":null,"currpage":null,"totalpage":null,"totalrows":null,"pagesize":null,"page":null,"query":null} +0ms
在node.js使用中 报错 使用官方的测试成功

sysdicts没有启动成功问题

下载 clause-osc之后 进入admin/docker 执行 ./start.sh
报错:clauseosc_sysdicts_1 exited with code 132
单独启动显示
root@075cd2541a79:/app# ./sysdicts_server "--flagfile=/config/cmd.flags"
Illegal instruction (core dumped)

导致:
clause_1 | Thrift: Mon May 11 14:37:27 2020 TSocket::open() getaddrinfo() <Host: sysdicts Port: 8066>Name or service not known
clause_1 | I0511 14:37:27.393725 1 client.cpp:47] sysdicts init exception: Could not resolve host for client socket.
clause_1 | I0511 14:37:27.393741 1 handler.cpp:120] Init fails, exception in Sysdicts.
clause_1 | F0511 14:37:27.393748 1 main.cpp:67] Check failed: handler->init() [Fatal Error] Serving Handler fails to init.
报错

通过 docker-compose ps 查看
chatopera/sysdicts:develop "/app/sysdicts_ser..." About a minute ago Restarting (132) 32 seconds ago

redis,mq,mysql,intend 服务启动正常

Docker version 17.06.2-ce, build cec0b72

docker-compose version 1.15.0, build e12f3b9

操作系统信息:
Linux version 3.10.0-693.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Tue Aug 22 21:09:27 UTC 2017

CentOS Linux release 7.4.1708 (Core)

gcc 信息:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)

服务管理脚本

发布版本,打包。
增加服务启动,清数据,服务停止等脚本。

如何注册zookeeper

您好,在部署过程中遇到了部署均衡的问题,请问如何配置clause的注册中心信息?谢谢!

No rule to make target '../../lib/libthriftnb.so', needed by 'src/clause/clause_server'

ubuntu:~/clause/build/debug$ make

[ 32%] Building CXX object src/clause/CMakeFiles/clause_server.dir/serving/server_constants.cpp.o
[ 33%] Building CXX object src/clause/CMakeFiles/clause_server.dir/serving/server_types.cpp.o
make[2]: *** No rule to make target '../../lib/libthriftnb.so', needed by 'src/clause/clause_server'. Stop.
CMakeFiles/Makefile2:347: recipe for target 'src/clause/CMakeFiles/clause_server.dir/all' failed
make[1]: *** [src/clause/CMakeFiles/clause_server.dir/all] Error 2
Makefile:90: recipe for target 'all' failed

环境:ubuntu 18.04,使用官方脚本并执行sudo apt-get install libevent-dev

提供不同语言的客户端代码

命令:

~/git/clause/bin/thrift --gen php -o . ../thrift/server.dsl
~/git/clause/bin/thrift --gen js:node -o . ../thrift/server.dsl
~/git/clause/bin/thrift --gen cpp -o . ../thrift/server.dsl
~/git/clause/bin/thrift --gen csharp -o . ../thrift/server.dsl
~/git/clause/bin/thrift --gen py -o . ../thrift/server.dsl
~/git/clause/bin/thrift --gen java -o . ../thrift/server.dsl

It takes very long time on training and no results

描述

提交公司信息说明后优先处理解决!

现在行为

root@128bb1f63e75:/data# ls
LICENSE README.md assets bot.py docker-compose.yml profile.json requirements.txt sample.env scripts var
root@128bb1f63e75:/data# python bot.py
[connect] clause host clause, port 8056
[create] dict name food
[create] dict name phoneNumber
[create] intent name take_out
[create] intent slot time
[create] intent slot loc
[create] intent slot food
[create] intent slot phone
[create] intent utter 我想订一份{food}
[create] intent utter 我想点外卖
[create] intent utter 我想点一份外卖,{time}用餐
[create] intent utter 我想点一份{food},送到{loc}
[train] start to train bot ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
[train] in progress ...
......

预期行为

如示例截屏所示,模型应该能很快训练完成

解决方案

No

环境

  • 代码版本:
    Git commit hash (git rev-parse HEAD)
    aed7470

pip install clause 报错;错误信息如下

Collecting clause
Using cached https://files.pythonhosted.org/packages/15/01/603f7a3d8711c514c4fc6e150b282fc94d4791e76c84b6048dd2e5940bb1/clause-1.1.5.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-t3euV0/clause/setup.py", line 3, in
from clause import version
File "clause/init.py", line 19, in
from .gen.clause import ttypes, constants, Serving
File "clause/gen/clause/ttypes.py", line 21
SyntaxError: Non-ASCII character '\xe5' in file clause/gen/clause/ttypes.py on line 22, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-t3euV0/clause/

开源语义理解引擎有相关api文档吗!?

您好?

开源语义理解引擎有相关api文档吗!?
比如,语义理解有哪些接口或方法?
返回的正确 /错误代码有哪些?如rc:0, msg:train job is dispatched.
系统词典,有哪些等等?

知识库

如果想训练知识库,应该如何配置,是在profile.json里配置吗,谢谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.