ds-EkaCare commited on
Commit
fb033ee
·
verified ·
1 Parent(s): c9dd10d

detect() result is now a required transform argument (0.4.0)

Browse files
Files changed (1) hide show
  1. README.md +8 -8
README.md CHANGED
@@ -42,8 +42,8 @@ brew install tesseract
42
 
43
  **`detect()` is the core primitive** — it finds every PII entity with its
44
  location, category, and confidence. The transforms (redact / anonymize /
45
- de-identify) consume its output: run detection once, feed the same result
46
- into whichever transform you need.
47
 
48
  ### Image — text + visual PII in document images
49
 
@@ -61,9 +61,9 @@ for e in entities:
61
  print(e.kind, e.category, e.bbox, e.text, e.score)
62
 
63
  # One detection, three possible outputs:
64
- redactor.redact("page.jpg", entities=entities).save("redacted.png")
65
- redactor.anonymize("page.jpg", entities=entities).save("anonymized.png")
66
- deid = redactor.deidentify("page.jpg", entities=entities)
67
  deid.image.save("deidentified.png"); deid.mapping.to_dict()
68
  ```
69
 
@@ -79,9 +79,9 @@ spans = r.detect(text) # char-offset spans — the core call
79
  for s in spans:
80
  print(s.category, s.start, s.end, s.text, s.score)
81
 
82
- r.redact(text, mask="[REDACTED]", spans=spans)
83
- r.anonymize(text, spans=spans)
84
- r.deidentify(text, spans=spans) # .text + .mapping
85
  ```
86
 
87
  ### De-identify and anonymize (v0.2.0+, both modalities)
 
42
 
43
  **`detect()` is the core primitive** — it finds every PII entity with its
44
  location, category, and confidence. The transforms (redact / anonymize /
45
+ de-identify) take its result as a required argument: detection always runs
46
+ first, once, and every transform consumes its output.
47
 
48
  ### Image — text + visual PII in document images
49
 
 
61
  print(e.kind, e.category, e.bbox, e.text, e.score)
62
 
63
  # One detection, three possible outputs:
64
+ redactor.redact("page.jpg", entities).save("redacted.png")
65
+ redactor.anonymize("page.jpg", entities).save("anonymized.png")
66
+ deid = redactor.deidentify("page.jpg", entities)
67
  deid.image.save("deidentified.png"); deid.mapping.to_dict()
68
  ```
69
 
 
79
  for s in spans:
80
  print(s.category, s.start, s.end, s.text, s.score)
81
 
82
+ r.redact(text, spans, mask="[REDACTED]")
83
+ r.anonymize(text, spans)
84
+ r.deidentify(text, spans) # .text + .mapping
85
  ```
86
 
87
  ### De-identify and anonymize (v0.2.0+, both modalities)