isaacmeira commited on
Commit
22e10ae
·
verified ·
1 Parent(s): 4cdba67

Upload folder using huggingface_hub

Browse files
Files changed (6) hide show
  1. .gitattributes +1 -0
  2. README.md +76 -0
  3. config.json +56 -0
  4. model.safetensors +3 -0
  5. tokenizer.json +3 -0
  6. tokenizer_config.json +15 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - pt
4
+ - es
5
+ license: cc-by-4.0
6
+ library_name: transformers
7
+ pipeline_tag: token-classification
8
+ tags:
9
+ - ner
10
+ - token-classification
11
+ - portuguese
12
+ - spanish
13
+ - medical
14
+ - clinical
15
+ - cross-lingual
16
+ - openmed-br
17
+ base_model: xlm-roberta-base
18
+ datasets:
19
+ - MultiCoNER/multiconer_v2
20
+ - IEETA/SPACCC-Spanish-NER
21
+ metrics:
22
+ - seqeval
23
+ model-index:
24
+ - name: openmed-br-large-pt
25
+ results:
26
+ - task: {type: token-classification, name: Named Entity Recognition}
27
+ dataset: {name: MultiCoNER v2 (Portuguese, medical held-out), type: MultiCoNER/multiconer_v2}
28
+ metrics:
29
+ - {type: f1, value: 0.674, name: F1 (entity-level)}
30
+ - {type: precision, value: 0.636, name: Precision}
31
+ - {type: recall, value: 0.716, name: Recall}
32
+ ---
33
+
34
+ # OpenMed-BR Clinical NER — Large (PT, cross-lingual PT+ES)
35
+
36
+ NER clínico em português com reforço **cross-lingual** de corpora clínicos em
37
+ espanhol. Parte da iniciativa **OpenMed-BR**. Cinco tipos: **DOENCA, SINAL_SINTOMA,
38
+ MEDICAMENTO, PROCEDIMENTO, ANATOMIA**.
39
+
40
+ Base: [`xlm-roberta-base`](https://huggingface.co/xlm-roberta-base) (multilíngue).
41
+ Treino: MultiCoNER v2 PT (ouro) + prata SemClinBr/BioBERTpt (PT) + corpora clínicos
42
+ espanhóis ouro (DisTEMIST, MedProcNER, SympTEMIST).
43
+
44
+ ## Resultados (teste PT held-out, seqeval, nível de entidade)
45
+
46
+ | Tipo | F1 |
47
+ |---|---|
48
+ | ANATOMIA | 0.786 |
49
+ | DOENCA | 0.744 |
50
+ | PROCEDIMENTO | 0.643 |
51
+ | MEDICAMENTO | 0.537 |
52
+ | SINAL_SINTOMA | 0.526 |
53
+ | **Geral** | **0.674** |
54
+
55
+ O cross-lingual elevou muito DOENCA/PROCEDIMENTO/SINAL_SINTOMA. **MEDICAMENTO é o
56
+ mais fraco** porque esta versão não inclui corpus espanhol de fármacos (PharmaCoNER);
57
+ para MEDICAMENTO, o irmão `openmed-br-clinical-pt` (base OpenMed) vai melhor (0.67).
58
+
59
+ ## Uso
60
+ ```python
61
+ from transformers import pipeline
62
+ ner = pipeline("token-classification", model="BrazilAI/openmed-br-large-pt",
63
+ aggregation_strategy="simple")
64
+ ner("Paciente com pneumonia; solicitada tomografia de tórax e avaliada dor abdominal.")
65
+ ```
66
+
67
+ ## Atribuição (obrigatória — CC BY 4.0)
68
+ - **Base**: xlm-roberta-base (MIT).
69
+ - **Ouro PT**: MultiCoNER v2 — Fetahu et al., arXiv:2310.13213; SemEval-2023 Task 2, arXiv:2305.06586 (CC BY 4.0).
70
+ - **Ouro ES** (todos CC BY 4.0): DisTEMIST (Zenodo 7614764), MedProcNER (Zenodo 8224056), SympTEMIST (Zenodo 8223653) — BioASQ/BSC.
71
+ - **Prata PT (professores)**: BioBERTpt / clinicalnerpt / SemClinBr — Schneider et al., 2020 (ClinicalNLP@EMNLP), HAILab-PUCPR.
72
+
73
+ ## Limitações
74
+ Modelo assistivo, **não é dispositivo médico**, não serve para decisão clínica.
75
+ Teste held-out pequeno (77 frases) → honesto porém ruidoso. MEDICAMENTO fraco (sem
76
+ fármaco no ES desta versão). Uma versão futura com PharmaCoNER deve fechar esse gap.
config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_cross_attention": false,
3
+ "architectures": [
4
+ "XLMRobertaForTokenClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "classifier_dropout": null,
9
+ "dtype": "float32",
10
+ "eos_token_id": 2,
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.1,
13
+ "hidden_size": 768,
14
+ "id2label": {
15
+ "0": "O",
16
+ "1": "B-DOENCA",
17
+ "2": "I-DOENCA",
18
+ "3": "B-SINAL_SINTOMA",
19
+ "4": "I-SINAL_SINTOMA",
20
+ "5": "B-MEDICAMENTO",
21
+ "6": "I-MEDICAMENTO",
22
+ "7": "B-PROCEDIMENTO",
23
+ "8": "I-PROCEDIMENTO",
24
+ "9": "B-ANATOMIA",
25
+ "10": "I-ANATOMIA"
26
+ },
27
+ "initializer_range": 0.02,
28
+ "intermediate_size": 3072,
29
+ "is_decoder": false,
30
+ "label2id": {
31
+ "B-ANATOMIA": 9,
32
+ "B-DOENCA": 1,
33
+ "B-MEDICAMENTO": 5,
34
+ "B-PROCEDIMENTO": 7,
35
+ "B-SINAL_SINTOMA": 3,
36
+ "I-ANATOMIA": 10,
37
+ "I-DOENCA": 2,
38
+ "I-MEDICAMENTO": 6,
39
+ "I-PROCEDIMENTO": 8,
40
+ "I-SINAL_SINTOMA": 4,
41
+ "O": 0
42
+ },
43
+ "layer_norm_eps": 1e-05,
44
+ "max_position_embeddings": 514,
45
+ "model_type": "xlm-roberta",
46
+ "num_attention_heads": 12,
47
+ "num_hidden_layers": 12,
48
+ "output_past": true,
49
+ "pad_token_id": 1,
50
+ "position_embedding_type": "absolute",
51
+ "tie_word_embeddings": true,
52
+ "transformers_version": "5.13.1",
53
+ "type_vocab_size": 1,
54
+ "use_cache": false,
55
+ "vocab_size": 250002
56
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf80763d60958a4468e9cf79e71346ba919eef0b51fd6e9ddf17298a9b532c05
3
+ size 1109870108
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1d237c4974cfea16dffbc5035028fea5b47ad8b653af90c908b7a35bdc8b0d90
3
+ size 17098184
tokenizer_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "backend": "tokenizers",
4
+ "bos_token": "<s>",
5
+ "cls_token": "<s>",
6
+ "eos_token": "</s>",
7
+ "is_local": false,
8
+ "local_files_only": false,
9
+ "mask_token": "<mask>",
10
+ "model_max_length": 512,
11
+ "pad_token": "<pad>",
12
+ "sep_token": "</s>",
13
+ "tokenizer_class": "XLMRobertaTokenizer",
14
+ "unk_token": "<unk>"
15
+ }