"ZEBEL" (pronounced like "rebel") is an intelligent IRC bot.
Its primary goal is gathering intelligence and secrets through contextual analysis of the conversations on IRC. I almost got you! :-)
Jokes aside, Zebel is a simple IRC bot that whenever you talk to him, tries to reply with a relatively relevant message. If you're curious, drop by in #zebel on irc.freenode.org and have a chat with him.
When someone in an IRC channel, talks to Zebel, e.g. sends out a public message
like zebel: greetings
, Zebel tries to make sense of your message as below:
- It first sanitises the message; removing stop words, punctuations and unimportant words.
- The sanitised text is fed into natural language processing to determine each word's role in the sentence.
- For each word and its given role, the list of synonyms are extracted from NLP database.
- The words along with their synonyms are forged into a query.
- A full-text search on the DB is performed.
- If anything relevant enough is found, it is returned.
- If there's no relevant enough answer in the database, a fuzzy search for the original message is performed.
- If fuzzy search finds a good enough answer, it is returned.
- Even if fuzzy search can't help, Zebel simply gives up on finding a reasonable answer and instead just picks up a message from the "confused" category.
Zebel, developed with Python 3.4+, is composed of 3 main parts:
- The IRC client (irc library)
- The database (ElasticSearch)
- The text and natural language processing unit (nltk library)
If you plan to run your own Zebel instance:
- Install Python 3.4
- Create a virtual environment for Zebel, e.g.
pyvenv-3.4 .venv
- Activate the venv, e.g.
source .venv/bin/activate
- Clone Zebel.
- Install required packages, e.g.
cd zebel && pip install -r requirements.txt
- Install nltk data, e.g.
python -m nltk.downloader all
. Warning: this downloads quite a bit of data. - Edit
zebel.ini
to your needs. - Install and run ElasticSearch.
- Import Zebel's quotes and messages into ElasticSearch,
e.g.
data/drop-import-all.sh
- Run Zebel, e.g.
cd zebel && python main.py
- The bot named "vandusen" in #chicken on FreeNode was a great inspiration to me.