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

Overview

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,非常棒的项目!

You might also like...
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

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

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

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

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

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

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

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

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

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

    opened by Raptor-wxw 2
  • 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

    opened by lonnietc 2
Releases(v1.0.2)
  • v1.0.2(Feb 5, 2022)

  • v1.0.1(Nov 27, 2021)

  • v1.0.0(Oct 11, 2021)

    • bot

      Conversational dialog engine

    • cli

      • train

        Train the given conversation data and generate corpus format file .gob

        • -d reads all json and yaml corpus files in the specified directory
        • -i read the specified json or yaml corpus files, splitting multiple files by commas
        • -o specify the output .gob file
        • -m print memory usage at regular intervals
      • ask

        An example question and answer command line tool

        • -v verbose
        • -c trained .gob file
        • -t data for several possible answers
    Source code(tar.gz)
    Source code(zip)
Owner
Kevin Wan
go-zero.dev
Kevin Wan
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

Ebrahim 4 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

Pattycakes 5 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

Sebastian Müller 142 Oct 24, 2022
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

pai 12 Jul 7, 2021
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

HEIMAN PICTURES 9 Mar 21, 2022
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

kayos 159 Oct 25, 2022
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

Simon Klinkert 60 Nov 5, 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

null 0 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

null 1 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

null 18 Nov 8, 2021