Skip to content

Commit

Permalink
Fix bug in bm25
Browse files Browse the repository at this point in the history
  • Loading branch information
ignorejjj committed Jun 23, 2024
1 parent 5905168 commit 5009089
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions flashrag/retriever/index_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,7 @@ def build_bm25_index(self):
temp_dir = self.save_dir + "/temp"
temp_file_path = temp_dir + "/temp.jsonl"
os.makedirs(temp_dir)

if self.have_contents:
shutil.copyfile(self.corpus_path, temp_file_path)
else:
with open(temp_file_path, "w") as f:
for item in self.corpus:
f.write(json.dumps(item) + "\n")
shutil.copyfile(self.corpus_path, temp_file_path)

print("Start building bm25 index...")
pyserini_args = ["--collection", "JsonCollection",
Expand Down

0 comments on commit 5009089

Please sign in to comment.