Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
1. Instruct LLM to preserve the order of links from original document.
In some languages (
ja,ko) sentences might be inverted and it changes the order of links. But our translation fixer tool relies on the fact that links should go in the same order as in the original document.Commit: 7c5797c
2. On retry, pass validation error and results of previous iteration
If translation fails to pass validation we just retry it with the same input. So, retry is kind of a lottery - we just hope that next time it will make it better.
If we instead update prompt to provide validation error text and pass current result (instead of initial translation) - it improves results:
Before changes it was often something like:
(result still doesn't pass validation)
After changes, it still needs several attempts, but results is improved with every attempt:
(after third attempt it gave a valid result)
Commit: c7ca144
Diff is actually not as big as GitHub shows it. I just moved prompt creation logic outside the
translate_pageand changed it a bit to add the verification error from the last attempt and pass the results of last attempt instead of initial translation.