iloncka commited on
Commit
09ac51e
1 Parent(s): bbffa0d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -6,7 +6,7 @@ from haystack.utils import convert_files_to_docs
6
  from haystack.schema import Answer
7
  from haystack.document_stores import InMemoryDocumentStore
8
  from haystack.pipelines import ExtractiveQAPipeline
9
- from haystack.nodes import FARMReader, BM25Retriever
10
  import logging
11
  from markdown import markdown
12
  from annotated_text import annotation
@@ -25,7 +25,7 @@ DEFAULT_ANSWER_AT_STARTUP = os.getenv("DEFAULT_ANSWER_AT_STARTUP", "Paris")
25
  def place_header_center(text, lottie_data):
26
  cgap1, ctitle, cgap2 = st.columns([3, 3, 1])
27
  with cgap1:
28
- st_lottie(lottie_data, height=150)
29
  with ctitle:
30
  st.title(text)
31
  with cgap2:
@@ -52,7 +52,7 @@ def load_and_write_data(document_store):
52
  # def start_haystack():
53
  document_store = InMemoryDocumentStore() # use_bm25=True
54
  load_and_write_data(document_store)
55
- retriever = BM25Retriever(document_store=document_store)
56
  reader = FARMReader(model_name_or_path="mrm8488/RuPERTa-base-finetuned-squadv1",
57
  use_gpu=False,
58
  num_processes=1)
 
6
  from haystack.schema import Answer
7
  from haystack.document_stores import InMemoryDocumentStore
8
  from haystack.pipelines import ExtractiveQAPipeline
9
+ from haystack.nodes import FARMReader, TfidfRetriever
10
  import logging
11
  from markdown import markdown
12
  from annotated_text import annotation
 
25
  def place_header_center(text, lottie_data):
26
  cgap1, ctitle, cgap2 = st.columns([3, 3, 1])
27
  with cgap1:
28
+ st_lottie(lottie_data, height=250)
29
  with ctitle:
30
  st.title(text)
31
  with cgap2:
 
52
  # def start_haystack():
53
  document_store = InMemoryDocumentStore() # use_bm25=True
54
  load_and_write_data(document_store)
55
+ retriever = TfidfRetriever(document_store=document_store)
56
  reader = FARMReader(model_name_or_path="mrm8488/RuPERTa-base-finetuned-squadv1",
57
  use_gpu=False,
58
  num_processes=1)