Instructions to use fjoeda/gliner-biomed-multi-test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- GLiNER
How to use fjoeda/gliner-biomed-multi-test with GLiNER:
from gliner import GLiNER model = GLiNER.from_pretrained("fjoeda/gliner-biomed-multi-test") - Notebooks
- Google Colab
- Kaggle
| license: mit | |
| datasets: | |
| - anthonyyazdaniml/gliner-biomed-pre-training | |
| language: | |
| - en | |
| - multilingual | |
| base_model: | |
| - urchade/gliner_multi-v2.1 | |
| pipeline_tag: token-classification | |
| tags: | |
| - gliner | |
| # About | |
| This is an initial test for multilingual biomedical NER model using GLiNER. The model uses multilingual GLiNER model (`urchade/gliner_multi-v2.1`) as the base model and fine-tuned with biomedical NER dataset. | |
| ## Installation | |
| This model uses GLiNER python library. You can install the library: | |
| ``` | |
| pip install gliner | |
| ``` | |
| ## Usage | |
| To use the model, you can load the model and tokenizer using `GLiNER.from_pretrained()` method. Then, you can use the `predict_entities()` method to extract entities from the input text. | |
| ```python | |
| from gliner import GLiNER | |
| model = GLiNER.from_pretrained("fjoeda/gliner-biomed-multi-test", load_tokenizer=True) | |
| text = "<your input text here>" | |
| labels = ["entity #1", "entity#2"] | |
| entities = model.predict_entities(text, labels, threshold=0.5) | |
| for entity in entities: | |
| print(entity["text"], "=>", entity["label"]) | |
| ``` | |
| ### Sample on English Text | |
| Here is an example of how to use the model to extract entities from English text: | |
| ```python | |
| text = """ | |
| Male patient, 68 years old, admitted from July 1, 2026 to July 4, 2026 | |
| due to recurrent urination symptoms, weak flow, and pelvic pain | |
| caused by Benign Prostatic Hyperplasia (BPH). | |
| Transurethral resection of the prostate (TURP) was performed without complications. | |
| Patient was prescribed continued medical therapy with tamsulosin 0.4 mg qd, | |
| """ | |
| labels = ["Disease", "Procedure", "Medication", "Symptom", "Anatomy", "Medical Device"] | |
| entities = model.predict_entities(text, labels, threshold=0.5) | |
| for entity in entities: | |
| print(entity["text"], "=>", entity["label"]) | |
| ``` | |
| output: | |
| ``` | |
| recurrent urination symptoms => Symptom | |
| weak flow => Symptom | |
| pelvic pain => Symptom | |
| Benign Prostatic Hyperplasia (BPH) => Disease | |
| Transurethral resection of the prostate (TURP) => Procedure | |
| tamsulosin 0.4 mg qd => Medication | |
| ``` | |
| ### Sample on Indonesian Text | |
| Since GLiNER multilingual model can recognize entities from non-English text without having explicitly trained on the language, here is an example of how to use the model to extract entities from Indonesian text: | |
| ```python | |
| text = """ | |
| Pasien pria usia 68 tahun, dirawat dari 1 Juli 2026 hingga 4 Juli 2026 | |
| karena gejala urinasi berulang, aliran lemah, dan nyeri panggul | |
| yang disebabkan oleh Benign Prostatic Hyperplasia (BPH). | |
| evaluasi klinis, USG, uroflowmetry, dan cystoscopy, dilakukan TURP tanpa komplikasi | |
| serta diberikan terapi medis lanjutan dengan tamsulosin 0.4 mg qd, | |
| antibiotik profilaksis, analgesik, dan lanjutan pengobatan hipertensi | |
| """ | |
| labels = ["Disease", "Procedure", "Medication", "Symptom", "Anatomy", "Medical Device"] | |
| entities = model.predict_entities(text, labels, threshold=0.5) | |
| for entity in entities: | |
| print(entity["text"], "=>", entity["label"]) | |
| ``` | |
| output: | |
| ``` | |
| urinasi berulang => Symptom | |
| aliran lemah => Symptom | |
| nyeri panggul => Symptom | |
| Benign Prostatic Hyperplasia (BPH) => Disease | |
| evaluasi klinis => Procedure | |
| USG => Procedure | |
| uroflowmetry => Procedure | |
| cystoscopy => Procedure | |
| TURP => Procedure | |
| tamsulosin 0.4 mg qd => Medication | |
| antibiotik profilaksis => Medication | |
| analgesik => Medication | |
| ``` | |