Skip to content

Commit

Permalink
Merge pull request #619 from quartata/master
Browse files Browse the repository at this point in the history
Lowered threshold for similar_answer
  • Loading branch information
ArtOfCode- committed Mar 26, 2017
2 parents 6fb042f + a58e38e commit 02a7186
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion findspam.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from helpers import all_matches_unique, log

SIMILAR_THRESHOLD = 0.95
SIMILAR_ANSWER_THRESHOLD = 0.7
EXCEPTION_RE = r"^Domain (.*) didn't .*!$"
RE_COMPILE = regex.compile(EXCEPTION_RE)
COMMON_MALFORMED_PROTOCOLS = [
Expand Down Expand Up @@ -397,7 +398,7 @@ def similar_answer(post):
sanitized_answer = strip_urls_and_tags(other_answer.body)
ratio = similar_ratio(sanitized_body, sanitized_answer)

if ratio >= SIMILAR_THRESHOLD:
if ratio >= SIMILAR_ANSWER_THRESHOLD:
return False, False, True, \
u"Answer similar to answer {}, ratio {}".format(other_answer.post_id, ratio)

Expand Down

0 comments on commit 02a7186

Please sign in to comment.