orionweller commited on
Commit
c2fe84b
β€’
1 Parent(s): 52b042a
Files changed (4) hide show
  1. .gitignore +1 -0
  2. README.md +1 -1
  3. app.py +5 -3
  4. packages.txt +1 -0
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ __pycache__
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Msmarco Bm25
3
  emoji: πŸ“‰
4
  colorFrom: pink
5
  colorTo: purple
 
1
  ---
2
+ title: MSMarco BM25
3
  emoji: πŸ“‰
4
  colorFrom: pink
5
  colorTo: purple
app.py CHANGED
@@ -6,12 +6,14 @@ import os
6
  if not os.path.exists('msmarco-passage'):
7
  os.system('python -c "from pyserini.search import LuceneSearcher; LuceneSearcher.from_prebuilt_index(\'msmarco-passage\')"')
8
 
 
 
 
 
 
9
  def search_pyserini(query):
10
  try:
11
- searcher = LuceneSearcher('msmarco-passage')
12
- searcher.set_bm25(k1=0.9, b=0.4)
13
  hits = searcher.search(query, k=10)
14
-
15
  results = []
16
  for i, hit in enumerate(hits):
17
  doc = searcher.doc(hit.docid)
 
6
  if not os.path.exists('msmarco-passage'):
7
  os.system('python -c "from pyserini.search import LuceneSearcher; LuceneSearcher.from_prebuilt_index(\'msmarco-passage\')"')
8
 
9
+
10
+ searcher = LuceneSearcher('msmarco-passage')
11
+ searcher.set_bm25(k1=0.9, b=0.4)
12
+
13
+
14
  def search_pyserini(query):
15
  try:
 
 
16
  hits = searcher.search(query, k=10)
 
17
  results = []
18
  for i, hit in enumerate(hits):
19
  doc = searcher.doc(hit.docid)
packages.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ default-jre