Neural Question Answering at Scale. Use modern transformer based models like BERT to find answers in large document collections
Project description
Introduction
The performance of modern Question Answering Models (BERT, ALBERT …) has seen drastic improvements within the last year enabling many new opportunities for finding information more efficiently. However, those models are usually designed to find answers within rather small text passages. Haystack let’s you scale QA models to large collections of documents!
Haystack is designed in a modular way and is tightly integrated with the FARM framework for training QA models. Swap your models easily from BERT to roBERTa and scale the database from dev (Sqlite) to production (PostgreSQL, elasticsearch …).
Core Features
Most powerful models: Utilize all the latest transformer based models (BERT, ALBERT roBERTa …)
Modular & future-proof: Avoid technical debt. With haystack you can easily switch to newer models once they get published.
Developer friendly: Easy to debug, extend and modify.
Scalable: Switch from dev to production within minutes.
Components
Retriever: Fast, simple model that identify candidate passages from a large collection of documents. Algorithms include TF-IDF, which is similar to what’s used in popular search systems like Elasticsearch. The Retriever helps to narrow down the scope for Reader to smaller units of text where a given question could be answered.
Reader: Powerful neural model that read through texts in detail to find an answer. Use diverse models like BERT, Roberta or XLNet trained via the FARM Framework on SQuAD like tasks. The Reader takes multiple passages of text as input and returns top-n answers with corresponding confidence scores.
Finder: Glues together a Reader and a Retriever as a pipeline to provide an easy-to-use question answering interface.
Labeling Tool: (Coming soon)
Resources
Tutorial 1 - Basic QA Pipeline: Jupyter notebook or Colab
Quickstart
Installation
There are two ways to install:
(recommended) from source,
git clone <url>
and runpip install [--editable] .
from the root of the repositry.from PyPI, do a
pip install farm-haystack
Usage
Configuration
The configuration can be supplied in a qa_config.py
placed in the PYTHONPATH. Alternatively, the DATABASE_URL
can also be set an an environment variable.
Deployment
SQL Backend
The database ORM layer is implemented using SQLAlchemy library. By default, it uses the file-based SQLite database. For large scale deployments, the configuration can be changed to use other compatible databases like PostgreSQL or MySQL.
Elasticsearch Backend
(Coming soon)
REST API
A Flask based HTTP REST API is included to use the QA Framework with UI or integrating with other systems. To serve the API, run FLASK_APP=farm_hackstack.api.inference flask run
.
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
Hashes for farm-haystack-0.1.0.post2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 813f00e2bef7407448fccb1e486b16c8078f52cc7dca31b4bdf6f3c6d3d928f2 |
|
MD5 | 320e4b03c371d37cb14094c2971727fc |
|
BLAKE2b-256 | 4f9ce43877fda5183cc2adc9539ff6a05ad525051893de3391b5058628e675b4 |