Skip to content

Commit

Permalink
tested on benchmark and small fixes to pyserini bm25 to spare
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Almeida committed Oct 24, 2023
1 parent 06152f1 commit 4e47275
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion converting_from_anserini.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def main(dataset_folder):


sparseCSR_collection = SparseCollectionCSR.from_bm25_pyserini_iterator(os.path.join(dataset_folder, "anserini_index"),
sparseCSR_collection = SparseCollectionCSR.from_bm25_pyserini_index(os.path.join(dataset_folder, "anserini_index"),
k1=1.2,
b=0.75,
dtype=spare.float32,
Expand Down
2 changes: 1 addition & 1 deletion spare/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def from_bm25_pyserini_index(cls,
sparse_collection = cls(index_reader.stats()["documents"],
vec_dim=index_reader.stats()["unique_terms"],
dtype=dtype,
weighting_schema=BM25WeightingSchema(k1=k1, b=b, k3=None, idf_weighting=idf_weighting),
weighting_schema=BM25WeightingSchema(k1=k1, b=b, idf_weighting=None),
backend=backend,
**kwargs)

Expand Down
2 changes: 1 addition & 1 deletion spare/weighting_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _get_vars_to_save(self):
return super()._get_vars_to_save() | {
"k1": self.k1,
"b": self.b,
"idf_weighting": idf_weighting
"idf_weighting": self.idf_weighting
}

def _load_vars(self, data):
Expand Down

0 comments on commit 4e47275

Please sign in to comment.