Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Gene Extraction Model
|
| 2 |
+
|
| 3 |
+
This model is fine-tuned for gene extraction using BERT-CRF architecture.
|
| 4 |
+
|
| 5 |
+
## Usage
|
| 6 |
+
|
| 7 |
+
```python
|
| 8 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 9 |
+
from transformers import pipeline
|
| 10 |
+
|
| 11 |
+
# Load model and tokenizer
|
| 12 |
+
model_name = "RaduGabriel/gene-entity-recognition"
|
| 13 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 14 |
+
model = AutoModelForTokenClassification.from_pretrained(model_name)
|
| 15 |
+
|
| 16 |
+
# Create NER pipeline
|
| 17 |
+
ner_pipeline = pipeline(
|
| 18 |
+
"ner",
|
| 19 |
+
model=model,
|
| 20 |
+
tokenizer=tokenizer,
|
| 21 |
+
aggregation_strategy="simple"
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
# Example usage
|
| 25 |
+
text = "The BRCA1 gene is associated with breast cancer."
|
| 26 |
+
results = ner_pipeline(text)
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
## Labels
|
| 30 |
+
- O
|
| 31 |
+
- B-GENE
|
| 32 |
+
- I-GENE
|
| 33 |
+
- E-GENE
|
| 34 |
+
- S-GENE
|
| 35 |
+
|
| 36 |
+
## Model Details
|
| 37 |
+
- Architecture: BERT-CRF
|
| 38 |
+
- Base Model: answerdotai/ModernBERT-large
|
| 39 |
+
- Number of Labels: 5
|
| 40 |
+
- CRF Layer: Enabled
|