<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">SN</journal-id><journal-title-group><journal-title>Social Networking</journal-title></journal-title-group><issn pub-type="epub">2169-3285</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/sn.2014.32008</article-id><article-id pub-id-type="publisher-id">SN-43321</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  Using Luhn’s Automatic Abstract Method to Create Graphs of Words for Document Visualization
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>uiz</surname><given-names>Cláudio Santos Silva</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Renelson</surname><given-names>Ribeiro Sampaio</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Faculdade de Tecnologia SENAI Cimatec, Salvador, Brazil</addr-line></aff><author-notes><corresp id="cor1">* E-mail:<email>luizclaudio@gmail.com(UCSS)</email>;<email>renelson.sampaio@fieb.org.br(RRS)</email>;</corresp></author-notes><pub-date pub-type="epub"><day>27</day><month>02</month><year>2014</year></pub-date><volume>03</volume><issue>02</issue><fpage>65</fpage><lpage>70</lpage><history><date date-type="received"><day>November</day>	<month>15,</month>	<year>2013</year></date><date date-type="rev-recd"><day>December</day>	<month>17,</month>	<year>2013</year>	</date><date date-type="accepted"><day>January</day>	<month>25,</month>	<year>2014</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
   Visualization methods for single documents are either too simple, considering word frequency only, or depend on syntactic and semantic information bases to be more useful. This paper presents an intermediary approach, based on H. P. Luhn’s automatic abstract creation algorithm, and intends to aggregate more information to document visualization than word counting methods do without the need of external sources. The method takes pairs of relevant words and computes the linkage force between them. Relevant words become vertices and links become edges in the resulting graph. 
 
