Divyasreepat
commited on
Commit
•
6241bc8
1
Parent(s):
2369f6d
Update README.md with new model card content
Browse files
README.md
CHANGED
@@ -39,7 +39,7 @@ __Arguments__
|
|
39 |
### Example Usage
|
40 |
```python
|
41 |
import keras
|
42 |
-
import
|
43 |
import numpy as np
|
44 |
```
|
45 |
|
@@ -49,7 +49,7 @@ features = ["The quick brown fox jumped.", "I forgot my homework."]
|
|
49 |
labels = [0, 3]
|
50 |
|
51 |
# Pretrained classifier.
|
52 |
-
classifier =
|
53 |
"roberta_base_en",
|
54 |
num_classes=4,
|
55 |
)
|
@@ -77,7 +77,7 @@ features = {
|
|
77 |
labels = [0, 3]
|
78 |
|
79 |
# Pretrained classifier without preprocessing.
|
80 |
-
classifier =
|
81 |
"roberta_base_en",
|
82 |
num_classes=4,
|
83 |
preprocessor=None,
|
@@ -85,11 +85,11 @@ classifier = keras_hub.models.RobertaClassifier.from_preset(
|
|
85 |
classifier.fit(x=features, y=labels, batch_size=2)
|
86 |
```
|
87 |
|
88 |
-
## Example Usage with
|
89 |
|
90 |
```python
|
91 |
import keras
|
92 |
-
import
|
93 |
import numpy as np
|
94 |
```
|
95 |
|
@@ -99,8 +99,8 @@ features = ["The quick brown fox jumped.", "I forgot my homework."]
|
|
99 |
labels = [0, 3]
|
100 |
|
101 |
# Pretrained classifier.
|
102 |
-
classifier =
|
103 |
-
"roberta_base_en",
|
104 |
num_classes=4,
|
105 |
)
|
106 |
classifier.fit(x=features, y=labels, batch_size=2)
|
@@ -127,8 +127,8 @@ features = {
|
|
127 |
labels = [0, 3]
|
128 |
|
129 |
# Pretrained classifier without preprocessing.
|
130 |
-
classifier =
|
131 |
-
"roberta_base_en",
|
132 |
num_classes=4,
|
133 |
preprocessor=None,
|
134 |
)
|
|
|
39 |
### Example Usage
|
40 |
```python
|
41 |
import keras
|
42 |
+
import keras_nlp
|
43 |
import numpy as np
|
44 |
```
|
45 |
|
|
|
49 |
labels = [0, 3]
|
50 |
|
51 |
# Pretrained classifier.
|
52 |
+
classifier = keras_nlp.models.RobertaClassifier.from_preset(
|
53 |
"roberta_base_en",
|
54 |
num_classes=4,
|
55 |
)
|
|
|
77 |
labels = [0, 3]
|
78 |
|
79 |
# Pretrained classifier without preprocessing.
|
80 |
+
classifier = keras_nlp.models.RobertaClassifier.from_preset(
|
81 |
"roberta_base_en",
|
82 |
num_classes=4,
|
83 |
preprocessor=None,
|
|
|
85 |
classifier.fit(x=features, y=labels, batch_size=2)
|
86 |
```
|
87 |
|
88 |
+
## Example Usage with Hugging Face URI
|
89 |
|
90 |
```python
|
91 |
import keras
|
92 |
+
import keras_nlp
|
93 |
import numpy as np
|
94 |
```
|
95 |
|
|
|
99 |
labels = [0, 3]
|
100 |
|
101 |
# Pretrained classifier.
|
102 |
+
classifier = keras_nlp.models.RobertaClassifier.from_preset(
|
103 |
+
"hf://keras/roberta_base_en",
|
104 |
num_classes=4,
|
105 |
)
|
106 |
classifier.fit(x=features, y=labels, batch_size=2)
|
|
|
127 |
labels = [0, 3]
|
128 |
|
129 |
# Pretrained classifier without preprocessing.
|
130 |
+
classifier = keras_nlp.models.RobertaClassifier.from_preset(
|
131 |
+
"hf://keras/roberta_base_en",
|
132 |
num_classes=4,
|
133 |
preprocessor=None,
|
134 |
)
|