-
Notifications
You must be signed in to change notification settings - Fork 307
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
[new model] Identify spam comments #3994
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @jpangas! Please see my comments.
bugbug/comment_features.py
Outdated
class UnknownLinkAtBeginning(CommentFeature): | ||
name = "Unknown Link found at Beginning of the Comment" | ||
|
||
def __init__(self, domains_to_ignore=set()): | ||
self.known_domains = domains_to_ignore | ||
|
||
def __call__(self, comment, **kwargs): | ||
urls = extract_urls_and_domains(comment["text"], self.known_domains)["urls"] | ||
|
||
words = comment["text"].split() | ||
return words[0] in urls if words else False | ||
|
||
|
||
class UnknownLinkAtEnd(CommentFeature): | ||
name = "Unknown Link found at End of the Comment" | ||
|
||
def __init__(self, domains_to_ignore=set()): | ||
self.known_domains = domains_to_ignore | ||
|
||
def __call__(self, comment, **kwargs): | ||
urls = extract_urls_and_domains(comment["text"], self.known_domains)["urls"] | ||
|
||
words = comment["text"].split() | ||
return words[-1] in urls if words else False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, we could return the index for the start of the first link and the index for the end of the last link.
@jpangas wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds good. Let me try it out and I will share the results.
This is currently blocked by #4097 |
Closes #3377
This PR introduces the
spamcomment
model which is trained to identify spam comments. Later, it will be used to tag potential spam comments.The model is a work in progress and still needs some features to be added, refined and experimented.
Train on Taskcluster: spamcomment