<commit_before>lockebot
![LockeBotLogo](media/JohnLockeLogoMini.jpg)

**LockeBot:** a demonstration of implementing a basic question answering bot with use of [Rasa NLU](https://github.com/golastmile/rasa_nlu) and a database.

## What is this?

[image of LockeBot in use]

This project grew out of my experiments to build a bot in Python using Rasa NLU. I should be up-front that this is not necessarily the perfect way to use it and there are probably many things that could be done in a more Pythonic way, but my intent is that by sharing it, others will either be able to get something basic working quickly or they'll use it for inspiration in another project.

Rasa NLU has the great advantage of letting you handle your NLU models locally and thus not hand off data to a third-party.  I'm not idealogically against use of third-party NLU tools, but when getting a sense of what is possible it seemed to me very useful not to require external involvement and I suspect others may be in this position too.

One other option with this project is to run the finished bot on a Raspberry Pi.  Although you may well not wish to train the model on the Pi (it may take a rather long time!), once you have a trained model, it is very much capable of giving responses quickly and although large scale use will likely not be viable it works for small numbers of concurrent users (LIMITS NOT TESTED, but email use with a group of ~20 users is definitely viable)

There is a **basebot** (which does very little) and a slightly more capable version **name_tbc** 

## Install

* git clone from this repo
	* FILL IN INSTRUCTIONS
* create virtual environment
	* virtualenv2 venv
* activate virtual environment
	* source venv/bin/activate
* pip install
	* pip install requirements.txt<commit_msg>Adding asciinema.org demo to README.md<commit_after># lockebot

![LockeBotLogo](media/JohnLockeLogoMini.jpg)

**LockeBot:** a demonstration of implementing a basic question answering bot with use of [Rasa NLU](https://github.com/golastmile/rasa_nlu) and a database.

## What is this?

It is a bot that can answer simple questions - after being trained on examples, it is (to a degree) able to generalise the questions and respond to ones in a similar style. The questions are turned into intents and entities, which are then used to construct queries to run against a database to provide the answer.

Here is a demo of the BaseBot version (which is somewhat limited in what it can respond to and has a small table of people with some trivial characteristics, like name, number and location)

[![asciicast](https://asciinema.org/a/5j5zs42kk95itm1uzdqlwys86.png)](https://asciinema.org/a/5j5zs42kk95itm1uzdqlwys86)

This project grew out of my experiments to build a bot in Python using Rasa NLU. I should be up-front that this is not necessarily the perfect way to use it and there are probably many things that could be done in a more Pythonic way, but my intent is that by sharing it, others will either be able to get something basic working quickly or they'll use it for inspiration in another project.

Rasa NLU has the great advantage of letting you handle your NLU models locally and thus not hand off data to a third-party.  I'm not idealogically against use of third-party NLU tools, but when getting a sense of what is possible it seemed to me very useful not to require external involvement and I suspect others may be in this position too.

One other option with this project is to run the finished bot on a Raspberry Pi.  Although you may well not wish to train the model on the Pi (it may take a rather long time!), once you have a trained model, it is very much capable of giving responses quickly and although large scale use will likely not be viable it works for small numbers of concurrent users (LIMITS NOT TESTED, but email use with a group of ~20 users is definitely viable)

There is a **basebot** (which does very little) and a slightly more capable version **name_tbc** 

## Install

* git clone from this repo
	* FILL IN INSTRUCTIONS
* create virtual environment
	* virtualenv2 venv
* activate virtual environment
	* source venv/bin/activate
* pip install
	* pip install requirements.txt
{'fraction_non_alphanumeric': 0.04433849821215733, 'fraction_numerical': 0.0057210965435041715, 'mean_word_length': 4.421188630490956, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3762703', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1071, 'n_words': 664}