-
Notifications
You must be signed in to change notification settings - Fork 68
[MODEL-1448] Upsert label feedback method #1684
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
Conversation
55e3a6a
to
8d5b97c
Compare
libs/labelbox/src/labelbox/client.py
Outdated
@@ -2216,3 +2216,27 @@ def get_embedding_by_name(self, name: str) -> Embedding: | |||
return e | |||
raise labelbox.exceptions.ResourceNotFoundError(Embedding, | |||
dict(name=name)) | |||
|
|||
def upsert_label_feedback(self, label_id: str, feedback: str, | |||
scores: Dict[str, float]) -> Entity.Label: |
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.
return type is Entity.Label
, but actual type is List[Entity.Label]
. Probably its better to match the actual returned type
libs/labelbox/src/labelbox/client.py
Outdated
Returns: A list of LabelScore instances | ||
|
||
""" | ||
mutation_str = """mutation UpsertAutoQaLabelFeedbackPyApi($labelId: ID!, $feedback: String!, $scores: Json!){ |
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.
would be nice to keep mutation string formatted to keep style consistency across the file
def upsert_label_feedback(self, label_id: str, feedback: str, | ||
scores: Dict[str, float]) -> Entity.Label: | ||
""" | ||
|
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.
extra whitespace
libs/labelbox/src/labelbox/client.py
Outdated
scores: A dict of scores, the key is a score name and the value is the score value | ||
Returns: A list of LabelScore instances |
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.
white space between to keep style consistent with other methods
feedback: Free text comment regarding the label | ||
scores: A dict of scores, the key is a score name and the value is the score value | ||
Returns: A list of LabelScore instances | ||
|
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.
extra whitespace
""" | ||
a label score | ||
|
||
Attributes | ||
name | ||
score | ||
|
||
""" |
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.
would be nice to preserve the same docs style format as with the rest of schema objects. Look Dataset
, Batch
for examples.
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.
If I understand this class correctly, this is just a data
class.
My personal opinion you should use a pydantic model instead of DbObject
as a parent here. DbObject is our home-grown graphql client framework. Unless your class executes queries using this framework, no need to use it
""" | ||
a label score | ||
|
||
Attributes | ||
name | ||
score | ||
|
||
""" |
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.
If I understand this class correctly, this is just a data
class.
My personal opinion you should use a pydantic model instead of DbObject
as a parent here. DbObject is our home-grown graphql client framework. Unless your class executes queries using this framework, no need to use it
@@ -0,0 +1,15 @@ | |||
from labelbox import pydantic_compat |
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.
Since this is a new package / class we also need to make sure it will appear in readthedocs by adding a new .rst in docs/labelbox/ file and updating docs/labelbox/index.rst
FYI the same is documented in CONTRIBUTING.md under General Guidelines
A list of LabelScore instances | ||
""" | ||
mutation_str = """ | ||
mutation UpsertAutoQaLabelFeedbackPyApi( |
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.
Since this our public doc (on readthedocs) please do not internal mutation code here
can you elaborate?
Rather, I would recommend to add some method usages
will add a usage example now 👍
Description
Introduced a method to submit label feedback which includes a free-text message and numeric scores.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
All Submissions
New Feature Submissions
Changes to Core Features