Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve pyzor with min and halfscore threshold settings #4948

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mykeenu
Copy link

@mykeenu mykeenu commented Apr 27, 2024

For some e-mails, pyzor reports a very low number of both blacklist and whitelist hits. This pull request adds a mechanism to only set the pyzor symbol if there is a minimum amount of total reports. Further, it adds another setting that allows you to only set half of the calculated pyzor score if the total report count is lower than this second threshold setting.

Theoretically this could be further improved by making a linear formula between the settings instead of the two steps here.

Both new variables are set to zero by default in order to not break existing deployments.

This can be used by adding something like this to local.d/external_services.conf:

pyzor {
  #servers = "127.0.0.1:5953";
  default_score = 2.5;
  min_threshold = 5;
  halfscore_threshold = 20;
}

@vstakhov
Copy link
Member

It looks good but I think we can improve it slightly by adding a table to match thresholds and multipliers. For example, something like this:

thresholds = {
   5 = 0.0,
   10 = 0.6,
   20 = 0.7,
   30 = 1.0,
}

That will make min_threshold and other things redundant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants