Instructions to use keras/roberta_large_en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasHub
How to use keras/roberta_large_en with KerasHub:
import keras_hub # Load TextClassifier model text_classifier = keras_hub.models.TextClassifier.from_preset( "hf://keras/roberta_large_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_large_en")import keras_hub # Create a Backbone model unspecialized for any task backbone = keras_hub.models.Backbone.from_preset("hf://keras/roberta_large_en") - Keras
How to use keras/roberta_large_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_large_en") - Notebooks
- Google Colab
- Kaggle
Update README.md with new model card content
Browse files
README.md
CHANGED
|
@@ -8,7 +8,7 @@ tags:
|
|
| 8 |
- keras
|
| 9 |
pipeline_tag: text-classification
|
| 10 |
---
|
| 11 |
-
## Model Overview
|
| 12 |
A RoBERTa encoder network.
|
| 13 |
|
| 14 |
This network implements a bi-directional Transformer-based encoder as
|
|
@@ -140,4 +140,4 @@ classifier = keras_hub.models.RobertaClassifier.from_preset(
|
|
| 140 |
preprocessor=None,
|
| 141 |
)
|
| 142 |
classifier.fit(x=features, y=labels, batch_size=2)
|
| 143 |
-
```
|
|
|
|
| 8 |
- keras
|
| 9 |
pipeline_tag: text-classification
|
| 10 |
---
|
| 11 |
+
### Model Overview
|
| 12 |
A RoBERTa encoder network.
|
| 13 |
|
| 14 |
This network implements a bi-directional Transformer-based encoder as
|
|
|
|
| 140 |
preprocessor=None,
|
| 141 |
)
|
| 142 |
classifier.fit(x=features, y=labels, batch_size=2)
|
| 143 |
+
```
|