There is a newer version of this record available.

Dataset Open Access

Models for "A data-driven approach to the changing vocabulary of the 'nation' in English, Dutch, Swedish and Finnish newspapers, 1750-1950"

Hengchen, Simon; Ros, Ruben; Marjanen, Jani

DataCite XML Export

<?xml version='1.0' encoding='utf-8'?>
<resource xmlns:xsi="" xmlns="" xsi:schemaLocation="">
  <identifier identifierType="DOI">10.5281/zenodo.3270648</identifier>
      <creatorName>Hengchen, Simon</creatorName>
      <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="">0000-0002-8453-7221</nameIdentifier>
      <affiliation>University of Helsinki</affiliation>
      <creatorName>Ros, Ruben</creatorName>
      <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="">0000-0002-5303-2861</nameIdentifier>
      <affiliation>Utrecht University</affiliation>
      <creatorName>Marjanen, Jani</creatorName>
      <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="">0000-0002-3085-4862</nameIdentifier>
      <affiliation>University of Helsinki</affiliation>
    <title>Models for "A data-driven approach to the changing vocabulary of the 'nation' in English, Dutch, Swedish and Finnish newspapers, 1750-1950"</title>
    <subject>word embeddings</subject>
    <date dateType="Issued">2019-07-06</date>
  <resourceType resourceTypeGeneral="Dataset"/>
    <alternateIdentifier alternateIdentifierType="url"></alternateIdentifier>
    <relatedIdentifier relatedIdentifierType="DOI" relationType="IsVersionOf">10.5281/zenodo.3270647</relatedIdentifier>
    <relatedIdentifier relatedIdentifierType="URL" relationType="IsPartOf"></relatedIdentifier>
    <rights rightsURI="">Creative Commons Attribution 4.0 International</rights>
    <rights rightsURI="info:eu-repo/semantics/openAccess">Open Access</rights>
    <description descriptionType="Abstract">&lt;p&gt;NOTE: This is a badly rendered version of the README within the archive.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A data-driven approach to the changing vocabulary of the &amp;lsquo;nation&amp;rsquo; in English, Dutch, Swedish and Finnish newspapers, 1750-1950&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Simon Hengchen*, Ruben Ros**, Jani Marjanen*&lt;/p&gt;

&lt;p&gt;*University of Helsinki:&amp;nbsp;&lt;a href=""&gt;;/a&gt;; ** Utrecht University:&amp;nbsp;&lt;a href=""&gt;;/a&gt;&lt;/p&gt;

&lt;p&gt;These are the supplementary materials for the DH2019 paper&amp;nbsp;&lt;em&gt;A data-driven approach to the changing vocabulary of the &amp;lsquo;nation&amp;rsquo; in English, Dutch, Swedish and Finnish newspapers, 1750-1950&lt;/em&gt;. If you end up using whole or parts of this resource, please use the following citation:&lt;/p&gt;

	&lt;li&gt;Hengchen, S., Ros, R., and Marjanen, J. (2019). A data-driven approach to the changing vocabulary of the &amp;lsquo;nation&amp;rsquo; in English, Dutch, Swedish and Finnish newspapers, 1750-1950. In&amp;nbsp;&lt;em&gt;Proceedings of the Digital Humanities (DH) conference 2019, Utrecht, The Netherlands&lt;/em&gt;,&lt;br&gt;
	or alternatively use the following&amp;nbsp;&lt;code&gt;bib&lt;/code&gt;:&lt;/li&gt;

 title="A data-driven approach to the changing vocabulary of the 'nation' in {E}nglish, {D}utch, {S}wedish and {F}innish newspapers, 1750-1950.",
 author={Hengchen, Simon, and Ros, Ruben, and Marjanen, Jani},
 booktitle={Proceedings of the Digital Humanities (DH) conference 2019, Utrecht, The Netherlands}


&lt;p&gt;This archive contains three folders &amp;ndash; one per language &amp;ndash; as well as this README. The folders contain the models for their respective languages. This work is licensed under a&amp;nbsp;&lt;a href=""&gt;Creative Commons Attribution-ShareAlike 4.0 International License&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source material&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;The models were created with data from the Finnish Sub-corpus of the Newspaper and Periodical Corpus of the National Library of Finland (National Library of Finland, 2011). We used everything in the corpus.&lt;/p&gt;


