mirror of
https://github.com/qurator-spk/dinglehopper.git
synced 2025-06-07 19:05:13 +02:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b5ceaa8690
2 changed files with 15 additions and 9 deletions
|
@ -11,12 +11,12 @@ repos:
|
|||
- id: check-ast
|
||||
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 23.10.0
|
||||
rev: 23.12.1
|
||||
hooks:
|
||||
- id: black
|
||||
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.1.1
|
||||
rev: v0.1.10
|
||||
hooks:
|
||||
- args:
|
||||
- --fix
|
||||
|
@ -24,13 +24,13 @@ repos:
|
|||
id: ruff
|
||||
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.6.1
|
||||
rev: v1.8.0
|
||||
hooks:
|
||||
- additional_dependencies:
|
||||
- types-setuptools
|
||||
id: mypy
|
||||
|
||||
- repo: https://gitlab.com/vojko.pribudic/pre-commit-update
|
||||
rev: v0.1.0
|
||||
rev: v0.1.1
|
||||
hooks:
|
||||
- id: pre-commit-update
|
||||
|
|
|
@ -122,9 +122,11 @@ def process(
|
|||
|
||||
gt_text = extract(gt, textequiv_level=textequiv_level)
|
||||
ocr_text = extract(ocr, textequiv_level=textequiv_level)
|
||||
gt_words = words_normalized(gt_text)
|
||||
ocr_words = words_normalized(ocr_text)
|
||||
gt_words: list = list(words_normalized(gt_text))
|
||||
ocr_words: list = list(words_normalized(ocr_text))
|
||||
|
||||
assert isinstance(gt_text, ExtractedText)
|
||||
assert isinstance(ocr_text, ExtractedText)
|
||||
cer, n_characters = character_error_rate_n(gt_text, ocr_text)
|
||||
char_diff_report, diff_c = gen_diff_report(
|
||||
gt_text,
|
||||
|
@ -136,6 +138,10 @@ def process(
|
|||
differences=differences,
|
||||
)
|
||||
|
||||
# {gt,ocr}_words must not be a generator, so we don't drain it for the differences
|
||||
# report.
|
||||
assert isinstance(gt_words, list)
|
||||
assert isinstance(ocr_words, list)
|
||||
wer, n_words = word_error_rate_n(gt_words, ocr_words)
|
||||
word_diff_report, diff_w = gen_diff_report(
|
||||
gt_words,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue