A chinese chat bot
Project description
cbot
a chinese chat robot
Introduction to cbot usage:
version:0.1.0
####how to install cbot: #####pip install cbot #####if you got an error when install python-Levenshtein package #####you can download .whl file and install this package:python-levenshtein ####If you want to use it locally:
from cbot import CBot
cbot = CBot('cbotName')
# If you start from scratch
# cbot.train()
# while True:
# que = input('me:')
# reponse = cbot.get_response(str(que))
# print('cbot:', reponse)
# If you want to train some data first
# The data set must be list type.
# And the next sentence is the answer to the last sentence.
trainList = [
'早',
'早上好',
'早饭吃了么',
'还没呢!,你呢?',
'我也没吃',
'我们一起吃早饭去吧',
'好呀'
]
cbot.train(trainList)
while True:
que = input('me:')
reponse = cbot.get_response(str(que))
print('cbot:', reponse)
####If you want to use it with turing api:
from cbot import CBot
cbot = CBot('felix')
cbot.turing_key = '' # you should git an api key at http://www.tuling123.com/
while True:
que = input('我:')
reponse = cbot.get_response(str(que), api='turing')
print('CBot:', reponse)
###Now have fun! ###If you get a bug,you can send the bug to my email. ###Here is my email:felix2@foxmail.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cbot-0.1.4.3.tar.gz
(19.8 kB
view details)
File details
Details for the file cbot-0.1.4.3.tar.gz
.
File metadata
- Download URL: cbot-0.1.4.3.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b065be60f88443755683e852c40bdb8e02f9c14b97026781ce4e13a97b1f6c7 |
|
MD5 | 697b9c88a20c57e335f6b67166b299c4 |
|
BLAKE2b-256 | cdb3b887c9301b033dfd8dbb09882bb18e157688a4cba549d46906a2f10421ca |