Skip to content

Commit 4845baa

Browse files
authored
Merge pull request #36 from SAFEHR-data/paul/fix-test-imports
Fix unit tests for the analysis module
2 parents 16670b8 + 75a7a23 commit 4845baa

File tree

5 files changed

+4
-4
lines changed

5 files changed

+4
-4
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OCR performance evaluation metrics
22

3-
The `analysis` directory contains code for evaluating the performance of OCR tools. The metrics include:
3+
The `pyonb.analysis` module contains code for evaluating the performance of OCR tools. The metrics include:
44

55
- Character Error Rate (CER)
66
- Word Error Rate (WER)
@@ -14,7 +14,7 @@ For all of these metrics 0 = perfect score and 1 = maximum dissimilarity.
1414

1515
2. **OCR Processed File:** Process your PDF file with an OCR tool. Either save the output as a .txt file, or in the case of pyonb, save it as a .json file (e.g. `ocr-output.json`). Note, the JSON response from pyonb is a dictionary structure which contains a key-value pair `"ocr-result": "example output text"`
1616

17-
3. Run OCR performance metrics (code below uses files in [tests/](../tests/data/ocr_eval/) directory):
17+
3. Run OCR performance metrics (code below uses files in [tests/](../../../tests/data/ocr_eval/) directory):
1818

1919
```shell
2020
cd pyonb/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from ast import literal_eval
66
from pathlib import Path
77

8-
from analysis.metrics import cer, ned, wer
8+
from pyonb.analysis.metrics import cer, ned, wer
99

1010

1111
def read_file(file_path: Path) -> str | dict:

tests/analysis/test_eval_ocr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from ast import literal_eval
44
from pathlib import Path
55

6-
from analysis.eval_ocr import evaluate_metrics, read_file
6+
from pyonb.analysis.eval_ocr import evaluate_metrics, read_file
77

88

99
def test_read_file(ground_truth_txt_filepath: Path, marker_ocr_json_filepath: Path) -> None:

0 commit comments

Comments
 (0)