<!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>Identification of Semantic Patterns in Full-text Documents Using Neural Network Methods</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute of Informatics Problems FRS CSC of the Russian Academy of Sciences</institution>
          ,
          <addr-line>Moscow</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Moscow Institute of Physics and Technology</institution>
          ,
          <addr-line>Moscow</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>O. Zolotarev</institution>
        </aff>
        <aff id="aff3">
          <label>3</label>
          <institution>Research Center for Physical and Technical Informatics</institution>
          ,
          <addr-line>Nizhny Novgorod</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff4">
          <label>4</label>
          <institution>Russian New University</institution>
          ,
          <addr-line>Moscow</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Processing and text mining are becoming increasingly possible thanks to the development of computer technology, as well as the development of artificial intelligence (machine learning). This article describes approaches to the analysis of texts in natural language using methods of morphological, syntactic and semantic analysis. Morphological and syntactic analysis of the text is carried out using the Pullenti system, which allows not only to normalize words, but also to distinguish named entities, their characteristics, and relationships between them. As a result, a semantic network of related named entities is built, such as people, positions, geographical names, business associations, documents, education, dates, etc. The word2vec technology is used to identify semantic patterns in the text based on the joint occurrence of terms. The possibility of joint use of the described technologies is being considered.</p>
      </abstract>
      <kwd-group>
        <kwd>intelligent text analysis</kwd>
        <kwd>natural language</kwd>
        <kwd>neural networks</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>2. Features of the Pullenti program</title>
      <p>
        Pullenti is a program for processing unstructured
