Views
No views yet
| Metric | Score |
|---|---|
| F1 Score | 74.4% |
| Precision | 75.4% |
| Recall | 73.3% |
| Accuracy | 94.3% |
| Model | F1 Score | Precision | Recall |
|---|---|---|---|
| Base BioLinkBERT | 65.9% | 66.7% | 65.2% |
| + Domain Adaptation | 74.4% | 75.4% | 73.3% |
| Improvement | +8.5% | +8.7% | +8.1% |
1from transformers import AutoTokenizer, AutoModelForTokenClassification
2import torch
3# Load model and tokenizer
4tokenizer = AutoTokenizer.from_pretrained("adamleeit/biolink-lg-interop-ner-model")
5model = AutoModelForTokenClassification.from_pretrained("adamleeit/biolink-lg-interop-ner-model")
6# Tokenize input text
7text = "FHIR and HL7 standards improve healthcare data interoperability."
8inputs = tokenizer(text, return_tensors="pt", return_offsets_mapping=True)
9offset_mapping = inputs.pop("offset_mapping")
10# Get predictions
11with torch.no_grad():
12 outputs = model(**inputs)
13# Process predictions
14predictions = torch.argmax(outputs.logits, dim=2)
15input_ids = inputs["input_ids"][0]
16# Convert predictions to entities
17predicted_entities = []
18current_entity = []
19for i, pred in enumerate(predictions[0]):
20 token = tokenizer.convert_ids_to_tokens(input_ids[i])
21 if pred == 0: # O
22 if current_entity:
23 predicted_entities.append(" ".join(current_entity))
24 current_entity = []
25 elif pred == 1: # B-ENTITY
26 if current_entity:
27 predicted_entities.append(" ".join(current_entity))
28 current_entity = [token]
29 elif pred == 2: # I-ENTITY
30 current_entity.append(token)
31if current_entity:
32 predicted_entities.append(" ".join(current_entity))
33print(f"Identified entities: {predicted_entities}")@misc{interoperability-ner-model,
author = {Your Name},
title = {Healthcare Interoperability NER Model},
year = {2025},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/adamleeit/biolink-lg-interop-ner-model}}
}