Views
No views yet
pipeline for easy inference:1from transformers import pipeline
2
3# Load the model
4model_path = "venkatd/NCBI_NER"
5pipe = pipeline(
6 task="token-classification",
7 model=model_path,
8 tokenizer=model_path,
9 aggregation_strategy="simple"
10)
11
12# Test the pipeline
13text = ("A 48-year-old female presented with vaginal bleeding and abnormal Pap smears. "
14 "Upon diagnosis of invasive non-keratinizing SCC of the cervix, she underwent a radical "
15 "hysterectomy with salpingo-oophorectomy which demonstrated positive spread to the pelvic "
16 "lymph nodes and the parametrium.")
17result = pipe(text)
18print(result)1[
2 {
3 "entity_group": "Disease",
4 "score": 0.98,
5 "word": "SCC of the cervix",
6 "start": 121,
7 "end": 139
8 },
9 ...
10]microsoft/deberta-v3-baselen(train_loader) * num_epochs