<!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>Visualising Text Co-occurrence Networks</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Laurie Hirsch</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Sheffield Hallam University</institution>
        </aff>
      </contrib-group>
      <fpage>19</fpage>
      <lpage>27</lpage>
      <abstract>
        <p>We present a tool for automatically generating a visual summary of unstructured text data retrieved from documents, web sites or social media feeds. Unlike tools such as word clouds, we are able to visualise structures and topic relationships occurring in a document. These relationships are determined by a unique approach to co-occurrence analysis. The algorithm applies a decaying function to the distance between word pairs found in the original text such that words regularly occurring close to each other score highly, but even words occurring some distance apart will make a small contribution to the overall co-occurrence score. This is in contrast to other algorithms which simply count adjacent words or use a sliding window of fixed size. We show, with examples, how the network generated can be presented in tree or graph format. The tree format allows for the user to interact with the visualisation and expand or contract the data to a preferred level of detail. The tool is available as a web application and can be viewed using any modern web browser.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Visual representations have proved to be useful alternatives to linear text documents.
The mind mapping technique was introduced in the 1960s and is thought to encourage
learning. However, creating mind maps can be a complex and time-consuming
undertaking and the ability to automatically produce text visualisations has attracted
significant research in recent decades. A number of possible benefits have been attributed to
such tools including managing information overload, providing summaries and
‘impression formation’. Tools have been developed for identifying topics and topic
correlations, displaying knowledge and generating concept clouds [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ][
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Here we will
briefly outline a number of existing techniques and then show how we have developed
a method based on word co-occurrence which can be used for generating both graphs
and trees in various types of diagram. Here we include a number of example
visualisations, all of which are based on the text of a paper concerning conceptual
structures[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]1
      </p>
    </sec>
    <sec id="sec-2">
      <title>Word Clouds</title>
      <p>
        Although many systems are formed using user provided tags, there has been significant
interest in ‘word tags’ or ‘text tags’ which are automatically generated using the text
found in documents or web sites. The popular tool Wordle [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] has seen a steady increase
in usage and many variations have been made available. Word clouds are based on the
frequency of individual words found in the available text after stop word removal. The
most frequent words are selected and then presented using various techniques to adjust
font, colour, size and position, in a way that is pleasing and useful to the user. The
words are often sorted alphabetically, although various systems of arrangement have
been proposed and attempts have been made to place similar words together. Word
clouds are simple and are commonly presented on web sites with little or no explanation
of how they should be used or interpreted. A word cloud of the Sowa text can be seen
in Figure 12
A commonly cited issue with word clouds is that they can hinder understanding due to
the fact that they lack information about the relationships between words.
1.2
      </p>
    </sec>
    <sec id="sec-3">
      <title>Tree Clouds</title>
      <p>
        Trees have been presented as an easy to read and meaningful format and the term
'tree cloud' has been proposed [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. A freely available system which generates trees
based on the semantic distance between words derived from the original text is also
2 Created using the tool at https://www.jasondavies.com/wordcloud/
available and gives the user an indication of the relationship between the key terms in
the visualisation. The Sowa text produces the tree cloud shown in figure 23
The tree cloud includes colouring, font sizes and arcs to indicate relationships between
topics.
2
      </p>
      <sec id="sec-3-1">
        <title>Description of the System</title>
        <p>In this section we will describe how our system known as txt2vz
(http://txt2vz.appspot.com/) works and will compare visualisations produced with other
text visualisation tools.
2.1</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Pre-processing</title>
      <p>To reduce dimensionality of the document(s) all words are placed in lower case, stop
words are removed and stemming applied, such that only the most frequent form of a
word is preserved.
2.2</p>
    </sec>
    <sec id="sec-5">
      <title>Significance Measure.</title>
      <p>We define a measure of significance for a pair (P, Q) of words, based on the number of
occurrences of (P, Q), or more specifically the co-occurrences and the distance between
3 Using the tool at http://treecloud.univ-mlv.fr/cgi-bin/NuageArbore_EN.cgi#
P and Q where the distance between P and Q is defined to be the number of words
between P and Q:
(1)
where M is the number of co-occurrences of P and Q; is the distance between P and Q
in the ith co-occurrence; 0&lt;B&lt;1 B is between 0 and 1 and typically set to 0.9. We do
not consider the significance if the distance is beyond a pre-set maximum distance
which has a default of 20 words. The use of a decaying function here is in contrast to
commonly used ‘sliding window’ methods of computing co-occurrence where we
simply count the number of times that two words occur within a predefined distance.
2.3</p>
    </sec>
    <sec id="sec-6">
      <title>Network Generation Algorithm.</title>
      <p>
        The visualisations produced by txt2vz are intended for use in a web application and the
visualisation should be presented to the user in a reasonable time. Even after dimension
reduction there are likely to be a large number of unique words in a text and computing
the co-occurrence value for each possible pair can be time consuming. We therefore
sort the words according to frequency and select the top N words for the next stage
where N is typically set to 200. The significance of each pair of words from the
remaining set is computed and all the word pairs are sorted in descending order by their
accumulated co-occurrence values. An undirected graph can then be built by selecting
the top K word pairs and creating an edge between the two words of each pair. The
graph is built using the d3.js software library [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]
2.4
      </p>
    </sec>
    <sec id="sec-7">
      <title>Txt2vz network</title>
      <p>
        The simplest format for txt2vz has been described previously [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and the visualization
for the Sowa text is shown in Figure 3.
The visualisation is made up of a number of undirected graphs. Links between words
are shown and the most highly linked words should move toward the centre of the
graph.
      </p>
      <p>The three diagrams shown above include many common words but have a number of
important differences. For example, the fact that ‘conceptual’ and ‘graphs’ are related
is not clear from the word cloud in Figure 1. We have argued that links between words
in the txt2vz graph are made clearer via the arcs in the graph when compared to the tree
cloud in figure 2. The graph shown above is actually animated on the web page using
d3’s force directed layout.
2.5</p>
    </sec>
    <sec id="sec-8">
      <title>Txt2vz Tree</title>
      <p>We have been experimenting with new visualisations based on the same co-occurrence
data but in tree format. A graph such as the one shown in figure 3 may contain many
possible trees. In our system the list of word pairs used to generate the visualisation is
already in order of the co-occurrence value for the pair. A relatively simple way of
creating a tree is to identify the root as the most frequently occurring word of the first
pair. Iterating through the list we build up the tree, pair by pair, but only create new
nodes if a tree structure is preserved. If this is not the case the pair is discarded. We
argue that there are certain advantages of txt2vz trees over those produce by tree cloud
(Figure 2). Firstly, the visualization makes clear the links between two nodes, and
secondly where the tree branches the arcs emanate from a labeled node making the
relationship obvious.</p>
    </sec>
    <sec id="sec-9">
      <title>Force directed collapsible tree.</title>
      <p>Another advantage of the tree format is that it is relatively easy to make the
visualisation collapsible so that the user can interact and expand or collapse non-leaf nodes as
required to obtain a useful level of detail. A fully expanded version of the visualized
Sowa text is shown in figure 4 but if the user clicks on an internal node the tree will
collapse into the node until the user clicks again.</p>
    </sec>
    <sec id="sec-10">
      <title>Radial Reingold–Tilford Tree.</title>
      <p>
        A possible disadvantage of the force directed tree shown in Figure 4 is that the text
for the nodes can overlap, particularly for lager trees. Although the user can interact
with the diagram and pull the nodes apart, it is not always an ideal way to get a quick
overall impression of the structure. An alternate radial tree format based on the
Reingold–Tilford algorithm [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] is also available, and an example of the Sowa text is
shown in figure 5 and 6. In this case the nodes and labels are spaced in rather a beautiful
way.
      </p>
      <sec id="sec-10-1">
        <title>Discussion and further work</title>
        <p>Txt2vz is work in progress. Apart from the basic graph types there are many
parameters that affect the appearance of the final visualisation. We have therefore added a
control panel to the web application so that the user can experiment and view different
perspectives on the same piece of text. For example, reducing the number of word pairs
to be analyzed will produce the smaller graph shown in figure 5, which some users may
prefer. We would not want to argue that one particular graph type or cloud is the ‘best’
but we do suggest that it may be useful for the user to be able to be able to switch
between different types of visualization.</p>
        <p>We would like to spend more time evaluating the usefulness of the tool as perceived
by human subjects. We also hope to investigate the feasibility of using Txt2vz as part
of a web search engine such that a user could be presented with a quick visual summary
of the content of the pages pointed to by the result links. Lastly we are investigating
the possibility of scaling txt2vz such that it can produce visualisations of large text
datasets. We leave the reader with two further radial tree visualisations on different
texts. Figure 7 shows a visualization of this article and Figure 8 shows a visualization
of Darwins ‘On the Origin of Species’.
4</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Smith</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chuang</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hu</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Boyd-Graber</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Findlater</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <year>2014</year>
          .
          <article-title>Concurrent Visualization of Relationships between Words and Topics in Topic Models</article-title>
          .
          <source>Sponsor: Idibon</source>
          ,
          <fpage>79</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Aga</surname>
          </string-name>
          , R.T. and
          <string-name>
            <surname>Wartena</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <year>2015</year>
          ,
          <string-name>
            <surname>October.</surname>
          </string-name>
          <article-title>Constructing concept clouds from company websites</article-title>
          .
          <source>In Proceedings of the 15th International Conference on Knowledge Technologies and Data-driven Business</source>
          (p.
          <fpage>38</fpage>
          ). ACM
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Sowa</surname>
            ,
            <given-names>J.F.</given-names>
          </string-name>
          ,
          <year>2011</year>
          .
          <article-title>Cognitive architectures for conceptual structures</article-title>
          .
          <source>In Conceptual Structures for Discovering Knowledge</source>
          (pp.
          <fpage>35</fpage>
          -
          <lpage>49</lpage>
          ). Springer Berlin Heidelberg.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Viégas</surname>
            ,
            <given-names>F.B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wattenberg</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <article-title>Tag Clouds and the Case for Vernacular Visualization</article-title>
          ,
          <source>ACM Interactions, XV.4 - July/August</source>
          , 2008
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Gambette</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Véronis</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <year>2010</year>
          .
          <article-title>Visualising a text with a tree cloud</article-title>
          .
          <source>In Classification as a Tool for Research</source>
          (pp.
          <fpage>561</fpage>
          -
          <lpage>569</lpage>
          ). Springer Berlin Heidelberg..
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Bostock</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <year>2014</year>
          .
          <article-title>Data-Driven Documents-D3. js</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Hirsch</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Tian</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <year>2013</year>
          , January. Txt2vz:
          <article-title>a new tool for generating graph clouds</article-title>
          .
          <source>In International Conference on Conceptual Structures</source>
          (pp.
          <fpage>322</fpage>
          -
          <lpage>331</lpage>
          ). Springer Berlin Heidelberg.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Reingold</surname>
            ,
            <given-names>E.M.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Tilford</surname>
            ,
            <given-names>J.S.</given-names>
          </string-name>
          ,
          <year>1981</year>
          .
          <article-title>Tidier drawings of trees</article-title>
          .
          <source>Software Engineering, IEEE Transactions on, (2)</source>
          , pp.
          <fpage>223</fpage>
          -
          <lpage>228</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>