diff --git a/README.md b/README.md index 3ccb9f1648e9eb9f292da1caad70d18b7c60c81b..a064b8faa2ed5a72360ab98703573656b0ab6950 100644 --- a/README.md +++ b/README.md @@ -222,7 +222,6 @@ https://github.com/huggingface/datasets/blob/main/templates/README_guide.md - [Annotations](#annotations) - [Source Data](#source-data) - [Data Collection and Processing](#data-collection-and-processing) - - [Dataset Statistics](#dataset-statistics) - [Contributing to the dataset](#contributing-to-the-dataset) - [Citation Information](#citation-information) - [License information](#license-information) @@ -233,10 +232,9 @@ https://github.com/huggingface/datasets/blob/main/templates/README_guide.md ## Dataset Description -- **Language**: dan, dansk, Danish - **Number of samples**: 5.55M - **Number of tokens (Llama 3)**: 5.83B -- **Average document length (characters)**: 3171.33 +- **Average document length (min, max)**: 1.05K [2, 9.81M] @@ -296,20 +294,20 @@ This dynaword consist of data from various domains (e.g., legal, books, social m -| Domain | Sources | N. Tokens | -|:-------------|:---------------------------------------------------------------------------------------------------------|:------------| -| Legal | [cellar], [eur-lex-sum-da], [fm-udgivelser], [retsinformationdk], [skat], [retspraksis], [domsdatabasen] | 2.32B | -| News | [enevaeldens_nyheder], [ncc_newspaper], [tv2r], [nordjyllandnews] | 1.09B | -| Books | [grundtvig], [ncc_books], [memo], [adl], [wikibooks], [jvj], [gutenberg], [relig] | 732.52M | -| Conversation | [danske-taler], [opensubtitles], [ep], [ft], [spont], [naat] | 497.09M | -| Social Media | [hest] | 389.32M | -| Other | [ncc_parliament], [dannet], [depbank], [synne] | 340.59M | -| Web | [ai-aktindsigt], [ncc_maalfrid], [miljoeportalen] | 295.87M | -| Encyclopedic | [wikisource], [wiki] | 127.35M | -| Medical | [health_hovedstaden] | 27.07M | -| Readaloud | [nota] | 7.30M | -| Dialect | [botxt] | 847.97K | -| **Total** | | 5.83B | +| Domain | Sources | N. Tokens | +| :----------- | :------------------------------------------------------------------------------------------------------- | :-------- | +| Legal | [cellar], [eur-lex-sum-da], [fm-udgivelser], [retsinformationdk], [skat], [retspraksis], [domsdatabasen] | 2.32B | +| News | [enevaeldens_nyheder], [ncc_newspaper], [tv2r], [nordjyllandnews] | 1.09B | +| Books | [grundtvig], [ncc_books], [memo], [adl], [wikibooks], [jvj], [gutenberg], [relig] | 732.52M | +| Conversation | [danske-taler], [opensubtitles], [ep], [ft], [spont], [naat] | 497.09M | +| Social Media | [hest] | 389.32M | +| Other | [ncc_parliament], [dannet], [depbank], [synne] | 340.59M | +| Web | [ai-aktindsigt], [ncc_maalfrid], [miljoeportalen] | 295.87M | +| Encyclopedic | [wikisource], [wiki] | 127.35M | +| Medical | [health_hovedstaden] | 27.07M | +| Readaloud | [nota] | 7.30M | +| Dialect | [botxt] | 847.97K | +| **Total** | | 5.83B | [ai-aktindsigt]: data/ai-aktindsigt/ai-aktindsigt.md [cellar]: data/cellar/cellar.md @@ -370,13 +368,13 @@ The following gives an overview of the licensing in the Dynaword. To get the exa These license is applied to the constituent data, i.e., the text. The collection of datasets (metadata, quality control, etc.) is licensed under [CC-0](https://creativecommons.org/publicdomain/zero/1.0/legalcode.en). -| License | Sources | N. Tokens | -|:--------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------| -| CC-0 | [enevaeldens_nyheder], [grundtvig], [danske-taler], [ncc_books], [ncc_newspaper], [miljoeportalen], [opensubtitles], [ep], [ft], [wikisource], [spont], [adl], [hest], [skat], [retspraksis], [wikibooks], [botxt], [naat], [synne], [wiki], [nordjyllandnews], [relig], [nota], [health_hovedstaden] | 3.04B | -| CC-BY-SA 4.0 | [cellar], [eur-lex-sum-da], [fm-udgivelser], [memo], [tv2r], [jvj], [depbank] | 1.37B | -| Other (No attribution required) | [retsinformationdk], [domsdatabasen] | 904.61M | -| Other (Attribution required) | [ai-aktindsigt], [ncc_maalfrid], [ncc_parliament], [dannet], [gutenberg] | 515.61M | -| **Total** | | 5.83B | +| License | Sources | N. Tokens | +| :------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------- | +| CC-0 | [enevaeldens_nyheder], [grundtvig], [danske-taler], [ncc_books], [ncc_newspaper], [miljoeportalen], [opensubtitles], [ep], [ft], [wikisource], [spont], [adl], [hest], [skat], [retspraksis], [wikibooks], [botxt], [naat], [synne], [wiki], [nordjyllandnews], [relig], [nota], [health_hovedstaden] | 3.04B | +| CC-BY-SA 4.0 | [cellar], [eur-lex-sum-da], [fm-udgivelser], [memo], [tv2r], [jvj], [depbank] | 1.37B | +| Other (No attribution required) | [retsinformationdk], [domsdatabasen] | 904.61M | +| Other (Attribution required) | [ai-aktindsigt], [ncc_maalfrid], [ncc_parliament], [dannet], [gutenberg] | 515.61M | +| **Total** | | 5.83B | [ai-aktindsigt]: data/ai-aktindsigt/ai-aktindsigt.md [cellar]: data/cellar/cellar.md @@ -432,10 +430,7 @@ Each entry in the dataset consists of a single text with associated metadata ```py { "id": "adl_aakjaer06val", - "text": "SAMLEDE VÆRKER - -JEPPE AAKJÆR GYLDENDALSKE BOGHANDEL - NORDISK FORLAG KJØBENHAVN OG -KRISTIANIA 1919 0[...]", + "text": "SAMLEDE VÆRKER\n\nJEPPE AAKJÆR GYLDENDALSKE BOGHANDEL - NORDISK FORLAG KJØBENHAVN OG\nKRISTIANIA 1919 0[...]", "source": "adl", "added": "2020-09-14", "created": "1700-01-01, 2022-01-01", @@ -482,47 +477,47 @@ Below follows a brief overview of the sources in the corpus along with their ind You can learn more about each dataset by pressing the link in the first column. -| Source | Description | Domain | N. Tokens | License | -|:----------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------|:------------|:-----------------------| -| [cellar] | The official digital repository for European Union legal documents and open data | Legal | 1.15B | [CC-BY-SA 4.0] | -| [enevaeldens_nyheder] | High quality OCR'd texts from Danish and Norwegian newspapers during the period of constitutional absolutism in Denmark (1660–1849) | News | 1.03B | [CC-0] | -| [retsinformationdk] | [retsinformation.dk](https://www.retsinformation.dk) (legal-information.dk) the official legal information system of Denmark | Legal | 818.25M | [Danish Copyright Law] | -| [ncc_books] | Danish books extracted from the [Norwegian Colossal Corpus](https://huggingface.co/datasets/NbAiLab/NCC) derived from OCR | Books | 531.97M | [CC-0] | -| [hest] | Samples from the Danish debate forum www.heste-nettet.dk | Social Media | 389.32M | [CC-0] | -| [ncc_parliament] | Collections from the Norwegian parliament in Danish. Extracted from the [Norwegian Colossal Corpus](https://huggingface.co/datasets/NbAiLab/NCC) derived from ocr | Other | 338.87M | [NLOD 2.0] | -| [opensubtitles] | Danish subsection of [OpenSubtitles](https://opus.nlpl.eu/OpenSubtitles/corpus/version/OpenSubtitles) | Conversation | 271.60M | [CC-0] | -| [ai-aktindsigt] | Multiple web scrapes from municipality websites collected as a part of the [AI-aktindsigt](https://ai-aktindsigt.dk) project | Web | 139.23M | [Apache 2.0] | -| [miljoeportalen] | Data from [Danmarks Miljøportalen](https://www.miljoeportal.dk/om-danmarks-miljoeportal/) (Denmark's Environment Portal) | Web | 127.38M | [CC-0] | -| [skat] | Skat is the Danish tax authority. This dataset contains content from its website skat.dk | Legal | 122.11M | [CC-0] | -| [wiki] | The Danish subsection of [wikipedia](https://en.wikipedia.org/wiki/Main_Page) | Encyclopedic | 122.00M | [CC-0] | -| [ft] | Records from all meetings of The Danish parliament (Folketinget) in the parliament hall | Conversation | 114.09M | [CC-0] | -| [memo] | The MeMo corpus comprising almost all Danish novels from the period 1870-1899, known as the Modern Breakthrough | Books | 113.74M | [CC-BY-SA 4.0] | -| [ep] | The Danish subsection of [Europarl](https://aclanthology.org/2005.mtsummit-papers.11/) | Conversation | 100.84M | [CC-0] | -| [domsdatabasen] | [Domsdatabasen.dk](https://domsdatabasen.dk/) is a public database containing selected judgments from the Danish courts | Legal | 86.35M | [Danish Copyright Law] | -| [adl] | Danish literature from 1700-2023 from the [Archive for Danish Literature](https://tekster.kb.dk/text?editorial=no&f%5Bsubcollection_ssi%5D%5B%5D=adl&match=one&search_field=Alt) (ADL) | Books | 58.49M | [CC-0] | -| [retspraksis] | Case law or judical practice in Denmark derived from [Retspraksis](https://da.wikipedia.org/wiki/Retspraksis) | Legal | 56.26M | [CC-0] | -| [fm-udgivelser] | The official publication series of the Danish Ministry of Finance containing economic analyses, budget proposals, and fiscal policy documents | Legal | 50.34M | [CC-BY-SA 4.0] | -| [nordjyllandnews] | Articles from the Danish Newspaper [TV2 Nord](https://www.tv2nord.dk) | News | 37.90M | [CC-0] | -| [eur-lex-sum-da] | The Danish subsection of EUR-lex SUM consisting of EU legislation paired with professionally written summaries | Legal | 31.37M | [CC-BY-SA 4.0] | -| [ncc_maalfrid] | Danish content from Norwegian institutions websites | Web | 29.26M | [NLOD 2.0] | -| [health_hovedstaden] | Guidelines and informational documents for healthcare professionals from the Capital Region | Medical | 27.07M | [CC-0] | -| [tv2r] | Contemporary Danish newswire articles published between 2010 and 2019 | News | 21.67M | [CC-BY-SA 4.0] | -| [grundtvig] | The complete collection of [Grundtvig](https://en.wikipedia.org/wiki/N._F._S._Grundtvig) (1783-1872) one of Denmark’s most influential figures | Books | 10.53M | [CC-0] | -| [danske-taler] | Danish Speeches from [dansketaler.dk](https://www.dansketaler.dk) | Conversation | 8.72M | [CC-0] | -| [nota] | The text only part of the [Nota lyd- og tekstdata](https://sprogteknologi.dk/dataset/nota-lyd-og-tekstdata) dataset | Readaloud | 7.30M | [CC-0] | -| [gutenberg] | The Danish subsection from Project [Gutenberg](https://www.gutenberg.org) | Books | 6.76M | [Gutenberg] | -| [wikibooks] | The Danish Subsection of [Wikibooks](https://www.wikibooks.org) | Books | 6.24M | [CC-0] | -| [wikisource] | The Danish subsection of [Wikisource](https://en.wikisource.org/wiki/Main_Page) | Encyclopedic | 5.34M | [CC-0] | -| [jvj] | The works of the Danish author and poet, [Johannes V. Jensen](https://da.wikipedia.org/wiki/Johannes_V._Jensen) | Books | 3.55M | [CC-BY-SA 4.0] | -| [spont] | Conversational samples collected as a part of research projects at Aarhus University | Conversation | 1.56M | [CC-0] | -| [dannet] | [DanNet](https://cst.ku.dk/projekter/dannet) is a Danish WordNet | Other | 1.48M | [DanNet 1.0] | -| [relig] | Danish religious text from the 1700-2022 | Books | 1.24M | [CC-0] | -| [ncc_newspaper] | OCR'd Newspapers derived from [NCC](https://huggingface.co/datasets/NbAiLab/NCC) | News | 1.05M | [CC-0] | -| [botxt] | The Bornholmsk Ordbog Dictionary Project | Dialect | 847.97K | [CC-0] | -| [naat] | Danish speeches from 1930-2022 | Conversation | 286.68K | [CC-0] | -| [depbank] | The Danish subsection of the [Universal Dependencies Treebank](https://github.com/UniversalDependencies/UD_Danish-DDT) | Other | 185.45K | [CC-BY-SA 4.0] | -| [synne] | Dataset collected from [synnejysk forening's website](https://www.synnejysk.dk), covering the Danish dialect sønderjysk | Other | 52.02K | [CC-0] | -| **Total** | | | 5.83B | | +| Source | Description | Domain | N. Tokens | License | +| :-------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------- | :-------- | :--------------------- | +| [cellar] | The official digital repository for European Union legal documents and open data | Legal | 1.15B | [CC-BY-SA 4.0] | +| [enevaeldens_nyheder] | High quality OCR'd texts from Danish and Norwegian newspapers during the period of constitutional absolutism in Denmark (1660–1849) | News | 1.03B | [CC-0] | +| [retsinformationdk] | [retsinformation.dk](https://www.retsinformation.dk) (legal-information.dk) the official legal information system of Denmark | Legal | 818.25M | [Danish Copyright Law] | +| [ncc_books] | Danish books extracted from the [Norwegian Colossal Corpus](https://huggingface.co/datasets/NbAiLab/NCC) derived from OCR | Books | 531.97M | [CC-0] | +| [hest] | Samples from the Danish debate forum www.heste-nettet.dk | Social Media | 389.32M | [CC-0] | +| [ncc_parliament] | Collections from the Norwegian parliament in Danish. Extracted from the [Norwegian Colossal Corpus](https://huggingface.co/datasets/NbAiLab/NCC) derived from ocr | Other | 338.87M | [NLOD 2.0] | +| [opensubtitles] | Danish subsection of [OpenSubtitles](https://opus.nlpl.eu/OpenSubtitles/corpus/version/OpenSubtitles) | Conversation | 271.60M | [CC-0] | +| [ai-aktindsigt] | Multiple web scrapes from municipality websites collected as a part of the [AI-aktindsigt](https://ai-aktindsigt.dk) project | Web | 139.23M | [Apache 2.0] | +| [miljoeportalen] | Data from [Danmarks Miljøportalen](https://www.miljoeportal.dk/om-danmarks-miljoeportal/) (Denmark's Environment Portal) | Web | 127.38M | [CC-0] | +| [skat] | Skat is the Danish tax authority. This dataset contains content from its website skat.dk | Legal | 122.11M | [CC-0] | +| [wiki] | The Danish subsection of [wikipedia](https://en.wikipedia.org/wiki/Main_Page) | Encyclopedic | 122.00M | [CC-0] | +| [ft] | Records from all meetings of The Danish parliament (Folketinget) in the parliament hall | Conversation | 114.09M | [CC-0] | +| [memo] | The MeMo corpus comprising almost all Danish novels from the period 1870-1899, known as the Modern Breakthrough | Books | 113.74M | [CC-BY-SA 4.0] | +| [ep] | The Danish subsection of [Europarl](https://aclanthology.org/2005.mtsummit-papers.11/) | Conversation | 100.84M | [CC-0] | +| [domsdatabasen] | [Domsdatabasen.dk](https://domsdatabasen.dk/) is a public database containing selected judgments from the Danish courts | Legal | 86.35M | [Danish Copyright Law] | +| [adl] | Danish literature from 1700-2023 from the [Archive for Danish Literature](https://tekster.kb.dk/text?editorial=no&f%5Bsubcollection_ssi%5D%5B%5D=adl&match=one&search_field=Alt) (ADL) | Books | 58.49M | [CC-0] | +| [retspraksis] | Case law or judical practice in Denmark derived from [Retspraksis](https://da.wikipedia.org/wiki/Retspraksis) | Legal | 56.26M | [CC-0] | +| [fm-udgivelser] | The official publication series of the Danish Ministry of Finance containing economic analyses, budget proposals, and fiscal policy documents | Legal | 50.34M | [CC-BY-SA 4.0] | +| [nordjyllandnews] | Articles from the Danish Newspaper [TV2 Nord](https://www.tv2nord.dk) | News | 37.90M | [CC-0] | +| [eur-lex-sum-da] | The Danish subsection of EUR-lex SUM consisting of EU legislation paired with professionally written summaries | Legal | 31.37M | [CC-BY-SA 4.0] | +| [ncc_maalfrid] | Danish content from Norwegian institutions websites | Web | 29.26M | [NLOD 2.0] | +| [health_hovedstaden] | Guidelines and informational documents for healthcare professionals from the Capital Region | Medical | 27.07M | [CC-0] | +| [tv2r] | Contemporary Danish newswire articles published between 2010 and 2019 | News | 21.67M | [CC-BY-SA 4.0] | +| [grundtvig] | The complete collection of [Grundtvig](https://en.wikipedia.org/wiki/N._F._S._Grundtvig) (1783-1872) one of Denmark’s most influential figures | Books | 10.53M | [CC-0] | +| [danske-taler] | Danish Speeches from [dansketaler.dk](https://www.dansketaler.dk) | Conversation | 8.72M | [CC-0] | +| [nota] | The text only part of the [Nota lyd- og tekstdata](https://sprogteknologi.dk/dataset/nota-lyd-og-tekstdata) dataset | Readaloud | 7.30M | [CC-0] | +| [gutenberg] | The Danish subsection from Project [Gutenberg](https://www.gutenberg.org) | Books | 6.76M | [Gutenberg] | +| [wikibooks] | The Danish Subsection of [Wikibooks](https://www.wikibooks.org) | Books | 6.24M | [CC-0] | +| [wikisource] | The Danish subsection of [Wikisource](https://en.wikisource.org/wiki/Main_Page) | Encyclopedic | 5.34M | [CC-0] | +| [jvj] | The works of the Danish author and poet, [Johannes V. Jensen](https://da.wikipedia.org/wiki/Johannes_V._Jensen) | Books | 3.55M | [CC-BY-SA 4.0] | +| [spont] | Conversational samples collected as a part of research projects at Aarhus University | Conversation | 1.56M | [CC-0] | +| [dannet] | [DanNet](https://cst.ku.dk/projekter/dannet) is a Danish WordNet | Other | 1.48M | [DanNet 1.0] | +| [relig] | Danish religious text from the 1700-2022 | Books | 1.24M | [CC-0] | +| [ncc_newspaper] | OCR'd Newspapers derived from [NCC](https://huggingface.co/datasets/NbAiLab/NCC) | News | 1.05M | [CC-0] | +| [botxt] | The Bornholmsk Ordbog Dictionary Project | Dialect | 847.97K | [CC-0] | +| [naat] | Danish speeches from 1930-2022 | Conversation | 286.68K | [CC-0] | +| [depbank] | The Danish subsection of the [Universal Dependencies Treebank](https://github.com/UniversalDependencies/UD_Danish-DDT) | Other | 185.45K | [CC-BY-SA 4.0] | +| [synne] | Dataset collected from [synnejysk forening's website](https://www.synnejysk.dk), covering the Danish dialect sønderjysk | Other | 52.02K | [CC-0] | +| **Total** | | | 5.83B | | [ai-aktindsigt]: data/ai-aktindsigt/ai-aktindsigt.md [cellar]: data/cellar/cellar.md @@ -591,23 +586,6 @@ The data collection and processing varies depending on the dataset and is docume In addition to data specific processing we also run a series automated quality checks to ensure formatting (e.g. ensuring correctly formatted columns and unique IDs), quality checks (e.g. duplicate and empty string detection) and datasheet documentation checks. These checks are there to ensure a high quality of documentation and a minimal level of quality. To allow for the development of novel cleaning methodologies we do not provide more extensive cleaning. - -### Dataset Statistics -The following plot pr. dataset histograms displaying document lengths. - -
-Per dataset histograms - -

