peter2000 commited on
Commit
576942c
1 Parent(s): fedecb4

Update appStore/keyword_search.py

Browse files
Files changed (1) hide show
  1. appStore/keyword_search.py +7 -0
appStore/keyword_search.py CHANGED
@@ -31,6 +31,13 @@ logger = logging.getLogger(__name__)
31
  def start_haystack(documents_processed):
32
  document_store = InMemoryDocumentStore()
33
  document_store.write_documents(documents_processed)
 
 
 
 
 
 
 
34
  retriever = EmbeddingRetriever(document_store=document_store)
35
  reader = FARMReader(model_name_or_path="deepset/tinyroberta-squad2", use_gpu=True) #deepset/roberta-base-squad2
36
  pipeline = ExtractiveQAPipeline(reader, retriever)
 
31
  def start_haystack(documents_processed):
32
  document_store = InMemoryDocumentStore()
33
  document_store.write_documents(documents_processed)
34
+
35
+ retriever = EmbeddingRetriever(
36
+ document_store=document_store,
37
+ embedding_model="sentence-transformers/multi-qa-mpnet-base-dot-v1",
38
+ model_format="sentence_transformers")
39
+ document_store.update_embeddings(retriever)
40
+
41
  retriever = EmbeddingRetriever(document_store=document_store)
42
  reader = FARMReader(model_name_or_path="deepset/tinyroberta-squad2", use_gpu=True) #deepset/roberta-base-squad2
43
  pipeline = ExtractiveQAPipeline(reader, retriever)