Update README.md
Browse files
README.md
CHANGED
@@ -14,6 +14,10 @@ license: cc-by-4.0
|
|
14 |
|
15 |
# NorBERT 3 large
|
16 |
|
|
|
|
|
|
|
|
|
17 |
|
18 |
## Other sizes:
|
19 |
- [NorBERT 3 xs (15M)](https://huggingface.co/ltg/norbert3-xs)
|
@@ -21,18 +25,23 @@ license: cc-by-4.0
|
|
21 |
- [NorBERT 3 base (123M)](https://huggingface.co/ltg/norbert3-base)
|
22 |
- [NorBERT 3 large (323M)](https://huggingface.co/ltg/norbert3-large)
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
## Example usage
|
26 |
|
27 |
-
This model currently needs a custom wrapper from `modeling_norbert.py
|
28 |
|
29 |
```python
|
30 |
import torch
|
31 |
-
from transformers import AutoTokenizer
|
32 |
-
from modeling_norbert import NorbertForMaskedLM
|
33 |
|
34 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
35 |
-
|
36 |
|
37 |
mask_id = tokenizer.convert_tokens_to_ids("[MASK]")
|
38 |
input_text = tokenizer("Nå ønsker de seg en[MASK] bolig.", return_tensors="pt")
|
@@ -43,4 +52,17 @@ output_text = torch.where(input_text.input_ids == mask_id, output_p.logits.argma
|
|
43 |
print(tokenizer.decode(output_text[0].tolist()))
|
44 |
```
|
45 |
|
46 |
-
The following classes are currently implemented: `
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
# NorBERT 3 large
|
16 |
|
17 |
+
<img src="https://huggingface.co/ltg/norbert3-base/resolve/main/norbert.png" width=12.5%>
|
18 |
+
|
19 |
+
The official release of a new generation of NorBERT language models described in paper [**NorBench — A Benchmark for Norwegian Language Models**](https://openreview.net/forum?id=WgxNONkAbz). Plese read the paper to learn more details about the model.
|
20 |
+
|
21 |
|
22 |
## Other sizes:
|
23 |
- [NorBERT 3 xs (15M)](https://huggingface.co/ltg/norbert3-xs)
|
|
|
25 |
- [NorBERT 3 base (123M)](https://huggingface.co/ltg/norbert3-base)
|
26 |
- [NorBERT 3 large (323M)](https://huggingface.co/ltg/norbert3-large)
|
27 |
|
28 |
+
## Generative NorT5 siblings:
|
29 |
+
- [NorT5 xs (32M)](https://huggingface.co/ltg/nort5-xs)
|
30 |
+
- [NorT5 small (88M)](https://huggingface.co/ltg/nort5-small)
|
31 |
+
- [NorT5 base (228M)](https://huggingface.co/ltg/nort5-base)
|
32 |
+
- [NorT5 large (808M)](https://huggingface.co/ltg/nort5-large)
|
33 |
+
|
34 |
|
35 |
## Example usage
|
36 |
|
37 |
+
This model currently needs a custom wrapper from `modeling_norbert.py`, you should therefore load the model with `trust_remote_code=True`.
|
38 |
|
39 |
```python
|
40 |
import torch
|
41 |
+
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
|
|
42 |
|
43 |
+
tokenizer = AutoTokenizer.from_pretrained("ltg/norbert3-large")
|
44 |
+
model = AutoModelForMaskedLM.from_pretrained("ltg/norbert3-large", trust_remote_code=True)
|
45 |
|
46 |
mask_id = tokenizer.convert_tokens_to_ids("[MASK]")
|
47 |
input_text = tokenizer("Nå ønsker de seg en[MASK] bolig.", return_tensors="pt")
|
|
|
52 |
print(tokenizer.decode(output_text[0].tolist()))
|
53 |
```
|
54 |
|
55 |
+
The following classes are currently implemented: `AutoModel`, `AutoModelMaskedLM`, `AutoModelForSequenceClassification`, `AutoModelForTokenClassification`, `AutoModelForQuestionAnswering` and `AutoModeltForMultipleChoice`.
|
56 |
+
|
57 |
+
## Cite us
|
58 |
+
|
59 |
+
```bibtex
|
60 |
+
@inproceedings{
|
61 |
+
samuel2023norbench,
|
62 |
+
title={NorBench -- A Benchmark for Norwegian Language Models},
|
63 |
+
author={David Samuel and Andrey Kutuzov and Samia Touileb and Erik Velldal and Lilja {\O}vrelid and Egil R{\o}nningstad and Elina Sigdel and Anna Sergeevna Palatkina},
|
64 |
+
booktitle={The 24rd Nordic Conference on Computational Linguistics},
|
65 |
+
year={2023},
|
66 |
+
url={https://openreview.net/forum?id=WgxNONkAbz}
|
67 |
+
}
|
68 |
+
```
|