Commit Graph

112 Commits (cac437afbf623bd2bae193df8e1c885d1bdda0fb)

Author SHA1 Message Date
Benjamin Rosemann cac437afbf Evaluate some performance issues
Benjamin Rosemann 1bc7ef6c8b Correct report for fca
As the fca implementation already knows the editing operations for each
segment we use a different sequence alignment method.
Benjamin Rosemann 750ad00d1b Add tooltips to fca report
Benjamin Rosemann 53064bf833 Include fca as parameter and add some tests
Benjamin Rosemann 4a87adc2c7 Implement version specific data structures
As ocr-d continues the support for Python 3.5 until the end of this year
version specific data structures have been implemented.

When the support for Python 3.5 is dropped the extra file can easily be
removed.
Benjamin Rosemann 2a215a1062 Reformat using black
Benjamin Rosemann 5277593bdb Fix some special cases
Benjamin Rosemann d7a74fa58b First draft of flexible character accuracy
Benjamin Rosemann a68fc269d9 Fix the extraction of text from Page with TableRegion
Dinglehopper did not consider `OrderedGroupIndex` in the `ReadingOrder`
element when extracting text regions. As a consequence a `TableRegion`
was not considered for text extraction.
Konstantin Baierer 74e0ac18ed ocrd cli: use core-provided zip_input_files method
Gerber, Mike 389e253c11 🐛 dinglehopper: Fix alto_extract_lines()'s type annotation
Gerber, Mike fe3923a8af 🐛 dinglehopper: Fix alto_extract()'s type annotation
Gerber, Mike 132f91d500 ✔️ dinglehopper: Add missing integration test markers
Benjamin Rosemann ce752e1912 Remove .idea folder and modify .gitignore
Sharing even parts of the .idea folder in worldwide setting is bound to
generate more problems than solutions. Therefore it should be removed
and consequently ignore in .gitignore.

Also adds some Python specific stuff to the .gitignore file.
Benjamin Rosemann 5270737c1f Skip test on windows because it is unix specific.
Gerber, Mike 32a4b95a99 🐛 dinglehopper: Normalize in plain_extract()
Gerber, Mike 14421c8e53 🎨 dinglehopper: Reformat using black
Gerber, Mike 31c63f9e4c 🎨 dinglehopper: s/LOG/log
Robert Sachunsky a60c14351e
1 more update for core's getLogger context
Benjamin Rosemann c02569b41e Fix f-strings for Python 3.5
Benjamin Rosemann 7b27b2834e More complex sorting for text extraction
When extracting text from TextEquiv nodes we may encounter nodes without
index or nodes that should get sorted via the conf attribute.

Therefore we added a more complex algorithm to extract a TextEquiv and
inform the user via log messages if we encounter structures that we can
handle but may produce unexpected results.
Benjamin Rosemann 6ff831dfd2 Sort textlines with missing indices
Python's `sorted` method will fail with a TypeError when called with
`None` and Integers:

```python
>>> sorted([None, 1])
TypeError: '<' not supported between instances of 'int' and 'NoneType'
```
Therefore we are using `float('inf')` instead of `None` in case of
missing textline indices.
Gerber, Mike 5cbe148741 🐛 dinglehopper: Skip pages if there is no GT nor OCR (Fixes GH-34)
Gerber, Mike e4e2777cb7 🐛 dinglehopper: Do try to get text when no TextEquivs exist
Gerber, Mike 1c88891a98 ✔️ Add test data for LAREX's indexed TextEquivs (unused)
Gerber, Mike 19d15e3ecc 🐛 dinglehopper: Honor TextEquiv index (Closes GH-33)
Gerber, Mike f626a2ebe6 🧹 dinglehopper: Remove warning when there is a non-TextRegion in the ReadingOrder
Gerber, Mike 8b4ee20a40 Add a new CLI tool dinglehopper-extract to just give the extracted text
Gerber, Mike b23b75b601 dinglehopper: Give segment ids from the extracted textequiv_level
Gerber, Mike b23e4ce30e dinglehopper: Add OCR-D parameter to choose TextEquiv level
Gerber, Mike 9744fa2567 dinglehopper: Add CLI option to choose TextEquiv level
Gerber, Mike 75733039b8 🧹 dinglehopper: Do not hardcode joiner to \n
Gerber, Mike 3848412349 dinglehopper: Implement the basic text extraction from PAGE TextLines
Gerber, Mike f2367ac0c3 🐛 Fix OCR-D CLI for newest OCR-D
Now that find_files() is a generator, we can't use [0] to get the file.
Gerber, Mike 5ed184c8c4 dinglehopper: Show a progressbar on --progress
Gerber, Mike 4951823a29 🧹 dinglehopper: Disable metrics in JSON report, too
Gerber, Mike 82217a25bb 🧹 dinglehopper: Move all normalization code to extracted_text.py
Gerber, Mike c6c6b8efab 📝 dinglehopper: Add detail about the text extraction and ExtractedText
Gerber, Mike f50591abac Merge branch 'feat/display-segment-id'
Gerber, Mike c514abfb9f 🧹 dinglehopper: Sanitize imports
Gerber, Mike 1077dc64ce ➡️ dinglehopper: Move ExtractedText to its own file
Gerber, Mike 9dd4ff0aae dinglehopper: Extract line IDs for ALTO
Gerber, Mike f3aafb6fdf dinglehopper: Validate ExtractedText.{segments,_text} in both directions
Gerber, Mike b14c35e147 🎨 dinglehopper: Use multimethod to handle str vs ExtractedText
Gerber, Mike a17ee2afec 🚧 dinglehopper: Guarantee NFC + rename from_text → from_str
Gerber, Mike 7843824eaf 🚧 dinglehopper: Support str & ExtractedText in CER and distance functions
Gerber, Mike 5bee55c896 💩 dinglehopper: Fix OCR-D CLI test by working around ocrd_cli_wrap_processor() check for arguments
Gerber, Mike 96b55f1806 🚧 dinglehopper: Hierarchical text representation
Gerber, Mike d706ef4621 📝 Document CER/WER and the format detection (Fixes GH-26)
Gerber, Mike da47e41c85 💩 dinglehopper: Fix OCR-D CLI test by working around ocrd_cli_wrap_processor() check for arguments