</p></abstract><kwd-group><kwd>Text Visualization; Graph of Words</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Text mining and visualization have been given more attention lately due to the large and increasing volume of available documents, both physical and digital. The search for relevant information and the identification of patterns in unstructured data can be aided by understanding what a text is about, how it is structured and in which style it is written.</p><p>Single document mining and visualization may be difficult tasks depending on text length. Shorter texts provide less data to work on and lead to simpler results. There are two kinds of single document visualization methods. The first one comprises statistical methods, basically word counting; they are simpler but produce limited results. The other kind comprises more complex methods that use syntactic analysis and may need semantic-annotated vocabularies; those lead to better results [<xref ref-type="bibr" rid="scirp.43321-ref1">1</xref>].</p><p>The most known word frequency-based method for text visualization is the word cloud, also known as tag cloud. It was first adopted in so called “Web 2.0” sites as a way to highlight the words that were most used to tag posts or links. These words are shown in an image in font size directly proportional to their frequency in the text. A color scale may be used too.</p><p>Word clouds can also be used for single document visualization. In this case, tags will represent the most frequent words in the text. There are sites that let users create word clouds on-line. <xref ref-type="fig" rid="fig1">Figure 1</xref> shows an example created with IBM Many Eyes [<xref ref-type="bibr" rid="scirp.43321-ref2">2</xref>] and  <xref ref-type="fig" rid="fig2">Figure 2</xref> shows another one created with Wordle [<xref ref-type="bibr" rid="scirp.43321-ref3">3</xref>].</p><p>Another method adopted for single document visualization is the graph of words. As its name suggests, text is represented by a graph in which some words are selected as the vertices and the edges are traced between vertices that satisfy a given relation. It is also a simple method but brings more information than a word cloud. And although it is not as informative as a concept map [<xref ref-type="bibr" rid="scirp.43321-ref4">4</xref>], for example, which presents the meaning of the relationships between concepts, a graph of words can be created by unsupervised methods.</p><p>This article proposes the creation of graphs of words inspired by a well-known document summarization algorithm. This is a development of a previous work [<xref ref-type="bibr" rid="scirp.43321-ref5">5</xref>] presented at the first Brazilian Workshop on Social Network</p><p>Analysis and Mining (BraSNAM), a satellite event of the XXXII Brazilian Computer Society Conference in July of 2012.</p><p>Document summarization algorithms intend to automatically create summaries. The basic ones simply select sentences or paragraphs from the text and show them in order of relevance. One of the first of these methods was proposed by H. P. Luhn back in 1957 [<xref ref-type="bibr" rid="scirp.43321-ref6">6</xref>]. It proposes the selection of a significant word pool through the definition of high and low frequencies cutoffs. These words should reflect the core subject, or subjects, of the text. The most relevant sentences will be those in which significant words appear more and closer to each other. It is important to note that Luhn’s method initially targeted science and technology texts, but its principles may work well for other styles too.</p><p>Luhn’s automatic abstract method was chosen as a starting point due to its simplicity and efficiency. It can create good summaries using only text mining and simple statistical concepts. Despite all the time since its publication, this algorithm continues to be used in recent works [<xref ref-type="bibr" rid="scirp.43321-ref7">7</xref>]. Nevertheless, previous examples using Luhn’s algorithm for the creation of graphs of words could not be found.</p><p>In the next section, the proposed method is described in detail. In Section 3, some application examples are presented and discussed. And in Section 4, the final considerations are made.</p></sec><sec id="s2"><title>2. Method</title><p>The method proposed by this article can be divided in three main steps, as shown in <xref ref-type="fig" rid="fig3">Figure 3</xref>. In the following parts of this section, each step is explained.</p><sec id="s2_1"><title>2.1. Identifying Relevant Words</title><p>To identify the relevant words, text must be first preprocessed by well known text mining tasks: elimination of stop-words and stemming [<xref ref-type="bibr" rid="scirp.43321-ref8">8</xref>], although Luhn’s method may be used without these prior steps.</p><p>After preprocessing, next step is to identify the more relevant words by calculating their frequencies in the text. Simplifying Luhn’s method, the mean word frequency is considered as the low cutoff and no high cutoff is adopted. If the number of relevant words still shows too large due to the length of the document, one or more standard deviations may be added to the mean to raise the low cutoff. And some of the much frequent words may need to also be considered contextual stop-words.</p><p>To select the sentences to create the document abstract, Luhn’s method adopts a score that depends on the number of relevant words that appear together in that sentence, but within a defined threshold distance. This idea is adapted here to define a way of estimating the linkage force between a pair of relevant words.</p></sec><sec id="s2_2"><title>2.2. Computing Linkage Force</title><p>Once relevant words have been selected, it is necessary to find how many times they appear together in pairs, in the same sentences, as well as the distances between them two within the same sentences. (Differently from Luhn’s method, there is not a threshold distance beyond which pairs should not be considered.) The many possible distances between each pair of relevant words must be reduced to a mean value for the pair.</p><p>Then, these two values, 1) number of times two relevant words appear together in a sentence and 2) mean distance between them in all sentences, should be used to compute the linkage force between them two. The more times two relevant words appear in the same sentences and at the shortest mean distance, the stronger is the link between them. For any two relevant words A and B, doing the necessary normalizations, the linkage force between them is</p><p><img src="1-5\744f98cc-3c10-48ec-8c82-c9b28af6f70b.jpg" /></p><p>where n<sub>(A,B)</sub> is number of times words A and B appear together in the same sentences, n<sub>max</sub> is the highest number of times any pair of relevant words appear together in then same sentences, d(A,B) is the mean distance between words A and B in all sentences they appear together and d<sub>max</sub> is the highest mean distance between any pair of relevant words in all sentences they appear together.</p><p>The normalized number of times and mean distance vary from zero (exclusive) to 1 (inclusive) and so does the linkage force, consequently.</p></sec><sec id="s2_3"><title>2.3. Creating a Graph of Words</title><p>Once data have been processed, the graph of words may be created. Relevant words will stand as vertices and the edges will exist whenever there will be a relationship between a pair of words. Visual exploration let us evaluate concepts like centrality and intermediation, which helps to understand document’s core subject and the structure. Disconnected sub graphs may show different subjects or subparts in the same text.</p><p>To enhance visualization, vertices may be drawn in a size proportional to the word frequency, as well as edges may be drawn as thick as the linkage force between the words. That is, bigger vertices denote more frequent words and thicker edges denote stronger links.</p></sec></sec><sec id="s3"><title>3. Application</title><p>To evaluate the method, three documents of different lengths were processed. There was no special reason other than to vary the input in each turn and observe the results.</p><p>All documents were converted to plain text format and processed by scripts developed by the authors in the Python programming language. Two important Python libraries were also used: NumPy [<xref ref-type="bibr" rid="scirp.43321-ref9">9</xref>], for statistical treatment, and Natural Language Toolkit (NLTK) [<xref ref-type="bibr" rid="scirp.43321-ref10">10</xref>], for text mining. The HalfViz graph visualization environment [<xref ref-type="bibr" rid="scirp.43321-ref11">11</xref>] was used to create the graphs.</p><p>It was observed that the method has an important dependence on sentence delimitation criteria. When binary files are converted to plain text, paragraphs and sentences may be broken and the resulting fragmented text will lead to a more disconnected graph.</p><sec id="s3_1"><title>3.1. Document A</title><p>Document A [<xref ref-type="bibr" rid="scirp.43321-ref12">12</xref>] is a tutorial about the use of “sna” package for the statistical software R. It was chosen to represent shorter documents.  <xref ref-type="table" rid="table1">Table 1</xref> displays the metrics computed for the document.</p><p>To reach a satisfactory representation for this document, only relevant words with frequency greater than the mean word frequency plus one standard deviation were selected. And only pairs with linkage force greater than 0.1 were finally considered.</p><p><xref ref-type="fig" rid="fig4">Figure 4</xref> shows the graph created for Document A. It has two sub graphs and the bigger one gathers the main concepts. The edges that link the vertices “network”, “social” and “sna” are stronger and denote their importance to the document context. On the other hand, the distance of the sub graph formed by the words “graph” and “set” shows they represent a different part of the document.</p></sec><sec id="s3_2"><title>3.2. Document B</title><p>Document B [<xref ref-type="bibr" rid="scirp.43321-ref6">6</xref>] is H.P. Luhn’s paper itself. It was chosen to represent medium length documents. <xref ref-type="table" rid="table2">Table 2</xref> displays the metrics computed for the Document B:</p><p>To reach a satisfactory representation for this document, only relevant words with frequency greater than mean word frequency plus one standard deviation were selected. And only pairs with linkage force greater than 0.1 were finally considered.</p><p><xref ref-type="fig" rid="fig5">Figure 5</xref> shows the graph created for Document B. It has two main sections and a disconnected pair (“total”-“number”). Some words stand out due to their degree and stronger linkage force: “document”, “word”, “method” and “process”.</p></sec><sec id="s3_3"><title>3.3. Document C</title><p>Document C [<xref ref-type="bibr" rid="scirp.43321-ref13">13</xref>] is the W3C’s Request for Comments for HTTP 1.1 (RFC 2616). It was chosen to represent longer documents. <xref ref-type="table" rid="table3">Table 3</xref> displays the metrics computed for the Document C.</p><p>To reach a satisfactory representation for this document, only relevant words with frequency greater than mean word frequency plus three standard deviations were selected. And only pairs with linkage force greater than 0.35 were finally considered.  <xref ref-type="fig" rid="fig6">Figure 6</xref> shows the graph created for Document C.</p><p>Document C was by far longer than the previous documents. Due to the number of words, limits had to be higher to avoid an overpopulated graph. And the final result was very good, with a connected graph where the words “request” and “must” are central to the structure. Although a verb, “must” has been included as a relevant word because of the prescriptive nature of the document.</p></sec></sec><sec id="s4"><title>4. Conclusions</title><p>The objective of this paper was to propose a new way of creating graphs of words for single document visualization. The idea was to go beyond the simple word frequency metrics. Method adopts principles present in H. P. Luhn’s Automatic Abstract Method, and uses them to mine links between important concepts in the document.</p><p>Evaluating the results, it seems that the method may be used in documents of different lengths once the thresholds of word frequency and linkage force are adjusted. The text mining tasks of stemming and stop-word removing have a great impact on the outcome. Sentence fragmentation due to file conversion also affects the result and must be observed.</p><p>Although network metrics were not used, the graphs of words created may also be treated as such. That can bring new information about text structure. This will be an objective for future works.</p></sec><sec id="s5"><title>REFERENCES</title></sec></body><back><ref-list><title>References</title><ref id="scirp.43321-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">M. Grobelnik and D. Mladenic, “Tutorial on Text Mining,” PASCAL Network of Excellence Workshop on Text Classification, 2004.</mixed-citation></ref><ref id="scirp.43321-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">IBM Research, “Many Eyes: Tag Cloud,” 2013. 
http://www-958.ibm.com/software/analytics/manyeyes/page/Tag_Cloud.html</mixed-citation></ref><ref id="scirp.43321-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">J. Feinberg, “Wordle—Beautiful Word Clouds,” 2013. 
http://www.wordle.net/</mixed-citation></ref><ref id="scirp.43321-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">J. D. Novak and A. J. Ca?as, “The Theory Underlying Concept Maps and How to Construct Them,” Technical Report IHMC CmapTools 2006-01 Rev 01-2008, Florida Institute for Human and Machine Cognition, 2008. </mixed-citation></ref><ref id="scirp.43321-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">L. C. S. Silva and R. R. Sampaio, “Use of Graphs of Terms to Analyse Contents of Technical Documents,” Proceedings of the Brazilian Workshop on Social Network Analysis and Mining, XXXII Congress of the Brazilian Computer Society, Curitiba, 2012.</mixed-citation></ref><ref id="scirp.43321-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">H. P. Luhn, “The Automatic Creation of Literature Abstracts,” IBM Journal of Research and Development, Vol. 2, No. 2, 1958, pp. 159-165. 
http://dx.doi.org/10.1147/rd.22.0159</mixed-citation></ref><ref id="scirp.43321-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">M. A. Russell, “Mining the Social Web,” O’Reilly, 2011, pp. 256-257.</mixed-citation></ref><ref id="scirp.43321-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">S. M. Weiss, N. Indurkhya, T. Zhang and F. J. Damerau, “From Textual Information to Numerical Vectors,” In: Text Mining: Predictive Methods for Analysing Unstructured Information, Springer Verlag, 2005, pp. 15-44.  
http://dx.doi.org/10.1007/978-0-387-34555-0_2</mixed-citation></ref><ref id="scirp.43321-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">NumPy Developers, “Scientific Computing Tools for Python—Numpy,” 2013. http://www.numpy.org/</mixed-citation></ref><ref id="scirp.43321-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">NLTK Project, “Natural Language Toolkit—NLTK 2.0,” 2013. http://nltk.org/</mixed-citation></ref><ref id="scirp.43321-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Samizdat Drafting Co., “HalfViz Graph Visualization Environment,” 2013. http://arborjs.org/halfviz/</mixed-citation></ref><ref id="scirp.43321-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">C. T. Butts, “Social Network Analysis with sna,” Journal of Statistical Software, Vol. 24, No. 6, 2008.</mixed-citation></ref><ref id="scirp.43321-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">R. Fielding, J. Gettys, J. Mogul, H. Frystyk, L. Masinter, P. Leach and T. Berners-Lee, “Hypertext Transfer Protocol—HTTP/1.1,” The Internet Society, 1999.</mixed-citation></ref></ref-list></back></article>