Add ai methods that sort threads based on content similarity w/ given…#1391
Merged
OpenSourceSimon merged 3 commits intoelebumm:masterfrom Dec 19, 2022
Merged
Add ai methods that sort threads based on content similarity w/ given…#1391OpenSourceSimon merged 3 commits intoelebumm:masterfrom
OpenSourceSimon merged 3 commits intoelebumm:masterfrom
Conversation
Collaborator
OpenSourceSimon
left a comment
There was a problem hiding this comment.
Will need to test this but thanks! Good functionality!
OpenSourceSimon
approved these changes
Dec 19, 2022
Collaborator
OpenSourceSimon
left a comment
There was a problem hiding this comment.
Tested and works! Thank you for your PR
Contributor
Author
|
No problem :) Keep doing a great job |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Hi, I added a new feature to your project which refers to sorting threads based on their similarity to the keywords given by the user. The way this is achieved is through a HuggingFace library model, which creates an embedding from the title and content of each thread and compares it to the embedding of each keyword. Thus, for each thread the overall similarity to the keywords is summed up, through which the objects of type "Submission" are sorted and then given to the function "get_subreddit_undone" for further checks (allow_nsfw, already done etc). Finally in case that all the threads are used up then for each different date filter "VALID_TIME_FILTERS" applied the threads are re-sorted based on their similarity to the keywords. I am open to your opinion about this feature and sorry about any possible mistakes, this is my first contribution to a project.
Issue Fixes
None
Checklist:
How to test -> Run the main.py file