Skip to content

Commit

Permalink
refactor: adjust splade script
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianWoelki committed Oct 31, 2024
1 parent caba1af commit cffaa5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/splade.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def clean_text(text):
for example in tqdm(training_dataset, desc="Processing"):
text = clean_text(example['Overview'])
texts.append(text)
if len(texts) == 11: # temporary
if len(texts) == 25000: # temporary
break

def sparse_vector_to_dict(vector):
Expand Down Expand Up @@ -65,7 +65,7 @@ def compute_similarity(vec1, vec2):
for text in tqdm(texts, desc="Generating sparse vectors"):
sparse_vectors.append(sparse_vector_to_dict(create_splade(text)))

num_queries = 2
num_queries = round(len(texts) / 10) # Like in `generator_sparse.rs` file
queries = []
query_vectors = []
groundtruth = []
Expand Down

0 comments on commit cffaa5a

Please sign in to comment.