Skip to content

Commit

Permalink
Merge pull request #81 from ebotiab/fix-crf-model
Browse files Browse the repository at this point in the history
Fix CRF model to not to translate tags in predict
  • Loading branch information
omri374 authored Oct 11, 2023
2 parents 6745717 + 0175263 commit d105ee2
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 d105ee2

Please sign in to comment.