Skip to content

Commit

Permalink
NiFi scripts: added anon doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
vladd-bit committed Nov 27, 2023
1 parent 2c8bdc7 commit dd3af8c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions nifi/user-scripts/anonymise_doc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from medcat.utils.ner.deid import DeIdModel
import sys

input_text = sys.stdin.read()

model_pack_path = "/opt/models/de_id_base.zip"

cat = DeIdModel.load_model_pack(model_pack_path)

anon_text = cat.deid_text(input_text, redact=True)

sys.stdout.write(anon_text)

0 comments on commit dd3af8c

Please sign in to comment.