Update model_cards/README.md
Browse files- model_cards/README.md +39 -0
model_cards/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# StackOBERTflow-comments-small
|
| 2 |
+
|
| 3 |
+
StackOBERTflow is a RoBERTa model trained on StackOverflow comments.
|
| 4 |
+
A Byte-level BPE tokenizer with dropout was used (using the `tokenizers` package).
|
| 5 |
+
|
| 6 |
+
The model is *small*, i.e. has only 6-layers and the maximum sequence length was restricted to 256 tokens.
|
| 7 |
+
The model was trained for 6 epochs on several GBs of comments from the StackOverflow corpus.
|
| 8 |
+
|
| 9 |
+
## Quick start: masked language modeling prediction
|
| 10 |
+
|
| 11 |
+
```python
|
| 12 |
+
from transformers import pipeline
|
| 13 |
+
from pprint import pprint
|
| 14 |
+
|
| 15 |
+
COMMENT = "You really should not do it this way, I would use <mask> instead."
|
| 16 |
+
|
| 17 |
+
fill_mask = pipeline(
|
| 18 |
+
"fill-mask",
|
| 19 |
+
model="./StackOBERTflow-comments-small-v1",
|
| 20 |
+
tokenizer="./StackOBERTflow-comments-small-v1"
|
| 21 |
+
)
|
| 22 |
+
|
| 23 |
+
pprint(fill_mask(COMMENT))
|
| 24 |
+
# [{'score': 0.019997311756014824,
|
| 25 |
+
# 'sequence': '<s> You really should not do it this way, I would use jQuery instead.</s>',
|
| 26 |
+
# 'token': 1738},
|
| 27 |
+
# {'score': 0.01693696901202202,
|
| 28 |
+
# 'sequence': '<s> You really should not do it this way, I would use arrays instead.</s>',
|
| 29 |
+
# 'token': 2844},
|
| 30 |
+
# {'score': 0.013411642983555794,
|
| 31 |
+
# 'sequence': '<s> You really should not do it this way, I would use CSS instead.</s>',
|
| 32 |
+
# 'token': 2254},
|
| 33 |
+
# {'score': 0.013224546797573566,
|
| 34 |
+
# 'sequence': '<s> You really should not do it this way, I would use it instead.</s>',
|
| 35 |
+
# 'token': 300},
|
| 36 |
+
# {'score': 0.011984303593635559,
|
| 37 |
+
# 'sequence': '<s> You really should not do it this way, I would use classes instead.</s>',
|
| 38 |
+
# 'token': 1779}]
|
| 39 |
+
```
|