Token Classification
Transformers
PyTorch
English
bert
fill-mask
bert-base-cased
biodiversity
sequence-classification
Instructions to use NoYo25/BiodivBERT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NoYo25/BiodivBERT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="NoYo25/BiodivBERT")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("NoYo25/BiodivBERT") model = AutoModelForMaskedLM.from_pretrained("NoYo25/BiodivBERT", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -20,6 +20,8 @@ license: cc-by-nc-4.0
|
|
| 20 |
## How to use
|
| 21 |
* You can use BiodivBERT via huggingface library as follows:
|
| 22 |
|
|
|
|
|
|
|
| 23 |
````
|
| 24 |
>>> from transformers import AutoTokenizer, AutoModelForMaskedLM
|
| 25 |
|
|
@@ -28,6 +30,26 @@ license: cc-by-nc-4.0
|
|
| 28 |
>>> model = AutoModelForMaskedLM.from_pretrained("NoYo25/BiodivBERT")
|
| 29 |
````
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
## Training data
|
| 32 |
|
| 33 |
* BiodivBERT is pre-trained on abstracts and full text from biodiversity domain-related publications.
|
|
|
|
| 20 |
## How to use
|
| 21 |
* You can use BiodivBERT via huggingface library as follows:
|
| 22 |
|
| 23 |
+
1. Masked Language Model
|
| 24 |
+
|
| 25 |
````
|
| 26 |
>>> from transformers import AutoTokenizer, AutoModelForMaskedLM
|
| 27 |
|
|
|
|
| 30 |
>>> model = AutoModelForMaskedLM.from_pretrained("NoYo25/BiodivBERT")
|
| 31 |
````
|
| 32 |
|
| 33 |
+
2. Token Classification - Named Entity Recognition
|
| 34 |
+
|
| 35 |
+
````
|
| 36 |
+
>>> from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 37 |
+
|
| 38 |
+
>>> tokenizer = AutoTokenizer.from_pretrained("NoYo25/BiodivBERT")
|
| 39 |
+
|
| 40 |
+
>>> model = AutoModelForTokenClassification.from_pretrained("NoYo25/BiodivBERT")
|
| 41 |
+
````
|
| 42 |
+
|
| 43 |
+
3. Sequence Classification - Relation Extraction
|
| 44 |
+
|
| 45 |
+
````
|
| 46 |
+
>>> from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 47 |
+
|
| 48 |
+
>>> tokenizer = AutoTokenizer.from_pretrained("NoYo25/BiodivBERT")
|
| 49 |
+
|
| 50 |
+
>>> model = AutoModelForSequenceClassification.from_pretrained("NoYo25/BiodivBERT")
|
| 51 |
+
````
|
| 52 |
+
|
| 53 |
## Training data
|
| 54 |
|
| 55 |
* BiodivBERT is pre-trained on abstracts and full text from biodiversity domain-related publications.
|