Skip to content

Commit

Permalink
Fix CRF model to not to translate tags in predict
Browse files Browse the repository at this point in the history
  • Loading branch information
enrique.botia committed Oct 9, 2023
1 parent 6745717 commit 0175263
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions presidio_evaluator/models/crf_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 0175263

Please sign in to comment.