Haystack v0.4.0 adds FAISSDocumentStore for scalable dense retrieval, Apache Tika file conversion, and DPR support for InMemoryDocumentStore.
$ git clone --branch v0.4.0 https://github.com/deepset-ai/haystack.git # already have the repo? check out this version: $ git checkout v0.4.0
document_store = FAISSDocumentStore(sql_url="sqlite:///mydb.db", vector_size=768)
tika_converter = TikaConverter(
tika_url="http://localhost:9998/tika",
remove_numeric_tables=False,
remove_whitespace=False,
remove_empty_lines=False,
remove_header_footer=False,
valid_languages=None,
)
result = tika_converter.convert(file_path="documents/report.docx")
print(result["text"]) reader.train(
data_dir="data/squad",
train_filename="train-v2.0.json",
num_processes=8,
) - ›Adds FAISSDocumentStore(sql_url, vector_size) for scalable approximate nearest-neighbour dense retrieval, using FAISS for embeddings and SQL for text/metadata storage.
- ›Adds TikaConverter(tika_url, remove_numeric_tables, remove_whitespace, remove_empty_lines, remove_header_footer, valid_languages) with a .convert(file_path) method to extract text from docx, pptx, html, epub, odf, and other formats via Apache Tika.
- ›Adds
refresh_typeargument toElasticsearchDocumentStore. - ›Adds
indexargument to Finder.get_answers() and Finder._via_similar_questions(). - ›Adds
num_processesparameter to reader.train() to configure multiprocessing during training.
+7 moreshow less
- ›Adds unanswerable-question support and 'no answer' aggregation to
TransformersReader. - ›Adds
MultiLabelaggregation for no-answer labels across multiple passages. - ›Adds DPR (
DensePassageRetriever) support forInMemoryDocumentStore. - ›Adds eval capability for
DensePassageRetrieverincluding refactored label/feedback handling. - ›Adds export-answers-to-CSV function.
- ›Adds option to update existing documents when indexing in document stores.
- ›Adds method to update meta fields for documents in
ElasticsearchDocumentStore.
- !The
databasemodule is renamed todocument_store; imports must be updated accordingly. - !The
indexingmodule is split intofile_converterandpreprocessor; imports must be updated. - !Document, Label, and Multilabel classes are moved to
schema; update imports tofrom haystack import Document, Label, Multilabel. - !File converter interface changed: Fileconverter.extract_pages(file_path=Path('...')) (which returned pages and meta) is replaced by Fileconverter.convert(file_path='...', meta={...}), which returns a dict with
text(using\fpage-break symbols) andmeta. - !
DensePassageRetrieversignature changed: now acceptsquery_embedding_modelandpassage_embedding_model(HuggingFace model hub strings) instead of the previous Facebook-codebase arguments. - !The
tagsfield on Documents is removed; filtering must now use themetafield (e.g.,{'text': 'some', 'meta': {'category': ['1', '2']}}instead of{'text': 'some', 'tags': ['category1', 'category2']}).