Modello NER per Schede Emergenziali del 118 Italiano

Questo modello esegue Named Entity Recognition (NER) su testi in lingua italiana provenienti da schede emergenziali del servizio 118. È stato addestrato su un dataset sintetico creato per rappresentare fedelmente il linguaggio e la struttura dei documenti operativi utilizzati in contesti di emergenza sanitaria. L’obiettivo del modello è l’estrazione automatica di informazioni strutturate da testi liberi, come dati anagrafici, parametri vitali, orari e luoghi di intervento, figure professionali coinvolte e condizioni cliniche riferite.

Il modello deriva da un linguaggio pre-addestrato in italiano, successivamente adattato al dominio medico-emergenziale attraverso una combinazione di Domain-Adaptive Pre-Training (DAPT) e fine-tuning con LoRA. Il DAPT ha consentito di specializzare le rappresentazioni linguistiche del modello su testi sintetici di natura emergenziale, mentre il fine-tuning con LoRA ha permesso un addestramento efficiente su un dataset annotato per il compito di riconoscimento di entità. Il risultato è un modello ottimizzato per identificare automaticamente entità nominali e numeriche rilevanti nelle schede operative del 118, includendo informazioni su pazienti, operatori, parametri clinici, codici e tempistiche operative.

Il modello riconosce le seguenti 55 categorie di entità: AUTISTA, AUTORITA_PRESENTE, CAUSA_TRASPORTO_NON_EFFETTUATO, CODICE_RIENTRO, CODICE_USCITA, COMUNE_RESIDENZA, CONDIZIONE_RIFERITA, COSCIENZA, CRI, CUTE, DATA_CHIAMATA, DATA_NASCITA, DECESSO, DICHIARANTE_DATI, FC_BPM, GCS_APERTURA_OCCHI, GCS_RISPOSTA_MOTORIA, GCS_RISPOSTA_VERBALE, GLICEMIA, INFERMIERE_PROFESSIONALE, LESIONE, LUOGO_INTERVENTO, LUOGO_NASCITA, MEDICINA, MEDICO, NOME_COGNOME, NUMERO_RESIDENZA, NUMERO_TELEFONO, ORA_CHIAMATA, ORA_DECESSO, ORA_IN_PRONTO_SOCCORSO, ORA_LIBERO_OPERATIVO, ORA_PARTENZA, ORA_PARTENZA_POSTO, ORA_SUL_POSTO, PARTE_CORPO, PA_MMHG, PROVINCIA_RESIDENZA, PROVVEDIMENTI_ALTRO, PROVVEDIMENTI_CIRCOLO, PROVVEDIMENTI_IMMOBILIZZAZIONE, PROVVEDIMENTI_RESPIRO, PUPILLE_REATTIVITA, PUPILLE_TIPO_DX, PUPILLE_TIPO_SX, RESPIRO, RIFIUTO, SEL, SESSO, SOCCORRITORE_1, SOCCORRITORE_2, SOCCORRITORE_3, SpO2, TEMPERATURA, VIA_RESIDENZA.

Il modello è destinato a scopi di ricerca e sperimentazione nel campo dell’elaborazione del linguaggio naturale applicata al dominio medico-emergenziale. Non è adatto all’uso clinico o decisionale senza un’adeguata validazione su dati reali e revisionati da personale esperto. Le tecniche utilizzate comprendono il Domain-Adaptive Pre-Training (DAPT) e il fine-tuning LoRA su un dataset sintetico in lingua italiana. Il modello appartiene alla categoria token-classification (Named Entity Recognition) ed è ottimizzato per il contesto linguistico e operativo del sistema di emergenza sanitaria italiano.

ESEMPIO DI UTILIZZO

Questo esempio mostra come caricare il modello e il tokenizer, applicare la pipeline NER a un testo di esempio e stampare le entità estratte.

import torch
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline

path_model = "./Text2NER"

tokenizer = AutoTokenizer.from_pretrained(path_model)
model = AutoModelForTokenClassification.from_pretrained(path_model)
model.eval()

ner_pipeline = pipeline(
    "ner",
    model=model,
    tokenizer=tokenizer,
    aggregation_strategy="simple",
    device=0 if torch.cuda.is_available() else -1
)

text = """
In Via Verdi a Parma, il paziente Mario Rossi, maschio, 58 anni, presentava dolore toracico con SpO₂ 91%, 
PA 160/95 mmHg, FC 112 bpm; codice uscita Rosso, rientro 2, sul posto la Croce Rossa Italiana di Parma, autista Bianchi Luca, 
medico Dott. Verdi Andrea.
"""

results = ner_pipeline(text)

print(f"{'ENTITÀ':<40} | {'LABEL'}")
print("-" * 60)
for r in results:
    entity = r["word"]
    label = r["entity_group"]
    print(f"{entity:<40} | {label}")

OUTPUT ATTESO

ENTITÀ LABEL
Via Verdi a Parma LUOGO_INTERVENTO
Mario Rossi NOME_COGNOME
maschio SESSO
58 anni DATA_NASCITA
SpO₂ 91% SpO2
PA 160/95 mmHg PA_MMHG
FC 112 bpm FC_BPM
Rosso CODICE_USCITA
2 CODICE_RIENTRO
Croce Rossa Italiana di Parma CRI
Bianchi Luca AUTISTA
Dott. Verdi Andrea MEDICO

DESCRIZIONE

