mirror of
https://github.com/qurator-spk/dinglehopper.git
synced 2025-07-29 12:19:57 +02:00
Move metrics into separate package
This commit is contained in:
parent
45465f8d13
commit
4ccae9432d
10 changed files with 16 additions and 14 deletions
|
@ -1,5 +1,3 @@
|
||||||
from .ocr_files import *
|
from .ocr_files import *
|
||||||
from .extracted_text import *
|
from .extracted_text import *
|
||||||
from .character_error_rate import *
|
|
||||||
from .word_error_rate import *
|
|
||||||
from .align import *
|
from .align import *
|
||||||
|
|
|
@ -6,8 +6,8 @@ from markupsafe import escape
|
||||||
from uniseg.graphemecluster import grapheme_clusters
|
from uniseg.graphemecluster import grapheme_clusters
|
||||||
from ocrd_utils import initLogging
|
from ocrd_utils import initLogging
|
||||||
|
|
||||||
from .character_error_rate import character_error_rate_n
|
from .metrics.character_error_rate import character_error_rate_n
|
||||||
from .word_error_rate import word_error_rate_n, words_normalized
|
from .metrics.word_error_rate import word_error_rate_n, words_normalized
|
||||||
from .align import seq_align
|
from .align import seq_align
|
||||||
from .extracted_text import ExtractedText
|
from .extracted_text import ExtractedText
|
||||||
from .ocr_files import extract
|
from .ocr_files import extract
|
||||||
|
|
2
qurator/dinglehopper/metrics/__init__.py
Normal file
2
qurator/dinglehopper/metrics/__init__.py
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
from .character_error_rate import *
|
||||||
|
from .word_error_rate import *
|
|
@ -6,8 +6,8 @@ from typing import Tuple
|
||||||
from multimethod import multimethod
|
from multimethod import multimethod
|
||||||
from uniseg.graphemecluster import grapheme_clusters
|
from uniseg.graphemecluster import grapheme_clusters
|
||||||
|
|
||||||
from .edit_distance import distance
|
from ..edit_distance import distance
|
||||||
from .extracted_text import ExtractedText
|
from ..extracted_text import ExtractedText
|
||||||
|
|
||||||
|
|
||||||
@multimethod
|
@multimethod
|
|
@ -6,8 +6,8 @@ from multimethod import multimethod
|
||||||
|
|
||||||
import uniseg.wordbreak
|
import uniseg.wordbreak
|
||||||
|
|
||||||
from .edit_distance import levenshtein
|
from ..edit_distance import levenshtein
|
||||||
from . import ExtractedText
|
from .. import ExtractedText
|
||||||
|
|
||||||
|
|
||||||
@multimethod
|
@multimethod
|
0
qurator/dinglehopper/tests/metrics/__init__.py
Normal file
0
qurator/dinglehopper/tests/metrics/__init__.py
Normal file
|
@ -3,7 +3,7 @@ from __future__ import division, print_function
|
||||||
import math
|
import math
|
||||||
import unicodedata
|
import unicodedata
|
||||||
|
|
||||||
from .. import character_error_rate
|
from ...metrics import character_error_rate
|
||||||
|
|
||||||
|
|
||||||
def test_character_error_rate():
|
def test_character_error_rate():
|
|
@ -6,9 +6,10 @@ import pytest
|
||||||
from lxml import etree as ET
|
from lxml import etree as ET
|
||||||
from uniseg.graphemecluster import grapheme_clusters
|
from uniseg.graphemecluster import grapheme_clusters
|
||||||
|
|
||||||
from .. import character_error_rate, page_text, alto_text
|
from ... import page_text, alto_text
|
||||||
|
from ...metrics import character_error_rate
|
||||||
|
|
||||||
data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data")
|
data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../", "data")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.integration
|
@pytest.mark.integration
|
|
@ -5,9 +5,10 @@ import os
|
||||||
import pytest
|
import pytest
|
||||||
from lxml import etree as ET
|
from lxml import etree as ET
|
||||||
|
|
||||||
from .. import word_error_rate, words, page_text, alto_text
|
from ... import page_text, alto_text
|
||||||
|
from ...metrics import word_error_rate, words\
|
||||||
|
|
||||||
data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data")
|
data_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../", "data")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.integration
|
@pytest.mark.integration
|
|
@ -2,7 +2,7 @@ from __future__ import division, print_function
|
||||||
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
from .. import word_error_rate, words
|
from ...metrics import word_error_rate, words
|
||||||
|
|
||||||
|
|
||||||
def test_words():
|
def test_words():
|
Loading…
Add table
Add a link
Reference in a new issue