Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: sv
|
3 |
+
---
|
4 |
+
|
5 |
+
# A Swedish Bert model
|
6 |
+
|
7 |
+
## Model description
|
8 |
+
This model has the same architecture as the Bert Large model. It is implemented with the Megatron Bert Architecture containing following parameters:
|
9 |
+
<figure>
|
10 |
+
|
11 |
+
| Hyperparameter | Value |
|
12 |
+
|----------------------|------------|
|
13 |
+
| \\(n_{parameters}\\) | 340M |
|
14 |
+
| \\(n_{layers}\\) | 24 |
|
15 |
+
| \\(n_{heads}\\) | 16 |
|
16 |
+
| \\(n_{ctx}\\) | 1024 |
|
17 |
+
| \\(n_{vocab}\\) | 30592 |
|
18 |
+
|
19 |
+
|
20 |
+
## Training data
|
21 |
+
This repository contains a BERT Large model pretrained on a Swedish text corpus of around 80 GB from a variety of sources as shown below.
|
22 |
+
<figure>
|
23 |
+
|
24 |
+
| Dataset | Genre | Size(GB)|
|
25 |
+
|----------------------|------|------|
|
26 |
+
| Anföranden | Politics |0.9|
|
27 |
+
|DCEP|Politics|0.6|
|
28 |
+
|DGT|Politics|0.7|
|
29 |
+
|Fass|Medical|0.6|
|
30 |
+
|Författningar|Legal|0.1|
|
31 |
+
|Web data|Misc|45.0|
|
32 |
+
|JRC|Legal|0.4|
|
33 |
+
|Litteraturbanken|Books|0.3O|
|
34 |
+
|SCAR|Misc|28.0|
|
35 |
+
|SOU|Politics|5.3|
|
36 |
+
|Subtitles|Drama|1.3|
|
37 |
+
|Wikipedia|Facts|1.8|
|
38 |
+
|
39 |
+
|
40 |
+
## Intended uses & limitations
|
41 |
+
The raw model can be used for the usual tasks of masked language modeling or next sentence prediction. It is also often fine-tuned on a downstream task to improve its performance in a specific domain/task.
|
42 |
+
<br>
|
43 |
+
<br>
|
44 |
+
|
45 |
+
## How to use
|
46 |
+
|
47 |
+
```python
|
48 |
+
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
49 |
+
tokenizer = AutoTokenizer.from_pretrained("AI-Nordics/bert-large-swedish-cased")
|
50 |
+
model = AutoModelForMaskedLM.from_pretrained("AI-Nordics/bert-large-swedish-cased")
|
51 |
+
|