File size: 6,705 Bytes
da633ea
 
 
d36009a
da633ea
1b6610f
da633ea
d36009a
 
da633ea
d36009a
1b6610f
 
da633ea
 
 
 
 
8b59592
da633ea
 
8b59592
da633ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d36009a
da633ea
 
d36009a
da633ea
d36009a
da633ea
 
 
 
 
 
 
d36009a
da633ea
 
 
 
d36009a
da633ea
 
 
 
 
 
 
d36009a
da633ea
d36009a
da633ea
 
 
 
 
8b59592
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
da633ea
 
8b59592
 
 
da633ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d36009a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
pretty_name: Norwegian Colossal Corpus (newspaper)
language:
- da
license: cc0-1.0
license_name: CC-0
task_categories:
- text-generation
- fill-mask
task_ids:
- language-modeling
domains:
- News
---

# Dataset Card for Norwegian Colossal Corpus (newspaper)

<!-- START-SHORT DESCRIPTION -->
OCR'd Newspapers derived from [NCC](https://huggingface.co/datasets/NbAiLab/NCC)
<!-- END-SHORT DESCRIPTION -->

The Norwegian Colossal Corpus is a collection of multiple smaller Norwegian corpuses suitable for training large language models.

## Dataset Description

<!-- START-DESC-STATS -->
- **Language**: dan, dansk, Danish
- **Number of samples**: 5.37K
- **Number of tokens (Llama 3)**: 1.05M
- **Average document length (characters)**: 571.69
<!-- END-DESC-STATS -->


## Dataset Structure
An example from the dataset looks as follows.
<!-- START-SAMPLE -->
```py
{
  "id": "fylkestidendeforsognogfjordane_null_null_19410723_69_54_1_MODSMD_ARTICLE5",
  "text": "STOCKHOLM: Det er kommet melding Ul den svenske turlst forenlng om at de to svenske ljellklatrerne s[...]",
  "source": "ncc_newspaper",
  "added": "2025-05-01",
  "created": "1941-01-01, 1941-12-31",
  "token_count": 137
}
```

### Data Fields

An entry in the dataset consists of the following fields:

- `id` (`str`): An unique identifier for each document.
- `text`(`str`): The content of the document.
- `source` (`str`): The source of the document (see [Source Data](#source-data)).
- `added` (`str`): An date for when the document was added to this collection.
- `created` (`str`): An date range for when the document was originally created.
- `token_count` (`int`): The number of tokens in the sample computed using the Llama 8B tokenizer
<!-- END-SAMPLE -->



### Dataset Statistics

<!-- START-DATASET PLOTS -->
<p align="center">
<img src="./images/dist_document_length.png" width="600" style="margin-right: 10px;" />
</p>
<!-- END-DATASET PLOTS -->

## Additional Information

## License Information

This dataset is licensed under [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/).
This license is derived from the original [publication](https://huggingface.co/datasets/NbAiLab/NCC), which is published by the 
[National Library of Norway](https://www.nb.no/en/).

## Filtering

This subset is the result of the following filtering from all available data splits on the [NCC](https://huggingface.co/datasets/NbAiLab/NCC):

- is_books: Documents, which are tagged as newspapers
- language_filter: Document is classified as Danish with a threshold of 0.75
- min_length: Document has at least 10 words (whitespace separated strings + punctuation)
- alpha_ratio: The ratio of all words / words with only alphabetical characters is at least 0.7
- min_stop_words: The document contains at least 2 Danish stop words
- duplicate: Duplicate documents were removed

The effect of each of these steps is outlined in the table below:

| Filtering step  | Number of document |
| --------------- | ------------------ |
| is_books        | 504 602            |
| language_filter | 7 632              |
| min_length      | 6 401              |
| alpha_ratio     | 5 439              |
| min_stop_words  | 5 374              |
| duplicate       | 5 373              |

## Quality

It is important to note, that recurring [OCR](https://en.wikipedia.org/wiki/Optical_character_recognition) errors and historic expressions in older 
texts hinder the legibility of some of the documents and make differentiating between Norwegian and Danish difficult.

### Citation Information

If you use this source please cite the following articles:

```
@inproceedings{kummervold-etal-2022-norwegian-colossal,
  title     = {The {N}orwegian colossal corpus: A text corpus for training large {N}orwegian language models},
  author    = {Kummervold, Per E  and
               Wetjen, Freddy    and
               De la Rosa, Javier},
  booktitle = {Proceedings of the Thirteenth Language Resources and Evaluation Conference (LREC)},
  year      = {2022},
  address   = {Marseille, France},
  publisher = {European Language Resources Association},
  url       = {https://aclanthology.org/2022.lrec-1.410},
  pages     = {3852--3860},
  abstract  = {Norwegian has been one of many languages lacking sufficient available text to train quality language models. In an attempt to bridge this gap, we introduce the Norwegian Colossal Corpus (NCC), which comprises 49GB of clean Norwegian textual data containing over 7B words. The NCC is composed of different and varied sources, ranging from books and newspapers to government documents and public reports, showcasing the various uses of the Norwegian language in society. The corpus contains mainly Norwegian Bokmål and Norwegian Nynorsk. Each document in the corpus is tagged with metadata that enables the creation of sub-corpora for specific needs. Its structure makes it easy to combine with large web archives that for licensing reasons could not be distributed together with the NCC. By releasing this corpus openly to the public, we hope to foster the creation of both better Norwegian language models and multilingual language models with support for Norwegian.},
}

@inproceedings{kummervold-etal-2021-operationalizing,
  title     = {Operationalizing a National Digital Library: The Case for a {N}orwegian Transformer Model},
  author    = {Kummervold, Per E  and
               De la Rosa, Javier  and
               Wetjen, Freddy  and
               Brygfjeld, Svein Arne},
  booktitle = {Proceedings of the 23rd Nordic Conference on Computational Linguistics (NoDaLiDa)},
  year      = {2021},
  address   = {Reykjavik, Iceland (Online)},
  publisher = {Linköping University Electronic Press, Sweden},
  url       = {https://aclanthology.org/2021.nodalida-main.3},
  pages     = {20--29},
  abstract  = {In this work, we show the process of building a large-scale training set from digital and digitized collections at a national library.
  The resulting Bidirectional Encoder Representations from Transformers (BERT)-based language model for Norwegian outperforms multilingual BERT (mBERT) models
  in several token and sequence classification tasks for both Norwegian Bokmål and Norwegian Nynorsk. Our model also improves the mBERT performance for other
  languages present in the corpus such as English, Swedish, and Danish. For languages not included in the corpus, the weights degrade moderately while keeping strong multilingual properties. Therefore,
  we show that building high-quality models within a memory institution using somewhat noisy optical character recognition (OCR) content is feasible, and we hope to pave the way for other memory institutions to follow.},
}

```