A modern and lightweight NLP interface for Question-Answering systems and more.
Fork this project to showcase your Python models with elegant web application in no time!
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
Python is one the trending programming languages to build and run Natural Language Processing pipelines. However, while programming a simple GUI framework is not much of a difficult task in Python, building a modern and nice interface can be a real nightmare, involving heavy external libraries and steep learning curves.
This projects aims to provide a simple environment to showcase Huggingface NLP Models internally with modern and well-designed user interfaces. By binding Python with HTML, CSS and Javascript with Eel (a little Python library for making simple Electron-like apps), this environment can be easily extended by those who are familiar with web design to build amazing web application within a few hours, with almost no additional effort.
With this aim in mind, I decided to implement a Qustion-Answering (QA) bot, called "Ask Me Anything (AMA) Bot" and based on Deepset's RoBERTa implementation , hosted on Huggingface and trained on SQuAD 2.0 for extractive QA.
This project is mainly written in Python+Javascript and built with:
- Huggingface Transformers for the NLP pipeline
- Eel for the Python-Javascript binding
- Bootstrap for front-end UI design
To get a local copy of the AMA Bot up and running follow these simple example steps.
This project depends on two Python Modules that must be installed in your virtual environment before running the main script.
- huggingface transformers
python -m pip install transformers
- eel
python -m pip install eel
- Copy this repository
- Activate the virtual environment where Python Modules are installed
- Run the main script
python main.py
You can also create a runnable batch file on Windows. Check the gui.bat
template provided and change the path to point to your target virtual environment.
The way extractive QA bots work is simple.
- The user provides the context, which is usually a relatively long text that is supposed to include the answers to the user's questions.
- The user formulates a question and press the ask button.
- The model will scan the context and output its guess about the answer, which will be part of the context itself. The answer comes with a confidence core, which is an indicator of how reliable the model's prediction is.
- Basic implementation
- Confidence Score
- Answer highlighting in context
- Uploading different checkpoint
See the open issues for a full list of proposed features (and known issues).
Distributed under the GPL-3 License. See LICENSE.txt
for more information.
Project Link: https://github.com/detsutut/qa-webgui
Gratitude for support, assistance and inspiration goes to: