-
Notifications
You must be signed in to change notification settings - Fork 3
Iris
: Add FAQ consistency check
#61
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
cremertim
wants to merge
60
commits into
main
Choose a base branch
from
iris/feature/faq/add-rewrite-consistency
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 57 commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
1415aa7
First draft of inconsistency pipeline
cremertim 6c53ff8
Refactored to seperate inconsistencies
cremertim 6534b5d
Added newlines
cremertim fac3799
Finished draft of implementation for FAQ inconsistencies
cremertim a859c76
Merge branch 'iris/feature/faq/add-rewrite-consistency' from multiple…
bassner b8849c2
Ensure language
cremertim f1c1aba
Ensure proper callback
cremertim 29e9307
Ensure proper callback
cremertim eb1940c
Delete .idea/.gitignore
cremertim 6f1e775
remove whitespace
cremertim 14de2af
Adjust course chat for presentation
cremertim 58ec964
Merge branch 'main' into iris/feature/faq/add-rewrite-consistency
cremertim 1dd3bce
Adjust prompt
cremertim 8b3278e
Merge remote-tracking branch 'origin/iris/feature/faq/add-rewrite-con…
cremertim 921e328
Merge branch 'main' into iris/feature/faq/add-rewrite-consistency
cremertim 67b0797
Revert wrong import changes
cremertim df88e12
Revert wrong import changes
cremertim f003225
Revert wrong import changes
cremertim b3f6418
Fix doc
cremertim 4fb9038
Changes should fix linter
cremertim 72864ca
Fix imports
cremertim 1d10bba
Changes should fix linter
cremertim fd1c7dd
Merge branch 'main' into iris/feature/faq/add-rewrite-consistency
cremertim 62e406a
Merge branch 'main' into iris/feature/faq/add-rewrite-consistency
cremertim 61865f9
changed type of prompt
cremertim cad0598
Merge remote-tracking branch 'origin/iris/feature/faq/add-rewrite-con…
cremertim 7febfaa
lock consistency check result
cremertim b4e9fa5
log consistency check result
cremertim a5c1598
test stripping
cremertim 801d5cc
consistency result
cremertim f32516c
consistency result fix
cremertim ea479ab
consistency result fix
cremertim 2585ae9
prompt fix
cremertim db69f5c
inconsistencies fix
cremertim 7b80422
adapted latest changes
cremertim de0d417
adapted latest changes
cremertim d7ef783
Fix import
cremertim 60aa3ab
Merge branch 'main' into iris/feature/faq/add-rewrite-consistency
cremertim 508bf87
Fix import
cremertim 9ec527f
Hopefully fix variants
cremertim c681ec3
Remove import
cremertim 73c06f1
Merge branch 'main' into iris/feature/faq/add-rewrite-consistency
cremertim ba21bd9
Add consistency check once more
cremertim 34788c5
Merge remote-tracking branch 'origin/iris/feature/faq/add-rewrite-con…
cremertim ba38183
parse faq inconsistencies once more, reformat code
cremertim 8cb86b4
remove logging
cremertim 9421ae2
adjust prompt a bit
cremertim 44d9be9
adjust prompt a bit
cremertim a89b6c4
adjust prompt a bit
cremertim aeaf685
adjust prompt a bit
cremertim 137b469
Merge branch 'main' into iris/feature/faq/add-rewrite-consistency
cremertim 26be703
adjust prompt a bit
cremertim fdb85b8
Remove \n
cremertim e05fe9f
Merge branch 'main' into iris/feature/faq/add-rewrite-consistency
cremertim 181ba71
add patricks modification again
cremertim 778e89f
Linter
cremertim 5871c47
black
cremertim 4ab9f4f
precommit
cremertim 88f5276
Merge branch 'main' into iris/feature/faq/add-rewrite-consistency
cremertim 8e644f4
Merge branch 'main' into iris/feature/faq/add-rewrite-consistency
cremertim 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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
from iris.domain.status.status_update_dto import StatusUpdateDTO | ||
from typing import List | ||
|
||
|
||
class RewritingStatusUpdateDTO(StatusUpdateDTO): | ||
result: str = "" | ||
suggestions: List[str] = [] | ||
inconsistencies: List[str] = [] | ||
improvement: str = "" |
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,56 @@ | ||
faq_consistency_prompt = """ | ||
You are an AI assistant responsible for verifying the consistency of information. | ||
### Task: | ||
You have been provided with a list of FAQs and a final result. Your task is to determine whether the | ||
final result is consistent with the given FAQs. Please compare each FAQ with the final result separately. | ||
|
||
### Instructions: | ||
Carefully distinguish between semantically different terms. | ||
For example, do not treat "exam" and "make-up exam" as identical — they refer to different concepts. | ||
Only treat content as consistent if it refers to the same concept using either the same wording or clearly | ||
synonymous expressions within the course context. Do not assume equivalence between terms unless explicitly | ||
stated. | ||
|
||
Secondly, identify the language of the course. The language of the course is either german or english. You can | ||
extract the language from the existing FAQs. Your output should be in the same language as the course language. | ||
|
||
If you are unsure, choose english. | ||
|
||
### Given FAQs: | ||
{faqs} | ||
|
||
### Final Result: | ||
{final_result} | ||
|
||
### Output: | ||
|
||
Generate the following response dictionary: | ||
"type": "consistent" or "inconsistent" | ||
The following four entries are optional and should only be set if inconsistencies are detected. | ||
|
||
"faqs" must be a JSON array of objects. Each entry must be a JSON dictionary with exactly the following fields: | ||
"faq_id" (string or number) | ||
"faq_question_title" (string) | ||
"faq_question_answer" (string) | ||
Do not return strings like "faq_id: 1, faq_question_title: ..., ..." — return actual JSON objects. | ||
Assume that existing FAQs are correct, so the new final_result is inconsistent. | ||
cremertim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Include only FAQs that contradict the final_result. Do not include FAQs that are consistent with the final_result. | ||
|
||
"message": "The provided text was rephrased, however it contains inconsistent information with existing FAQs." | ||
|
||
-Make sure to always insert two new lines after the last character of this sentences. | ||
The "faqs" field should contain only inconsistent FAQs with their faq_id, faq_question_title, and faq_question_answer. | ||
Make sure to not include any additional FAQs that are consistent with the final_result. | ||
|
||
-"suggestion": This entry is a list of strings, each string represents a suggestion to improve the final result. | ||
- Each suggestion should focus on a different inconsistency. | ||
- Each suggestions highlights what is the inconsistency and how it can be improved. | ||
- Do not mention the term final result, call it provided text | ||
- Please ensure that at no time, you have a different amount of suggestions than inconsistencies. | ||
- Highlight how you can improve the rewritten text to be consistent with the existing FAQs. | ||
Both should have the same amount of entries. | ||
|
||
-"improved version": This entry should be a string that represents the improved version of the final result. | ||
|
||
Do NOT provide any explanations or additional text. | ||
""" |
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
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
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.