A fast responsive, machine learning, conversational dialog engine for creating chat bots, written in Go.

chatbot

English | 简体中文

项目说明

chatbot 是一个通过已知对话数据集快速生成回答的 Go 问答引擎。比 ChatterBot 快非常多,我们在1.2亿对话上的对比结果是:ChatterBot 回答需要21秒,chatbot 只需要18毫秒。

  • bot

    问答引擎

  • cli

    • train

      训练给定的问答数据并生成 .gob 文件

      • -d 读取指定目录下所有 jsonyaml 语料文件
      • -i 读取指定的 jsonyaml 语料文件,多个文件用逗号分割
      • -o 指定输出的 .gob 文件
      • -m 定时打印内存使用情况
    • ask

      一个示例的问答命令行工具

      • -v verbose
      • -c 训练好的 .gob 文件
      • -t 数据几个可能的答案

数据格式

数据格式可以通过 yaml 或者 json 文件提供,参考 https://github.com/kevwan/chatterbot-corpus 里的格式。大致如下:

categories:
- AI
conversations:
- - 什么是ai
  - 人工智能是工程和科学的分支,致力于构建具有思维的机器。
- - 你是什么语言编写的
  - Python
- - 你听起来像机器
  - 是的,我受到造物者的启发
- - 你是一个人工智能
  - 那是我的名字。

问答示例

user: 在吗?
bot: 在
user: 在干嘛呢?
bot: 看电视
user: 看啥电视呀
bot: 活色生香
user: 很好看吗?
bot: 特搞笑
user: 你在哪里呀?
bot: 家里
user: 家里就你一个人嘛?
bot: 我喜欢一个人玩
user: 那我过来找你?
bot: 不可以,乖乖上班去

致谢

ChatterBot - https://github.com/gunthercox/ChatterBot

最早我是使用 ChatterBot.的,但由于回答太慢,所有后来只能自己实现了,感谢 ChatterBot,非常棒的项目!

Owner
Kevin Wan
go-zero.dev
Kevin Wan
Similar Resources

Search & watch Youtube videos from a Zoom Meeting chat bot.

Uut Download and search for Youtube videos from a Zoom meeting chatbot. Installation Download Golang and setup your environment Clone this repo Instal

Nov 2, 2021

Official Go Keybase chat bot SDK

go-keybase-chat-bot Write rich bots for Keybase chat in Go. Installation Make sure to install Keybase. go get -u github.com/keybase/go-keybase-chat-bo

Nov 13, 2022

DiscordGo: a Go package that provides low level bindings to the Discord chat client API

DiscordGo: a Go package that provides low level bindings to the Discord chat client API

DiscordGo DiscordGo is a Go package that provides low level bindings to the Discord chat client API. DiscordGo has nearly complete support for all of

Dec 14, 2021

A telegram bot to ban the chat spammers by channel, made with Golang.

ChannelBot A telegram bot to ban channels spamming chat. Vars TOKEN - Your Telegram Bot Token (@BotFather) More Information With the latest update of

Nov 8, 2022

This utility allows you to execute Minecraft server commands through the RCON protocol via Telegram chat.

Minecraft RCON by Telegram This utility allows you to execute Minecraft server commands through the RCON protocol via Telegram chat. FAQ When you run

Jul 24, 2022

A serverless bot which periodically checks configured BigQuery capacity commitments, reservations and assignments against actual slot consumption of running jobs and reports findings to Slack/Google Chat.

A serverless bot which periodically checks configured BigQuery capacity commitments, reservations and assignments against actual slot consumption of running jobs and reports findings to Slack/Google Chat.

Solution Guide This solution implements a ChatOps-like approach to monitoring slot utilization of Google Cloud BigQuery reservations. As an alternativ

Dec 7, 2022

A k6 extension for creating telegram notifications.

xk6-telegram This is a k6 extension using the xk6 system. ❗ This is a proof of concept, isn't supported by the k6 team, and may break in the future. U

Aug 22, 2022

A boiler-plate like base for people to get started in creating automation software specifically for purchasing items on websites.

Bot-Base Bot-Base is a small project with concepts for most elements of a bot. Feel free to contact me on Twitter with any questions. Contributing Pul

Dec 27, 2022

Creating a twiter bot using GO