natural language texts. Program functions: breaking down
text into words, performing morphological analysis,
determining of all possible parts of speech of words
(regardless of context), normalizing words, bringing words
to the desired case / gender / number, highlighting named
entities, multiplication of functions with numeric, nominal
and verbal groups, brackets, quotes and other useful
features [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>
        In Pullenti, such objects as persons, organizations,
dates, geographic objects, sums of money, etc. are
distinguished. There are specialized analyzers that cover a
certain subject area. For example, identifying the structure
of a regulatory act and a contract with its details, analyzing
the title pages, literary characters, incidents, etc [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Here
is an incomplete list of named entities that allocate a
program: dates, date ranges, phone numbers, websites,
sums of money, bank details, keywords and phrases,
definitions, measured values and their ranges, countries,
regions, seas, lakes, planets, addresses, streets,
organizations, persons, passport data, electronic addresses,
business facts, links, promotions, product attributes,
weapons, relations etc. Selected entities can be represented
as a connected graph, see fig. 1.
      </p>
      <p>Fig. 1. Graph of selected named entities.</p>
      <p>Copyright © 2019 for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).</p>
      <p>Pullenti ChatBot technology is designed to develop
the intellectual part of chat bots. The technology is based
on the SDK Pullenti (www.pullenti.ru), which contains
various linguistic processing procedures, including
morphological analysis. In addition, the technology offers
a number of specific handlers of typical situations arising
in the process of dialogue. For example, the selection of a
phone number from a sequence in which the numbers are
given in words, which takes place at the output of voice
recognition systems ASR (automatic speech recognition),
assessment of emotional state, typical situation (agreement,
refusal, greetings ...), etc. The technology is aimed at
developing the part of the chat bot that mimics its “brain”,
that is, responsible for analyzing text fragments from the
user (if it’s a voice, then after recognizing it),
understanding, extracting data from the text and generating
text answer.</p>
      <p>Here is an example of using Pullenti through Python
(Jupyter Notebook). The following program selects name
groups from arbitrary text: «American President Donald
Trump wrote on Twitter on Thursday that it was time for
the US to recognize the Golan Heights as Israel in the
interests of the security of Israel and the region as a whole.</p>
      <p>A number of countries in the Middle East and Europe have
already expressed regret in connection with this decision,
and the Russian Foreign Ministry called it irresponsible and
leading to the destabilization of the region».</p>
      <p>The result of the program: «['AMERICAN
PRESIDENT', 'PRESIDENT', 'TRUMP', 'THURSDAY',
'TWITTER', 'PORA', 'GOLANA HEIGHT', 'HEIGHT',
'INTEREST', 'SECURITY', 'REGION', 'WHOLE',
'SERIES', 'STRANA', 'NEAR EAST', 'EAST', 'EUROPE',
'Uzh', 'COMPLAINT', 'CONNECTION', 'DECISION',
'DECISION', 'MFA', 'MASTER','DESTABILIZATION',
'REGION']».</p>
      <p>Pullenti does not include context definition functions,
therefore the meaning of a word must be performed by
other means, not by the program Pullenti. One of these
tools is a program from Google – word2vec.</p>
    </sec>
    <sec id="sec-2">
      <title>3. The principle of the technology word2vec on the algorithm Skip-Gram</title>
      <p>
        Word2vec – is a set of models for the analysis of the
semantics of natural languages, which is a technology that
is based on distributional semantics and vector
representation of words [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The word2vec model provides
two global operation algorithms: CBOW and Skip-Gram
[
        <xref ref-type="bibr" rid="ref8 ref9">8,9</xref>
        ]. CBOW determines the most appropriate word for a
given set of words (by context). Skip-Gram, on the
contrary, determines the most appropriate set of words to a
given word. This article will consider the algorithm
SkipGram.
      </p>
      <p>Before the appearance of neural networks, to analyze
the proximity of words, a table of frequency of each word
was compiled. That is, they made a matrix where words
were horizontally and vertically laid out, and the frequency
of the word in the specified line with the word specified in
the column was indicated in the cells.</p>
      <p>
        This paper discusses the skip-gram algorithm for
predicting a neighboring word. Further, this approach
covers several words [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>At the input of the neural network, pairs of words are
fed, the window size is selected, and then the moving
window slides through the text over all the pairs of words
in this window. If you select a window equal to one, the
window will contain one word to the left of the target word
and one word to the right of the target word. If the size of
the window is equal to two, then to the left and right of the
target word there will be two words each. Below is an
example for a window equal to two (articles removed):
Old abandoned house stands on the edge of the forest
Training phrases: (old, abandoned), (old, house)
Old abandoned house stands on the edge of the forest
Training phrases: (abandoned, old), (abandoned,
house), (abandoned, stands)</p>
      <p>Old abandoned house stands on the edge of the forest
Training phrases: (house, old), (house, abandoned),
(house, stands), (house, on)</p>
      <p>Old abandoned house stands on the edge of the forest
Training phrases: (stands, abandoned), (stands, old),
(stands, on), (stands, edge)</p>
      <p>The neural network will learn statistics on the
frequency of occurrence of each pair of words. Every word
needs to be converted to digital form. One of the common
ways is to present it as a column vector (one-hot encoding),
for example, like this:
0
1
 ⃗ = 0
. . .</p>
      <p>[ 0 ]</p>
      <p>Here our word, which we represent as a vector, takes
second place in the dictionary. Transformations using a
neural network can be represented as follows (fig. 2).</p>
      <p>Here x is the input word (or several words) by which
we want to predict, y is the word (or several words).</p>
      <p>h (hidden layer of the neural network) is a vector
obtained by multiplying the word vector x by the matrix of
weight coefficients w:</p>
      <p>ℎ⃗⃗ =   ⋅  ⃗
w – is a matrix containing weights, it has the
dimension: (dictionary length) * (number of attributes).
The number of signs is set once before the launch of the
neural network, it is selected to obtain the best result.
Example: Google used 300 tags to train a neural network
on a variety of Google News data. The weighting
coefficients at the initial moment of time take random
values, then they are adjusted in accordance with the
subtracted proportion of values w, so the matrix w′
method of back error propagation.</p>
      <p>∑

 =1</p>
      <p>After the hidden layer h, taking into account another
matrix of weight coefficients w ’, the vector u is formed:
⃗⃗ =  ′ ⋅ ℎ⃗⃗ =  ′ ⋅   ⋅  ⃗</p>
      <p>The dimension of the vector u coincides with the
dimension of the vector ⃗⃗.</p>
      <p>To normalize the output vector  ⃗ in the range [0; 1],
we use the softmax function (it is used as the activation
function, see  (⃗⃗  ) figure 2):
where N is the number of signs.</p>
      <p>As a result, we obtain that   is the probability of
observing (predicting) the i-th word (or phrase) in the
dictionary with the incoming word (context) x.</p>
      <p>The purpose of the neural network, shown in Figure
1, is to determine the weights w and w’. The criterion for
convergence of calculations is the maximization of the
probability y for all possible output words (phrases). As a
result
of
mathematical
transformations
(taking
the
logarithm of the probability y, then calculating the
derivative of the logarithm of the probability y using the
variable w’) we get an equation for which it is impossible
to find the optimum. Therefore, it is necessary to use
numerical methods. One of the best numerical methods is
the gradient descent method. The result is that you need to
solve a recursive task:</p>
      <p>′ ←  ′ −  (</p>
      <p>⋅ (1 −  ))</p>
      <sec id="sec-2-1">
        <title>Here G is a gradient descent function.</title>
        <p>Thus, if the probability for the output word being
searched is maximal, then the expression in parentheses is
close to zero, and
probability of output word is very small, then from w’
new
w ' 
old
w ' . Otherwise, when the
approaches to the matrix w.</p>
      </sec>
      <sec id="sec-2-2">
        <title>Similarly, w can be brought closer to w’:</title>
        <p />
      </sec>
    </sec>
    <sec id="sec-3">
      <title>4. Word2vec example on multiple articles</title>
      <p>In the example below, we are processing several
articles and collections of articles related to virtual reality
and modeling.</p>
      <p>The processing objects are the following documents:
materials of conferences on
programming, computer
science, collections of articles, presentations, dissertations.
The processing program is written in python.</p>
      <p>Before processing was only 473 337 words.</p>
      <p>As a result of processing module Pullenti formed 320
564 words.</p>
      <p>Virtual</p>
      <p>After the processing the above documents for 20
cycles with the word2vec module there were highlighted 8
words closest to the word 'virtual'. Here they are:
scholar
reality
system
google
pubmed
research
analysis
environment</p>
      <p>In this work, we use only certain functions of Pullenti
that have common functions for highlighting some entities.
Pullenti can use different libraries for different situations.
The quality of building model depends on which class the
text belongs to. Classification of texts using neural
networks will allow us to choose special methods of text
processing and improve the quality of the resulting model.</p>
      <p>In Pullenti for complex mining tasks, a higher level
presentation of data may be required.</p>
      <p>Pullenti denotes named entities based on the
construction of a chain of adjacent words. The use of neural
networks and, in particular, the genism library for
additional analysis of the text, allows us to define
significant verbose terms that are in the sentence quite far
from each other. In this case, it will be possible to form
semantic named entities and carry out their identification
throughout the text based on the analysis of the word
environment.</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>An example of the work of the program Pullenti has
been analyzed, a drawback has been revealed - the lack of
definition of the context of words.</p>
      <p>An example of the work of the word2vec technology
has been analyzed, and the problem of training on a small
amount of data has been revealed.</p>
      <p>During the training of the word2vec model,
satisfactory results were obtained with the number of
cycles equal to 20.</p>
      <p>The use of methods based on neural networks for the
analysis of texts will allow us to switch from text parsing
to partially semantic modeling.</p>
      <p>The approach outlined in this document can be used
to analyze texts, compare and classify documents.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>This work is supported by Russian Foundation for
Basic Research, grants 18-07-01111, 18-07-00909,
19-0700857 and 16-29-09527.</p>
      <p>We are grateful to the Russian Foundation for Basic
Research for financial support of our projects.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <article-title>[1] Word2Vec: how to work with vector representations of words [Electronic resource]</article-title>
          . // https://neurohive.io/ru/osnovy
          <article-title>-data-science/word2vecvektornye-predstavlenija-slov-dlja-mashinnogoobuchenija/ (appeal date</article-title>
          <volume>08</volume>
          /04/
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Word2Vec</given-names>
            <surname>Tutorial - The Skip-Gram</surname>
          </string-name>
          <string-name>
            <surname>Model</surname>
          </string-name>
          [Electronic resource]. // http://mccormickml.com/
          <year>2016</year>
          /04/19/word2vec-tutorialthe
          <article-title>-skip-gram-model/ (appeal date</article-title>
          <volume>08</volume>
          /04/
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Ali</given-names>
            <surname>Ghodsi</surname>
          </string-name>
          ,
          <source>Lec</source>
          <volume>13</volume>
          :
          <string-name>
            <given-names>Word2Vec</given-names>
            <surname>Skip-Gram</surname>
          </string-name>
          [Electronic resource]. // https://www.youtube.com/watch?v=GMCwS7tS5ZM/ (appeal date 08/04/
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <fpage>models</fpage>
          .word2vec - Word2vec embeddings [Electronic resource]. // https://radimrehurek.com/gensim/models/word2vec.html# gensim.
          <source>models.word2vec.Word2Vec/ (appeal date</source>
          <volume>08</volume>
          /04/
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Zolotarev</surname>
            <given-names>OV</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sharnin</surname>
            <given-names>MM</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Klimenko</surname>
            <given-names>SV</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kuznetsov</surname>
            <given-names>KI</given-names>
          </string-name>
          <article-title>System PullEnti - extracting information from natural language texts</article-title>
          and
          <source>automated building of information systems // Proceedings of the International Conference</source>
          .
          <article-title>Situation centers and class 4i information and analytical systems for monitoring and security tasks</article-title>
          .
          <source>SCVRT2015- 16</source>
          , Pushchino, TsarGrad, November 21-
          <issue>24</issue>
          ,
          <fpage>2015</fpage>
          -
          <lpage>2016</lpage>
          , Pushchino, pp.
          <fpage>28</fpage>
          -
          <lpage>35</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Deep</given-names>
            <surname>Contextualized Word Representations</surname>
          </string-name>
          / Matthew Peters, Mark Neumann, Mohit Iyyer et al. // Proceedings of the
          <year>2018</year>
          <article-title>Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies</article-title>
          . - Association for Computational Linguistics,
          <year>2018</year>
          . - Pp.
          <fpage>2227</fpage>
          -
          <lpage>2237</lpage>
          ..
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Zolotarev</surname>
            <given-names>OV</given-names>
          </string-name>
          ,
          <string-name>
            <surname>MM Sharnin</surname>
            ,
            <given-names>S.V.</given-names>
          </string-name>
          <string-name>
            <surname>Klimenko</surname>
            ,
            <given-names>A.G.</given-names>
          </string-name>
          <string-name>
            <surname>Matskevich</surname>
          </string-name>
          .
          <article-title>Research of methods of automatic formation of associative-hierarchical portrait of the subject area</article-title>
          // Bulletin of the Russian New University.
          <source>Series "Complex systems: models, analysis and management." - 2018. № 1</source>
          . - p.
          <fpage>91</fpage>
          <lpage>96</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <article-title>[8] Distributed Representations of Words and Phrases and their Compositionality</article-title>
          . / Tomas Mikolov, Ilya Sutskever, Kai Chen et al. // NIPS / Ed. by
          <string-name>
            <surname>Christopher J. C. Burges</surname>
            , L´eon Bottou, Zoubin Ghahramani,
            <given-names>Kilian Q.</given-names>
          </string-name>
          <string-name>
            <surname>Weinberger</surname>
          </string-name>
          .
          <article-title>-</article-title>
          <year>2013</year>
          . - Pp.
          <fpage>3111</fpage>
          -
          <lpage>3119</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Enriching</given-names>
            <surname>Word Vectors with Subword Information</surname>
          </string-name>
          / Piotr Bojanowski, Edouard Grave, Armand Joulin, Tomas Mikolov // Transactions of the Association for Computational Linguistics.
          <article-title>-</article-title>
          <year>2017</year>
          . - Vol.
          <volume>5</volume>
          . - Pp.
          <fpage>135</fpage>
          -
          <lpage>146</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Enriching</given-names>
            <surname>Word Vectors with Subword Information</surname>
          </string-name>
          / Piotr Bojanowski, Edouard Grave, Armand Joulin, Tomas Mikolov // Transactions of the Association for Computational Linguistics.
          <article-title>-</article-title>
          <year>2017</year>
          . - Vol.
          <volume>5</volume>
          . - Pp.
          <fpage>135</fpage>
          -
          <lpage>146</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>