Skip to content
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

fix: levenshtein import #6

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ocrd_cis/align/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import click
import json
import os
import Levenshtein
from rapidfuzz.distance import Levenshtein
from ocrd import Processor
from ocrd.decorators import ocrd_cli_options
from ocrd.decorators import ocrd_cli_wrap_processor
Expand Down
2 changes: 1 addition & 1 deletion ocrd_cis/div/eval.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from PIL import Image
from Levenshtein import distance
from rapidfuzz.distance.Levenshtein import distance


path = '/mnt/c/Users/chris/Documents/projects/OCR-D/daten/gt/lines/'
Expand Down
4 changes: 2 additions & 2 deletions ocrd_cis/div/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ocrd import Processor
from ocrd_cis import get_ocrd_tool
from ocrd_models.ocrd_page_generateds import parse
from Levenshtein import distance
from rapidfuzz.distance import Levenshtein


class Stats(Processor):
Expand Down Expand Up @@ -81,7 +81,7 @@ def process(self):
# print(line.get_TextEquiv()[2].dataType)
unicodeline = line.get_TextEquiv()[i].Unicode

d[i] += distance(gtline, unicodeline)
d[i] += Levenshtein.distance(gtline, unicodeline)

# words = line.get_Word()
# for word in words:
Expand Down