-
Notifications
You must be signed in to change notification settings - Fork 750
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
feat: Internal deduplication impl. #1568
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.
Thanks @keli-wen @NeilJohnson0930 @raywhoelse
Left some comments below, I think we can implement some methods to further improve the efficiency, feel free to check and review the PR here #1579 for the refactor, let me know if there's anything we can further discuss!
|
||
import numpy as np | ||
from pydantic import BaseModel | ||
from sklearn.metrics.pairwise import cosine_similarity |
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.
use lazy import make sklearn
and numpy
optional
""" | ||
The result of deduplication. |
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.
docstring format is not aligned with camel style, check https://github.com/camel-ai/camel/blob/master/CONTRIBUTING.md#guideline-for-writing-docstrings
|
||
def deduplicate_internally( | ||
texts: List[str], | ||
threshold: float = 0.65, |
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.
should we validate threshold
value?
Description
The implementation of internal deduplication utils function.
Motivation and Context
Refer to #1517
Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Checklist
Go over all the following points, and put an
x
in all the boxes that apply.If you are unsure about any of these, don't hesitate to ask. We are here to help!