go-twiter-bot Creating a twiter bot using GO Libs: github.com/dghubble/go-twitter github.com/dghubble/oauth1 Configuração: Exportar variáveis de ambie

Mar 29, 2022
Comments
  • 无法加载数据集

    无法加载数据集

    您好,我不知道是什么原因,看起来无法正常读取yaml数据集。不知道是否是我的使用方式有问题? ai.yaml 是chatterbot-corpus的。在Mac上和Windows上的使用效果是一样的,都是这样无法读取。

    D:\VsCode\Go\chatbot\cli\train>go run train.go -i ai.yaml
    Loading corpora...
    Creating Q/A mappings...
    Building indexes...
    Elapsed: 3.0005ms
    
    D:\VsCode\Go\chatbot\cli\train>ls
    
    ai.yaml  corpus.gob  train.go
    
    D:\VsCode\Go\chatbot\cli\train>cd ../ask
    
    D:\VsCode\Go\chatbot\cli\ask>go run ask.go -c D:/VsCode/Go/chatbot/cli/train/corpus.gob
    Q: 什么是ai
    No answer!
    Q: hello
    No answer!
    Q: 你好
    No answer!
    Q: No answer!
    Q: exit status 0xc000013a
    
    D:\VsCode\Go\chatbot\cli\ask>cd ../train
    
    D:\VsCode\Go\chatbot\cli\train>du -sh *
    8.0K    ai.yaml
    1.0K    corpus.gob
    4.0K    train.go
    

    On Windows CMD

  • Where do you get the large corpus data?

    Where do you get the large corpus data?

    Hello,

    I am working on trying out your chat bot and would like to download your 120 million conversations to run them as well.

    Where can I download them?

    Thanks

A set of mastodon (fediverse) bots written in Go

Mastodon Bot Bots Hagh Hagh reblogs certain toots to itself creating a Hagh page. Users from local instance are able to make a toot hagh. Setup Have g

Sep 17, 2021
ChatRat is a twitch chat bot built in Go that is a dedicated shitpost machine.

ChatRat ChatRat is a twitch chat bot built in Go that is a dedicated shitpost machine. Also does some other things, but for now the main thing is just

Nov 17, 2022
Golang Framework for writing Slack bots

hanu - Go for Slack Bots! The Go framework hanu is your best friend to create Slack bots! hanu uses allot for easy command and request parsing (e.g. w

Oct 24, 2022
its the same idea as bruh-bot, but with golang, and add more bots
its the same idea as bruh-bot, but with golang, and add more bots

bruh-bot but more powerful! requirements python go you can used on mac and linux the idea its really simple, can make a lot of bots with the same task

Jul 7, 2021
A Telegram Repo For Bots Under Maintenance Which Gives Faster Response To Users
A Telegram Repo For Bots Under Maintenance Which Gives Faster Response To Users

Maintenance Bot A Telegram Repo For Bots Under Maintenance Which Gives Faster Response To Users Requests » Report a Bug | Request Feature Table of Con

Mar 21, 2022
HellPot is a portal to endless suffering meant to punish unruly HTTP bots.
HellPot is a portal to endless suffering meant to punish unruly HTTP bots.

HellPot Summary HellPot is an endless honeypot based on Heffalump that sends unruly HTTP bots to hell. Notably it implements a toml configuration file

Jan 2, 2023
Automated Trader (at). Framework for building trading bots.
Automated Trader (at). Framework for building trading bots.

Automated Trader (at) Purpose: Framework for building automated trading strategies in three steps: Build your own strategy. Verify it with the backtes

Dec 14, 2022
Wrapper library for github.com/tucnak/telebot to create simple text-based Telegram bots

tbwrap Wrapper library for github.com/tucnak/telebot to create simple text-based Telegram bots Installation go get github.com/enrico5b1b4/tbwrap Exam

Dec 7, 2021
Make discord bots to drain discriminators

allthebotses make discord bots to drain discriminators a stupid idea You can only make ~5 bots before getting ratelimited, and it gets tougher every t

Dec 12, 2021
Zuri Chat Repo

zurichat Zuri Chat Repo To setup To get the Go server running go to the terminal and enter the zc_core type "go run ." Open the url http://127.0.0.1:8

Nov 8, 2021