Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions drain3/drain.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def fast_match(self,
match_cluster = None

max_sim: Union[int, float] = -1
max_param_count = -1
min_param_count = len(tokens)
max_cluster = None

for cluster_id in cluster_ids:
Expand All @@ -139,9 +139,9 @@ def fast_match(self,
if cluster is None:
continue
cur_sim, param_count = self.get_seq_distance(cluster.log_template_tokens, tokens, include_params)
if cur_sim > max_sim or (cur_sim == max_sim and param_count > max_param_count):
if cur_sim > max_sim or (cur_sim == max_sim and param_count < min_param_count):
max_sim = cur_sim
max_param_count = param_count
min_param_count = param_count
max_cluster = cluster

if max_sim >= sim_th:
Expand Down