# Clause
**Repository Path**: mirrors/Clause
## Basic Information
- **Project Name**: Clause
- **Description**: Clause 是帮助中小型企业快速而低成本地获得好用的语义理解服务的系统
- **Primary Language**: C++
- **License**: Not specified
- **Default Branch**: osc
- **Homepage**: https://www.oschina.net/p/Clause
- **GVP Project**: No
## Statistics
- **Stars**: 8
- **Forks**: 3
- **Created**: 2019-09-11
- **Last Updated**: 2025-09-06
## Categories & Tags
**Categories**: ai
**Tags**: None
## README
[主页](https://github.com/chatopera/clause) | [Chatopera 云服务](https://docs.chatopera.com/) | [开发者文档](https://github.com/chatopera/clause/wiki) | [博客专栏](https://chatopera.blog.csdn.net/)
# Clause
Chatopera 语义理解服务 / Chatopera Language Understanding Service
Clause 帮助聊天机器人开发商、开发者快速而低成本的获得开源的语义理解系统。
Clause 是 Chatopera 团队自主研发及使用其他商业友好的开源软件的方式实现的,Clause 为实现聊天机器人提供强大的大脑,包括客服、智能问答和自动流程服务。Clause 利用深度学习,自然语言处理和搜索引擎技术,让机器更加理解人。
利用 Clause 可快速实现聊天机器人服务,通过自然语言的人机交互形式完成数据收集和数据处理。
## 功能
- 支持多机器人管理,每个机器人可创建多个意图(Intent)
- 自定义词典(CustomDict),支持词表形式及正则表达式形式
- 自定义意图(Intent),槽位(Slot)和说法(Utterance)
- 开箱即用的系统词典(人名、地名、组织机构名和时间等)
- 支持聊天机器人调试分支和上线分支
- 支持会话周期管理
- 服务端为微服务,C++实现;客户端使用 RPC 协议连接进行集成,支持多种语言 SDK
- 服务端可做集群,支持大规模高并发访问
**Clause 的服务端使用 C++编写,并且发布为 Docker 镜像;同时提供的客户端集成接口支持多种语言,包括 Java、Python、Node.js 等,请参考下面的内容进一步了解。**
## 快速开始
使用 Python 快速实现问答机器人(链接)
## Docker 安装和部署
### 下载 Docker 镜像
#### 1/3 购买证书
在 Chatopera 证书商店的产品页面购买证书:
下单地址:[https://store.chatopera.com/product/clause001](https://store.chatopera.com/product/clause001)

#### 2/3 下载文件
在 Chatopera 证书商店的证书详情页面,得到证书标识。
证书标识是一个字符串,比如:`FOO123`。
文件的下载地址为:
https://store.chatopera.com/dl/`${LICENSE_ID}`.gz
将 `${LICENSE_ID}` 替换为您的证书标识。假设上一步得到的证书标识为:`FOO123`,那么 URL 下载地址就是:
`https://store.chatopera.com/dl/FOO123.gz`
```
wget --no-check-certificate https://store.chatopera.com/dl/FOO123.gz -O clause001.tar.gz
tar xzfv clause001.tar.gz # 进行解压
./activemq.docker.5143.tgz # 解压得到的文件
./clause.docker.c24ffc1.tgz # 解压得到的文件
./intent.docker.c24ffc1.tgz # 解压得到的文件
./mysql.docker.57.tgz # 解压得到的文件
./README.md # 解压得到的文件
./redis.docker.505.tgz # 解压得到的文件
./sysdicts.docker.c24ffc1.tgz # 解压得到的文件
```
下载后的文件是一个压缩包,格式为 `tar.gz`,该文件使用 `7zip` 或 `WinRAR` 等流行的解压工具都可以打开。
除了使用 `wget` 形式下载,还可以通过浏览器打开 URL 下载。
复制以上脚本,到[项目官方地址](https://github.com/chatopera/clause)。
#### 3/3 加载镜像
得到上述的各 `*.tgz` 文件后,在命令行终端执行命令:
```
docker load < ./activemq.docker.5143.tgz
docker load < ./clause.docker.c24ffc1.tgz
docker load < ./intent.docker.c24ffc1.tgz
docker load < ./mysql.docker.57.tgz
docker load < ./redis.docker.505.tgz
docker load < ./sysdicts.docker.c24ffc1.tgz
```
执行后,镜像文件就被加载到了 `docker images` 中。
使用命令验证,执行 `docker images`,确定出现:
```
clause/clause:develop
clause/intent:develop
clause/sysdicts:develop
chatopera/activemq:5.14.3
chatopera/mysql:5.7
chatopera/redis:5.0.5
```
### 启动服务
使用文档:
* [GitHub Wiki](https://github.com/chatopera/clause/wiki/%E6%9C%8D%E5%8A%A1%E9%83%A8%E7%BD%B2)
* [(备份地址) Gitee Wiki](https://gitee.com/chatopera/clause/wikis/%E6%9C%8D%E5%8A%A1%E9%83%A8%E7%BD%B2)
## 欢迎使用
- [概述](https://github.com/chatopera/clause/wiki/%E6%A6%82%E8%BF%B0)
- [系统设计与实现](https://github.com/chatopera/clause/wiki/%E7%B3%BB%E7%BB%9F%E8%AE%BE%E8%AE%A1%E4%B8%8E%E5%AE%9E%E7%8E%B0)
- [示例程序](https://github.com/chatopera/clause/wiki/%E7%A4%BA%E4%BE%8B%E7%A8%8B%E5%BA%8F)
- [开发环境搭建](https://github.com/chatopera/clause/wiki/%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA)
- [系统集成](https://github.com/chatopera/clause/wiki/%E7%B3%BB%E7%BB%9F%E9%9B%86%E6%88%90)
- [API 文档](https://github.com/chatopera/clause/wiki/API%E6%96%87%E6%A1%A3)
- [FAQ](https://github.com/chatopera/clause/wiki/FAQ)
## Chatopera 云服务
Clause 同时也是 [Chatopera 云服务](https://bot.chatopera.com/)的一个基础模块。
[https://bot.chatopera.com/](https://bot.chatopera.com/)
[Chatopera 云服务](https://bot.chatopera.com)是一站式实现聊天机器人的云服务,按接口调用次数计费。Chatopera 云服务是 [Chatopera 机器人平台](https://docs.chatopera.com/products/chatbot-platform/index.html)的软件即服务实例。在云计算基础上,Chatopera 云服务属于**聊天机器人即服务**的云服务。
Chatopera 机器人平台包括知识库、多轮对话、意图识别和语音识别等组件,标准化聊天机器人开发,支持企业 OA 智能问答、HR 智能问答、智能客服和网络营销等场景。企业 IT 部门、业务部门借助 Chatopera 云服务快速让聊天机器人上线!
展开查看 Chatopera 云服务的产品截图
自定义词典
自定义词条
创建意图
添加说法和槽位
训练模型
测试对话
机器人画像
系统集成
聊天历史
立即使用
## 主题演讲
| 时间 | 活动 | 链接 | 时长 | 概述 |
| ---------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------ | ----------------------------------- |
| 2019-12-14 | [Microsoft AI Bootscamp(2019)](https://github.com/huan/microsoft-ai-bootcamp) | [回放](https://www.bilibili.com/video/av80153181?p=3) | 40mins | 基本使用介绍+支持正则表达式词典 |
| 2019-11-03 | [COSCon '2019 中国开源年会](https://www.bagevent.com/event/5744455) | [回放](https://v.qq.com/x/page/u3017ka4t6o.html), [PPT【提取码: 25ni】](https://pan.baidu.com/s/1Z-d6CMtI782TLHRxaklDcw) | 40mins | 基本使用介绍+支持读取文件训练机器人 |
| 2019-09-26 | CSDN 学院直播:深度学习之智能问答机器人实战 | [回放](https://edu.csdn.net/huiyiCourse/detail/1068) | 60mins | 基本使用介绍 |
## 用户交流群
在 Chatopera 客户群中也包括其他用户,请不要发送敏感信息。讨论与 Chatopera 产品和服务相关的事宜
## 媒体报道
- [开源中国:语义理解系统 Clause](https://www.oschina.net/p/clause)
- [我爱自然语言处理:Clause,开源的语义理解服务](http://www.52nlp.cn/clause-oss)
## 特别鸣谢
- [Lexical Analysis of Chinese](https://github.com/baidu/lac): Baidu's open-source lexical analysis tool for Chinese, including word segmentation, part-of-speech tagging & named entity recognition.
- [CRFsuite](https://github.com/chokkan/crfsuite): a fast implementation of Conditional Random Fields (CRFs)
- [Xapian](https://xapian.org/): an Open Source Search Engine Library
# 自然语言处理推荐入门&工具书
机器学习 & 自然语言处理入门指南,本书由 [Clause](https://github.com/chatopera/clause) 作者参与著作。
快速购书链接
[《智能问答与深度学习》](https://search.jd.com/Search?keyword=%E6%99%BA%E8%83%BD%E9%97%AE%E7%AD%94%E4%B8%8E%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0&enc=utf-8&wq=%E6%99%BA%E8%83%BD%E9%97%AE%E7%AD%94%E4%B8%8E%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0) 这本书是服务于准备入门机器学习和自然语言处理的学生和软件工程师的,在理论上介绍了很多原理、算法,同时也提供很多示例程序增加实践性,这些程序被汇总到示例程序代码库,这些程序主要是帮助大家理解原理和算法的,欢迎大家下载和执行。代码库的地址是:
[https://github.com/l11x0m7/book-of-qna-code](https://github.com/l11x0m7/book-of-qna-code)
## 开源许可协议
Copyright (2019-2020) 北京华夏春松科技有限公司
[Apache License Version 2.0](https://github.com/chatopera/clause/blob/master/LICENSE)
[![chatoper banner][co-banner-image]][co-url]
[co-banner-image]: https://static-public.chatopera.com/assets/images/42383104-da925942-8168-11e8-8195-868d5fcec170.png
[co-url]: https://www.chatopera.com