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

Feature/figleaf filter #497

Merged
merged 3 commits into from
Aug 13, 2024
Merged

Feature/figleaf filter #497

merged 3 commits into from
Aug 13, 2024

Conversation

denis-yuen
Copy link
Member

@denis-yuen denis-yuen commented Aug 7, 2024

Description
A simple filter for topic sentences, can take a look in the log to see if workflows are skipped.
A pretty naive implementation that only checks full words

I largely agree with https://blog.codinghorror.com/obscenity-filters-bad-idea-or-incredibly-intercoursing-bad-idea/ but I kinda feel that since "we're" generating these we need to do some minimal due diligence on the results and have something to refer to.

Review Instructions
Could try a bunch of different languages and tests. Or could intentionally create something offensive and try to upload it using the uploader

Issue
https://ucsc-cgl.atlassian.net/browse/SEAB-6538

Security
None.

  • Check that you pass the basic style checks and unit tests by running mvn clean install in the project that you have modified (until https://ucsc-cgl.atlassian.net/browse/SEAB-5300 adds multi-module support properly)
  • Ensure that the PR targets the correct branch. Check the milestone or fix version of the ticket.
  • If you are changing dependencies, check with dependabot to ensure you are not introducing new high/critical vulnerabilities
  • If this PR is for a user-facing feature, create and link a documentation ticket for this feature (usually in the same milestone as the linked issue). Style points if you create a documentation PR directly and link that instead.

@denis-yuen denis-yuen self-assigned this Aug 7, 2024
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 64.86486% with 13 lines in your changes missing coverage. Please review.

Project coverage is 45.40%. Comparing base (da37df9) to head (d44fc39).

Files Patch % Lines
...ckstore/topicgenerator/helper/ChristianFilter.java 0.00% 11 Missing ⚠️
...store/topicgenerator/helper/ChuckNorrisFilter.java 77.77% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop     #497      +/-   ##
=============================================
+ Coverage      45.13%   45.40%   +0.27%     
- Complexity       305      315      +10     
=============================================
  Files             47       50       +3     
  Lines           2663     2700      +37     
  Branches         205      209       +4     
=============================================
+ Hits            1202     1226      +24     
- Misses          1368     1381      +13     
  Partials          93       93              
Flag Coverage Δ
metricsaggregator 36.40% <0.00%> (-0.51%) ⬇️
toolbackup 22.85% <0.00%> (-0.32%) ⬇️
tooltester 17.07% <0.00%> (-0.24%) ⬇️
topicgenerator 20.29% <64.86%> (+0.61%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@denis-yuen denis-yuen marked this pull request as ready for review August 7, 2024 20:49
@denis-yuen denis-yuen requested review from a team, coverbeck, david4096, hyunnaye and kathy-t and removed request for a team August 7, 2024 20:49
@@ -59,6 +62,7 @@ public class TopicGeneratorClient {
private static final int MAX_CONTEXT_LENGTH = 16385;
private static final EncodingRegistry REGISTRY = Encodings.newDefaultEncodingRegistry();
private static final Encoding ENCODING = REGISTRY.getEncodingForModel(AI_MODEL);
private final List<StringFilter> stringFilters = Lists.newArrayList(new ChuckNorrisFilter("en"), new ChuckNorrisFilter("fr-CA-u-sd-caqc"));
Copy link
Contributor

Choose a reason for hiding this comment

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

LOL, I was wondering how you were going to implement this without committing a bunch of foul language to our repo. :)

Copy link

sonarcloud bot commented Aug 13, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@denis-yuen denis-yuen merged commit 68da2aa into develop Aug 13, 2024
10 of 11 checks passed
@denis-yuen denis-yuen deleted the feature/figleaf_filter branch August 13, 2024 18:08
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.

5 participants