Question Answering Dialog System
Project description
Let Me Answer For You
A Simple and Powerful Deep Learning Dialog System for Question and Answering
A bot that can answer specific and complex questions. It has been built on top of the deeppavlov library
Pip Install
The sentiment classifier can be found on PyPI so you can just run:
pip install let_me_answer_for_you
Simple Usage
Once the package is installed you can download the file chatbot.py
of the repo and run:
python chatbot.py
After finishing the installation process, an interface like the following will appear:
In this example, there was already an answer to the question and a new context was also added. The function chatbot.py
accepts the context and faq files as their flags. If no flags for the files are provided, the system reads them (if inexistent, makes them) from the data directory at same path-level of chatbot.py
Technologies
The Chatbot is based on two types of question/answer models:
It is strongly recommended to consult the deeppavlov library for further details of the available models for dialog systems.
Structure of the Package
The chatbot.py
module calls the ChatBot
class in let_me_answer_for_you.chatbot
. The ChatBot
is the child of the DialogSystem
class. This class lives in let_me_answer_for_you.chatbot.dialog_system
and is composed of the three main methods of the library:
The first method retrieves a set of answers for a given question. The second method adds a new question-answer pair to the dataset and the third method adds a new context to the dataset. These are the methods that may be exported as the API calls.
Documentation
Requirements
The library has been tested in python 3.7
Install the configuration files by instantiating the SystemClass
from let_me_answer_for_you.dialog_system import DialogSystem()
ds = DialogSystem( context_data_file=None,
faq_data_file=None,
configs_faq=None,
download_models=True)
If the context_data_file or the faq_data_file parameters are None
, a data directory will be created in the directory where the script is running. The data directory will contain the FAQ or the context CSV files
Get Response
To get a response to a question call the method question_answer
in the instance of SystemClass
ds.question_answer()
Introduce question:
what can you offer me at Intekglobal?
what can you offer me at Intekglobal?:
1: expert resources to connect your different devices and exchange data within those devices
2: Connect with us for further information
3: We like to provide world class solutions with complete features what you want to impletement in your business!
New Question-Answer Pair
Populate the FAQ data file with a new question answer by calling the method new_q_a
:
ds.new_q_a()
Introduce question:
What type of Dialog System is this?
Introduce the answer:
Is a combination of context question answering system with a faq system
New Context
The systems accept a response as a context. The advantage of having contexts is that many answers can be found in one context. To create a new context, call the new_context
method:
ds.new_context()
Give context a title:
IOT
Introduce the context:
We can provide expert resources to connect your different devices and exchange data within those devices. Further make the data accessible via web tools. Connect with us for further information. DevOps Our team can help you organization to implement best DevOps practices that can automate the processes between software development and various IT teams, in order that they can build, test, and release software faster and more reliably.
Docker
A container with all the configurations installed can be pulled it with the following instruction:
docker pull ejimenezr/dialog_system
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
Built Distribution
Hashes for let_me_answer_for_you-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb6c7045f1920be21982d410680bea223effbd2d8b601c1943f80736c44b29e6 |
|
MD5 | 5b6340d9ab2e9f423dbb57ddbc178ba1 |
|
BLAKE2b-256 | 20e7e6b6610acc93258301ba4c7f12cdcdac1dfc1c337d9349a5d4d359ef410b |
Hashes for let_me_answer_for_you-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95c4a344f000f3bda4f9d4c12d0bbfb861af7fcc0c52e386e203591c8429743c |
|
MD5 | b21ed6967106d15a577ba8c0b4cfe1f8 |
|
BLAKE2b-256 | 733d628fb0a43f3e3c77a9a65e5a8e4e47a6ac17bc110a30b9aaed1ad3234b34 |