ds-EkaCare commited on
Commit
55ff413
·
verified ·
1 Parent(s): 1c00698

Fix stale pre-0.4.0 example in deid/anon section

Browse files
Files changed (1) hide show
  1. README.md +6 -3
README.md CHANGED
@@ -98,11 +98,14 @@ Beyond redaction, both redactors support:
98
  mapping exists anywhere.
99
 
100
  ```python
101
- result = r.deidentify("John Doe met Asha. Call John at +91 98765 43210.")
102
- result.text # "Person_1 met Person_2. Call Person_3 at Phone_1."
 
 
 
103
  result.mapping # yours to store securely; never persisted by the library
104
 
105
- r.anonymize("Mr. John Doe, 45 yrs, DOB 12-03-1979, Indiranagar, Karnataka.")
106
  # -> "[PERSON], 40–49 yrs, DOB 1979, [LOCATION], Karnataka."
107
  ```
108
 
 
98
  mapping exists anywhere.
99
 
100
  ```python
101
+ text = "Mr. John Doe, 45 yrs, DOB 12-03-1979, Indiranagar, Karnataka."
102
+ spans = r.detect(text)
103
+
104
+ result = r.deidentify(text, spans)
105
+ result.text # "Person_1, Age_1 yrs, DOB Date_1, City_1, State_1."
106
  result.mapping # yours to store securely; never persisted by the library
107
 
108
+ r.anonymize(text, spans)
109
  # -> "[PERSON], 40–49 yrs, DOB 1979, [LOCATION], Karnataka."
110
  ```
111