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 with new model card content
Browse files
README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
---
|
| 2 |
library_name: keras-hub
|
| 3 |
---
|
| 4 |
-
##
|
| 5 |
A RoBERTa encoder network.
|
| 6 |
|
| 7 |
This network implements a bi-directional Transformer-based encoder as
|
|
@@ -36,7 +36,7 @@ __Arguments__
|
|
| 36 |
`max_sequence_length` default value. This determines the variable
|
| 37 |
shape for positional embeddings.
|
| 38 |
|
| 39 |
-
##
|
| 40 |
```python
|
| 41 |
import keras
|
| 42 |
import keras_hub
|
|
|
|
| 1 |
---
|
| 2 |
library_name: keras-hub
|
| 3 |
---
|
| 4 |
+
## Model Overview
|
| 5 |
A RoBERTa encoder network.
|
| 6 |
|
| 7 |
This network implements a bi-directional Transformer-based encoder as
|
|
|
|
| 36 |
`max_sequence_length` default value. This determines the variable
|
| 37 |
shape for positional embeddings.
|
| 38 |
|
| 39 |
+
## Example Usage
|
| 40 |
```python
|
| 41 |
import keras
|
| 42 |
import keras_hub
|