Skip to content

[PLT-1207] Added prompt classification for python object support #1700

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

Merged
merged 18 commits into from
Jul 3, 2024

Conversation

Gabefire
Copy link
Collaborator

@Gabefire Gabefire commented Jun 27, 2024

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

  • Gives the ability to import annotations for prompt response projects
  • Made custom prompt classification annotation class for better validation (only one is allowed per label)
  • Did some testing and classification annotation class will work for a response (only classification). I had a response custom class but I think that is to complicated and reuses a bunch of code
  • Since we are deprecating the data type. I only allowed global keys to be passed in as a dict for data. I don't see the point of adding since we are deprecating.
  • Switch the default inference data type to GenericDataRowData to deserialize a label. This improves testing

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

All Submissions

  • Have you followed the guidelines in our Contributing document?
  • Have you provided a description?
  • Are your changes properly formatted?

New Feature Submissions

  • Does your submission pass tests?
  • Have you added thorough tests for your new feature?
  • Have you commented your code, particularly in hard-to-understand areas?
  • Have you added a Docstring?

@Gabefire Gabefire requested a review from a team as a code owner June 27, 2024 19:12
@Gabefire
Copy link
Collaborator Author

prompt_annotation = lb_types.PromptClassificationAnnotation(
    name="test",
    value=lb_types.PromptText(answer="the answer to the text questions right here"),
    
)

response_annotation = lb_types.ClassificationAnnotation(
    name="response_radio",
    value=lb_types.Radio(answer = 
                         lb_types.ClassificationAnswer(
                             name="1"
                         ))
)

label = []
label.append(
    lb_types.Label(
        data={"global_key": "clxxmppe00p36073qc3qqfvkq"},
        annotations=[
            prompt_annotation,
            response_annotation
        ],
    ))

Copy link
Contributor

@vbrodsky vbrodsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Gabefire all of my comments are nit(s), optional except the testing one.
I think we need to add an integration test that shows we can upload annotations of this type

@Gabefire Gabefire merged commit 7746479 into develop Jul 3, 2024
22 checks passed
@Gabefire Gabefire deleted the gu/prompt_response_support branch July 3, 2024 19:47
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.

2 participants