From b161f1ae54a810d262c093ba717493814c11e8eb Mon Sep 17 00:00:00 2001 From: moniquebm <60358442+moniquebm@users.noreply.github.com> Date: Fri, 11 Dec 2020 11:24:21 -0300 Subject: [PATCH] Update README.md (#8820) --- model_cards/monilouise/ner_pt_br/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/model_cards/monilouise/ner_pt_br/README.md b/model_cards/monilouise/ner_pt_br/README.md index d875ab3de9..7041b3991f 100644 --- a/model_cards/monilouise/ner_pt_br/README.md +++ b/model_cards/monilouise/ner_pt_br/README.md @@ -22,6 +22,17 @@ For more details, please see, (https://github.com/SecexSaudeTCU/noticias_ner). #### How to use +```python +from transformers import BertForTokenClassification, DistilBertTokenizerFast, pipeline +model = BertForTokenClassification.from_pretrained('monilouise/ner_pt_br') +tokenizer = DistilBertTokenizerFast.from_pretrained('neuralmind/bert-base-portuguese-cased' + , model_max_length=512 + , do_lower_case=False + ) +nlp = pipeline('ner', model=model, tokenizer=tokenizer, grouped_entities=True) +result = nlp("O Tribunal de Contas da União é localizado em Brasília e foi fundado por Rui Barbosa.") +``` + #### Limitations and bias - The finetunned model was trained on a corpus with around 180 news articles crawled from Google News. The original project's purpose was to recognize named entities in news