add img to readme. update FARM api format

This commit is contained in:
Malte Pietsch 2019-11-25 14:39:36 +01:00
parent 45365e6b99
commit 6f8a015145
5 changed files with 13 additions and 7 deletions

View File

@ -12,10 +12,10 @@ Haystack is designed in a modular way and is tightly integrated with the `FARM <
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
- **Developer friendly**: Easy to debug, extend and modify.
- **Scalable**: Switch from dev to production within minutes.
Components
@ -40,6 +40,11 @@ There are two ways to install:
* (recommended) from source, :code:`git clone <url>` and run :code:`pip install [--editable] .` from the root of the repositry.
* from PyPI, do a :code:`pip install farm_haystack`
Usage
-----
.. image:: https://raw.githubusercontent.com/deepset-ai/haystack/master/docs/img/code_snippet_usage.png
Configuration
-------------
The configuration can be supplied in a :code:`qa_config.py` placed in the PYTHONPATH. Alternatively, the :code:`DATABASE_URL` can also be set an an environment variable.

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

0
example.py Normal file
View File

View File

@ -60,7 +60,7 @@ class Finder:
retrieved_scores, question, candidate_doc_ids=candidate_doc_ids
)
results = self.reader.predict(inference_dicts, top_k=top_k_reader)
return results
return results["results"]
def _convert_retrieved_text_to_reader_format(
self, retrieved_scores, question, candidate_doc_ids=None, verbose=True

View File

@ -18,7 +18,8 @@ def create_db():
db.session.create_all()
def print_answers(answers, details="all"):
def print_answers(results, details="all"):
answers = results[0]["answers"]
pp = pprint.PrettyPrinter(indent=4)
if details != "all":
if details == "minimal":