Feature Extraction
Transformers
Safetensors
English
bert
text-classification
icd10
healthcare
medical
custom_code
text-embeddings-inference
Instructions to use UMCU/ICD10_classifier_base_English with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use UMCU/ICD10_classifier_base_English with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="UMCU/ICD10_classifier_base_English", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("UMCU/ICD10_classifier_base_English", trust_remote_code=True) model = AutoModelForSequenceClassification.from_pretrained("UMCU/ICD10_classifier_base_English", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update modeling.py
Browse files- modeling.py +3 -2
modeling.py
CHANGED
|
@@ -11,13 +11,14 @@ class CustomSequenceClassificationModel(PreTrainedModel):
|
|
| 11 |
def __init__(
|
| 12 |
self,
|
| 13 |
config,
|
| 14 |
-
head_layers: int = 1,
|
| 15 |
-
head_dropout: float = 0.1,
|
| 16 |
):
|
| 17 |
super().__init__(config)
|
| 18 |
self.num_labels = config.num_labels
|
| 19 |
self.config = config
|
| 20 |
self.backbone = AutoModel.from_config(config)
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
hidden_size = getattr(config, "hidden_size", None)
|
| 23 |
if hidden_size is None:
|
|
|
|
| 11 |
def __init__(
|
| 12 |
self,
|
| 13 |
config,
|
|
|
|
|
|
|
| 14 |
):
|
| 15 |
super().__init__(config)
|
| 16 |
self.num_labels = config.num_labels
|
| 17 |
self.config = config
|
| 18 |
self.backbone = AutoModel.from_config(config)
|
| 19 |
+
|
| 20 |
+
head_layers = getattr(config, "head_layers", 1)
|
| 21 |
+
head_dropout = getattr(config, "head_dropout", 0.1)
|
| 22 |
|
| 23 |
hidden_size = getattr(config, "hidden_size", None)
|
| 24 |
if hidden_size is None:
|