Make Levenshtein a proper differ instead of a hacky mode#147
Open
MikeSmithEU wants to merge 5 commits intomasterfrom
Open
Make Levenshtein a proper differ instead of a hacky mode#147MikeSmithEU wants to merge 5 commits intomasterfrom
MikeSmithEU wants to merge 5 commits intomasterfrom
Conversation
d1a75f4 to
c23c4a4
Compare
Contributor
|
Thanks, Mike, |
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.
Levenshtein should be a proper Differ class, not hacked into metrics.
This PR does the necessary changes to achieve that.
get_opcode_countsandget_error_rate(especially in the case of Levenshtein this can allow for huge speed and memory gains as for large texts the Levenshtein algorithm needs a big matrix to properly determine the least expensive path)Known issues:
Levenshteinpackage (only supports strings, so not usable)edit-distancepackage at the moment, but it does not give the proper results for lists. The package is bugged for opcodes and I cannot currently invest the time to fix it or even file a proper error report and unit tests to the maintainer.It seems to me that we should probably only support Levenshtein for distance, not for the opcodes at the moment, editops totals ("opcode counts") might be feasible, have not yet looked at the implementations here as I really wanted to get full and correct opcodes so that we could display the entire diff between ref and hyp.