test / pipeline.py
iamviveksrk's picture
ML pipeline generation
8956e4f
raw
history blame
485 Bytes
from haystack.document_stores import InMemoryDocumentStore
from haystack.nodes import TfidfRetriever
from haystack.pipelines import ExtractiveQAPipeline
from haystack.nodes import FARMReader
import joblib
docs = joblib.load('docs.joblib')
document_store = InMemoryDocumentStore()
document_store.write_documents(docs)
retriever = TfidfRetriever(document_store)
reader = FARMReader(model_name_or_path="ixa-ehu/SciBERT-SQuAD-QuAC")
pipeline = ExtractiveQAPipeline(reader, retriever)