nioushasadjadi
commited on
Commit
·
a8650f6
1
Parent(s):
4025bf2
DOC: Update example to use BertForTokenClassification instead of AutoModel
Browse files
README.md
CHANGED
@@ -13,7 +13,7 @@ A pre-trained transformer model for inference on insect DNA barcoding data.
|
|
13 |
To use **BarcodeBERT** as a feature extractor:
|
14 |
|
15 |
```python
|
16 |
-
from transformers import AutoTokenizer,
|
17 |
|
18 |
# Load the tokenizer
|
19 |
tokenizer = AutoTokenizer.from_pretrained(
|
@@ -21,7 +21,7 @@ tokenizer = AutoTokenizer.from_pretrained(
|
|
21 |
)
|
22 |
|
23 |
# Load the model
|
24 |
-
model =
|
25 |
|
26 |
# Sample sequence
|
27 |
dna_seq = "ACGCGCTGACGCATCAGCATACGA"
|
|
|
13 |
To use **BarcodeBERT** as a feature extractor:
|
14 |
|
15 |
```python
|
16 |
+
from transformers import AutoTokenizer, BertForTokenClassification
|
17 |
|
18 |
# Load the tokenizer
|
19 |
tokenizer = AutoTokenizer.from_pretrained(
|
|
|
21 |
)
|
22 |
|
23 |
# Load the model
|
24 |
+
model = BertForTokenClassification.from_pretrained("bioscan-ml/BarcodeBERT", trust_remote_code=True)
|
25 |
|
26 |
# Sample sequence
|
27 |
dna_seq = "ACGCGCTGACGCATCAGCATACGA"
|