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

[new model] Identify spam comments #3994

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open

Conversation

jpangas
Copy link
Collaborator

@jpangas jpangas commented Jan 24, 2024

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

bugbug/comment_features.py Outdated Show resolved Hide resolved
@jpangas jpangas requested a review from marco-c February 28, 2024 12:09
Copy link
Member

@suhaibmujahid suhaibmujahid left a 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/models/spamcomment.py Outdated Show resolved Hide resolved
Comment on lines 131 to 154
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
Copy link
Member

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?

Copy link
Collaborator Author

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.

@jpangas jpangas marked this pull request as ready for review March 13, 2024 11:08
@jpangas
Copy link
Collaborator Author

jpangas commented Mar 14, 2024

This is currently blocked by #4097

@marco-c marco-c removed their request for review August 5, 2024 16:33
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.

Create a model to automatically tag spam comments
3 participants