Il codice mostra passo passo come inizializzare il tokenizer e il modello, creare la pipeline NER con aggregazione, applicarla a un testo di esempio e stampare le entità in formato tabellare chiaro. La tabella rappresenta le entità automaticamente riconosciute dal modello con le rispettive label, utile per analisi strutturate delle schede emergenziali del servizio 118.

NER Model for Italian 118 Emergency Medical Records

This model performs Named Entity Recognition (NER) on Italian-language texts derived from emergency medical records of the Italian 118 service. It was trained on a synthetic dataset designed to reproduce the linguistic structure and style of operational documents used in emergency medical contexts. The model’s purpose is to automatically extract structured information from free text, such as personal data, vital signs, event times and locations, professional roles, and reported clinical conditions.

The model is based on a pre-trained Italian language model, further adapted to the medical-emergency domain through a combination of Domain-Adaptive Pre-Training (DAPT) and LoRA fine-tuning. The DAPT phase allowed the model to specialize its linguistic representations on synthetic emergency-related texts, while LoRA fine-tuning enabled efficient task-specific training on a labeled dataset for entity recognition. As a result, the model can automatically identify relevant nominal and numerical entities within emergency records, including information about patients, staff, clinical parameters, operational codes, and event timing.

The model recognizes the following 55 entity categories: AUTISTA, AUTORITA_PRESENTE, CAUSA_TRASPORTO_NON_EFFETTUATO, CODICE_RIENTRO, CODICE_USCITA, COMUNE_RESIDENZA, CONDIZIONE_RIFERITA, COSCIENZA, CRI, CUTE, DATA_CHIAMATA, DATA_NASCITA, DECESSO, DICHIARANTE_DATI, FC_BPM, GCS_APERTURA_OCCHI, GCS_RISPOSTA_MOTORIA, GCS_RISPOSTA_VERBALE, GLICEMIA, INFERMIERE_PROFESSIONALE, LESIONE, LUOGO_INTERVENTO, LUOGO_NASCITA, MEDICINA, MEDICO, NOME_COGNOME, NUMERO_RESIDENZA, NUMERO_TELEFONO, ORA_CHIAMATA, ORA_DECESSO, ORA_IN_PRONTO_SOCCORSO, ORA_LIBERO_OPERATIVO, ORA_PARTENZA, ORA_PARTENZA_POSTO, ORA_SUL_POSTO, PARTE_CORPO, PA_MMHG, PROVINCIA_RESIDENZA, PROVVEDIMENTI_ALTRO, PROVVEDIMENTI_CIRCOLO, PROVVEDIMENTI_IMMOBILIZZAZIONE, PROVVEDIMENTI_RESPIRO, PUPILLE_REATTIVITA, PUPILLE_TIPO_DX, PUPILLE_TIPO_SX, RESPIRO, RIFIUTO, SEL, SESSO, SOCCORRITORE_1, SOCCORRITORE_2, SOCCORRITORE_3, SpO2, TEMPERATURA, VIA_RESIDENZA.

The model is intended for research and experimental purposes within domain-specific NLP applied to emergency medicine. It is not suitable for clinical or operational decision-making without further validation on real annotated data. The techniques used include Domain-Adaptive Pre-Training (DAPT) and LoRA fine-tuning on a synthetic Italian dataset. The model is categorized under token-classification (Named Entity Recognition) and is optimized for linguistic and contextual data typical of the Italian emergency medical system.

USAGE EXAMPLE

This example shows how to load the model and tokenizer, apply the NER pipeline to a sample text, and print the extracted entities.

import torch
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline

path_model = "./Text2NER"

tokenizer = AutoTokenizer.from_pretrained(path_model)
model = AutoModelForTokenClassification.from_pretrained(path_model)
model.eval()

ner_pipeline = pipeline(
    "ner",
    model=model,
    tokenizer=tokenizer,
    aggregation_strategy="simple",
    device=0 if torch.cuda.is_available() else -1
)

text = """
At Via Verdi in Parma, the patient Mario Rossi, male, 58 years old, presented with chest pain and SpO₂ 91%, 
PA 160/95 mmHg, FC 112 bpm; exit code Red, return 2, on site the Italian Red Cross of Parma, driver Bianchi Luca, 
doctor Dr. Verdi Andrea.
"""

results = ner_pipeline(text)

print(f"{'ENTITY':<40} | {'LABEL'}")
print("-" * 60)
for r in results:
    entity = r["word"]
    label = r["entity_group"]
    print(f"{entity:<40} | {label}")

EXPECTED OUTPUT

ENTITY LABEL
Via Verdi a Parma LUOGO_INTERVENTO
Mario Rossi NOME_COGNOME
maschio SESSO
58 anni DATA_NASCITA
SpO₂ 91% SpO2
PA 160/95 mmHg PA_MMHG
FC 112 bpm FC_BPM
Rosso CODICE_USCITA
2 CODICE_RIENTRO
Croce Rossa Italiana di Parma CRI
Bianchi Luca AUTISTA
Dott. Verdi Andrea MEDICO

DESCRIPTION

The code shows step by step how to initialize the tokenizer and model, create the NER pipeline with aggregation, apply it to a text example, and print the entities in a clear tabular format. The table represents the entities automatically recognized by the model with their corresponding labels, suitable for structured analysis of emergency medical records.

Downloads last month
11
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for pacovalentino/Text2NER

Base model

IVN-RIN/medBIT
Finetuned
(2)
this model

Dataset used to train pacovalentino/Text2NER