Skip to main content

"An open framework and dataset for building a distributed-agent chatbot based on _Natural Language Processing in Action_."

Project description

Buy Us Tea PyPI version License codecov

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 an active developer community and is supported by San Diego Python User Group (some qary talks here and in docs/) and San Diego Machine Learning Group.

Install

Package install

qary package can be installed from PyPi by running:

pip install qary

Developer install

First retrieve a copy of the source code for qary:

git clone git@gitlab.com:tangibleai/qary
cd qary

Then, install and use the conda python package manager within the Anaconda software package.

conda update -y -n base -c defaults conda
conda create -y -n qaryenv 'python>=3.6.5,<3.9'
conda env update -n qaryenv -f environment.yml
conda activate qaryenv || source activate qaryenv
pip install --editable .

Windows Users: docs/README-windows-install.md

Usage

$ qary --help
usage: qary [-h] [--version] [--name STR] [-p] [-s STR] [-v] [-vv] [words [words ...]]

Running qary for just one skill

$ qary -s qa
# ... (logging messages)
YOU: When was Barack Obama born?
# ... (logging messages)
qary: August 4, 1961

qary skills

qary's probabilistic conversation manager chooses a reply from the possiblities generated by the different personalities:

  • pattern (skills/pattern.py): example skill using regex patterns to reply to greetings like "hi"
  • qa (skills/qa.py): BERT and ALBERT Wikipedia Question Answering (WikiQA reading comprehension tests)
  • faq (skills/faq.py): answers to frequently asked questions using data/faq/*.yml
  • glossary (skills/glossary.py): definitions from glossary yml files in data/faq/glossary-*.yml
  • eliza (eliza.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 to change the default skills loaded for your own custom skill in the skills directory.

Approach

qary's chatbot framework allows you to combine many approaches to give you state-of-the-art capability to answer questions and carry on a conversation:

  1. search: chatterbot, will
  2. pattern matching and response templates: Alexa, AIML
  3. generative deep learning: robot-bernie, movie-bot
  4. 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'd like to join us for weekly Zoom collaborative-coding sessions.

  1. Create a fork of the main qary repository on Gitlab.
  2. Make your changes in a branch named something different from master, e.g. create a new branch my-pull-request.
  3. Create a merge request.
  4. 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! You've made 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

qary-0.6.16.tar.gz (5.9 MB view details)

Uploaded Source

Built Distribution

qary-0.6.16-py2.py3-none-any.whl (2.1 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file qary-0.6.16.tar.gz.

File metadata

  • Download URL: qary-0.6.16.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3.post20210118 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for qary-0.6.16.tar.gz
Algorithm Hash digest
SHA256 a6d70832045f453a6da5edfd1e6eb9075bb127eaca6ae2599b412250d19b0d70
MD5 0dbead57112863a1ed095ce4f7757a6e
BLAKE2b-256 1e2d22a3143171f6e6632c3267c3532cb5e49ae7c56f886e31bc4fd23185a981

See more details on using hashes here.

Provenance

File details

Details for the file qary-0.6.16-py2.py3-none-any.whl.

File metadata

  • Download URL: qary-0.6.16-py2.py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3.post20210118 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for qary-0.6.16-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c9c6dd78977b9b9a18ede8e1bc2389a96960a8a859aa80c522e7bee452d73bf9
MD5 360a9ba5c508980214bf1a053bb8d517
BLAKE2b-256 1c79f39e903de15dd767306eea412d8eeb53c9ea6cec77b62b2cdf5fa6d01cc2

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page