Skip to content

Commit

Permalink
ref: Remove message similarity calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
jangjodi committed Sep 19, 2024
1 parent 54117ec commit cbe15d8
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/seer/grouping/grouping.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import difflib
import gc
import logging
from functools import wraps
Expand Down Expand Up @@ -367,9 +366,6 @@ def get_nearest_neighbors(self, issue: GroupingRequest) -> SimilarityResponse:

similarity_response = SimilarityResponse(responses=[])
for record, distance in results:
message_similarity_score = difflib.SequenceMatcher(
None, issue.message, record.message
).ratio()
should_group = distance <= issue.threshold

if should_group:
Expand All @@ -387,7 +383,7 @@ def get_nearest_neighbors(self, issue: GroupingRequest) -> SimilarityResponse:
GroupingResponse(
parent_hash=record.hash,
stacktrace_distance=distance,
message_distance=1.0 - message_similarity_score,
message_distance=0.0,
should_group=should_group,
)
)
Expand Down Expand Up @@ -443,13 +439,10 @@ def insert_batch_grouping_records(

if nearest_neighbor:
neighbor, distance = nearest_neighbor[0][0], nearest_neighbor[0][1]
message_similarity_score = difflib.SequenceMatcher(
None, entry.message, neighbor.message
).ratio()
response = GroupingResponse(
parent_hash=neighbor.hash,
stacktrace_distance=distance,
message_distance=1.0 - message_similarity_score,
message_distance=0.0,
should_group=True,
)
groups_with_neighbor[str(entry.group_id)] = response
Expand Down

0 comments on commit cbe15d8

Please sign in to comment.