detect_spam module
Handler for spam note detection, store bad word list and provide
utilities to evaluate the quality of notes.
-
class
detect_spam.SpamDetector(bad_words)[source]
-
bad_words_set = set([])
-
estimate_spam_score(text)[source]
Estimate the probability of the input text being spam.
Returns:
a float score between [0,1], or None if text is empty
after normalization.
-
detect_spam.normalize(string)[source]
Normalize a string to all lowercase and remove accents.