&lt;p&gt;The models were created with data from the Kubhist corpus (Spr&amp;aring;kbanken) &amp;ndash; more precisely, the data dumps available at&amp;nbsp;&lt;a href=""&gt;;/a&gt;. We used everything in the corpus.&lt;/p&gt;


&lt;p&gt;The models were created with data from the Delpher newspaper archive (Royal Dutch Library, 2017), through data dumps for newspapers until and including 1876, and through API hits for articles from 1877 to 1899 (included).&lt;/p&gt;

	&lt;li&gt;For anything pre-1877 we discarded full texts that had, in the metadata, anything else than exclusively&amp;nbsp;&lt;code&gt;nl&lt;/code&gt;&amp;nbsp;or&amp;nbsp;&lt;code&gt;NL&lt;/code&gt;&amp;nbsp;as a language tag.&lt;/li&gt;
	&lt;li&gt;For the full texts between 1877 and 1899: we queried the API for all items in the &amp;ldquo;artikel&amp;rdquo; category that contained the determiner&amp;nbsp;&lt;code&gt;de&lt;/code&gt;.&lt;/li&gt;

&lt;p&gt;Our assumption was that most articles should contain&amp;nbsp;&lt;code&gt;de&lt;/code&gt;&amp;nbsp;at least once, and those that didn&amp;rsquo;t were too short to be deemed interesting. A subsequent study showed that was not exactly the case, but we were reassured by the fact that left-out articles were probably &amp;ldquo;shipping or financial reports&amp;rdquo; (thanks go to Melvin Wevers).&lt;br&gt;
We also did not include the colonial newspapers for our embeddings. This is motivated by two reasons, important in the context of our research question: first, only the Dutch dataset has an extensive coverage of colonial newspapers &amp;ndash; including them would have weakened our comparisons with the other countries in our studies. Second, Dutch colonial newspapers &amp;ldquo;showed a great uniformity&amp;rdquo; because &amp;ldquo;their news supply was unique and controlled by the official news agency, ANETA&amp;rdquo;. (Our translation and paraphrasing of Witte 1998:18). A list of removed newspapers is available on request.&lt;/p&gt;


&lt;p&gt;The embeddings are not available at this moment. Do get in touch with Simon if you want to receive an email when they become available.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Word embeddings&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For every language, we train diachronic embeddings as follows. We divide the data in 20-year time bins. We first train a model for the first time bin&amp;nbsp;&lt;code&gt;t&lt;/code&gt;. To train the model for&amp;nbsp;&lt;code&gt;t+1&lt;/code&gt;, we use the&amp;nbsp;&lt;code&gt;t&lt;/code&gt;&amp;nbsp;model to initialise the vectors for&amp;nbsp;&lt;code&gt;t+1&lt;/code&gt;, set the learning rate to correspond to the end learning rate of&amp;nbsp;&lt;code&gt;t&lt;/code&gt;, and continue training. This approach, closely following Kim et al (2014), has the advantage of avoiding the need for post-training vector space alignment.&lt;br&gt;
Parameters are as follows: CBOW architecture (Mikolov et al 2013), window size of 5, frequency threshold of 100, 5 epochs.&amp;nbsp;&lt;strong&gt;No tokens (including punctuation) were removed nor altered, aside from lowercasing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Python snippet below, which makes use of gensim (Rehurek and Sojka, 2010), illustrates the approach. Special thanks go to Sara Budts.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;lang = "fi" ## change this
class MySentences(object): ## This class has been directly copied from gensim.
    def __init__(self, liste):
        self.liste = liste
    def __iter__(self):
        for file in self.liste:
             with open(file, "r") as fname: ## Our files are line-separated, with tab-separated, lowercased tokens
                for line in fname:
                    yield line.split("\t")
