KennethEnevoldsen commited on
Commit
9c15515
·
unverified ·
1 Parent(s): ab78b91

Added number of llama3 tokens to desc stats

Browse files
Files changed (48) hide show
  1. .vscode/launch.json +16 -0
  2. README.md +13 -1
  3. data/adl/adl.md +1 -0
  4. data/adl/descriptive_stats.json +1 -1
  5. data/botxt/botxt.md +1 -0
  6. data/botxt/descriptive_stats.json +1 -1
  7. data/dannet/dannet.md +1 -0
  8. data/dannet/descriptive_stats.json +1 -1
  9. data/depbank/depbank.md +1 -0
  10. data/depbank/descriptive_stats.json +1 -1
  11. data/ep/descriptive_stats.json +1 -1
  12. data/ep/ep.md +1 -0
  13. data/ft/descriptive_stats.json +1 -1
  14. data/ft/ft.md +1 -0
  15. data/gutenberg/descriptive_stats.json +1 -1
  16. data/gutenberg/gutenberg.md +1 -0
  17. data/hest/descriptive_stats.json +1 -1
  18. data/hest/hest.md +1 -0
  19. data/jvj/descriptive_stats.json +1 -1
  20. data/jvj/jvj.md +1 -0
  21. data/naat/descriptive_stats.json +1 -1
  22. data/naat/naat.md +1 -0
  23. data/nordjyllandnews/descriptive_stats.json +1 -1
  24. data/nordjyllandnews/nordjyllandnews.md +1 -0
  25. data/relig/descriptive_stats.json +1 -1
  26. data/relig/relig.md +1 -0
  27. data/retsinformationdk/descriptive_stats.json +1 -1
  28. data/retsinformationdk/retsinformationdk.md +1 -0
  29. data/retspraksis/descriptive_stats.json +1 -1
  30. data/retspraksis/retspraksis.md +1 -0
  31. data/skat/descriptive_stats.json +1 -1
  32. data/skat/skat.md +1 -0
  33. data/spont/descriptive_stats.json +1 -1
  34. data/spont/spont.md +1 -0
  35. data/synne/descriptive_stats.json +1 -1
  36. data/synne/synne.md +1 -0
  37. data/tv2r/descriptive_stats.json +1 -1
  38. data/tv2r/tv2r.md +1 -0
  39. data/wiki/descriptive_stats.json +1 -1
  40. data/wiki/wiki.md +1 -0
  41. data/wikibooks/descriptive_stats.json +1 -1
  42. data/wikibooks/wikibooks.md +1 -0
  43. data/wikisource/descriptive_stats.json +1 -1
  44. data/wikisource/wikisource.md +1 -0
  45. descriptive_stats.json +1 -1
  46. pyproject.toml +2 -1
  47. scripts/update_descriptive_statistics.py +38 -6
  48. uv.lock +0 -0
.vscode/launch.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Python Debugger: Current File with Arguments",
9
+ "type": "debugpy",
10
+ "request": "launch",
11
+ "program": "${file}",
12
+ "console": "integratedTerminal",
13
+ "args": "--force"
14
+ }
15
+ ]
16
+ }
README.md CHANGED
@@ -114,6 +114,7 @@ language_bcp47:
114
  readme structure is inspired by:
115
  https://github.com/huggingface/datasets/blob/main/templates/README_guide.md -->
116
 
 
117
  # 🧨 Danish Dynaword
118
 
119
  | | |
@@ -149,6 +150,7 @@ https://github.com/huggingface/datasets/blob/main/templates/README_guide.md -->
149
 
150
  - **Language**: dan, dansk, Danish
151
  - **Number of samples**: 546.77K
 
152
  - **Average document length (characters)**: 8461.25
153
 
154
  <!-- END-DESC-STATS -->
@@ -262,7 +264,7 @@ Below follows a brief overview of the sources in the corpus along with their ind
262
  | [hest] | [CC-0] |
263
  | [jvj] | [CC-BY-SA 4.0] |
264
  | [naat] | [CC-0] |
265
- | [nordjyllandnews] | [CC-0] |
266
  | [relig] | [CC-0] |
267
  | [retsinformationdk] | [Other (Danish Law)] |
