-
Notifications
You must be signed in to change notification settings - Fork 4
Bugfix: Fix excessive api requests triggering genderdecoder
#2465
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
Open
ge94zec
wants to merge
125
commits into
main
Choose a base branch
from
bugfix/2379-fix-excessive-api-requests-triggering-genderdecoder
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 121 commits
Commits
Show all changes
125 commits
Select commit
Hold shift + click to select a range
f4a0117
fix: added basicInfoFormValueSignal() as a tracked dependency so the …
ge94zec 40d1edf
fix: run compliance analysis before translation for faster feedback
ge94zec edbea60
Merge branch 'main' into bugfix/2321-title-compliance-error-not-shown
ge94zec a7392d8
fix: double-trigger for translate -> race condition
ge94zec 437788f
Merge remote-tracking branch 'origin/bugfix/2321-title-compliance-err…
ge94zec 652bb5e
Added new categories in compliance sidebar
ge94zec 22c7fe1
added new categories in sidebar
ge94zec a184f9d
Merge branch 'main' into bugfix/2321-title-compliance-error-not-shown
ge94zec 343c8cc
fix highlights across reload
ge94zec 7f5a227
Merge remote-tracking branch 'origin/bugfix/2321-title-compliance-err…
ge94zec b0840ab
prettier
ge94zec 4a13ca2
esLint
ge94zec 07b036c
Merge branch 'main' into feat/2345-add-new-compliance-categories-in-s…
ge94zec 55ba4dd
Merge branch 'main' into feat/2345-add-new-compliance-categories-in-s…
ge94zec 21e240e
esLint
ge94zec 0c46d89
Merge remote-tracking branch 'origin/feat/2345-add-new-compliance-cat…
ge94zec e5d7de4
fix translations
ge94zec f1e62d4
prettier
ge94zec f241af0
Merge branch 'main' into bugfix/2321-title-compliance-error-not-shown
ge94zec 1b847bd
change requests
ge94zec 3c99c9f
Merge branch 'main' into feat/2345-add-new-compliance-categories-in-s…
ge94zec 08537ab
Merge branch 'main' into feat/2345-add-new-compliance-categories-in-s…
az108 fba7bed
Merge branch 'main' into feat/2345-add-new-compliance-categories-in-s…
ge94zec ee05ead
Merge branch 'main' into bugfix/2321-title-compliance-error-not-shown
ge94zec 5c6f1e2
Merge branch 'main' into feat/2345-add-new-compliance-categories-in-s…
ge94zec 497111a
change requests
ge94zec 53dd4e5
Merge remote-tracking branch 'origin/feat/2345-add-new-compliance-cat…
ge94zec dcf5420
Merge branch 'main' into bugfix/2321-title-compliance-error-not-shown
ge94zec 08152f4
change requests
ge94zec ccdca07
eslint
ge94zec 87ab90e
change requests
ge94zec dca0e2a
Merge branch 'main' into bugfix/2321-title-compliance-error-not-shown
ge94zec 807e8d8
Merge branch 'main' into feat/2345-add-new-compliance-categories-in-s…
ge94zec 9e23fd7
change requests
ge94zec 1acbc29
Merge remote-tracking branch 'origin/bugfix/2321-title-compliance-err…
ge94zec 7fe140f
Merge branch 'main' into feat/2345-add-new-compliance-categories-in-s…
ge94zec e08cc5b
Merge remote-tracking branch 'origin/main' into bugfix/2321-title-com…
ge94zec cd8b599
Merge branch 'feat/2345-add-new-compliance-categories-in-sidebar' int…
ge94zec 8bb854e
feat: merge compliance add new categories
ge94zec 0107acc
updated editor
ge94zec a8bf9bd
Merge branch 'main' into bugfix/2321-title-compliance-error-not-shown
ge94zec cc271f7
Merge branch 'main' into bugfix/2321-title-compliance-error-not-shown
ge94zec 1f09ad4
Merge branch 'main' into bugfix/2321-title-compliance-error-not-shown
ge94zec 2842223
Merge branch 'main' into bugfix/2321-title-compliance-error-not-shown
ge94zec 6e1c011
Merge branch 'main' into bugfix/2321-title-compliance-error-not-shown
ge94zec f958bc2
Merge branch 'main' into bugfix/2321-title-compliance-error-not-shown
ge94zec 5ac21ff
feat: move gender decoder analysis to server side
ge94zec c9f0d10
refactor: restructure server-side bias analysis and reduce excessive …
ge94zec 203ca29
- processingOrder: genderDecoder -> original compliance and translate…
ge94zec 8b22df9
Merge remote-tracking branch 'origin/main' into bugfix/2379-fix-exces…
ge94zec 9a02e9b
updated openapi
ge94zec 5eddb05
Merge remote-tracking branch 'origin/main' into bugfix/2379-fix-exces…
ge94zec 158eec0
chore: update OpenAPI spec and generated client
github-actions[bot] 8b7c4d4
fixed client and server tests
ge94zec 7327454
Merge remote-tracking branch 'origin/bugfix/2379-fix-excessive-api-re…
ge94zec 46b5c94
fixed client test
ge94zec 04a26a6
fixed server test
ge94zec 817ab36
Merge branch 'main' into bugfix/2379-fix-excessive-api-requests-trigg…
ge94zec 343b52b
- prettier
ge94zec 72c15c5
Merge remote-tracking branch 'origin/bugfix/2379-fix-excessive-api-re…
ge94zec ee58a1f
add doc
ge94zec c3fe888
refactor: remove GenderBiasAnalysisResource and GenderBiasAnalysisRe…
ge94zec 7252ffa
Merge branch 'main' into bugfix/2379-fix-excessive-api-requests-trigg…
ge94zec 9a2db45
Merge remote-tracking branch 'origin/main' into bugfix/2379-fix-exces…
ge94zec 9f0aa5d
refactor: replace coding with enum GenderCategory
ge94zec 0627177
\`Bugfix\`: Replace double Job load with a targeted biased-issues query
az108 c94c107
Merge branch 'main' into bugfix/2379-fix-excessive-api-requests-trigg…
az108 da449e8
fix editor
ge94zec a36dd36
Merge remote-tracking branch 'origin/main' into bugfix/2379-fix-exces…
ge94zec eb73e71
moved BiasWordList and GenderCategory
ge94zec 7d9245b
prettier
ge94zec 29c625b
Merge branch 'main' into bugfix/2379-fix-excessive-api-requests-trigg…
ge94zec cbe0b64
`Bugfix`: Store biased issues in a Set so Hibernate stops rewriting t…
az108 762be05
\`Bugfix\`: Carry the biased-issues Set type through the repo and DTO…
az108 be9f574
refactor complianceScore and tests
ge94zec e0f9c72
Merge remote-tracking branch 'origin/bugfix/2379-fix-excessive-api-re…
ge94zec 2b77652
refactor complianceScore
ge94zec 1e8ae67
prettier
ge94zec 9c85baa
Merge branch 'main' into bugfix/2379-fix-excessive-api-requests-trigg…
ge94zec 032eefe
Merge branch 'main' into bugfix/2379-fix-excessive-api-requests-trigg…
ge94zec e4cd714
Merge branch 'main' into bugfix/2379-fix-excessive-api-requests-trigg…
ge94zec e3634b0
- refactored namings and BiasedIssues to Set
ge94zec d5c024b
Merge remote-tracking branch 'origin/main' into bugfix/2379-fix-exces…
ge94zec 3bfef56
chore: update OpenAPI spec and generated client
github-actions[bot] 6ff3240
- fixed test names
ge94zec 509a39a
Merge remote-tracking branch 'origin/bugfix/2379-fix-excessive-api-re…
ge94zec bdfb33a
- fixed AiResourceTest
ge94zec 914b244
prettier
ge94zec f1ed30b
fix test
ge94zec 8011d44
fix test
ge94zec 775de1b
prettier
ge94zec 71d4abb
Fix gender bias scoring persistence per job
ge94zec 2174c4d
chore: update OpenAPI spec and generated client
github-actions[bot] 880e9e7
Adjust tests and prettier
ge94zec 536fbc2
Merge remote-tracking branch 'origin/bugfix/2379-fix-excessive-api-re…
ge94zec a3ecf73
lint
ge94zec 0f65c7a
fix gender bias scoring, blank descriptions, and review feedback
ge94zec 8b5da77
merge main
ge94zec 8e0f3c6
fix(ai): persist and return multilingual job analysis consistently
ge94zec 84eb1d8
chore: update OpenAPI spec and generated client
github-actions[bot] 705e89e
fix server and client tests
ge94zec 05e731b
Merge remote-tracking branch 'origin/bugfix/2379-fix-excessive-api-re…
ge94zec 8e5d39e
Merge branch 'main' into bugfix/2379-fix-excessive-api-requests-trigg…
ge94zec b9fe961
fix: synchronize autosave, translation and compliance analysis
ge94zec aad62bf
chore: update OpenAPI spec and generated client
github-actions[bot] 74ec58d
- fix server tests
ge94zec 1cc7ad7
Merge remote-tracking branch 'origin/bugfix/2379-fix-excessive-api-re…
ge94zec a25e72d
Merge branch 'main' into bugfix/2379-fix-excessive-api-requests-trigg…
ge94zec 811f5d0
fix: address review feedback for gender bias analysis
ge94zec c975f3b
prettier
ge94zec c1a3ef9
chore: update OpenAPI spec and generated client
github-actions[bot] 581b926
test: drive editor tests through public inputs and template events
ge94zec 73e5155
Merge remote-tracking branch 'origin/bugfix/2379-fix-excessive-api-re…
ge94zec dee54f3
chore: update OpenAPI spec and generated client
github-actions[bot] b2edf95
fix client test
ge94zec 0c27f27
Merge remote-tracking branch 'origin/bugfix/2379-fix-excessive-api-re…
ge94zec 7ea50d7
fix server test
ge94zec 33b2fc2
optimized tests
ge94zec f84b5d0
fix: prevent AI compliance analysis without user consent
ge94zec 232dbb9
fix client tests
ge94zec c52b9f8
prettier
ge94zec 431156e
prettier
ge94zec 1f1ac8e
test: compare parallel AI processing performance on test server
ge94zec ed0bcc8
Revert analysis and translation to sequential processing
ge94zec 8ebe8c4
Replace JobRepository.findByIdForAiUpdate with the inherited findById
ge94zec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package de.tum.cit.aet.ai.domain; | ||
|
|
||
| import de.tum.cit.aet.core.constants.GenderCategory; | ||
| import jakarta.persistence.Embeddable; | ||
| import jakarta.persistence.EnumType; | ||
| import jakarta.persistence.Enumerated; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.EqualsAndHashCode; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.Setter; | ||
|
|
||
| @Getter | ||
| @Setter | ||
| @Embeddable | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @EqualsAndHashCode | ||
| public class BiasedIssue { | ||
|
|
||
| private String language; | ||
| private String word; | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| private GenderCategory type; | ||
| } | ||
6 changes: 6 additions & 0 deletions
6
src/main/java/de/tum/cit/aet/ai/dto/AnalyzeJobDescriptionRequestDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| package de.tum.cit.aet.ai.dto; | ||
|
|
||
| import jakarta.validation.constraints.NotNull; | ||
| import java.util.UUID; | ||
|
|
||
| public record AnalyzeJobDescriptionRequestDTO(@NotNull UUID jobId, String title, String jobDescriptionEN, String jobDescriptionDE) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package de.tum.cit.aet.ai.dto; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import de.tum.cit.aet.ai.domain.BiasedIssue; | ||
| import de.tum.cit.aet.core.constants.GenderCategory; | ||
|
|
||
| @JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
| public record BiasedIssueDTO(String language, String word, GenderCategory type) { | ||
|
ge94zec marked this conversation as resolved.
|
||
| public static BiasedIssueDTO from(BiasedIssue issue) { | ||
| return new BiasedIssueDTO(issue.getLanguage(), issue.getWord(), issue.getType()); | ||
| } | ||
| } | ||
35 changes: 35 additions & 0 deletions
35
src/main/java/de/tum/cit/aet/ai/dto/ComplianceIssueDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package de.tum.cit.aet.ai.dto; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import de.tum.cit.aet.ai.constants.ComplianceAction; | ||
| import de.tum.cit.aet.ai.constants.ComplianceCategory; | ||
| import de.tum.cit.aet.ai.domain.ComplianceIssue; | ||
|
|
||
| @JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
| public record ComplianceIssueDTO( | ||
| String id, | ||
| ComplianceCategory category, | ||
| String text, | ||
| String article, | ||
|
ge94zec marked this conversation as resolved.
|
||
| String explanation, | ||
| ComplianceAction action, | ||
| String language | ||
| ) { | ||
| /** | ||
| * Creates a DTO from a persisted compliance issue. | ||
| * | ||
| * @param issue the persisted compliance issue | ||
| * @return the mapped compliance issue DTO | ||
| */ | ||
| public static ComplianceIssueDTO from(ComplianceIssue issue) { | ||
| return new ComplianceIssueDTO( | ||
| issue.getId(), | ||
| issue.getCategory(), | ||
| issue.getText(), | ||
| issue.getArticle(), | ||
| issue.getExplanation(), | ||
| issue.getAction(), | ||
| issue.getLanguage() | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package de.tum.cit.aet.ai.dto; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import de.tum.cit.aet.ai.domain.BiasedIssue; | ||
| import de.tum.cit.aet.ai.domain.ComplianceIssue; | ||
| import java.util.List; | ||
| import java.util.Set; | ||
|
|
||
| @JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
| public record JobAnalysisDTO(Integer aiScore, List<ComplianceIssueDTO> complianceIssues, List<BiasedIssueDTO> biasedIssues) { | ||
| /** | ||
| * Creates an analysis DTO from the persisted issues. | ||
| * | ||
| * @param aiScore the combined AI score | ||
| * @param complianceIssues the persisted compliance issues | ||
| * @param biasedIssues the persisted biased-language issues | ||
| * @return the mapped analysis DTO | ||
| */ | ||
| public static JobAnalysisDTO from(Integer aiScore, List<ComplianceIssue> complianceIssues, Set<BiasedIssue> biasedIssues) { | ||
| return new JobAnalysisDTO( | ||
| aiScore, | ||
| complianceIssues.stream().map(ComplianceIssueDTO::from).toList(), | ||
| biasedIssues.stream().map(BiasedIssueDTO::from).toList() | ||
| ); | ||
| } | ||
| } |
4 changes: 1 addition & 3 deletions
4
src/main/java/de/tum/cit/aet/ai/dto/TranslateComplianceDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,7 @@ | ||
| package de.tum.cit.aet.ai.dto; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import de.tum.cit.aet.core.dto.GenderBiasAnalysisResponse; | ||
| import jakarta.annotation.Nullable; | ||
| import jakarta.validation.constraints.NotBlank; | ||
|
|
||
| @JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
| public record TranslateComplianceDTO(@NotBlank String text, @Nullable GenderBiasAnalysisResponse originalAnalysis) {} | ||
| public record TranslateComplianceDTO(@NotBlank String text) {} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.