- -

- -
- - - - - ### Contributing to the dataset We welcome contributions to the dataset, including new sources, improved data filtering, and other enhancements. To get started on contributing, please see [the contribution guidelines](CONTRIBUTING.md) @@ -668,4 +646,4 @@ We will comply with legitimate requests by removing the affected sources from th Danish Foundation Models dataset - \ No newline at end of file + diff --git a/data/adl/adl.md b/data/adl/adl.md index 8d6ca557efc87737c5b373f8db19e853a5db3b85..2fd28fa8f1ee33899d7a9e9f69649b5a334be1e3 100644 --- a/data/adl/adl.md +++ b/data/adl/adl.md @@ -33,11 +33,9 @@ on the Danish Royal Library's [website](https://tekster.kb.dk/text?editorial=no& See also dataset [entry](https://sprogteknologi.dk/dataset/public-adl-text-sources) on sprogteknologi.dk and an [API](https://rawgit.com/Det-Kongelige-Bibliotek/access-digital-objects/master/form-demos/adl-form.html). -- **Language**: dan, dansk, Danish -- **Domains**: Books - **Number of samples**: 498 - **Number of tokens (Llama 3)**: 58.49M -- **Average document length (characters)**: 324932.24 +- **Average document length (min, max)**: 117.46K [53, 662.14K] diff --git a/data/adl/descriptive_stats.json b/data/adl/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..f72249488e841fe1c9f5864bd3b4600df0381fb7 --- /dev/null +++ b/data/adl/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 498, + "number_of_tokens": 58493311, + "min_length_tokens": 53, + "max_length_tokens": 662143, + "number_of_characters": 161816257, + "min_length_characters": 136, + "max_length_characters": 1879004 +} \ No newline at end of file diff --git a/data/ai-aktindsigt/ai-aktindsigt.md b/data/ai-aktindsigt/ai-aktindsigt.md index 2fe7eb2d0ea5d31d3373b600ab33b46f6073cb2a..91a73fb60e1122cf6613ceaa55add267155db521 100644 --- a/data/ai-aktindsigt/ai-aktindsigt.md +++ b/data/ai-aktindsigt/ai-aktindsigt.md @@ -27,11 +27,9 @@ The dataset consists of multiple scrapes of municipal websites compiled in conne -- **Language**: dan, dansk, Danish -- **Domains**: Web - **Number of samples**: 200.91K - **Number of tokens (Llama 3)**: 139.23M -- **Average document length (characters)**: 2030.75 +- **Average document length (min, max)**: 693.0064405666105 [9, 152.60K] diff --git a/data/ai-aktindsigt/descriptive_stats.json b/data/ai-aktindsigt/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..460c5808fc703945adc683666f80c7c829bd3253 --- /dev/null +++ b/data/ai-aktindsigt/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 200914, + "number_of_tokens": 139234696, + "min_length_tokens": 9, + "max_length_tokens": 152599, + "number_of_characters": 408005923, + "min_length_characters": 29, + "max_length_characters": 406832 +} \ No newline at end of file diff --git a/data/botxt/botxt.md b/data/botxt/botxt.md index 7ec369a297ae37842e7d6fb62a9220d7e14898e0..53e79d3e0c639694ceb204745417b3da8cdb2cbc 100644 --- a/data/botxt/botxt.md +++ b/data/botxt/botxt.md @@ -30,11 +30,9 @@ Fictional texts of various kinds written in Bornholmsk, the dialect spoken on th -- **Language**: dan, dansk, Danish -- **Domains**: Dialect, Web - **Number of samples**: 106 - **Number of tokens (Llama 3)**: 847.97K -- **Average document length (characters)**: 18972.42 +- **Average document length (min, max)**: 8.00K [407, 83.79K] diff --git a/data/botxt/descriptive_stats.json b/data/botxt/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..3251d1847651978a20eaa852763dedef586b7294 --- /dev/null +++ b/data/botxt/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 106, + "number_of_tokens": 847973, + "min_length_tokens": 407, + "max_length_tokens": 83792, + "number_of_characters": 2011076, + "min_length_characters": 845, + "max_length_characters": 202015 +} \ No newline at end of file diff --git a/data/cellar/cellar.md b/data/cellar/cellar.md index f1eb9f525fdaac0b7ce376a92ba135b39f172986..ecf4669df2d9fd747c0e29f685ee64c32e33216b 100644 --- a/data/cellar/cellar.md +++ b/data/cellar/cellar.md @@ -25,11 +25,9 @@ The EU Dataset Cellar serves as the central access point for all official EU pub ## Dataset Description -- **Language**: dan, dansk, Danish -- **Domains**: Legal - **Number of samples**: 63.40K - **Number of tokens (Llama 3)**: 1.15B -- **Average document length (characters)**: 60987.84 +- **Average document length (min, max)**: 18.17K [7, 2.60M] diff --git a/data/cellar/descriptive_stats.json b/data/cellar/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..8719215bce173193ef04e2a87501f80f94d6e21a --- /dev/null +++ b/data/cellar/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 63399, + "number_of_tokens": 1152074881, + "min_length_tokens": 7, + "max_length_tokens": 2599840, + "number_of_characters": 3866568270, + "min_length_characters": 14, + "max_length_characters": 37287484 +} \ No newline at end of file diff --git a/data/dannet/dannet.md b/data/dannet/dannet.md index d6f09bb51d2821860bfa321ae4869969dbd989e9..2fc6d8c24b4b2ecf0a48229a2895e90cfa4d6949 100644 --- a/data/dannet/dannet.md +++ b/data/dannet/dannet.md @@ -31,11 +31,9 @@ A WordNet is a lexico-semantic network which show the meaning and the relation b -- **Language**: dan, dansk, Danish -- **Domains**: Other - **Number of samples**: 47.60K - **Number of tokens (Llama 3)**: 1.48M -- **Average document length (characters)**: 90.88 +- **Average document length (min, max)**: 31.079364745919374 [2, 106] diff --git a/data/dannet/descriptive_stats.json b/data/dannet/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..fbeab34622d9be9e8ccf72659c609ae883ab3097 --- /dev/null +++ b/data/dannet/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 47603, + "number_of_tokens": 1479471, + "min_length_tokens": 2, + "max_length_tokens": 106, + "number_of_characters": 4326120, + "min_length_characters": 2, + "max_length_characters": 340 +} \ No newline at end of file diff --git a/data/danske-taler/danske-taler.md b/data/danske-taler/danske-taler.md index 0443a4441a6bc6e6d1c07d8841c0dccdd7db099c..fc9974e3cea155d6d8c31edfcb4a32593d2dc83f 100644 --- a/data/danske-taler/danske-taler.md +++ b/data/danske-taler/danske-taler.md @@ -37,11 +37,9 @@ Learn more about danske taler by reading their [about us](https://www.dansketale -- **Language**: dan, dansk, Danish -- **Domains**: Conversation, Speeches, Spoken - **Number of samples**: 2.91K - **Number of tokens (Llama 3)**: 8.72M -- **Average document length (characters)**: 9140.42 +- **Average document length (min, max)**: 3.00K [129, 53.40K] diff --git a/data/danske-taler/descriptive_stats.json b/data/danske-taler/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..98b8d87aad535213c182f0fa039568f0625e1906 --- /dev/null +++ b/data/danske-taler/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 2912, + "number_of_tokens": 8723951, + "min_length_tokens": 129, + "max_length_tokens": 53401, + "number_of_characters": 26616908, + "min_length_characters": 388, + "max_length_characters": 155429 +} \ No newline at end of file diff --git a/data/depbank/depbank.md b/data/depbank/depbank.md index f22e75f244a95f42bf62ec232580471e4b7acfef..d435d209635c12258722a42c2a055a154bd5f72e 100644 --- a/data/depbank/depbank.md +++ b/data/depbank/depbank.md @@ -32,11 +32,9 @@ While the dataset was initially intended as a rich annotation, this corpora only -- **Language**: dan, dansk, Danish -- **Domains**: Other - **Number of samples**: 536 - **Number of tokens (Llama 3)**: 185.45K -- **Average document length (characters)**: 1018.90 +- **Average document length (min, max)**: 345.99626865671644 [261, 517] diff --git a/data/depbank/descriptive_stats.json b/data/depbank/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..1c5b7460a60c8b66b3a93964a13377f915997214 --- /dev/null +++ b/data/depbank/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 536, + "number_of_tokens": 185454, + "min_length_tokens": 261, + "max_length_tokens": 517, + "number_of_characters": 546130, + "min_length_characters": 773, + "max_length_characters": 1398 +} \ No newline at end of file diff --git a/data/domsdatabasen/descriptive_stats.json b/data/domsdatabasen/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..6df1393ef376617934cb94586bfb7212b12eb340 --- /dev/null +++ b/data/domsdatabasen/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 8468, + "number_of_tokens": 86353024, + "min_length_tokens": 15, + "max_length_tokens": 1008826, + "number_of_characters": 256036077, + "min_length_characters": 35, + "max_length_characters": 3021437 +} \ No newline at end of file diff --git a/data/domsdatabasen/domsdatabasen.md b/data/domsdatabasen/domsdatabasen.md index 27099d0a67fa7dc70ecf718dd591cd6843d4a432..d5252f1b592a8d047e3ad74e08f2b07ff93a0cb2 100644 --- a/data/domsdatabasen/domsdatabasen.md +++ b/data/domsdatabasen/domsdatabasen.md @@ -56,11 +56,9 @@ Domsdatabasen is continuously being developed. As digitization progresses and te -- **Language**: dan, dansk, Danish -- **Domains**: Legal - **Number of samples**: 8.47K - **Number of tokens (Llama 3)**: 86.35M -- **Average document length (characters)**: 30235.72 +- **Average document length (min, max)**: 10.20K [15, 1.01M] diff --git a/data/enevaeldens_nyheder/descriptive_stats.json b/data/enevaeldens_nyheder/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..8bccbb8245d1198ffd54554340fe07d405b711ad --- /dev/null +++ b/data/enevaeldens_nyheder/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 4593228, + "number_of_tokens": 1034308344, + "min_length_tokens": 3, + "max_length_tokens": 37294, + "number_of_characters": 2889445364, + "min_length_characters": 4, + "max_length_characters": 111182 +} \ No newline at end of file diff --git a/data/enevaeldens_nyheder/enevaeldens_nyheder.md b/data/enevaeldens_nyheder/enevaeldens_nyheder.md index c8f3fc43b1fba5ead164ddbcb5b98dccecb1379c..b3c4f57f7db92cf060a012014ccb22715774ddf8 100644 --- a/data/enevaeldens_nyheder/enevaeldens_nyheder.md +++ b/data/enevaeldens_nyheder/enevaeldens_nyheder.md @@ -31,11 +31,9 @@ The newspaper editions have been segmented into individual texts using a model d -- **Language**: dan, dansk, Danish -- **Domains**: News - **Number of samples**: 4.59M - **Number of tokens (Llama 3)**: 1.03B -- **Average document length (characters)**: 629.07 +- **Average document length (min, max)**: 225.1811458085686 [3, 37.29K] diff --git a/data/ep/descriptive_stats.json b/data/ep/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..b23041d9755732f2fa41e5b4df4406a371480d45 --- /dev/null +++ b/data/ep/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 3930, + "number_of_tokens": 100841366, + "min_length_tokens": 8, + "max_length_tokens": 222729, + "number_of_characters": 311885257, + "min_length_characters": 14, + "max_length_characters": 688878 +} \ No newline at end of file diff --git a/data/ep/ep.md b/data/ep/ep.md index 5fbc0db580e94138b5602b22491f7a7d61f7ae0e..90a19afcc08dd6a04b0aa0253b985c1aacee100f 100644 --- a/data/ep/ep.md +++ b/data/ep/ep.md @@ -32,11 +32,9 @@ The europarl is a corpus of parallel text in 11 languages from the proceedings o -- **Language**: dan, dansk, Danish -- **Domains**: Conversation, Spoken - **Number of samples**: 3.93K - **Number of tokens (Llama 3)**: 100.84M -- **Average document length (characters)**: 79360.12 +- **Average document length (min, max)**: 25.66K [8, 222.73K] diff --git a/data/eur-lex-sum-da/descriptive_stats.json b/data/eur-lex-sum-da/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..a9797a869da93eaac1da2b2d390c1274d8046ef5 --- /dev/null +++ b/data/eur-lex-sum-da/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 1002, + "number_of_tokens": 31367665, + "min_length_tokens": 2144, + "max_length_tokens": 1723932, + "number_of_characters": 87802625, + "min_length_characters": 6439, + "max_length_characters": 2979072 +} \ No newline at end of file diff --git a/data/eur-lex-sum-da/eur-lex-sum-da.md b/data/eur-lex-sum-da/eur-lex-sum-da.md index 0c8ffc857ef669073db5964689f6d974b03edb25..92ee94bb83bf4fa7b27432939cf3f97423e6324d 100644 --- a/data/eur-lex-sum-da/eur-lex-sum-da.md +++ b/data/eur-lex-sum-da/eur-lex-sum-da.md @@ -26,11 +26,9 @@ The dataset is designed for training and evaluating automatic text summarization ## Dataset Description -- **Language**: dan, dansk, Danish -- **Domains**: Legal - **Number of samples**: 1.00K - **Number of tokens (Llama 3)**: 31.37M -- **Average document length (characters)**: 87627.37 +- **Average document length (min, max)**: 31.31K [2.14K, 1.72M] diff --git a/data/fm-udgivelser/descriptive_stats.json b/data/fm-udgivelser/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..7103a058e6797d05fb6b36b4f6b75109d295c70f --- /dev/null +++ b/data/fm-udgivelser/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 443, + "number_of_tokens": 50335291, + "min_length_tokens": 209, + "max_length_tokens": 595325, + "number_of_characters": 217115155, + "min_length_characters": 576, + "max_length_characters": 3791854 +} \ No newline at end of file diff --git a/data/fm-udgivelser/fm-udgivelser.md b/data/fm-udgivelser/fm-udgivelser.md index 95c0b514a5180a31da7f14520533bbf5c777cd28..76ad0977091e11d9b1e6670859a99ead69034e07 100644 --- a/data/fm-udgivelser/fm-udgivelser.md +++ b/data/fm-udgivelser/fm-udgivelser.md @@ -29,11 +29,9 @@ The publications are authoritative sources of information on Danish fiscal polic ## Dataset Description -- **Language**: dan, dansk, Danish -- **Domains**: Legal - **Number of samples**: 443 - **Number of tokens (Llama 3)**: 50.34M -- **Average document length (characters)**: 490101.93 +- **Average document length (min, max)**: 113.62K [209, 595.33K] diff --git a/data/ft/descriptive_stats.json b/data/ft/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..2ab10527a64cdf8d8cd924d77fc15fb0b9022e91 --- /dev/null +++ b/data/ft/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 1315, + "number_of_tokens": 114087231, + "min_length_tokens": 49, + "max_length_tokens": 342318, + "number_of_characters": 350769927, + "min_length_characters": 110, + "max_length_characters": 1041051 +} \ No newline at end of file diff --git a/data/ft/ft.md b/data/ft/ft.md index 766bd8c92ba5ae03b3428597c882186502a9b937..8f5b376241550bae37926b3ebf8c0771401670d2 100644 --- a/data/ft/ft.md +++ b/data/ft/ft.md @@ -33,11 +33,9 @@ In the parliament hall, one speaker at a time addresses members of the parliamen -- **Language**: dan, dansk, Danish -- **Domains**: Conversation, Spoken - **Number of samples**: 1.31K - **Number of tokens (Llama 3)**: 114.09M -- **Average document length (characters)**: 266745.19 +- **Average document length (min, max)**: 86.76K [49, 342.32K] diff --git a/data/grundtvig/descriptive_stats.json b/data/grundtvig/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..3aa920306150149fec3dbbbdd8e97445463a81de --- /dev/null +++ b/data/grundtvig/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 632, + "number_of_tokens": 10525393, + "min_length_tokens": 100, + "max_length_tokens": 453718, + "number_of_characters": 29669190, + "min_length_characters": 298, + "max_length_characters": 1285256 +} \ No newline at end of file diff --git a/data/grundtvig/grundtvig.md b/data/grundtvig/grundtvig.md index 2a4576238573d9e011d8e0e0a6c9142eb920f127..14f77f820d6ca1ad0e7e778eca58b63fe2bad116 100644 --- a/data/grundtvig/grundtvig.md +++ b/data/grundtvig/grundtvig.md @@ -31,11 +31,9 @@ The project is scheduled for completion in 2030 and will comprise 1,000 individu -- **Language**: dan, dansk, Danish -- **Domains**: Books - **Number of samples**: 632 - **Number of tokens (Llama 3)**: 10.53M -- **Average document length (characters)**: 46944.92 +- **Average document length (min, max)**: 16.65K [100, 453.72K] diff --git a/data/gutenberg/descriptive_stats.json b/data/gutenberg/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..8e489e734ae8d66967a5f128f874c609a64d9520 --- /dev/null +++ b/data/gutenberg/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 66, + "number_of_tokens": 6763317, + "min_length_tokens": 7915, + "max_length_tokens": 250511, + "number_of_characters": 19149764, + "min_length_characters": 24572, + "max_length_characters": 713986 +} \ No newline at end of file diff --git a/data/gutenberg/gutenberg.md b/data/gutenberg/gutenberg.md index 0df92d895d7ec04fe9a00077ac9a411988d1b1c8..2f68df7d68046b32971000249db9b1af4467b18b 100644 --- a/data/gutenberg/gutenberg.md +++ b/data/gutenberg/gutenberg.md @@ -30,11 +30,9 @@ Project Gutenberg is an online library of free eBooks. Project Gutenberg was the -- **Language**: dan, dansk, Danish -- **Domains**: Books - **Number of samples**: 66 - **Number of tokens (Llama 3)**: 6.76M -- **Average document length (characters)**: 290147.94 +- **Average document length (min, max)**: 102.47K [7.92K, 250.51K] diff --git a/data/health_hovedstaden/descriptive_stats.json b/data/health_hovedstaden/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..1ac884b4f96b5e7da46367e12d8395b340b1eb88 --- /dev/null +++ b/data/health_hovedstaden/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 23996, + "number_of_tokens": 27066716, + "min_length_tokens": 4, + "max_length_tokens": 51033, + "number_of_characters": 79883922, + "min_length_characters": 4, + "max_length_characters": 152339 +} \ No newline at end of file diff --git a/data/health_hovedstaden/health_hovedstaden.md b/data/health_hovedstaden/health_hovedstaden.md index ba17d0c7aa47f1086bee9d78f58d6c9196b76302..0683d64a5a56d77c4da93639f97114af41dfcc28 100644 --- a/data/health_hovedstaden/health_hovedstaden.md +++ b/data/health_hovedstaden/health_hovedstaden.md @@ -34,11 +34,9 @@ Martin Sundahl Laursen and Thiusius R. Savarimuthu from the University of Southe ## Dataset Description -- **Language**: dan, dansk, Danish -- **Domains**: Medical, Encyclopedic - **Number of samples**: 24.00K - **Number of tokens (Llama 3)**: 27.07M -- **Average document length (characters)**: 3329.05 +- **Average document length (min, max)**: 1.13K [4, 51.03K] diff --git a/data/hest/descriptive_stats.json b/data/hest/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..b9af6ecfb4ba1bd7a6c35dffa0594e08e903b4f6 --- /dev/null +++ b/data/hest/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 14342, + "number_of_tokens": 389318703, + "min_length_tokens": 3, + "max_length_tokens": 9812841, + "number_of_characters": 1193724991, + "min_length_characters": 2, + "max_length_characters": 30324298 +} \ No newline at end of file diff --git a/data/hest/hest.md b/data/hest/hest.md index 5ca5b3a3192c9482f97bbd39663290d8517ec8e1..420b3c7a98e5c3a85ab384398fb3ef6617e418de 100644 --- a/data/hest/hest.md +++ b/data/hest/hest.md @@ -32,11 +32,9 @@ Its inclusion as training data for large language models have multiple times rea -- **Language**: dan, dansk, Danish -- **Domains**: Social Media - **Number of samples**: 14.34K - **Number of tokens (Llama 3)**: 389.32M -- **Average document length (characters)**: 83232.81 +- **Average document length (min, max)**: 27.15K [3, 9.81M] diff --git a/data/jvj/descriptive_stats.json b/data/jvj/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..03e33705630d0e62cffd6a8ee9cba2c59d550f3a --- /dev/null +++ b/data/jvj/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 42, + "number_of_tokens": 3549181, + "min_length_tokens": 15474, + "max_length_tokens": 271790, + "number_of_characters": 10705534, + "min_length_characters": 47146, + "max_length_characters": 819703 +} \ No newline at end of file diff --git a/data/jvj/jvj.md b/data/jvj/jvj.md index 843c1b74248a6f1102a7894a654938c0c2b7cb35..eebb8bacc6b799e27a287c1285e54a15f0f48d43 100644 --- a/data/jvj/jvj.md +++ b/data/jvj/jvj.md @@ -32,11 +32,9 @@ The works of the Danish author and poet, [Johannes V. Jensen](https://da.wikiped -- **Language**: dan, dansk, Danish -- **Domains**: Books - **Number of samples**: 42 - **Number of tokens (Llama 3)**: 3.55M -- **Average document length (characters)**: 254893.67 +- **Average document length (min, max)**: 84.50K [15.47K, 271.79K] diff --git a/data/memo/descriptive_stats.json b/data/memo/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..6eab8a43672f07c4e7043ee1752ad6f80393a1f1 --- /dev/null +++ b/data/memo/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 858, + "number_of_tokens": 113742425, + "min_length_tokens": 6671, + "max_length_tokens": 720171, + "number_of_characters": 322392717, + "min_length_characters": 18626, + "max_length_characters": 2074215 +} \ No newline at end of file diff --git a/data/memo/memo.md b/data/memo/memo.md index 251f1b565bb06482e7ef864ded6bb75474cdf3f6..fe4ccab6449bd8c6ba3a2ca17e5b8e13780503f1 100644 --- a/data/memo/memo.md +++ b/data/memo/memo.md @@ -28,11 +28,9 @@ Additional information about this dataset can be found on their [project page](h ## Dataset Description -- **Language**: dan, dansk, Danish -- **Domains**: Books - **Number of samples**: 858 - **Number of tokens (Llama 3)**: 113.74M -- **Average document length (characters)**: 375749.09 +- **Average document length (min, max)**: 132.57K [6.67K, 720.17K] diff --git a/data/miljoeportalen/descriptive_stats.json b/data/miljoeportalen/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..6cac0f082dddff3564591d1f4772d9dbe869eb40 --- /dev/null +++ b/data/miljoeportalen/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 2120, + "number_of_tokens": 127379475, + "min_length_tokens": 54, + "max_length_tokens": 1436111, + "number_of_characters": 483758823, + "min_length_characters": 148, + "max_length_characters": 18428593 +} \ No newline at end of file diff --git a/data/miljoeportalen/miljoeportalen.md b/data/miljoeportalen/miljoeportalen.md index 8af8c1a326ef2372d9b365865bcecd796680bace..46ec0d61265ab72f33ad61005afbd0d4e9769b02 100644 --- a/data/miljoeportalen/miljoeportalen.md +++ b/data/miljoeportalen/miljoeportalen.md @@ -29,11 +29,9 @@ This can be decisions specifically targeted at the environment such as water pla ## Dataset Description -- **Language**: dan, dansk, Danish -- **Domains**: Web - **Number of samples**: 2.12K - **Number of tokens (Llama 3)**: 127.38M -- **Average document length (characters)**: 228188.12 +- **Average document length (min, max)**: 60.08K [54, 1.44M] diff --git a/data/naat/descriptive_stats.json b/data/naat/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..3f9964a2dcedaf8e89e1143517074b9b3faf99de --- /dev/null +++ b/data/naat/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 129, + "number_of_tokens": 286677, + "min_length_tokens": 228, + "max_length_tokens": 3952, + "number_of_characters": 881378, + "min_length_characters": 664, + "max_length_characters": 12118 +} \ No newline at end of file diff --git a/data/naat/naat.md b/data/naat/naat.md index 2f0532ef89861675716b225f7f5d961612d80193..44e08b0c13d5bec6998fd94263a42611b1ce3eba 100644 --- a/data/naat/naat.md +++ b/data/naat/naat.md @@ -29,11 +29,9 @@ Danish speeches from 1930-2022. -- **Language**: dan, dansk, Danish -- **Domains**: Conversation - **Number of samples**: 129 - **Number of tokens (Llama 3)**: 286.68K -- **Average document length (characters)**: 6832.39 +- **Average document length (min, max)**: 2.22K [228, 3.95K] diff --git a/data/ncc_books/descriptive_stats.json b/data/ncc_books/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..23feb6d0cb49eb2d57a7017daff418890e66a0ce --- /dev/null +++ b/data/ncc_books/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 4902, + "number_of_tokens": 531969285, + "min_length_tokens": 58, + "max_length_tokens": 383508, + "number_of_characters": 1539542960, + "min_length_characters": 153, + "max_length_characters": 1000000 +} \ No newline at end of file diff --git a/data/ncc_books/ncc_books.md b/data/ncc_books/ncc_books.md index 829ff6c41f9529edb4d21912c3f96f226cb1a930..75145b24e5cc275a866f2b81c91ba18e7078a43e 100644 --- a/data/ncc_books/ncc_books.md +++ b/data/ncc_books/ncc_books.md @@ -25,11 +25,9 @@ The Norwegian Colossal Corpus is a collection of multiple smaller Norwegian corp ## Dataset Description -- **Language**: dan, dansk, Danish -- **Domains**: Books - **Number of samples**: 4.90K - **Number of tokens (Llama 3)**: 531.97M -- **Average document length (characters)**: 314064.25 +- **Average document length (min, max)**: 108.52K [58, 383.51K] diff --git a/data/ncc_maalfrid/descriptive_stats.json b/data/ncc_maalfrid/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..48c9cdbf0695dad15b2d70a55d8c40aa9f0ed421 --- /dev/null +++ b/data/ncc_maalfrid/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 33336, + "number_of_tokens": 29260357, + "min_length_tokens": 12, + "max_length_tokens": 5105, + "number_of_characters": 84621219, + "min_length_characters": 31, + "max_length_characters": 15740 +} \ No newline at end of file diff --git a/data/ncc_maalfrid/ncc_maalfrid.md b/data/ncc_maalfrid/ncc_maalfrid.md index d043b9c8aa57f3c5ca17cfaa3f6cd263a27c4500..4febe7d6d49cc86c09a72f87f212a46c046120a8 100644 --- a/data/ncc_maalfrid/ncc_maalfrid.md +++ b/data/ncc_maalfrid/ncc_maalfrid.md @@ -24,11 +24,9 @@ Documents are derived from the [Målfrid collection](https://www.nb.no/sprakbank ## Dataset Description -- **Language**: dan, dansk, Danish -- **Domains**: Web - **Number of samples**: 33.34K - **Number of tokens (Llama 3)**: 29.26M -- **Average document length (characters)**: 2538.43 +- **Average document length (min, max)**: 877.7404907607391 [12, 5.11K] diff --git a/data/ncc_newspaper/descriptive_stats.json b/data/ncc_newspaper/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..5a07f0fac78736cb83709ab65c90b2b17a37bc67 --- /dev/null +++ b/data/ncc_newspaper/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 5373, + "number_of_tokens": 1052890, + "min_length_tokens": 12, + "max_length_tokens": 3851, + "number_of_characters": 3071706, + "min_length_characters": 33, + "max_length_characters": 10689 +} \ No newline at end of file diff --git a/data/ncc_newspaper/images/dist_document_length.png b/data/ncc_newspaper/images/dist_document_length.png index 728e611cc9abfc37f99a64826546a0a2599fd151..ea6600468b7bcb0f966629dcf279c9e7a22ab474 100644 --- a/data/ncc_newspaper/images/dist_document_length.png +++ b/data/ncc_newspaper/images/dist_document_length.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5ac1dfd8ee13d98e8f3e1754d144557d289e97e826c81f50e1897a797c3a015b -size 458956 +oid sha256:0f2c304bf6092db6c82337cc75af057c1a7a400db6de2ca98bb4f52baebf8a86 +size 556296 diff --git a/data/ncc_newspaper/ncc_newspaper.md b/data/ncc_newspaper/ncc_newspaper.md index 593a7810ebcac298564ab5f883243b0a681cbb32..e41bd467d7a42d269a1708ab0351e4223ed8a8c9 100644 --- a/data/ncc_newspaper/ncc_newspaper.md +++ b/data/ncc_newspaper/ncc_newspaper.md @@ -24,11 +24,9 @@ The Norwegian Colossal Corpus is a collection of multiple smaller Norwegian corp ## Dataset Description -- **Language**: dan, dansk, Danish -- **Domains**: News - **Number of samples**: 5.37K - **Number of tokens (Llama 3)**: 1.05M -- **Average document length (characters)**: 571.69 +- **Average document length (min, max)**: 195.95942676344686 [12, 3.85K] diff --git a/data/ncc_parliament/descriptive_stats.json b/data/ncc_parliament/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..149e83a2d6accd5e778bf963b7dfbd050ecf104d --- /dev/null +++ b/data/ncc_parliament/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 1077, + "number_of_tokens": 338871082, + "min_length_tokens": 129, + "max_length_tokens": 373587, + "number_of_characters": 980786678, + "min_length_characters": 369, + "max_length_characters": 1000000 +} \ No newline at end of file diff --git a/data/ncc_parliament/ncc_parliament.md b/data/ncc_parliament/ncc_parliament.md index a04ec2b4e3b1c95da7200ad403010121af6f919c..96fd13c06de25269237e3fa2046ee1a30c5b610d 100644 --- a/data/ncc_parliament/ncc_parliament.md +++ b/data/ncc_parliament/ncc_parliament.md @@ -24,11 +24,9 @@ The Norwegian Colossal Corpus is a collection of multiple smaller Norwegian corp ## Dataset Description -- **Language**: dan, dansk, Danish -- **Domains**: Other - **Number of samples**: 1.08K - **Number of tokens (Llama 3)**: 338.87M -- **Average document length (characters)**: 910665.44 +- **Average document length (min, max)**: 314.64K [129, 373.59K] diff --git a/data/nordjyllandnews/descriptive_stats.json b/data/nordjyllandnews/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..91f856f4a32f8e021fd8434f356542a99649d991 --- /dev/null +++ b/data/nordjyllandnews/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 75215, + "number_of_tokens": 37904580, + "min_length_tokens": 29, + "max_length_tokens": 12257, + "number_of_characters": 115853123, + "min_length_characters": 96, + "max_length_characters": 35269 +} \ No newline at end of file diff --git a/data/nordjyllandnews/nordjyllandnews.md b/data/nordjyllandnews/nordjyllandnews.md index e16029a4405f870803b1c1915b3f7399ffef0011..1509f59ada282d4861a6b90e2f6373ad3d9b2871 100644 --- a/data/nordjyllandnews/nordjyllandnews.md +++ b/data/nordjyllandnews/nordjyllandnews.md @@ -30,11 +30,9 @@ The data is derived from the Huggingface dataset [alexandrainst/nordjylland-news -- **Language**: dan, dansk, Danish -- **Domains**: News - **Number of samples**: 75.22K - **Number of tokens (Llama 3)**: 37.90M -- **Average document length (characters)**: 1540.29 +- **Average document length (min, max)**: 503.9497440670079 [29, 12.26K] diff --git a/data/nota/descriptive_stats.json b/data/nota/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..63370f780f78658ecaba8a5bd9cf31e4839a77a7 --- /dev/null +++ b/data/nota/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 446, + "number_of_tokens": 7299012, + "min_length_tokens": 4477, + "max_length_tokens": 107261, + "number_of_characters": 17371602, + "min_length_characters": 10134, + "max_length_characters": 314671 +} \ No newline at end of file diff --git a/data/nota/nota.md b/data/nota/nota.md index 7f6fa38c8b1ffa1e9b9c26fd2ce8405de1198228..906dd4b1ad9626ff04e562a32d36d95abd39a885 100644 --- a/data/nota/nota.md +++ b/data/nota/nota.md @@ -25,11 +25,9 @@ The text only part of the [Nota lyd- og tekstdata](https://sprogteknologi.dk/dat ## Dataset Description -- **Language**: dan, dansk, Danish -- **Domains**: Readaloud, Spoken - **Number of samples**: 446 - **Number of tokens (Llama 3)**: 7.30M -- **Average document length (characters)**: 38949.78 +- **Average document length (min, max)**: 16.37K [4.48K, 107.26K] diff --git a/data/opensubtitles/descriptive_stats.json b/data/opensubtitles/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..153571c2a4b396efdf151f2ca04dddad2c9653b4 --- /dev/null +++ b/data/opensubtitles/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 29820, + "number_of_tokens": 271599443, + "min_length_tokens": 45, + "max_length_tokens": 70137, + "number_of_characters": 784206884, + "min_length_characters": 95, + "max_length_characters": 196114 +} \ No newline at end of file diff --git a/data/opensubtitles/opensubtitles.md b/data/opensubtitles/opensubtitles.md index 9efb372295d698c34d84ee9c735943841b56632e..b435e56576092092f18a2abc802da1a48424be85 100644 --- a/data/opensubtitles/opensubtitles.md +++ b/data/opensubtitles/opensubtitles.md @@ -27,11 +27,9 @@ Danish subsection of [OpenSubtitles](https://opus.nlpl.eu/OpenSubtitles/corpus/v ## Dataset Description -- **Language**: dan, dansk, Danish -- **Domains**: Conversation, Subtitles, Spoken - **Number of samples**: 29.82K - **Number of tokens (Llama 3)**: 271.60M -- **Average document length (characters)**: 26298.02 +- **Average document length (min, max)**: 9.11K [45, 70.14K] diff --git a/data/relig/descriptive_stats.json b/data/relig/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..1640b5a77eabb078ecca08066aed943d557b13a4 --- /dev/null +++ b/data/relig/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 66, + "number_of_tokens": 1243970, + "min_length_tokens": 473, + "max_length_tokens": 66422, + "number_of_characters": 3555655, + "min_length_characters": 1403, + "max_length_characters": 183661 +} \ No newline at end of file diff --git a/data/relig/relig.md b/data/relig/relig.md index 411f54440f4712d050329aca032e9da5419b4b8e..b21fb6fb3f85e4d443941a49288ff322cb2e7a00 100644 --- a/data/relig/relig.md +++ b/data/relig/relig.md @@ -31,11 +31,9 @@ without any pre-processing other than file format conversion. -- **Language**: dan, dansk, Danish -- **Domains**: Books - **Number of samples**: 66 - **Number of tokens (Llama 3)**: 1.24M -- **Average document length (characters)**: 53873.56 +- **Average document length (min, max)**: 18.85K [473, 66.42K] diff --git a/data/retsinformationdk/descriptive_stats.json b/data/retsinformationdk/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..a60ccc7d573bed58bb98327f499635c7e2a38426 --- /dev/null +++ b/data/retsinformationdk/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 100524, + "number_of_tokens": 818252220, + "min_length_tokens": 34, + "max_length_tokens": 9593591, + "number_of_characters": 2338693895, + "min_length_characters": 103, + "max_length_characters": 21609422 +} \ No newline at end of file diff --git a/data/retsinformationdk/retsinformationdk.md b/data/retsinformationdk/retsinformationdk.md index fe9c22ce6162208f104354c6f21857b8af4c82f8..1346e805640ea0cec31bfc4c6d68aab32e2ec23b 100644 --- a/data/retsinformationdk/retsinformationdk.md +++ b/data/retsinformationdk/retsinformationdk.md @@ -37,11 +37,9 @@ It serves as a central repository for Danish legislation, administrative regulat -- **Language**: dan, dansk, Danish -- **Domains**: Legal - **Number of samples**: 100.52K - **Number of tokens (Llama 3)**: 818.25M -- **Average document length (characters)**: 23265.03 +- **Average document length (min, max)**: 8.14K [34, 9.59M] diff --git a/data/retspraksis/descriptive_stats.json b/data/retspraksis/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..dbaedf31b415b0f68c055ed0d160ae0689f1e764 --- /dev/null +++ b/data/retspraksis/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 4362, + "number_of_tokens": 56263026, + "min_length_tokens": 298, + "max_length_tokens": 979662, + "number_of_characters": 201907995, + "min_length_characters": 892, + "max_length_characters": 6583837 +} \ No newline at end of file diff --git a/data/retspraksis/retspraksis.md b/data/retspraksis/retspraksis.md index edd18cb5f1b9e3cccb49b3c9cb96ff8cd682e479..0119fb9475470befc22eb69a9810ef8f15b65dc4 100644 --- a/data/retspraksis/retspraksis.md +++ b/data/retspraksis/retspraksis.md @@ -31,11 +31,9 @@ It encompasses the body of legal decisions made by Danish courts, which play a s -- **Language**: dan, dansk, Danish -- **Domains**: Legal - **Number of samples**: 4.36K - **Number of tokens (Llama 3)**: 56.26M -- **Average document length (characters)**: 46287.94 +- **Average document length (min, max)**: 12.90K [298, 979.66K] diff --git a/data/skat/descriptive_stats.json b/data/skat/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..2dea8a5cbcbd5eead293e0ffc96663394b16aa82 --- /dev/null +++ b/data/skat/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 14715, + "number_of_tokens": 122113781, + "min_length_tokens": 2, + "max_length_tokens": 175223, + "number_of_characters": 353560210, + "min_length_characters": 1, + "max_length_characters": 517882 +} \ No newline at end of file diff --git a/data/skat/skat.md b/data/skat/skat.md index a9dfb5c8aaed5c83b9d776cba60ff4eac4627a38..1fadb4f2d319b8e2f72c6f4903505bd87df1b463 100644 --- a/data/skat/skat.md +++ b/data/skat/skat.md @@ -28,11 +28,9 @@ Skat is the Danish tax authority. This dataset contains content from its website -- **Language**: dan, dansk, Danish -- **Domains**: Legal - **Number of samples**: 14.71K - **Number of tokens (Llama 3)**: 122.11M -- **Average document length (characters)**: 24027.20 +- **Average document length (min, max)**: 8.30K [2, 175.22K] diff --git a/data/spont/descriptive_stats.json b/data/spont/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..7638f2953bc56a8bf80701e83fcbf899ed464823 --- /dev/null +++ b/data/spont/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 411, + "number_of_tokens": 1555942, + "min_length_tokens": 85, + "max_length_tokens": 14025, + "number_of_characters": 4001824, + "min_length_characters": 183, + "max_length_characters": 37603 +} \ No newline at end of file diff --git a/data/spont/spont.md b/data/spont/spont.md index 8dccab9cc6c1b509dac932c9fd83596a5ed37448..2f4ceeec5a8075f7effdfa08e24a028d41c0ab9e 100644 --- a/data/spont/spont.md +++ b/data/spont/spont.md @@ -41,11 +41,9 @@ Speech is transcribed post-hoc by native speakers. Studies published relying on -- **Language**: dan, dansk, Danish -- **Domains**: Conversation, Spoken - **Number of samples**: 411 - **Number of tokens (Llama 3)**: 1.56M -- **Average document length (characters)**: 9736.80 +- **Average document length (min, max)**: 3.79K [85, 14.03K] diff --git a/data/synne/descriptive_stats.json b/data/synne/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..128032e001d639d4c77bd45beb4a58e999a761f1 --- /dev/null +++ b/data/synne/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 177, + "number_of_tokens": 52017, + "min_length_tokens": 128, + "max_length_tokens": 891, + "number_of_characters": 138484, + "min_length_characters": 333, + "max_length_characters": 2213 +} \ No newline at end of file diff --git a/data/synne/synne.md b/data/synne/synne.md index 7a091ba9a39045424ef515a4b564c00f25c34bb3..58cf4bae30bddb6677ebdcbb134a9c1672caa8f3 100644 --- a/data/synne/synne.md +++ b/data/synne/synne.md @@ -28,11 +28,9 @@ Dataset collected from [synnejysk forening's website](https://www.synnejysk.dk), -- **Language**: dan, dansk, Danish -- **Domains**: Other - **Number of samples**: 177 - **Number of tokens (Llama 3)**: 52.02K -- **Average document length (characters)**: 782.40 +- **Average document length (min, max)**: 293.8813559322034 [128, 891] diff --git a/data/tv2r/descriptive_stats.json b/data/tv2r/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..aafd73adfe1a023dab39440aba42d744e4c36c36 --- /dev/null +++ b/data/tv2r/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 49134, + "number_of_tokens": 21670824, + "min_length_tokens": 16, + "max_length_tokens": 5267, + "number_of_characters": 64040849, + "min_length_characters": 31, + "max_length_characters": 16140 +} \ No newline at end of file diff --git a/data/tv2r/tv2r.md b/data/tv2r/tv2r.md index 43d6902169e203166041b7c4c1d283344d51c07a..d8930978dbe23cd33f85f15c220b60d0b1bef521 100644 --- a/data/tv2r/tv2r.md +++ b/data/tv2r/tv2r.md @@ -30,11 +30,9 @@ It contains articles of regional interest, written following editorial standards -- **Language**: dan, dansk, Danish -- **Domains**: News - **Number of samples**: 49.13K - **Number of tokens (Llama 3)**: 21.67M -- **Average document length (characters)**: 1303.39 +- **Average document length (min, max)**: 441.055562339724 [16, 5.27K] diff --git a/data/wiki/descriptive_stats.json b/data/wiki/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..dc81766c3cae0ab26f5b0344dc9fe57e423dfee8 --- /dev/null +++ b/data/wiki/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 264433, + "number_of_tokens": 122002149, + "min_length_tokens": 3, + "max_length_tokens": 83123, + "number_of_characters": 366763808, + "min_length_characters": 5, + "max_length_characters": 247835 +} \ No newline at end of file diff --git a/data/wiki/wiki.md b/data/wiki/wiki.md index b295b04079695e44bf9dbecee9763f8bd0f2042d..d0332b3350ca33f22097213c2e8ac74047f75a60 100644 --- a/data/wiki/wiki.md +++ b/data/wiki/wiki.md @@ -30,11 +30,9 @@ You can read more about wikipedia on their [about](https://en.wikipedia.org/wiki -- **Language**: dan, dansk, Danish -- **Domains**: Encyclopedic - **Number of samples**: 264.43K - **Number of tokens (Llama 3)**: 122.00M -- **Average document length (characters)**: 1386.98 +- **Average document length (min, max)**: 461.372631252529 [3, 83.12K] diff --git a/data/wikibooks/descriptive_stats.json b/data/wikibooks/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..8ec35224d4d249b46505dcc103625befc159e4af --- /dev/null +++ b/data/wikibooks/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 1268, + "number_of_tokens": 6237322, + "min_length_tokens": 4, + "max_length_tokens": 365886, + "number_of_characters": 17525790, + "min_length_characters": 6, + "max_length_characters": 1007458 +} \ No newline at end of file diff --git a/data/wikibooks/wikibooks.md b/data/wikibooks/wikibooks.md index 03ce9f1fd19bdb26b7d9b6720bfe98743c9a4512..f8aa66a2b70af817ed427bb3f59b755fa53c4ae7 100644 --- a/data/wikibooks/wikibooks.md +++ b/data/wikibooks/wikibooks.md @@ -28,11 +28,9 @@ The Danish Subsection of [Wikibooks](https://www.wikibooks.org). -- **Language**: dan, dansk, Danish -- **Domains**: Books - **Number of samples**: 1.27K - **Number of tokens (Llama 3)**: 6.24M -- **Average document length (characters)**: 13821.60 +- **Average document length (min, max)**: 4.92K [4, 365.89K] diff --git a/data/wikisource/descriptive_stats.json b/data/wikisource/descriptive_stats.json new file mode 100644 index 0000000000000000000000000000000000000000..515ad2a112ac22006ecc6df73debce5061b1a0f9 --- /dev/null +++ b/data/wikisource/descriptive_stats.json @@ -0,0 +1,9 @@ +{ + "number_of_samples": 2419, + "number_of_tokens": 5344862, + "min_length_tokens": 5, + "max_length_tokens": 218362, + "number_of_characters": 15478618, + "min_length_characters": 10, + "max_length_characters": 613148 +} \ No newline at end of file diff --git a/data/wikisource/wikisource.md b/data/wikisource/wikisource.md index f0d99d87a1391bfa8bbae91e1ccf257864f5d827..2ccc3a0aba8a635bd7b0b7f72faf37091cca8b94 100644 --- a/data/wikisource/wikisource.md +++ b/data/wikisource/wikisource.md @@ -28,11 +28,9 @@ The Danish subsection of [Wikisource](https://en.wikisource.org/wiki/Main_Page). -- **Language**: dan, dansk, Danish -- **Domains**: Encyclopedic - **Number of samples**: 2.42K - **Number of tokens (Llama 3)**: 5.34M -- **Average document length (characters)**: 6398.77 +- **Average document length (min, max)**: 2.21K [5, 218.36K] diff --git a/descriptive_stats.json b/descriptive_stats.json index bacd4f2b568bb7a7ae6febbea19534678a82a596..f5ab0b9f76d09ef321ba91f957b2d0c2b3944c38 100644 --- a/descriptive_stats.json +++ b/descriptive_stats.json @@ -1,5 +1,9 @@ { "number_of_samples": 5554217, - "average_document_length": 3171.325986723241, "number_of_tokens": 5829657307, + "min_length_tokens": 2, + "max_length_tokens": 9812841, + "number_of_characters": 17614232708, + "min_length_characters": 1, + "max_length_characters": 37287484 } \ No newline at end of file diff --git a/images/tokens_over_time.html b/images/tokens_over_time.html index 5ef2cb4a463c96c55f9a263990fc65a2f1883cd7..afb8a4e61a0bc27963c09134ec48919d1fc42d73 100644 --- a/images/tokens_over_time.html +++ b/images/tokens_over_time.html @@ -2,6 +2,6 @@
-
+
\ No newline at end of file diff --git a/images/tokens_over_time.svg b/images/tokens_over_time.svg index efc13379424cacd1a960c7ef30fe701fa6c4b6a2..df84823342efe89ddc12648861339f11c93130a6 100644 --- a/images/tokens_over_time.svg +++ b/images/tokens_over_time.svg @@ -1 +1 @@ -Jan 2025Mar 2025May 2025Jul 20251.0G2.0G3.0G4.0G5.0G6.0GNumber of Tokens Over Time in Danish DynawordDateNumber of Tokens (Llama 3)Common Corpus (dan) (Langlais et al., 2025)Danish Gigaword (Derczynski et al., 2021) \ No newline at end of file +Jan 2025Mar 2025May 2025Jul 20251.0G2.0G3.0G4.0G5.0G6.0GNumber of Tokens Over Time in Danish DynawordDateNumber of Tokens (Llama 3)Common Corpus (dan) (Langlais et al., 2025)Danish Gigaword (Derczynski et al., 2021) \ No newline at end of file diff --git a/src/dynaword/datasheet.py b/src/dynaword/datasheet.py index 851910adfb949ac691615225c3b70f7658f9591f..c5217d63cd7f3a0ab971bf7880f367cfaaba4492 100644 --- a/src/dynaword/datasheet.py +++ b/src/dynaword/datasheet.py @@ -7,7 +7,7 @@ from textwrap import dedent from typing import Any, Literal, Self, cast import yaml -from datasets import Dataset, load_dataset +from datasets import Dataset, IterableDataset, load_dataset from pydantic import BaseModel, field_validator from dynaword.descriptive_stats import DescriptiveStatsOverview @@ -52,7 +52,7 @@ An entry in the dataset consists of the following fields: """ -def human_readable_large_int(value: int) -> str: +def convert_to_human_readable(value: float) -> str: thresholds = [ (1_000_000_000, "B"), (1_000_000, "M"), @@ -65,8 +65,7 @@ def human_readable_large_int(value: int) -> str: return str(value) -def create_sample_str(dataset: Dataset, max_str_len: int = 100): - sample = dataset[0] +def create_sample_str(sample: dict[str, Any], max_str_len: int = 100): for k in sample: if isinstance(sample[k], str) and len(sample[k]) > max_str_len: sample[k] = sample[k][:max_str_len] + "[...]" @@ -192,24 +191,11 @@ class DataSheet(BaseModel): else: d_stats = descriptive_stats - if len(self.language) != 1 and self.language[0] != "da": - raise NotImplementedError( - "This script only handles the language codes 'da'" - ) - languages = "dan, dansk, Danish" - - package = dedent(f""" - - **Language**: {languages}\n""") - - if self.domains: - domains = ", ".join(self.domains) - package += f"- **Domains**: {domains}\n" - - package += ( + package = ( dedent(f""" - - **Number of samples**: {human_readable_large_int(d_stats.number_of_samples)} - - **Number of tokens (Llama 3)**: {human_readable_large_int(d_stats.number_of_tokens)} - - **Average document length (characters)**: {d_stats.average_document_length:.2f} + - **Number of samples**: {convert_to_human_readable(d_stats.number_of_samples)} + - **Number of tokens (Llama 3)**: {convert_to_human_readable(d_stats.number_of_tokens)} + - **Average document length (min, max)**: {convert_to_human_readable(d_stats.average_document_length_tokens)} [{convert_to_human_readable(d_stats.min_length_tokens)}, {convert_to_human_readable(d_stats.max_length_tokens)}] """).strip() + "\n" ) @@ -228,9 +214,15 @@ class DataSheet(BaseModel): package=DATASET_PLOTS_template, tag=DEFAULT_SECTION_TAGS.dataset_plots ) - def add_sample_and_description(self, dataset: Dataset) -> str: + def add_sample_and_description( + self, dataset: Dataset | IterableDataset | None = None + ) -> str: + if dataset is None: + dataset = self.get_dataset(streaming=True) + + sample = dataset[0] if isinstance(dataset, Dataset) else next(iter(dataset)) return self.replace_tag( - package=create_sample_str(dataset), tag=DEFAULT_SECTION_TAGS.sample + package=create_sample_str(sample), tag=DEFAULT_SECTION_TAGS.sample ) def replace_tag(self, package: str, tag: str | DEFAULT_SECTION_TAGS) -> str: diff --git a/src/dynaword/descriptive_stats.py b/src/dynaword/descriptive_stats.py index e7b46e419dd3e36dff81060e3ae0b34637215999..c71432a06c498f70b13633dfc68065eed8ac4ec5 100644 --- a/src/dynaword/descriptive_stats.py +++ b/src/dynaword/descriptive_stats.py @@ -1,8 +1,9 @@ +from __future__ import annotations + import json import logging from dataclasses import dataclass from pathlib import Path -from typing import Self from datasets import Dataset @@ -18,25 +19,77 @@ def calculate_average_document_length( @dataclass() class DescriptiveStatsOverview: + """ + Overview of descriptive statistics for a dataset. + + Attributes: + number_of_samples: Total number of samples in the dataset. + number_of_tokens: Total number of tokens in the dataset + min_length: Minimum document length in tokens. + max_length: Maximum document length in tokens. + average_document_length: Average document length in tokens. + """ + number_of_samples: int - average_document_length: float number_of_tokens: int + min_length_tokens: int + max_length_tokens: int + number_of_characters: int + min_length_characters: int + max_length_characters: int + + @property + def average_document_length_tokens(self) -> float: + return ( + self.number_of_tokens / self.number_of_samples + if self.number_of_samples > 0 + else 0.0 + ) + + @property + def average_document_length_characters(self) -> float: + return ( + self.number_of_characters / self.number_of_samples + if self.number_of_samples > 0 + else 0.0 + ) @classmethod - def from_disk(cls, path: Path): + def from_disk(cls, path: Path) -> DescriptiveStatsOverview: with path.open("r") as f: data = json.load(f) obj = cls(**data) return obj - def to_disk(self, path: Path): + def to_disk(self, path: Path) -> None: with path.with_suffix(".json").open("w") as f: json.dump(self.__dict__, f, indent=2) @classmethod - def from_dataset(cls, dataset: Dataset) -> Self: + def from_dataset(cls, dataset: Dataset) -> DescriptiveStatsOverview: return cls( number_of_samples=len(dataset), - average_document_length=calculate_average_document_length(dataset), number_of_tokens=sum(dataset["token_count"]), + min_length_tokens=min(dataset["token_count"]), + max_length_tokens=max(dataset["token_count"]), + number_of_characters=sum(len(t) for t in dataset["text"]), + min_length_characters=min(len(t) for t in dataset["text"]), + max_length_characters=max(len(t) for t in dataset["text"]), + ) + + def __add__(self, other: DescriptiveStatsOverview) -> DescriptiveStatsOverview: + if not isinstance(other, DescriptiveStatsOverview): + raise TypeError("Can only add DescriptiveStatsOverview objects") + return DescriptiveStatsOverview( + number_of_samples=self.number_of_samples + other.number_of_samples, + number_of_tokens=self.number_of_tokens + other.number_of_tokens, + min_length_tokens=min(self.min_length_tokens, other.min_length_tokens), + max_length_tokens=max(self.max_length_tokens, other.max_length_tokens), + number_of_characters=self.number_of_characters + other.number_of_characters, + min_length_characters=min( + self.min_length_characters, other.min_length_characters + ), + max_length_characters=max( + self.max_length_characters, other.max_length_characters + ), ) diff --git a/src/dynaword/tables.py b/src/dynaword/tables.py index 2cd230add08d42fc6a0d2a5531507a8a524b8153..d5d6b5e8a6a0416253040f28616a6effe6a108d1 100644 --- a/src/dynaword/tables.py +++ b/src/dynaword/tables.py @@ -3,7 +3,7 @@ from typing import Literal import pandas as pd -from dynaword.datasheet import DataSheet, human_readable_large_int +from dynaword.datasheet import DataSheet, convert_to_human_readable from dynaword.paths import repo_path main_sheet = DataSheet.load_from_path(repo_path / "README.md") @@ -104,7 +104,7 @@ def create_overview_table( df = df.drop(columns=["Sources"]) if add_readable_tokens: - df["N. Tokens"] = df["N. Tokens"].apply(human_readable_large_int) + df["N. Tokens"] = df["N. Tokens"].apply(convert_to_human_readable) return df @@ -188,7 +188,7 @@ def create_grouped_table( df = df.reindex(new_index) if add_readable_tokens: - df["N. Tokens"] = df["N. Tokens"].apply(human_readable_large_int) + df["N. Tokens"] = df["N. Tokens"].apply(convert_to_human_readable) return df diff --git a/src/dynaword/update_descriptive_statistics.py b/src/dynaword/update_descriptive_statistics.py index 5e9e0deeb33745a3360659aa995a57f29ed9742b..a00729e87bc131b22661e2dc602118e6d69876eb 100644 --- a/src/dynaword/update_descriptive_statistics.py +++ b/src/dynaword/update_descriptive_statistics.py @@ -82,23 +82,24 @@ def update_dataset( ) return - logger.info(f"Computing descriptive stats for: {dataset_name}") - ds = load_dataset(str(repo_path), dataset_name, split="train") - ds = cast(Dataset, ds) + logger.info(f"Updating datasheet for: {dataset_name}") + sheet = DataSheet.load_from_path(markdown_path) if dataset_name != "default": + ds = load_dataset(str(repo_path), dataset_name, split="train") + ds = cast(Dataset, ds) desc_stats = DescriptiveStatsOverview.from_dataset(ds) - desc_stats.to_disk(desc_stats_path) + sheet.body = sheet.add_dataset_plots(ds, create_plot=True) else: # compute descriptive stats from existing files desc_paths = (repo_path / "data").glob("**/*descriptive_stats.json") - desc_stats = sum(DescriptiveStatsOverview.from_disk(p) for p in desc_paths) # type: ignore + _desc_stats = [DescriptiveStatsOverview.from_disk(p) for p in desc_paths] + desc_stats = sum(_desc_stats[1:], start=_desc_stats[0]) + desc_stats.to_disk(desc_stats_path) - logger.info(f"Updating datasheet for: {dataset_name}") - sheet = DataSheet.load_from_path(markdown_path) sheet.body = sheet.add_descriptive_stats(descriptive_stats=desc_stats) - sheet.body = sheet.add_sample_and_description(ds) - sheet.body = sheet.add_dataset_plots(ds, create_plot=True) + sheet.body = sheet.add_sample_and_description() + if dataset_name == "default": logger.info("Updating Overview table")