Token Classification
Transformers
Safetensors
English
modernbert
fill-mask
orality
linguistics
multi-label
custom_code
Instructions to use HavelockAI/bert-token-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HavelockAI/bert-token-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="HavelockAI/bert-token-classifier", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("HavelockAI/bert-token-classifier", trust_remote_code=True) model = AutoModelForMaskedLM.from_pretrained("HavelockAI/bert-token-classifier", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files- modeling_havelock.py +2 -1
modeling_havelock.py
CHANGED
|
@@ -92,7 +92,6 @@ class HavelockTokenConfig(PretrainedConfig):
|
|
| 92 |
super().__init__(**kwargs)
|
| 93 |
self.num_types = num_types
|
| 94 |
self.use_crf = use_crf
|
| 95 |
-
self.post_init()
|
| 96 |
|
| 97 |
|
| 98 |
class HavelockTokenClassifier(PreTrainedModel):
|
|
@@ -117,6 +116,8 @@ class HavelockTokenClassifier(PreTrainedModel):
|
|
| 117 |
if self.use_crf:
|
| 118 |
self.crf = MultiLabelCRF(config.num_types)
|
| 119 |
|
|
|
|
|
|
|
| 120 |
@classmethod
|
| 121 |
def from_backbone(
|
| 122 |
cls,
|
|
|
|
| 92 |
super().__init__(**kwargs)
|
| 93 |
self.num_types = num_types
|
| 94 |
self.use_crf = use_crf
|
|
|
|
| 95 |
|
| 96 |
|
| 97 |
class HavelockTokenClassifier(PreTrainedModel):
|
|
|
|
| 116 |
if self.use_crf:
|
| 117 |
self.crf = MultiLabelCRF(config.num_types)
|
| 118 |
|
| 119 |
+
self.post_init()
|
| 120 |
+
|
| 121 |
@classmethod
|
| 122 |
def from_backbone(
|
| 123 |
cls,
|