-
Notifications
You must be signed in to change notification settings - Fork 4
Development: Reuse compliance analysis across languages via snippet mapping
#2470
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
Changes from 36 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
76c5d6e
feat(ai): map translated compliance issues instead of re-analyzing ta…
ge94zec 9adc3e9
updated openapi
ge94zec 7946480
refactor: code
ge94zec 7433eeb
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec 5579180
updates:
ge94zec 97f4653
Merge remote-tracking branch 'origin/chore/2346-enhance-performance-f…
ge94zec bd80f96
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec 2d02039
updates:
ge94zec 23549fd
Merge remote-tracking branch 'origin/chore/2346-enhance-performance-f…
ge94zec 102ac7b
chore: update OpenAPI spec and generated client
github-actions[bot] b0c19fb
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec 8d001be
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec ee463f7
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec b7e0862
change requests
ge94zec 11e553a
chore: update OpenAPI spec and generated client
github-actions[bot] 26f3cbd
updated client
ge94zec 702dd6c
added AiServiceTest for analyze and map
ge94zec 3aa2f39
Merge remote-tracking branch 'origin/main' into chore/2346-enhance-pe…
ge94zec dced024
\`Bugfix\`: Restore full entity graph on findByIdWithCompliance
az108 9f21677
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec 630a36f
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec ba210c9
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec a035c0d
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec 71a0b76
feat: replace second compliance analysis with snippet mapping for tra…
ge94zec 8820354
ffix server test
ge94zec d8d704b
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec 48f651c
fix: improve compliance issue mapping for translated job descriptions
ge94zec 860c930
chore: update OpenAPI spec and generated client
github-actions[bot] ba889b1
fix client test
ge94zec ca5d5cc
Merge remote-tracking branch 'origin/chore/2346-enhance-performance-f…
ge94zec 62be17d
removed tests
ge94zec b757097
- changed Analyze prompt to original
ge94zec 520103a
chore: update OpenAPI spec and generated client
github-actions[bot] c046f8d
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec ad2aa73
- fix empty-value serialization
ge94zec 7c3b5ab
Merge remote-tracking branch 'origin/chore/2346-enhance-performance-f…
ge94zec 617f7d3
- avoid unnecessary null initialization
ge94zec 66c54e0
- fix empty-value serialization
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
16 changes: 16 additions & 0 deletions
16
src/main/java/de/tum/cit/aet/ai/dto/MapComplianceIssuesRequestDTO.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,16 @@ | ||
| package de.tum.cit.aet.ai.dto; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import de.tum.cit.aet.ai.domain.ComplianceIssue; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| @JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
| public record MapComplianceIssuesRequestDTO( | ||
| String toLang, | ||
| @NotNull UUID jobId, | ||
| @NotBlank String translatedText, | ||
| @NotNull List<ComplianceIssue> complianceIssues | ||
| ) {} | ||
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,22 @@ | ||
| package de.tum.cit.aet.ai.util; | ||
|
|
||
| /** | ||
| * Validates mapped compliance snippets against the translated target text. | ||
| */ | ||
| public final class SnippetMatcher { | ||
|
|
||
| private SnippetMatcher() {} | ||
|
|
||
| /** | ||
| * Checks whether a non-empty candidate occurs verbatim in the target text. | ||
| * Matching is case-sensitive because the model copies the phrase verbatim and | ||
| * the client searches for that exact phrase in the editor. | ||
| * | ||
| * @param targetText translated job description | ||
| * @param candidate mapped compliance snippet | ||
| * @return {@code true} when the candidate is non-empty and occurs verbatim | ||
| */ | ||
| public static boolean isVerbatim(String targetText, String candidate) { | ||
| return candidate != null && !candidate.isEmpty() && targetText.contains(candidate); | ||
| } | ||
| } |
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
|
ge94zec marked this conversation as resolved.
|
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,18 @@ | ||
| Map every numbered source issue to the exact phrase in TARGET that expresses the same issue. | ||
| Return exactly {count} strings, one per issue, preserving order and duplicates. | ||
| Every non-empty result MUST be copied verbatim from TARGET. Use "" only if no matching phrase exists. | ||
| Do not analyze compliance. Output one JSON string array immediately, without reasoning, prose, or markdown. | ||
|
|
||
| --- EXAMPLE --- | ||
| TARGET: Wir suchen ein junges, dynamisches Team für unsere Arbeitsgruppe. | ||
| ISSUES: | ||
| 1 young and dynamic team | ||
| 2 must hold a German passport | ||
| OUTPUT: ["junges, dynamisches Team", ""] | ||
|
|
||
| --- INPUT --- | ||
| TARGET: | ||
| {translatedText} | ||
|
|
||
| ISSUES: | ||
| {snippets} |
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
18 changes: 18 additions & 0 deletions
18
src/main/webapp/app/generated/model/map-compliance-issues-request-dto.ts
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,18 @@ | ||
| /** | ||
| * OpenAPI definition | ||
| * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
| * | ||
| * API Version: v0 | ||
| * | ||
| * | ||
| * NOTE: This file is auto-generated. Do not edit manually. | ||
| */ | ||
|
|
||
| import type { ComplianceIssue } from './compliance-issue'; | ||
|
|
||
| export interface MapComplianceIssuesRequestDTO { | ||
| readonly complianceIssues: Array<ComplianceIssue>; | ||
| readonly jobId: string; | ||
| readonly toLang?: string; | ||
| readonly translatedText: string; | ||
| } |
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.