Views
No views yet
pip install flair)1from flair.data import Sentence
2from flair.models import SequenceTagger
3# load tagger
4tagger = SequenceTagger.load("noharm-ai/anony")
5# make example sentence
6sentence = Sentence("FISIOTERAPIA TRAUMATO - MANHÃ Henrique Dias, 38 anos. Exercícios metabólicos de extremidades inferiores. Realizo mobilização patelar e leve mobilização de flexão de joelho conforme liberado pelo Dr Marcelo Arocha. Oriento cuidados e posicionamentos.")
7# predict NER tags
8tagger.predict(sentence)
9# print sentence
10print(sentence)
11# print predicted NER spans
12print('The following NER tags are found:')
13# iterate over entities and print
14for entity in sentence.get_spans('ner'):
15 print(entity)Span [5,6]: "Henrique Dias" [− Labels: NOME (0.9735)]
Span [31,32]: "Marcelo Arocha" [− Labels: NOME (0.9803)]@inproceedings{santos2021identification,
title={De-Identification of Clinical Notes Using Contextualized Language Models and a Token Classifier},
author={Santos, Joaquim and dos Santos, Henrique DP and Tabalipa, F{\'a}bio and Vieira, Renata},
booktitle={Brazilian Conference on Intelligent Systems},
pages={33--41},
year={2021},
organization={Springer}
}