count = 0                    
for key in sorted(list(dict_files.keys())): # dict_files is a dict with time bins as keys, and lists of filepaths as values
    number_of_files = len(dict_files[key])
    print("Number of files for double decade starting in",str(key),"is",str(number_of_files))
    if os.path.exists(dir_out+"/model_"+lang+"_"+str(key)+".w2v") == False:
        print("model_"+lang+"_"+str(key)+" does not exist, running")
        if number_of_files &amp;gt; 0:
            if count == 0: ## This is the first model.
                count += 1
                sentences = MySentences(dict_files[key])
                model = gensim.models.Word2Vec(sentences, min_count=100, workers=14, seed=1830, epochs=5)
                print("Model saved, on to the next\n")
            if count &amp;gt; 0: ## this is for the subsequent models.
                print("model for double decade starting in",str(key))
                model = gensim.models.Word2Vec.load(dir_out+"/model_"+lang+"_"+str(key-20)+".w2v") ## If the script crashes, we make sure to have the latest model.
                sentences = MySentences(dict_files[key])
                model.build_vocab(sentences, update=True)
                model.train(sentences, total_examples = model.corpus_count, start_alpha = model.alpha, end_alpha = model.min_alpha, epochs = model.iter)
                print("Model saved, on to the next\n")



&lt;p&gt;Part of this work has been supported by the European Union&amp;rsquo;s Horizon 2020 research and innovation programme under grant 770299&amp;nbsp;&lt;a href=""&gt;NewsEye&lt;/a&gt;.&lt;br&gt;
The authors would like to thank the following persons and institutions, listed in random order:&lt;br&gt;
Steven Claeyssens, Mikko Tolonen, Nina Tahmasebi, Melvin Wevers, Eetu M&amp;auml;kel&amp;auml;, the COMHIS group, Lidia Pivovarova, Antti Kanner, Senka Drobac, Krister Lind&amp;eacute;n, Lars Borin, Dominik Schlechtweg, Sara Budts, Haim Dubossarsky, Estelle Bunout, Axel-Jean Caurant, Tanja S&amp;auml;ily, Elaine Zosa, and Joris van Eijnatten.&lt;/p&gt;


&lt;p&gt;Kim, Y., Chiu, Y.I., Hanaki, K., Hegde, D. and Petrov, S. (2014). Temporal Analysis of Language through Neural Language Models.&amp;nbsp;&lt;em&gt;ACL 2014&lt;/em&gt;, p.61.&lt;br&gt;
Mikolov, T., Chen, K., Corrado, G. and Dean, J. (2013). Efficient estimation of word representations in vector space.&amp;nbsp;&lt;em&gt;arXiv preprint arXiv:1301.3781&lt;/em&gt;.&lt;br&gt;
National Library of Finland (2011).&amp;nbsp;&lt;em&gt;The Finnish Sub-corpus of the Newspaper and Periodical Corpus of the National Library of Finland, Kielipankki Version&lt;/em&gt;&amp;nbsp;[text corpus]. Kielipankki. Retrieved from&amp;nbsp;&lt;a href=""&gt;;/a&gt;.&lt;br&gt;
Rehurek, R. and Sojka, P. (2010). Software framework for topic modelling with large corpora. In&amp;nbsp;&lt;em&gt;Proceedings of the LREC 2010 Workshop on New Challenges for NLP Frameworks&lt;/em&gt;.&lt;br&gt;
Royal Dutch Library (2017).&amp;nbsp;&lt;em&gt;Delpher open krantenarchief (1.0)&lt;/em&gt;. Den Haag, 2017.&lt;br&gt;
Spr&amp;aring;kbanken.&amp;nbsp;&lt;em&gt;The Kubhist Corpus&lt;/em&gt;. Department of Swedish, University of Gothenburg.&amp;nbsp;&lt;a href=""&gt;;/a&gt;.&lt;br&gt;
Witte, R. (1998).&amp;nbsp;&lt;em&gt;De Indische radio-omroep: overheidsbeleid en ontwikkeling, 1923-1942&lt;/em&gt;. Uitgeverij Verloren.&lt;/p&gt;</description>
      <funderName>European Commission</funderName>
      <funderIdentifier funderIdentifierType="Crossref Funder ID">10.13039/100010661</funderIdentifier>
      <awardNumber awardURI="info:eu-repo/grantAgreement/EC/H2020/770299/">770299</awardNumber>
      <awardTitle>NewsEye: A Digital Investigator for Historical Newspapers</awardTitle>
All versions This version
Views 3,3471,049
Downloads 91472
Data volume 14.7 TB229.7 GB
Unique views 2,892968
Unique downloads 86257


Cite as