-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the issue that typing correction is unexpectedly demoted by resco…
…ring. There are two issues: 1) The typing correction bonus/penalty is lost by rescoring as it is added in `Result::wcost`. 2) Rescoring is performed for normal rusults and typing corrections separately (i.e., rescoring function is called twice in one prediction call). Since the conversion from Transformer LM score to cost depends on other results, both normal and typing correction need to be rescored together to get consistent results. This CL fixes the above issues as follows: 1) Record the bonus/penalty of typing correction in `Result` and restore it after rescoring. 2) Stop calling `MaybeRescoreResults()` in `RewiteResultsForPrediction()`. Instead, call it after generating both normal and typing correction results. To rescore typing correction results, this CL also stops using the composing Hiragana reading when evaluating the transformer LM scores, because typing correction naturally has different readings. Without this treatment, typing correction results likely to have lower LM scores due to the mismatch between the input reading and the corrected surface form. The side effect of this treatment is that some candidates having common surface form but irregular reading might be promoted, e.g., こうべ -> 頭. I will fix this issue in future CLs. PiperOrigin-RevId: 638980678
- Loading branch information
1 parent
6a3e223
commit 42cbb3f
Showing
3 changed files
with
26 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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 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 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