"An open framework and dataset for building a distributed-agent chatbot based on _Natural Language Processing in Action_."
Project description
qary
The qary
package is both a chatbot framework and a working "reference implementation" virtual assistant that actually assists! Most bots manipulate you to make money for their corporate masters. With qary, you can build your bot to protect you and amplify your intelligence and prosocial instincts.
qary
was conceived as part of NLP in Action book, is maintained by a active developer community and is supported by San Diego Python User Group (see talk presentations here and in docs/
.
Install
Package install
qary
package can be installed from PyPi by running:
pip install qary
Developer install
You'll want to install and use the conda package manager within Anaconda3, especially if your development environment is not an open standard operating system like Linux.
git clone git@gitlab.com:tangibleai/qary
cd qary
conda env create -n qaryenv -f environment.yml
conda activate qaryenv
pip install --editable .
Usage
$ qary --help
usage: bot [-h] [--version] [--name STR] [-p] [-b STR] [-v] [-vv] [words [words ...]]
Running qary
with a single statement/query
You can run bot just like any other command line app, giving it your statement/query as an argument.
$ qary what is an allele
bot: A variant form of a given gene, a version of a known mutation at the same place as the original unmodified gene within a chromosome.
Running qary
in dialog mode
$ qary [-b <personality1>,<personality2>] ...
# ... output from will making your new project
YOU: When was Barack Obama born?
# ... output for qary processing your request
qary: August 4, 1961
qary
personalities
qary
's probabilistic conversation manager chooses a reply from the possiblities generated by the different personalities:
qa
(qa_bots.py
): BERT and ALBERT Wikipedia Question Answering (WikiQA reading comprehension tests)faq
(faq_bots.py
): answers to frequently asked questions using data/faq/*.ymlglossary
(glossary_bots.py
): definitions from glossary yml files in data/faq/glossary-*.ymlpattern
(pattern_bots.py
): regex patterns and greeting templateseliza
(eliza_bots.py
): a python port of the ELIZA therapist bot
Configuring default personalities
By default, qary
runs with qa
personality. Check out the config file in qary.ini
or $ bot -h
to change the default bot personalities loaded for your own custom bot.
Approach
qary
's hybrid chatbot framework allows you to combine 4 approaches to give you state-of-the-art capability to answer questions and carry on a conversation:
- search: chatterbot, will
- pattern matching and response templates: Alexa, AIML
- generative deep learning: robot-bernie, movie-bot
- grounding: snips
It's all explained in detail at NLP in Action.
Presentations for San Diego Python User Group are in [docs/](/docs/2019-08-22--San Diego Python User Group -- How to Build a Chatbot.odp) and on the web at http://totalgood.org/midata/talks
Contributing pattern for developers
DM @hobs if you would like to participate in the weekly Zoom collaborative-programming sessions.
- Create a fork of the main qary repository on Gitlab.
- Make your changes in a branch named something different from
master
, e.g. create a new branchmy-pull-request
. - Create a merge request.
- Help your fellow contributors out by:
- Follow the PEP-8 style guide.
- Try to include a docstring, at least a single line, in any function, method, or class
- Bonus points for adding a doctest as part of your contribution.
- If you add a new feature, write some quick docs in the README.
- Add your name and attribution to the AUTHORS file.
- Know we are grateful for your contribution to making the chatbot world a little better.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for qary-0.4.16-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58d4eea5adfcd08127c8c6046ccc329e7cd2d5fac63db524a9e66eec9aa88268 |
|
MD5 | 4b18c98faa54b1a7b717471e6c8e122f |
|
BLAKE2b-256 | 92474f715921f1aa01cf70a635929f03b77212406d8c59cbb2109ac9fcc385bf |