268
  | [retspraksis] | [CC-0] |
@@ -314,3 +316,13 @@ We welcome contributions to the dataset such as new sources, better data filteri
314
  ### Citation Information
315
 
316
  This version expand upon existing dataset sources such as the [Danish gigaword](https://huggingface.co/danish-foundation-models). We recommend that you cite the source of the dataset when using these datasets.
 
 
 
 
 
 
 
 
 
 
 
114
  readme structure is inspired by:
115
  https://github.com/huggingface/datasets/blob/main/templates/README_guide.md -->
116
 
117
+
118
  # 🧨 Danish Dynaword
119
 
120
  | | |
 
150
 
151
  - **Language**: dan, dansk, Danish
152
  - **Number of samples**: 546.77K
153
+ - **Number of tokens (Llama 3)**: 1.57B
154
  - **Average document length (characters)**: 8461.25
155
 
156
  <!-- END-DESC-STATS -->
 
264
  | [hest] | [CC-0] |
265
  | [jvj] | [CC-BY-SA 4.0] |
266
  | [naat] | [CC-0] |
267
+ | [nordjyllandnews] | [CC-0] |
268
  | [relig] | [CC-0] |
269
  | [retsinformationdk] | [Other (Danish Law)] |
270
  | [retspraksis] | [CC-0] |
 
316
  ### Citation Information
317
 
318
  This version expand upon existing dataset sources such as the [Danish gigaword](https://huggingface.co/danish-foundation-models). We recommend that you cite the source of the dataset when using these datasets.
319
+
320
+
321
+ ---
322
+
323
+ <h3 style="display: flex; align-items: center;">
324
+ <a href="https://www.foundationmodels.dk">
325
+ <img src="./docs/icon.png" width="30" style="margin-right: 10px;" />
326
+ </a>
327
+ A&nbsp;<a href=https://www.foundationmodels.dk>Danish Foundation Models</a>&nbsp;dataset
328
+ </h3>
data/adl/adl.md CHANGED
@@ -23,6 +23,7 @@ Danish literature from 1700-2023 stemming for the Archive for Danish Literature
23
 
24
  - **Language**: dan, dansk, Danish
25
  - **Number of samples**: 498
 
26
  - **Average document length (characters)**: 324932.24
27
 
28
  <!-- END-DESC-STATS -->
 
23
 
24
  - **Language**: dan, dansk, Danish
25
  - **Number of samples**: 498
26
+ - **Number of tokens (Llama 3)**: 58.49M
27
  - **Average document length (characters)**: 324932.24
28
 
29
  <!-- END-DESC-STATS -->
data/adl/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 498, "average_document_length": 324932.2429718876, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 498, "average_document_length": 324932.2429718876, "number_of_tokens": 58493311, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/botxt/botxt.md CHANGED
@@ -24,6 +24,7 @@ Fictional texts of various kinds written in Bornholmsk, the dialect spoken on th
24
 
25
  - **Language**: dan, dansk, Danish
26
  - **Number of samples**: 106
 
27
  - **Average document length (characters)**: 18972.42
28
 
29
  <!-- END-DESC-STATS -->
 
24
 
25
  - **Language**: dan, dansk, Danish
26
  - **Number of samples**: 106
27
+ - **Number of tokens (Llama 3)**: 847.97K
28
  - **Average document length (characters)**: 18972.42
29
 
30
  <!-- END-DESC-STATS -->
data/botxt/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 106, "average_document_length": 18972.415094339623, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 106, "average_document_length": 18972.415094339623, "number_of_tokens": 847973, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/dannet/dannet.md CHANGED
@@ -25,6 +25,7 @@ A WordNet is a lexico-semantic network which show the meaning and the relation b
25
 
26
  - **Language**: dan, dansk, Danish
27
  - **Number of samples**: 49.04K
 
28
  - **Average document length (characters)**: 90.80
29
 
30
  <!-- END-DESC-STATS -->
 
25
 
26
  - **Language**: dan, dansk, Danish
27
  - **Number of samples**: 49.04K
28
+ - **Number of tokens (Llama 3)**: 1.52M
29
  - **Average document length (characters)**: 90.80
30
 
31
  <!-- END-DESC-STATS -->
data/dannet/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 49040, "average_document_length": 90.80340538336053, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 49040, "average_document_length": 90.80340538336053, "number_of_tokens": 1523416, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/depbank/depbank.md CHANGED
@@ -26,6 +26,7 @@ While the dataset was initially intended as a rich annotation, this corpora only
26
 
27
  - **Language**: dan, dansk, Danish
28
  - **Number of samples**: 536
 
29
  - **Average document length (characters)**: 1018.90
30
 
31
  <!-- END-DESC-STATS -->
 
26
 
27
  - **Language**: dan, dansk, Danish
28
  - **Number of samples**: 536
29
+ - **Number of tokens (Llama 3)**: 185.45K
30
  - **Average document length (characters)**: 1018.90
31
 
32
  <!-- END-DESC-STATS -->
data/depbank/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 536, "average_document_length": 1018.8992537313433, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 536, "average_document_length": 1018.8992537313433, "number_of_tokens": 185454, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/ep/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 4213, "average_document_length": 74063.40469973891, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 4213, "average_document_length": 74063.40469973891, "number_of_tokens": 100888932, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/ep/ep.md CHANGED
@@ -25,6 +25,7 @@ The europarl is a corpus of parallel text in 11 languages from the proceedings o
25
 
26
  - **Language**: dan, dansk, Danish
27
  - **Number of samples**: 4.21K
 
28
  - **Average document length (characters)**: 74063.40
29
 
30
  <!-- END-DESC-STATS -->
 
25
 
26
  - **Language**: dan, dansk, Danish
27
  - **Number of samples**: 4.21K
28
+ - **Number of tokens (Llama 3)**: 100.89M
29
  - **Average document length (characters)**: 74063.40
30
 
31
  <!-- END-DESC-STATS -->
data/ft/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 1315, "average_document_length": 266745.19163498096, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 1315, "average_document_length": 266745.19163498096, "number_of_tokens": 114087231, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/ft/ft.md CHANGED
@@ -26,6 +26,7 @@ In the parliament hall, one speaker at a time addresses members of the parliamen
26
 
27
  - **Language**: dan, dansk, Danish
28
  - **Number of samples**: 1.31K
 
29
  - **Average document length (characters)**: 266745.19
30
 
31
  <!-- END-DESC-STATS -->
 
26
 
27
  - **Language**: dan, dansk, Danish
28
  - **Number of samples**: 1.31K
29
+ - **Number of tokens (Llama 3)**: 114.09M
30
  - **Average document length (characters)**: 266745.19
31
 
32
  <!-- END-DESC-STATS -->
data/gutenberg/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 66, "average_document_length": 290147.9393939394, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 66, "average_document_length": 290147.9393939394, "number_of_tokens": 6763317, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/gutenberg/gutenberg.md CHANGED
@@ -24,6 +24,7 @@ Project Gutenberg is an online library of free eBooks. Project Gutenberg was the
24
 
25
  - **Language**: dan, dansk, Danish
26
  - **Number of samples**: 66
 
27
  - **Average document length (characters)**: 290147.94
28
 
29
  <!-- END-DESC-STATS -->
 
24
 
25
  - **Language**: dan, dansk, Danish
26
  - **Number of samples**: 66
27
+ - **Number of tokens (Llama 3)**: 6.76M
28
  - **Average document length (characters)**: 290147.94
29
 
30
  <!-- END-DESC-STATS -->
data/hest/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 14391, "average_document_length": 82950.79104996179, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 14391, "average_document_length": 82950.79104996179, "number_of_tokens": 389325153, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/hest/hest.md CHANGED
@@ -26,6 +26,7 @@ Its inclusion as training data for large language models have multiple times rea
26
 
27
  - **Language**: dan, dansk, Danish
28
  - **Number of samples**: 14.39K
 
29
  - **Average document length (characters)**: 82950.79
30
 
31
  <!-- END-DESC-STATS -->
 
26
 
27
  - **Language**: dan, dansk, Danish
28
  - **Number of samples**: 14.39K
29
+ - **Number of tokens (Llama 3)**: 389.33M
30
  - **Average document length (characters)**: 82950.79
31
 
32
  <!-- END-DESC-STATS -->
data/jvj/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 42, "average_document_length": 254893.66666666666, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 42, "average_document_length": 254893.66666666666, "number_of_tokens": 3549181, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/jvj/jvj.md CHANGED
@@ -26,6 +26,7 @@ The works of the Danish author and poet, [Johannes V. Jensen](https://da.wikiped
26
 
27
  - **Language**: dan, dansk, Danish
28
  - **Number of samples**: 42
 
29
  - **Average document length (characters)**: 254893.67
30
 
31
  <!-- END-DESC-STATS -->
 
26
 
27
  - **Language**: dan, dansk, Danish
28
  - **Number of samples**: 42
29
+ - **Number of tokens (Llama 3)**: 3.55M
30
  - **Average document length (characters)**: 254893.67
31
 
32
  <!-- END-DESC-STATS -->
data/naat/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 129, "average_document_length": 6832.387596899225, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 129, "average_document_length": 6832.387596899225, "number_of_tokens": 286677, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/naat/naat.md CHANGED
@@ -22,6 +22,7 @@ A dataset of Danish speeches from 1930-2022.
22
 
23
  - **Language**: dan, dansk, Danish
24
  - **Number of samples**: 129
 
25
  - **Average document length (characters)**: 6832.39
26
 
27
  <!-- END-DESC-STATS -->
 
22
 
23
  - **Language**: dan, dansk, Danish
24
  - **Number of samples**: 129
25
+ - **Number of tokens (Llama 3)**: 286.68K
26
  - **Average document length (characters)**: 6832.39
27
 
28
  <!-- END-DESC-STATS -->
data/nordjyllandnews/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 75219, "average_document_length": 1540.2673659580691, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 75219, "average_document_length": 1540.2673659580691, "number_of_tokens": 37905944, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/nordjyllandnews/nordjyllandnews.md CHANGED
@@ -25,6 +25,7 @@ The data is derived from the Huggingface dataset [alexandrainst/nordjylland-news
25
 
26
  - **Language**: dan, dansk, Danish
27
  - **Number of samples**: 75.22K
 
28
  - **Average document length (characters)**: 1540.27
29
 
30
  <!-- END-DESC-STATS -->
 
25
 
26
  - **Language**: dan, dansk, Danish
27
  - **Number of samples**: 75.22K
28
+ - **Number of tokens (Llama 3)**: 37.91M
29
  - **Average document length (characters)**: 1540.27
30
 
31
  <!-- END-DESC-STATS -->
data/relig/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 66, "average_document_length": 53873.56060606061, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 66, "average_document_length": 53873.56060606061, "number_of_tokens": 1243970, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/relig/relig.md CHANGED
@@ -22,6 +22,7 @@ Danish religious text from the 1700-2022.
22
 
23
  - **Language**: dan, dansk, Danish
24
  - **Number of samples**: 66
 
25
  - **Average document length (characters)**: 53873.56
26
 
27
  <!-- END-DESC-STATS -->
 
22
 
23
  - **Language**: dan, dansk, Danish
24
  - **Number of samples**: 66
25
+ - **Number of tokens (Llama 3)**: 1.24M
26
  - **Average document length (characters)**: 53873.56
27
 
28
  <!-- END-DESC-STATS -->
data/retsinformationdk/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 64043, "average_document_length": 22248.525506300455, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 64043, "average_document_length": 22248.525506300455, "number_of_tokens": 516537034, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/retsinformationdk/retsinformationdk.md CHANGED
@@ -31,6 +31,7 @@ It serves as a central repository for Danish legislation, administrative regulat
31
 
32
  - **Language**: dan, dansk, Danish
33
  - **Number of samples**: 64.04K
 
34
  - **Average document length (characters)**: 22248.53
35
 
36
  <!-- END-DESC-STATS -->
 
31
 
32
  - **Language**: dan, dansk, Danish
33
  - **Number of samples**: 64.04K
34
+ - **Number of tokens (Llama 3)**: 516.54M
35
  - **Average document length (characters)**: 22248.53
36
 
37
  <!-- END-DESC-STATS -->
data/retspraksis/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 4413, "average_document_length": 46323.66915930206, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 4413, "average_document_length": 46323.66915930206, "number_of_tokens": 57080441, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/retspraksis/retspraksis.md CHANGED
@@ -25,6 +25,7 @@ It encompasses the body of legal decisions made by Danish courts, which play a s
25
 
26
  - **Language**: dan, dansk, Danish
27
  - **Number of samples**: 4.41K
 
28
  - **Average document length (characters)**: 46323.67
29
 
30
  <!-- END-DESC-STATS -->
 
25
 
26
  - **Language**: dan, dansk, Danish
27
  - **Number of samples**: 4.41K
28
+ - **Number of tokens (Llama 3)**: 57.08M
29
  - **Average document length (characters)**: 46323.67
30
 
31
  <!-- END-DESC-STATS -->
data/skat/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 14716, "average_document_length": 24026.800964936123, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 14716, "average_document_length": 24026.800964936123, "number_of_tokens": 122120389, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/skat/skat.md CHANGED
@@ -22,6 +22,7 @@ Skat is the Danish tax authority. This dataset contains content from its website
22
 
23
  - **Language**: dan, dansk, Danish
24
  - **Number of samples**: 14.72K
 
25
  - **Average document length (characters)**: 24026.80
26
 
27
  <!-- END-DESC-STATS -->
 
22
 
23
  - **Language**: dan, dansk, Danish
24
  - **Number of samples**: 14.72K
25
+ - **Number of tokens (Llama 3)**: 122.12M
26
  - **Average document length (characters)**: 24026.80
27
 
28
  <!-- END-DESC-STATS -->
data/spont/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 411, "average_document_length": 9736.79805352798, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 411, "average_document_length": 9736.79805352798, "number_of_tokens": 1555942, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/spont/spont.md CHANGED
@@ -24,6 +24,7 @@ The conversational corpus included originates from interdisciplinary research co
24
 
25
  - **Language**: dan, dansk, Danish
26
  - **Number of samples**: 411
 
27
  - **Average document length (characters)**: 9736.80
28
 
29
  <!-- END-DESC-STATS -->
 
24
 
25
  - **Language**: dan, dansk, Danish
26
  - **Number of samples**: 411
27
+ - **Number of tokens (Llama 3)**: 1.56M
28
  - **Average document length (characters)**: 9736.80
29
 
30
  <!-- END-DESC-STATS -->
data/synne/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 178, "average_document_length": 785.3258426966293, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 178, "average_document_length": 785.3258426966293, "number_of_tokens": 52508, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/synne/synne.md CHANGED
@@ -22,6 +22,7 @@ Dataset collected from [synnejysk forening's website](https://www.synnejysk.dk),
22
 
23
  - **Language**: dan, dansk, Danish
24
  - **Number of samples**: 178
 
25
  - **Average document length (characters)**: 785.33
26
 
27
  <!-- END-DESC-STATS -->
 
22
 
23
  - **Language**: dan, dansk, Danish
24
  - **Number of samples**: 178
25
+ - **Number of tokens (Llama 3)**: 52.51K
26
  - **Average document length (characters)**: 785.33
27
 
28
  <!-- END-DESC-STATS -->
data/tv2r/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 49137, "average_document_length": 1303.3820746077295, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 49137, "average_document_length": 1303.3820746077295, "number_of_tokens": 21671943, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/tv2r/tv2r.md CHANGED
@@ -24,6 +24,7 @@ It contains articles of regional interest, written following editorial standards
24
 
25
  - **Language**: dan, dansk, Danish
26
  - **Number of samples**: 49.14K
 
27
  - **Average document length (characters)**: 1303.38
28
 
29
  <!-- END-DESC-STATS -->
 
24
 
25
  - **Language**: dan, dansk, Danish
26
  - **Number of samples**: 49.14K
27
+ - **Number of tokens (Llama 3)**: 21.67M
28
  - **Average document length (characters)**: 1303.38
29
 
30
  <!-- END-DESC-STATS -->
data/wiki/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 264502, "average_document_length": 1386.6366794958071, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 264502, "average_document_length": 1386.6366794958071, "number_of_tokens": 122003880, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/wiki/wiki.md CHANGED
@@ -24,6 +24,7 @@ You can read more about wikipeadia on their [about](https://en.wikipedia.org/wik
24
 
25
  - **Language**: dan, dansk, Danish
26
  - **Number of samples**: 264.50K
 
27
  - **Average document length (characters)**: 1386.64
28
 
29
  <!-- END-DESC-STATS -->
 
24
 
25
  - **Language**: dan, dansk, Danish
26
  - **Number of samples**: 264.50K
27
+ - **Number of tokens (Llama 3)**: 122.00M
28
  - **Average document length (characters)**: 1386.64
29
 
30
  <!-- END-DESC-STATS -->
data/wikibooks/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 1319, "average_document_length": 13291.027293404093, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 1319, "average_document_length": 13291.027293404093, "number_of_tokens": 6239127, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/wikibooks/wikibooks.md CHANGED
@@ -23,6 +23,7 @@ The Danish Subsection of [**Wikibooks**](https://www.wikibooks.org).
23
 
24
  - **Language**: dan, dansk, Danish
25
  - **Number of samples**: 1.32K
 
26
  - **Average document length (characters)**: 13291.03
27
 
28
  <!-- END-DESC-STATS -->
 
23
 
24
  - **Language**: dan, dansk, Danish
25
  - **Number of samples**: 1.32K
26
+ - **Number of tokens (Llama 3)**: 6.24M
27
  - **Average document length (characters)**: 13291.03
28
 
29
  <!-- END-DESC-STATS -->
data/wikisource/descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 2429, "average_document_length": 6372.487855084397, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 2429, "average_document_length": 6372.487855084397, "number_of_tokens": 5344937, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
data/wikisource/wikisource.md CHANGED
@@ -22,6 +22,7 @@ The Danish subsection of [Wikisource](https://en.wikisource.org/wiki/Main_Page).
22
 
23
  - **Language**: dan, dansk, Danish
24
  - **Number of samples**: 2.43K
 
25
  - **Average document length (characters)**: 6372.49
26
 
27
  <!-- END-DESC-STATS -->
 
22
 
23
  - **Language**: dan, dansk, Danish
24
  - **Number of samples**: 2.43K
25
+ - **Number of tokens (Llama 3)**: 5.34M
26
  - **Average document length (characters)**: 6372.49
27
 
28
  <!-- END-DESC-STATS -->
descriptive_stats.json CHANGED
@@ -1 +1 @@
1
- {"number_of_samples": 546769, "average_document_length": 8461.252984349881, "language": "dan, dansk, Danish", "revision": "f2ad4e16f68745b42ccd1b8e614b6e6908d15ffc"}
 
1
+ {"number_of_samples": 546769, "average_document_length": 8461.252984349881, "number_of_tokens": 1567706760, "language": "dan, dansk, Danish", "revision": "ab78b9132d5697343896be76ff8f99a6b544b74b"}
pyproject.toml CHANGED
@@ -3,7 +3,7 @@ name = "danish-dynaword"
3
  version = "1.0.4"
4
  description = "project code for the danish dynaword project"
5
  readme = "README.md"
6
- requires-python = ">=3.13"
7
  dependencies = [
8
  "datasets>=3.0.0",
9
  "gitpython>=3.1.43",
@@ -15,4 +15,5 @@ dependencies = [
15
  "ruff>=0.8.3",
16
  "seaborn>=0.13.2",
17
  "tomlkit>=0.13.2",
 
18
  ]
 
3
  version = "1.0.4"
4
  description = "project code for the danish dynaword project"
5
  readme = "README.md"
6
+ requires-python = ">=3.12"
7
  dependencies = [
8
  "datasets>=3.0.0",
9
  "gitpython>=3.1.43",
 
15
  "ruff>=0.8.3",
16
  "seaborn>=0.13.2",
17
  "tomlkit>=0.13.2",
18
+ "transformers>=4.47.1",
19
  ]
scripts/update_descriptive_statistics.py CHANGED
@@ -10,6 +10,7 @@ Example use:
10
  import argparse
11
  import json
12
  import logging
 
13
  from dataclasses import dataclass
14
  from pathlib import Path
15
  from textwrap import dedent
@@ -17,11 +18,15 @@ from typing import Self, cast
17
 
18
  from datasets import Dataset, load_dataset
19
  from git_utilities import check_is_ancestor, get_current_revision, get_latest_revision
 
20
 
21
  logger = logging.getLogger(__name__)
22
 
23
  repo_path = Path(__file__).parent.parent
24
 
 
 
 
25
 
26
  def human_readable_large_int(value: int) -> str:
27
  thresholds = [
@@ -36,29 +41,56 @@ def human_readable_large_int(value: int) -> str:
36
  return str(value)
37
 
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  @dataclass()
40
  class DescriptiveStatsOverview:
41
  number_of_samples: int
42
  average_document_length: float
 
43
  language: str = "dan, dansk, Danish"
44
 
45
  @classmethod
46
  def from_dataset(cls, dataset: Dataset) -> Self:
47
  return cls(
48
  number_of_samples=len(dataset),
49
- average_document_length=cls.calculate_average_document_length(dataset),
 
50
  )
51
 
52
- @staticmethod
53
- def calculate_average_document_length(dataset: Dataset) -> float:
54
- texts = sum(len(t) for t in dataset["text"])
55
- return texts / len(dataset)
56
-
57
  def to_markdown(self) -> str:
58
  format = dedent(f"""
59
 
60
  - **Language**: {self.language}
61
  - **Number of samples**: {human_readable_large_int(self.number_of_samples)}
 
62
  - **Average document length (characters)**: {self.average_document_length:.2f}
63
 
64
  """)
 
10
  import argparse
11
  import json
12
  import logging
13
+ import multiprocessing
14
  from dataclasses import dataclass
15
  from pathlib import Path
16
  from textwrap import dedent
 
18
 
19
  from datasets import Dataset, load_dataset
20
  from git_utilities import check_is_ancestor, get_current_revision, get_latest_revision
21
+ from transformers import AutoTokenizer
22
 
23
  logger = logging.getLogger(__name__)
24
 
25
  repo_path = Path(__file__).parent.parent
26
 
27
+ tokenizer_name = "AI-Sweden-Models/Llama-3-8B-instruct"
28
+ tokenizer = AutoTokenizer.from_pretrained(tokenizer_name, use_fast=True)
29
+
30
 
31
  def human_readable_large_int(value: int) -> str:
32
  thresholds = [
 
41
  return str(value)
42
 
43
 
44
+ def calculate_average_document_length(
45
+ dataset: Dataset, text_column: str = "text"
46
+ ) -> float:
47
+ texts = sum(len(t) for t in dataset[text_column])
48
+ return texts / len(dataset)
49
+
50
+
51
+ def _count_tokens(batch):
52
+ return {
53
+ "token_count": [
54
+ len(tokens)
55
+ for tokens in tokenizer(batch["text"], padding=False)["input_ids"]
56
+ ]
57
+ }
58
+
59
+
60
+ def calculate_number_of_tokens(
61
+ dataset: Dataset,
62
+ text_column: str = "text",
63
+ ) -> int:
64
+ token_counts = dataset.map(
65
+ _count_tokens,
66
+ batched=True,
67
+ batch_size=1000,
68
+ num_proc=multiprocessing.cpu_count(),
69
+ )
70
+ return sum(token_counts["token_count"])
71
+
72
+
73
  @dataclass()
74
  class DescriptiveStatsOverview:
75
  number_of_samples: int
76
  average_document_length: float
77
+ number_of_tokens: int
78
  language: str = "dan, dansk, Danish"
79
 
80
  @classmethod
81
  def from_dataset(cls, dataset: Dataset) -> Self:
82
  return cls(
83
  number_of_samples=len(dataset),
84
+ average_document_length=calculate_average_document_length(dataset),
85
+ number_of_tokens=calculate_number_of_tokens(dataset),
86
  )
87
 
 
 
 
 
 
88
  def to_markdown(self) -> str:
89
  format = dedent(f"""
90
 
91
  - **Language**: {self.language}
92
  - **Number of samples**: {human_readable_large_int(self.number_of_samples)}
93
+ - **Number of tokens (Llama 3)**: {human_readable_large_int(self.number_of_tokens)}
94
  - **Average document length (characters)**: {self.average_document_length:.2f}
95
 
96
  """)
uv.lock CHANGED
The diff for this file is too large to render. See raw diff