DEYYALA SAI VENKAT
commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -17,6 +17,48 @@ tags:
|
|
| 17 |
- classification
|
| 18 |
---
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
**Model Summary and Training Details**
|
| 22 |
|
|
|
|
| 17 |
- classification
|
| 18 |
---
|
| 19 |
|
| 20 |
+
**How to Use the Model for Inference:**
|
| 21 |
+
|
| 22 |
+
You can use the Hugging Face `pipeline` for easy inference:
|
| 23 |
+
|
| 24 |
+
```python
|
| 25 |
+
from transformers import pipeline
|
| 26 |
+
|
| 27 |
+
# Load the model
|
| 28 |
+
model_path = "venkatd/NCBI_NER"
|
| 29 |
+
pipe = pipeline(
|
| 30 |
+
task="token-classification",
|
| 31 |
+
model=model_path,
|
| 32 |
+
tokenizer=model_path,
|
| 33 |
+
aggregation_strategy="simple"
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
# Test the pipeline
|
| 37 |
+
text = ("A 48-year-old female presented with vaginal bleeding and abnormal Pap smears. "
|
| 38 |
+
"Upon diagnosis of invasive non-keratinizing SCC of the cervix, she underwent a radical "
|
| 39 |
+
"hysterectomy with salpingo-oophorectomy which demonstrated positive spread to the pelvic "
|
| 40 |
+
"lymph nodes and the parametrium.")
|
| 41 |
+
result = pipe(text)
|
| 42 |
+
print(result)
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
**Output Example:**
|
| 46 |
+
|
| 47 |
+
The output will be entity type of Disease, score, and start/end positions in the text. Here’s a sample output format:
|
| 48 |
+
|
| 49 |
+
```json
|
| 50 |
+
[
|
| 51 |
+
{
|
| 52 |
+
"entity_group": "Disease",
|
| 53 |
+
"score": 0.98,
|
| 54 |
+
"word": "SCC of the cervix",
|
| 55 |
+
"start": 121,
|
| 56 |
+
"end": 139
|
| 57 |
+
},
|
| 58 |
+
...
|
| 59 |
+
]
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
|
| 63 |
**Model Summary and Training Details**
|
| 64 |
|