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

fix(moderation prompt): lower false positives in toxic category #102

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

mantagen
Copy link
Collaborator

@mantagen mantagen commented Sep 9, 2024

Description

I tried a few variants locally (prompt/model combinations), and this was the best I found. (note: gpt-4o-mini is no good for this!).

  • updates open-ai from 4.52.0 to 4.58.1 (allowing for json_schema mode)
  • moderation agent now uses "json_schema" mode
  • adds a 'note' to the Toxic moderation category description
  • amends 'instruction' setting of the prompt
  • makes justification non-optional
  • filter categories by parent category score

Later will explore some more in-depth changes, but that would come with more risk associated, so want to do that when there's a dataset (and more time) to give the confidence required.

Issue(s)

https://www.notion.so/oaknationalacademy/Fix-moderation-bug-where-all-categories-get-flagged-3c93a1e819bb438f971187cb8be653bc

How to test

  1. Moderation should generally work (e.g. test some sensitive and toxic material)

Copy link

vercel bot commented Sep 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
oak-ai-lesson-assistant ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2024 9:58am

Copy link

github-actions bot commented Sep 9, 2024

Playwright e2e tests

Job summary

Download report

To view traces locally, unzip the report and run:

npx playwright show-report ~/Downloads/playwright-report

@mantagen mantagen marked this pull request as ready for review September 10, 2024 08:04
Copy link

Copy link
Collaborator

@codeincontext codeincontext left a comment

Choose a reason for hiding this comment

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

Makes sense to me 👍

@mantagen mantagen merged commit 76e3cd5 into main Sep 10, 2024
13 checks passed
@mantagen mantagen deleted the fix/moderation-prompt branch September 10, 2024 10:08
@oak-machine-user
Copy link
Collaborator

🎉 This PR is included in version 1.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants