Skip to content

Commit

Permalink
NiFi scripts: anon doc script improvement (allow modelpack path).
Browse files Browse the repository at this point in the history
  • Loading branch information
vladd-bit committed Nov 27, 2023
1 parent dd3af8c commit 84a18f3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions nifi/user-scripts/anonymise_doc.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
from medcat.utils.ner.deid import DeIdModel
import sys

import os
input_text = sys.stdin.read()

model_pack_path = "/opt/models/de_id_base.zip"
model_pack_path = os.environ.get("MODEL_PACK_PATH", "/opt/models/de_id_base.zip")

for arg in sys.argv:
_arg = arg.split("=", 1)
if _arg[0] == "model_pack_path":
model_pack_path = _arg[1]

cat = DeIdModel.load_model_pack(model_pack_path)

Expand Down

0 comments on commit 84a18f3

Please sign in to comment.