Update search.py
This commit is contained in:
parent
34d29d7e8b
commit
f2cd8d88a2
1 changed files with 3 additions and 0 deletions
|
|
@ -430,6 +430,9 @@ class Dealer:
|
||||||
sorted_idx = np.argsort(sim_np * -1)
|
sorted_idx = np.argsort(sim_np * -1)
|
||||||
|
|
||||||
valid_idx = [int(i) for i in sorted_idx if sim_np[i] >= similarity_threshold]
|
valid_idx = [int(i) for i in sorted_idx if sim_np[i] >= similarity_threshold]
|
||||||
|
# use top to limit the maximum number of returned results
|
||||||
|
top = min(len(valid_idx), top)
|
||||||
|
valid_idx = valid_idx[:top]
|
||||||
filtered_count = len(valid_idx)
|
filtered_count = len(valid_idx)
|
||||||
ranks["total"] = int(filtered_count)
|
ranks["total"] = int(filtered_count)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue