summaryrefslogtreecommitdiffstats
path: root/string_matcher.py
Commit message (Collapse)AuthorAge
* Fix matchStrings O(n^2) loopyum2022-11-07
| | | | | | | | | | | | | This slides 2 windows across input strings, looking for a region where they are most similar. It then uses that region to stitch the strings together. Since transcribe.py passes in a continuous transcription as the `old_text` argument, we can wind up spending a lot of time here. Constrain the area of the `old_text` argument that we look at to the most recent 50 characters. This should be good enough. Also fix how we calculate levenshtein_distance. Uh... yeah, let's not talk about how it was before.
* String matching no longer relies on spacesyum2022-11-06
| | | | | | | | | | | Add a `matchStrings` which does basically the same thing as `matchStringList` except it doesn't split the input at space boundaries. I think this should work better for Japanese and Chinese, since they don't use spaces. Doesn't seem to cause any accuracy regressions for English. Also update the README.
* Tweak continuous transcriptionyum2022-10-27
| | | | | Stitching new uses 6 word sliding window instead of 4 word. Seems to dramatically improve transcription quality.
* De-scuff continuous transcriptionyum2022-10-25
Transcription stitching now occurs in word space, rather than in text space. This avoids problems where we accidentally duplicate or delete letters in the middle of words. Factor out stitching into its own module and add a small handful of test cases. Hopefully if we hit problems in production, we can just grow this list and avoid regressions if we reimplement.