Skip to content

Latest commit

 

History

History
61 lines (37 loc) · 3.84 KB

README.md

File metadata and controls

61 lines (37 loc) · 3.84 KB

twitter-bot Build Status

Simple knowledge based question answering system for factoid questions with the help of wikipedia.

Getting started

First clone our repository:

git clone --depth 1 https://github.com/QABot-Team/twitter-bot.git --branch master --single-branch

Switch to the main project directory and install all dependencies:

cd twitter-bot/qa
./install.sh

Then you can run our application with the following command:

python src/main.py [--help]

External dependencies

The application requires a running elastic search instance with a indexed wikipedia dump. Host, port and index name of the elastic instance can be configured in our config.py.

Running tests

To write test cases we use the python unittest framework. To run our tests simply execute the following command:

python setup.py test

This uses pytest as test runner. If pytest is not installed it will be downloaded automatically.

Logging

For logging we use the Logger facade class which internal uses the python logger module. Our facade automatically adds the module name from which the log message was created.

Example:

from utils.logger import Logger
Logger.info('Start answer processing pipeline')

We use different log level for different purposes.

Level When it’s used Method call
DEBUG Detailed information, typically of interest only when diagnosing problems. Logger.debug(message)
INFO Confirmation that things are working as expected. Logger.info(message)
WARNING An indication that something unexpected happened, or indicative of some problem in the near future (e.g. ‘disk space low’). The software is still working as expected. Logger.warning(message)
ERROR Due to a more serious problem, the software has not been able to perform some function. Logger.error(message)
CRITICAL A serious error, indicating that the program itself may be unable to continue running. Logger.critical(message)

Link collection