Spaces:
Runtime error
Runtime error
iamviveksrk
commited on
Commit
β’
8956e4f
1
Parent(s):
d2f3fdd
ML pipeline generation
Browse files
document_store.py β pipeline.py
RENAMED
@@ -1,7 +1,16 @@
|
|
1 |
from haystack.document_stores import InMemoryDocumentStore
|
|
|
|
|
|
|
|
|
2 |
import joblib
|
3 |
|
4 |
docs = joblib.load('docs.joblib')
|
5 |
|
6 |
document_store = InMemoryDocumentStore()
|
7 |
document_store.write_documents(docs)
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from haystack.document_stores import InMemoryDocumentStore
|
2 |
+
from haystack.nodes import TfidfRetriever
|
3 |
+
from haystack.pipelines import ExtractiveQAPipeline
|
4 |
+
from haystack.nodes import FARMReader
|
5 |
+
|
6 |
import joblib
|
7 |
|
8 |
docs = joblib.load('docs.joblib')
|
9 |
|
10 |
document_store = InMemoryDocumentStore()
|
11 |
document_store.write_documents(docs)
|
12 |
+
|
13 |
+
retriever = TfidfRetriever(document_store)
|
14 |
+
reader = FARMReader(model_name_or_path="ixa-ehu/SciBERT-SQuAD-QuAC")
|
15 |
+
|
16 |
+
pipeline = ExtractiveQAPipeline(reader, retriever)
|