Spaces:
Sleeping
Sleeping
| from clinical_ner import ClinicalNER | |
| # Initialize the NER system | |
| ner = ClinicalNER() | |
| # Sample clinical text | |
| text = "Patient presents with hypertension and diabetes. Prescribed metformin 500mg." | |
| # Get basic NER annotations | |
| print("Basic NER:") | |
| results = ner.basic_ner(text) | |
| for entity in results: | |
| print(f" {entity['word']} -> {entity['entity_group']} (score: {entity['score']:.4f})") | |
| print("\n" + "="*60 + "\n") | |
| # Get Prolog facts | |
| print("Prolog NER:") | |
| prolog_output = ner.prolog_ner(text) | |
| print(prolog_output) | |