<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Snippets of Folk Legends: Adapting a Text Mining Tool to a Collection of Folk Legends?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Maria Skeppstedt</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Rickard Domeij</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fredrik Skott</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>The Institute for Language and Folklore</institution>
          ,
          <country country="SE">Sweden</country>
        </aff>
      </contrib-group>
      <fpage>242</fpage>
      <lpage>247</lpage>
      <abstract>
        <p>A topic modelling tool was adapted to requirements for a collection of Swedish folk legends. To offer an overview of a list of folk legend texts, which had been automatically extracted by the topic modelling tool, snippet text versions of the folk legends were displayed. The snippets were constructed from the full-text versions of the legends using the sentences most relevant to the topics extracted by the topic modelling algorithm. In addition, collection-adapted data was constructed for performing a pre-processing of the folk legend texts, before they were submitted to the topic modelling algorithm. This data consisted of a collection-adapted stop word list and word lists for improving the quality of clusters of semantically similar words.</p>
      </abstract>
      <kwd-group>
        <kwd>Folk Legends</kwd>
        <kwd>Topic Modelling</kwd>
        <kwd>Text Analysis</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Topic modelling has been shown to be a useful text mining technique for automatically
identifying recurring information in large text collections. The technique has been
applied on text collections belonging to a wide range of genres, e.g. news paper text [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ],
open-ended survey questions [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], Internet discussion forums [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], micro blogs [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ],
student essays [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and folk legends [
        <xref ref-type="bibr" rid="ref11 ref6">6, 11</xref>
        ].
      </p>
      <p>
        The topic modelling algorithm automatically analyses a text collection in search for
topics that often recur in the text. There are a number of topic modelling visualisation
tools, for instance, visualisations that focus on relations between the automatically
detected topics and the terms that represent these topics [
        <xref ref-type="bibr" rid="ref1 ref4">1, 4</xref>
        ]. We here instead use, and
develop, a tool that builds on previous research which shows the potential in performing
a manual analysis of the texts in which the topics detected are present. This tool, called
Topics2Themes1 [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], therefore also visualises the extracted texts and their associations
and provides support for performing a manual analysis of these texts. The tool also
provides a pre-processing step using a word2vec model [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], in which several words can
be organised into groups based on semantic similarity, and treated as one concept. This
is achieved through an automatic clustering of the word2vec vectors that represent the
words included in the text collection.
? Supported by the Swedish Research Council (project number 2017-00626).
1 The code for the tool is available at: https://github.com/mariask2/topics2themes.
      </p>
      <p>Copyright © 2021 for this paper by its authors. Use permitted under
Creative Commons License Attribution 4.0 International (CC BY 4.0).</p>
      <p>
        Topics2Themes has previously been applied to posts in discussion forum threads
[
        <xref ref-type="bibr" rid="ref13">13</xref>
        ], to micro blogs [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], and to research article paragraphs [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. We recently applied
the tool to a text collection consisting of around 10,000 Swedish folk legends [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. The
tool had previously been applied on English and Japanese texts, and to apply it on a
Swedish text collection we needed to configure it to use a Swedish stop word list and
a Swedish word2vec model. Apart from using standard Swedish stop words, we also
added words typical to the text collection to the stop word list, e.g. words that use older
spelling variants, and old grammatical forms.
      </p>
      <p>Texts extracted by the topic modelling algorithm as most closely associated with
the topics detected are displayed by Topics2Themes in a scrollable list. By scrolling
through this text list, the user is meant to be given an overview of the content extracted.
However, despite most of the folk legend texts being relatively short, many of them are
longer than the very short types of texts for which the tool was originally developed.
This has the effect that the overview, meant to be provided by the scrollable list, is lost.
To achieve the same overview in those cases, we therefore added the functionality to
– instead of displaying the full texts in the scrollable list – display a short snippet of
the text. In addition to this technical adaption of the tool, we also (i) further adapted
the stop word list to the folk legends collection by adding additional collection-specific
words, and (ii) performed a manual correction of the automatically constructed concept
clusters.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Topics2Themes Applied on the Folk Legend Collection</title>
      <p>Topics2Themes was applied on a text collection containing around 10,000 records of
folklore from the archive at the Institute for Language and Folklore in Gothenburg. The
material mainly consists of folk legends, i.e. typically narratives about our perceptions
of the world around us, about events in the past, and about everyday life manifestations
of that, which we perceive as supernatural. The legends are usually relatively short
and monoepisodic, have a fixed structure, and have been transmitted verbally from one
generation to another.</p>
      <p>Most of the records have been collected during the Interwar Period, through
interviews with older people in the countryside in western Sweden. The records either
contain (manual or HTR-based) transcriptions of handwritten text, or text obtained from
printed material using OCR. Most of the material is written in Standard Swedish,
although occasional dialectal expressions, as well as words written with older spelling
variants, occur in the texts.</p>
      <p>
        The Topics2Themes tool uses the topic modelling algorithm Non-negative matrix
factorisation [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], and then represents each topic detected by the algorithm through, (i) a
list of texts in which the topic is present, and (ii) a list of terms that frequently occur in
these texts. We re-ran the topic modelling algorithm 50 times on our collection of folk
legends, and only topics stable enough to be included in all re-runs were retained. This
resulted in that 19, out of 25 requested, topics were retrieved by the tool.
      </p>
      <p>Figure 1 shows the graphical user interface of Topics2Themes, when applied on
the folk legend collection. The tool displays information in four different panels. The
Topics panel, i.e. the second panel from the left, lists the topics that have been
automatically extracted by the topic modelling algorithm. A topic element in the Topics panel is
represented by a list element that contains the three terms most closely associated with
the topic, e.g. “kyrka – bygga – stannade” (“church – build – stayed”). The Terms and
Texts panels list the terms and texts, respectively, that are associated with the extracted
topics. We configured the tool to retrieve 10 terms and 40 texts for each topic. That is,
for each topic detected, the Terms panel displays 10 terms, and the Texts panel displays
40 texts. Term-topic and topic-text associations are visualised by lines that connect the
list elements. Finally, to the Themes panel (only shown partly in the figure), the user can
add recurring themes that are identified when the extracted texts are manually analysed.
That is, while the first three panels stem from an automatic process, the content of the
Themes panel is to be manually added by a user.</p>
      <p>The stop word list that was used for pre-processing the texts in the folk legends
collection has been iteratively expanded. This process consists of first using Topics2Themes
to construct a topic model, and thereafter of using the Terms panel to examine terms
extracted (as well as the Texts panel to examine their textual contexts), in order to
determine which terms are suitable as stop words. The process is then started over, using
a list expanded with the newly detected stop words when constructing the new model.
This iterative process has so far resulted in a stop word list consisting of 542 words.</p>
      <p>For creating clusters of semantically similar words, we used a pre-trained word2vec
continuous skipgram model2 and the automatic clustering functionality of the
Topics2Themes tool. We then used the functionality provided by the tool for manually
correcting the automatically constructed clusters. This is carried out by providing the
tool with two types of word lists, (i) a list of words that are to be removed from the
automatic clusters (since the automatic process assigns them to a semantic cluster to
which they do not belong), and (ii) a list of manually constructed word clusters. Our
manually constructed clusters were often automatic clusters that we expanded with
additional, semantically similar words, or automatic clusters that we divided into smaller,
more semantically coherent groups of words. The construction of the word lists for
improving the clustering is also an iterative process. We have so far detected 571 words
to exclude from the automatic clustering, and constructed 118 manual clusters based
on the automatic ones. A total of 369 concept clusters were used when pre-processing
the texts before sending them to the topic modelling algorithm. Examples of concept
clusters are shown in the Terms panel. For instance, the first element consists of
different inflections of “church”, and the tenth element consists of a large cluster of words
referring to body parts. The advantage of using semantic clustering instead of methods
based on morphology – e.g. lemmatisation – is that semantically similar words can be
conflated into one concept, regardless of their lexical instantiations.3
2 The model has been trained on the Swedish CoNLL17 corpus – which contains 3,010,472
tokens – by the Language Technology Group at the University of Oslo.</p>
      <p>The model is available at: http://vectors.nlpl.eu/repository/.
3 The topic model configuration, as well as the manually constructed word list and clusters is
available at: https://github.com/mariask2/swedish-folk-legends.
Fig. 1. Topics2Themes applied on a collection of Swedish folk legends. The topic “kyrka – bygga
– stannade” (“church – build – stayed”) is displayed with a blue background in the center panel,
which indicates that it has been selected by the user. The snippet versions of the texts most closely
associated with the selected topic are shown to the right, while associated terms are indicated with
a bold border to the left.</p>
    </sec>
    <sec id="sec-3">
      <title>Producing the Snippet Text for the Extracted Sentences</title>
      <p>The snippet text is produced by only retaining those sentences that contain terms that
the topic modelling algorithm has extracted as typical to the topics. A sentence – or a
sequence of sentences – that does not contain any of these terms is replaced by ellipsis,
as shown in Figure 1. The Topics2Themes configuration file lets the user specify the
maximum number of sentences to be included in the snippet text. This has the effect
that only the first sentences in the original text that contain a term will be added to the
text snippet, until the snippet has reached the maximum length specified. However, it is
also made sure that the snippet text includes at least one context sentence for each one
of the terms occurring in a text. Therefore, when more terms occur in the text than the
maximum snippet length specified, the length of the snippet will instead be determined
by the number of unique topic model-extracted terms occurring in the text.</p>
      <p>The interface of Topics2Themes shows the snippet version of the text by default in
the Texts panel. There are two methods by which the user can make the tool display
the full-text version, (i) either by double-clicking on one specific list element to make
the tool show the full-text version for this specific text, or (ii) by clicking on the arrow
button in the header of the Texts panel to make the tool show the full-text versions for
all texts.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Future Work</title>
      <p>We have now carried out the technical developments required for adapting the
Topics2Themes tool to our collection of folk legends. We have also provided the tool with
collection-adapted data in the form of an adapted stop word list and word lists for
improving the word2vec-based word clusters. As the next step, we will therefore use
Topics2Themes for carrying out a computer-assisted analysis of the folk legend collection.
That is, we will use the tool for identifying recurring themes in Swedish folk legends,
i.e. themes that might (i) reflect already established classification systems, as well as
(ii) provide new dimensions on how legends can be categorised in folkloristics.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Alexander</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kohlmann</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Valenza</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Witmore</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gleicher</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          : Serendip:
          <article-title>Topic model-driven visual exploration of text corpora</article-title>
          .
          <source>In: 2014 IEEE Conference on Visual Analytics Science and Technology (VAST)</source>
          . pp.
          <fpage>173</fpage>
          -
          <lpage>182</lpage>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Baumer</surname>
            ,
            <given-names>E.P.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mimno</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Guha</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Quan</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gay</surname>
            ,
            <given-names>G.K.</given-names>
          </string-name>
          :
          <article-title>Comparing grounded theory and topic modeling: Extreme divergence or unlikely convergence</article-title>
          ?
          <source>Journal of the Association for Information Science and Technology</source>
          <volume>68</volume>
          (
          <issue>6</issue>
          ),
          <fpage>1397</fpage>
          -
          <lpage>1410</lpage>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Blei</surname>
            ,
            <given-names>D.M.:</given-names>
          </string-name>
          <article-title>Topic modeling and digital humanities</article-title>
          .
          <source>Journal of Digital Humanities</source>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Chuang</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Manning</surname>
            ,
            <given-names>C.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heer</surname>
          </string-name>
          , J.: Termite:
          <article-title>Visualization techniques for assessing textual topic models</article-title>
          .
          <source>In: Proceedings of the International Working Conference on Advanced Visual Interfaces</source>
          . pp.
          <fpage>74</fpage>
          -
          <lpage>77</lpage>
          . ACM, New York, NY, USA (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Ferrara</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Montanelli</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Petasis</surname>
          </string-name>
          , G.:
          <article-title>Unsupervised detection of argumentative units though topic modeling techniques</article-title>
          .
          <source>In: Proceedings of the 4th Workshop on Argument Mining</source>
          . pp.
          <fpage>97</fpage>
          -
          <lpage>107</lpage>
          . Association for Computational Linguistics, Copenhagen, Denmark (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Karsdorp</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>den Bosch</surname>
          </string-name>
          , A.V.:
          <article-title>Identifying motifs in folktales using topic models</article-title>
          .
          <source>In: Proceedings of the 22 Annual Belgian-Dutch Conference on Machine Learning</source>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>D.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Seung</surname>
            ,
            <given-names>H.S.</given-names>
          </string-name>
          :
          <article-title>Algorithms for non-negative matrix factorization</article-title>
          .
          <source>In: Advances in neural information processing systems</source>
          . pp.
          <fpage>556</fpage>
          -
          <lpage>562</lpage>
          (
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Mikolov</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corrado</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dean</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          :
          <article-title>Efficient estimation of word representations in vector space (</article-title>
          <year>2013</year>
          ), http://arxiv.org/abs/1301.3781, cite arxiv:
          <volume>1301</volume>
          .
          <fpage>3781</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Skeppstedt</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ahltorp</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eriksson</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Domeij</surname>
          </string-name>
          , R.:
          <article-title>Annotating risk factor mentions in the COVID-</article-title>
          19 Open Research Dataset. In: CLARIN2020 Book of Abstracts (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Skeppstedt</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ahltorp</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kucher</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kerren</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rzepka</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Araki</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Topic modelling applied to a second language: A language adaptation and tool evaluation study</article-title>
          .
          <source>In: Selected Papers from the CLARIN Annual Conference</source>
          <year>2019</year>
          . vol.
          <volume>172</volume>
          :
          <issue>17</issue>
          , pp.
          <fpage>145</fpage>
          -
          <lpage>156</lpage>
          . Linko¨ ping Electronic Conference Proceedings (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Skeppstedt</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Domeij</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Skott</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Adapting a topic modelling tool to the task of finding recurring themes in folk legends</article-title>
          .
          <source>In: Proceedings of the Digital Humanities in the Nordic Countries</source>
          . pp.
          <fpage>388</fpage>
          -
          <lpage>392</lpage>
          . CEUR Workshop Proceedings (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Skeppstedt</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kerren</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stede</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Vaccine hesitancy in discussion forums: Computerassisted argument mining with topic models</article-title>
          . In:
          <article-title>Building Continents of Knowledge in Oceans of Data: The Future of Co-Created eHealth</article-title>
          . pp.
          <fpage>366</fpage>
          -
          <lpage>370</lpage>
          . No.
          <article-title>247 in Studies in Health Technology and Informatics</article-title>
          , IOS Press (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Skeppstedt</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kucher</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stede</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kerren</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Topics2Themes: Computer-Assisted Argument Extraction by Visual Analysis of Important Topics</article-title>
          .
          <source>In: Proceedings of the LREC Workshop on Visualization as Added Value in the Development</source>
          ,
          <article-title>Use and Evaluation of Language Resources</article-title>
          . pp.
          <fpage>9</fpage>
          -
          <lpage>16</lpage>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Surian</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nguyen</surname>
            ,
            <given-names>D.Q.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kennedy</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          , Johnson,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Coiera</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Dunn</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.G.</surname>
          </string-name>
          :
          <article-title>Characterizing Twitter discussions about HPV vaccines using topic modeling and community detection</article-title>
          .
          <source>J Med Internet Res</source>
          <volume>18</volume>
          (
          <issue>8</issue>
          ),
          <year>e232</year>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>