ds-EkaCare commited on
Commit
7d39f6d
·
verified ·
1 Parent(s): 43cecc2

Document bring-your-own-OCR support (0.7.0)

Browse files
Files changed (1) hide show
  1. README.md +8 -3
README.md CHANGED
@@ -29,9 +29,9 @@ in your browser.
29
  pip install eka-pii-redaction
30
  ```
31
 
32
- System dependency: **Tesseract OCR** — required for the **image** modality
33
- (it OCRs the document before classifying words); not needed for the
34
- text-only modality.
35
 
36
  ```bash
37
  # Debian/Ubuntu
@@ -62,6 +62,11 @@ entities = redactor.detect("page.jpg") # list[PIIEntity] — the core call
62
  for e in entities:
63
  print(e.kind, e.category, e.bbox, e.text, e.score)
64
 
 
 
 
 
 
65
  # One detection, three possible outputs:
66
  redactor.redact("page.jpg", entities).save("redacted.png")
67
  redactor.anonymize("page.jpg", entities).save("anonymized.png")
 
29
  pip install eka-pii-redaction
30
  ```
31
 
32
+ System dependency: **Tesseract OCR** — used by the **image** modality's
33
+ built-in OCR step. Not needed for the text-only modality, nor if you bring
34
+ your own OCR (`detect(..., words=..., boxes=...)`).
35
 
36
  ```bash
37
  # Debian/Ubuntu
 
62
  for e in entities:
63
  print(e.kind, e.category, e.bbox, e.text, e.score)
64
 
65
+ # Bring your own OCR (skips the built-in Tesseract step; your pixel-space
66
+ # word boxes pass through to the emitted entities):
67
+ entities = redactor.detect("page.jpg", words=["John", "Doe"],
68
+ boxes=[[100, 20, 140, 40], [145, 20, 180, 40]])
69
+
70
  # One detection, three possible outputs:
71
  redactor.redact("page.jpg", entities).save("redacted.png")
72
  redactor.anonymize("page.jpg", entities).save("anonymized.png")