From 0175263d8597a34adacda0f4950d4dcc9c14eed2 Mon Sep 17 00:00:00 2001 From: "enrique.botia" Date: Mon, 9 Oct 2023 16:35:47 +0200 Subject: [PATCH] Fix CRF model to not to translate tags in predict --- presidio_evaluator/models/crf_model.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/presidio_evaluator/models/crf_model.py b/presidio_evaluator/models/crf_model.py index 3a22d00..5a25011 100644 --- a/presidio_evaluator/models/crf_model.py +++ b/presidio_evaluator/models/crf_model.py @@ -94,9 +94,7 @@ def predict(self, sample: InputSample) -> List[str]: @staticmethod def crf_predict(sample, model): - sample.translate_input_sample_tags() - - conll = sample.to_conll(translate_tags=True) + conll = sample.to_conll(translate_tags=False) sentence = [(di["text"], di["pos"], di["label"]) for di in conll] features = CRFModel.sent2features(sentence) return model.predict([features])[0]