Instructions to use keras/roberta_base_en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/roberta_base_en with KerasHub:
import keras_hub # Load TextClassifier model text_classifier = keras_hub.models.TextClassifier.from_preset( "hf://keras/roberta_base_en", num_classes=2, ) # Fine-tune text_classifier.fit(x=["Thilling adventure!", "Total snoozefest."], y=[1, 0]) # Classify text text_classifier.predict(["Not my cup of tea."])import keras_hub # Create a MaskedLM model task = keras_hub.models.MaskedLM.from_preset("hf://keras/roberta_base_en")import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/roberta_base_en") - Keras
How to use keras/roberta_base_en with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://keras/roberta_base_en") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
| 1 |
---
|
| 2 |
library_name: keras-hub
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
## Model Overview
|
| 5 |
A RoBERTa encoder network.
|
|
@@ -133,4 +139,4 @@ classifier = keras_hub.models.RobertaClassifier.from_preset(
|
|
| 133 |
preprocessor=None,
|
| 134 |
)
|
| 135 |
classifier.fit(x=features, y=labels, batch_size=2)
|
| 136 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
library_name: keras-hub
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
tags:
|
| 7 |
+
- text-classification
|
| 8 |
+
- keras
|
| 9 |
---
|
| 10 |
## Model Overview
|
| 11 |
A RoBERTa encoder network.
|
|
|
|
| 139 |
preprocessor=None,
|
| 140 |
)
|
| 141 |
classifier.fit(x=features, y=labels, batch_size=2)
|
| 142 |
+
```
|