Journal article Open Access

A collection of Swedish diachronic word embedding models trained on historical newspaper data

Hengchen, Simon; Tahmasebi, Nina

JSON-LD ( Export

  "inLanguage": {
    "alternateName": "swe", 
    "@type": "Language", 
    "name": "Swedish"
  "description": "<p><em><strong>A collection of Swedish diachronic word embedding models trained on historical newspaper data</strong></em></p>\n\n<p>Simon Hengchen, Nina Tahmasebi</p>\n\n<p><em>NOTE: this;is a summary. For all details, see the paper at&nbsp;<a href=\"\"></a></em></p>\n\n<p><em>NOTE: this data release is available on Zenodo at&nbsp;<a href=\"\"></a></em></p>\n\n<p><strong>Description</strong></p>\n\n<p>This is the data release accompanying the Journal of Open Humanities Data paper &quot;A collection of Swedish diachronic word embedding models trained on historical newspaper data.&quot; This paper describes the creation of several word embedding models based on a large collection of diachronic Swedish newspaper material available through Spr&aring;kbanken Text, the Swedish language bank. This data was produced in the context of Spr&aring;kbanken Text&#39;s continued mission to collaborate with humanities and natural language processing researchers and to provide freely available language resources, for the development of state-of-the-art NLP methods and tools.</p>\n\n<p><strong>Bibtex</strong></p>\n\n<p>If you use the models or the code provided in this paper, please cite the following:</p>\n\n<pre><code>@article{hengchen-tahmasebi-2021-collection, \ntitle = \"A collection of {S}wedish diachronic word embedding models trained on historical newspaper data\", \nauthor = \"Hengchen, Simon and Tahmasebi, Nina\", \njournal = \"Journal of Open Humanities Data\", \nyear = \"2021\",\npages = {1--7},\nvolume = {7},\nnumber = {2},\ndoi = {10.5334/johd.22}\n} </code></pre>\n\n<p><strong>Overview</strong></p>\n\n<p>We release diachronic word2vec and fastText models in their skip-gram with negative sampling (SGNS) architecture. The models are trained on 20-year time bins, with two temporal alignment strategies: independently-trained models for post-hoc alignment, and incremental training. The independently-trained models are NOT aligned, leaving the&nbsp;<a href=\"\">choice of alignment</a>&nbsp;to the end user. We provide code to reproduce our pipeline, and code examples to load and use the models.</p>\n\n<p><strong>Data</strong></p>\n\n<p>The entirety of the Kunglinga bibliotekets historiska tidningar (Kubhist 2) corpus was used. The original data was scanned and OCRed by the National Library of Sweden. It consists of Swedish newspapers from all parts of Sweden. It has since been run through the Sparv annotation pipeline by Martin Hammarstedt at Spr&aring;kbanken Text.</p>\n\n<p><strong>Preprocessing</strong></p>\n\n<p>The text was retrieved from the original XML. The processing steps prior to training the models are:</p>\n\n<ul>\n\t<li>lowercasing</li>\n\t<li>removal of digits</li>\n\t<li>removal of all characters not belonging to the Swedish alphabet (a-z&auml;&aring;&ouml;)</li>\n\t<li>removal of tokens the length of which is two characters or smaller</li>\n\t<li>merging of all texts pertaining to the same double decade (1740-1759; 1760-1779; ...)</li>\n</ul>\n\n<p><strong>Quality control</strong></p>\n\n<p>All models have been queried for some control analogies by a native speaker of Swedish. A (non-native speaker of Swedish) reviewer, whom we thank, also performed checks on the local neighbourhoods of selected terms, performed vector arithmetics, and confirmed the models behaved as expected.</p>\n\n<p><strong>Structure</strong></p>\n\n<pre><code>ROOT/ \n \n    code/ \n        *.py files \n        requirements.txt \n    fasttext/ \n        incremental/ \n            *.ft files \n            *.npy files \n        indep/ \n            *.ft files \n            *.npy files \n    word2vec/ \n        incremental/ \n            *.w2v files \n            *.npy files \n        indep/ \n            *.w2v files \n            *.npy files </code></pre>\n\n<p>Regarding the code:</p>\n\n<ul>\n\t<li><code></code>&nbsp;will transform the XML into &quot;LineSentence&quot;, &quot;clean&quot; corpora</li>\n\t<li><code></code>&nbsp;will train models</li>\n\t<li><code></code>&nbsp;will print some examples of what can be done with embeddings</li>\n\t<li><code></code>&nbsp;contains the functions called by the scripts above</li>\n\t<li><code>requirements.txt</code>&nbsp;contains the output of&nbsp;<code>pip freeze &gt; requirements.txt</code>, i.e. the python libraries needed to run the scripts above</li>\n</ul>\n\n<p><strong>Funding</strong></p>\n\n<p>This work has been funded in part by the project&nbsp;<a href=\"\"><em>Towards Computational Lexical Semantic Change Detection</em></a>&nbsp;supported by the Swedish Research Council (2019--2022; dnr 2018-01184), and&nbsp;<em>Nationella Spr&aring;kbanken</em>&nbsp;(the Swedish National Language Bank) -- jointly funded by the Swedish Research Council (2018--2024; dnr 2017-00626) and its 10 partner institutions, to NT.</p>", 
  "license": "", 
  "creator": [
      "affiliation": "University of Gothenburg", 
      "@id": "", 
      "@type": "Person", 
      "name": "Hengchen, Simon"
      "affiliation": "University of Gothenburg", 
      "@id": "", 
      "@type": "Person", 
      "name": "Tahmasebi, Nina"
  "headline": "A collection of Swedish diachronic word embedding models trained on historical newspaper data", 
  "image": "", 
  "datePublished": "2020-12-01", 
  "url": "", 
  "@context": "", 
  "identifier": "", 
  "@id": "", 
  "@type": "ScholarlyArticle", 
  "name": "A collection of Swedish diachronic word embedding models trained on historical newspaper data"
All versions This version
Views 7,9497,898
Downloads 3,3503,350
Data volume 54.4 TB54.4 TB
Unique views 7,7137,688
Unique downloads 3,3313,331


Cite as