Spaces:
Runtime error
Runtime error
File size: 485 Bytes
8956e4f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
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)
|