Token Classification
Transformers
Safetensors
MultiLabelBert
multilabel
multilabel-token-classification
custom_code
Instructions to use jvaquet/multilabel-classification-bert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jvaquet/multilabel-classification-bert with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="jvaquet/multilabel-classification-bert", trust_remote_code=True)# Load model directly from transformers import AutoModelForTokenClassification model = AutoModelForTokenClassification.from_pretrained("jvaquet/multilabel-classification-bert", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -5,4 +5,24 @@ tags:
|
|
| 5 |
- multilabel-token-classification
|
| 6 |
base_model:
|
| 7 |
- google-bert/bert-large-cased
|
| 8 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
- multilabel-token-classification
|
| 6 |
base_model:
|
| 7 |
- google-bert/bert-large-cased
|
| 8 |
+
---
|
| 9 |
+
# Overview
|
| 10 |
+
- This is an extension of the `bert-large-cased` model to enable **multi-label token classification**.
|
| 11 |
+
- The training objective is BCELoss.
|
| 12 |
+
- Labels are one-hot encoded.
|
| 13 |
+
- Model output logits can be normalized using sigmoid activation.
|
| 14 |
+
|
| 15 |
+
# Usage
|
| 16 |
+
## Training
|
| 17 |
+
To initialize the model for training, simply provide `id2label` and `label2id`, similarly to standard token classification fine tuning:
|
| 18 |
+
```python
|
| 19 |
+
from transformers import AutoModelForTokenClassification
|
| 20 |
+
|
| 21 |
+
model = AutoModelForTokenClassification.from_pretrained('jvaquet/multilabel-classification-bert',
|
| 22 |
+
id2label = id2label,
|
| 23 |
+
label2id = label2id,
|
| 24 |
+
trust_remote_code=True)
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
|