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

added text labels to the API and the backend #60

Merged
merged 4 commits into from Dec 26, 2022

Conversation

yk
Copy link
Collaborator

@yk yk commented Dec 25, 2022

Adds the ability for frontends to send text labels to the backend to be stored.

The idea is this, for example, when a user stumbles across a text that contains profanity, they can flag that to their frontend, which will send it to the backend. Text labels can be associated with a post ID, but do not have to be. We currently provide a list of labels in protocol -> TextLabel, but this is up to change. Labels are submitted with a score from 0.0 to 1.0. Not every label must be present in the sent data.

@yk yk linked an issue Dec 25, 2022 that may be closed by this pull request
@yk yk changed the title added text labels to the API added text labels to the API and the backend Dec 25, 2022
@yk yk linked an issue Dec 25, 2022 that may be closed by this pull request
Copy link
Collaborator

@andreaskoepf andreaskoepf left a comment

Choose a reason for hiding this comment

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

(I know it is a live-coding result. Just had some questions.)

backend/alembic/versions/2022_12_25_1705-067c4002f2d9_.py Outdated Show resolved Hide resolved
backend/oasst_backend/api/v1/text_labels.py Outdated Show resolved Hide resolved
backend/oasst_backend/models/text_labels.py Show resolved Hide resolved
oasst-shared/oasst_shared/schemas/protocol.py Outdated Show resolved Hide resolved
backend/oasst_backend/prompt_repository.py Show resolved Hide resolved
oasst-shared/oasst_shared/schemas/protocol.py Show resolved Hide resolved
Copy link
Collaborator

@andreaskoepf andreaskoepf left a comment

Choose a reason for hiding this comment

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

Ready for merge.

(Not sure if "free text" labels (without post-reference) are a real use-case but we will see. If it turns out not to be we can add a not null constraint on post_id later.)

@andreaskoepf andreaskoepf merged commit 4b84267 into main Dec 26, 2022
@andreaskoepf andreaskoepf deleted the 40-introduce-text-labels-to-the-protocol branch December 26, 2022 08:34
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.

Implement Text Labels in the backend Introduce Text Labels to the protocol
2 participants