Skip to main content

A chatbot that assists rather than manipulates.

Project description

Buy Us Tea PyPI version License codecov DigitalOcean Referral Badge

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

Install from source

Retrieve the source code from GitLab:

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.9.7'
conda env update -n qaryenv -f ./scripts/environment.yml
conda activate qaryenv || source activate qaryenv
pip install --editable .

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

PyPi package

qary is on PyPi but this install is unlikely to work, unless you've already installed all the dependencies:

pip install qary

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.7.12.tar.gz (5.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qary-0.7.12-py3-none-any.whl (5.3 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qary-0.7.12.tar.gz
  • Upload date:
  • Size: 5.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.7 Linux/5.15.0-30-generic

File hashes

Hashes for qary-0.7.12.tar.gz
Algorithm Hash digest
SHA256 267a46207bf71373c5c226dd6b2bc456264f3667a6ad95171c1fdf9965294e35
MD5 6f956eeb5d69cdec355e2b19a31e76d0
BLAKE2b-256 5b6ef9955273d7521bd5a8552726adfd26be03f03c57cfa130117d751eed5303

See more details on using hashes here.

File details

Details for the file qary-0.7.12-py3-none-any.whl.

File metadata

  • Download URL: qary-0.7.12-py3-none-any.whl
  • Upload date:
  • Size: 5.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.7 Linux/5.15.0-30-generic

File hashes

Hashes for qary-0.7.12-py3-none-any.whl
Algorithm Hash digest
SHA256 67d1a40df7c3c694e7a6303c8ae43cf562aed6ca64ba60cc2a19130450ce81de
MD5 adb3e39d71151e22346cd6d2166063ab
BLAKE2b-256 93da56f9d312eb3edb1c8f09dd84bf1458d07d40a36a3ebfae6131805c719120

See more details on using hashes here.

Supported by

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