<!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>An Ensemble Model Based on Siamese Neural Networks for the Question Pairs Matching Task</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Tongji University</institution>
          ,
          <addr-line>Shanghai 201804</addr-line>
          ,
          <country country="CN">P.R. China</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The problem of question pairs matching aims to seek whether the underlying semantics of two questions are equivalent. For WeBank Chinese question pairs which are collected from real-world intelligent customer service questions, the goal is to identify question pairs that have the same intent. In this paper, we propose an ensemble model which based on both word and character level neural networks such as the convolutional neural network (CNN), and the long short-term memory network (LSTM) for modeling semantic similarity. And we adopt an enhanced deep semantic model (R-ESIM) which is proved to be more e ective for sentence modeling. Our model takes 10-fold cross-validation into account to improve the generalization ability. In the evaluation of the CCKS 2018 shared task three, our model achieves the F1 score of 0.85085 for the opening test data which ranks the second.</p>
      </abstract>
      <kwd-group>
        <kwd>semantic similarity</kwd>
        <kwd>siamese neural network</kwd>
        <kwd>word embedding</kwd>
        <kwd>char embedding</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Semantic textual similarity plays an important role in natural language
processing (NLP). It is the basis of many NLP tasks such as question answering
and information retrieval. In recent years, there are more and more English
semantic similarity tasks such as Quora Question Pairs in Kaggle and Semantic
Textual Similarity (STS) in SemEval. The CCKS 2018 WeBank intelligent
customer service question pairs matching task provides a Chinese dataset similar to
the Quora question pairs. We need to assess the degree of underlying semantic
similarity between two questions and identify whether the two questions have
the same intent. Similar question pairs are labeled as 1 and 0 otherwise. The
question matching task is challenging not only due to the short text with less
semantic information but also due to many typos from real users.</p>
      <p>
        There have been numerous methods to solve the problem of similarity. LSI
[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and LDA [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] are typical traditional methods. Latent Semantic Indexing(LSI)
maps words and documents to latent semantic space by SVD to solve the
problem of polysemy and synonymy. Latent Dirichlet Allocation (LDA) is a topic
model that represents documents by the probability distribution of topics. A
series of neural network models for sentence matching have emerged with the
development of deep learning. Most of them use word embedding as input,
convert word embedding to sentence representation by a siamese base network (CNN
or LSTM), and compute the similarity between two sentence representations. Hu
et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] propose a classi cation model which makes use of CNN to get sentence
representations and computes the sentence matching score by MLP. Mueller et
al. [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] devise a regression model based on LSTM and Manhattan metric. Chen
et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] present a very e ective attention-based enhanced LSTM model.
      </p>
      <p>In this paper, we propose an ensemble method combining the k-fold
crossvalidation results of various word-level and character-level deep learning models
to catch more semantic information for the WeBank task. Our approach achieves
the F1 score of 0.85085 which ranks the second in the nal evaluation.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Model Description</title>
      <p>In this section, we describe the proposed deep neural networks to solve the
WeBank question matching task. We rst model the questions by a certain siamese
base network to translate natural language into mathematical representations.
Then we treat the task as a binary classi cation problem and compute the
matching score of semantic representations for question pairs with a multi-layer
perceptron (MLP). Finally, we nd optimal ensemble strategy based on the
results of validation set and average the output of di erent single models.
2.1</p>
      <sec id="sec-2-1">
        <title>Data preprocessing</title>
        <p>
          Word embedding and character embedding are pre-trained by word2vec [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] based
on the training data provided by WeBank. They will be used as the initial weight
of the embedding layer. We count all the questions in the train set. The max
character length and word length (segmented by Jieba1) are 123 and 80. We pad
or truncate the questions to xed length based on the max length.
2.2
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>Semantic Matching Networks</title>
        <p>We use siamese architectures due to the input of question pairs. Namely, two
networks with the same structure and the same weight each process one question
in a pair. We have tried multiple deep siamese models for sentence modeling and
classi cation in the task. The input of them is a sequence of words or characters
de ned as x = (x1; x2; ; xn) (n is the xed length). The following is a detailed
description of these networks.</p>
        <p>
          CNN Siamese Kim [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] applies CNN to natural language in 2014. Vxi is the
kdimensional vector corresponding to i-th word or character in questions obtained
from the embedding layer. Filters with size h k are used to produce feature
maps in the convolutional layer de ned as z = (W Vx + b). Here W is the
        </p>
        <sec id="sec-2-2-1">
          <title>1 https://github.com/fxsjy/jieba</title>
          <p>convolutional weight, b is the bias, and is the activation function (we use ReLU
in this task). Then we apply 1-max pooling which means taking the highest value
for each feature map to capture the most important feature. All the features
generated by lters can be concatenated to represent the input sentences. Then
we concatenate two sentence vectors and feed it into two fully-connected layers
to obtain the matching score.</p>
          <p>
            BiLSTM Siamese LSTM [
            <xref ref-type="bibr" rid="ref4">4</xref>
            ] is an improvement of the recurrent neural network
(RNN). LSTM is capable of learning long-term dependencies due to the cell units
and gates that can store or forget information. Bidirectional LSTM combines
the results of the forward and backward LSTM (we use concatenation). hi is
the hidden state at i-th time step which can represent i-th word and its context.
Then we use the last hidden states to represent the input sentences and compute
the similarity.
          </p>
          <p>CNN-BiLSTM Siamese The CNN-BiLSTM model contains both CNN and
BiLSTM network. CNN can extract n-gram features and LSTM is able to
operate over sequence input. Both of these two mainstream models have their own
advantages. So we combine the strengths of them. We take advantage of CNN
to extract features and use LSTM to encode them to a semantic representation.
R-ESIM Siamese ESIM is a natural language inference (NLI) model, but
the main idea is still the sentence modeling and classi cation. Thus, we can
modify and re ne the ESIM network to t the sentence matching task. There
are mainly six steps: 1) Input question pairs are encoded to hidden vectors
(a = fa1; :::; ang and b = fb1; :::; bng) by BiLSTM; 2) We compute the similarity
of each two hidden vectors from given pairs as attention weight (eij = aiT bj); 3)
New vectors that can re ect local relevance between question pairs are obtained
by weighted summation of hidden vectors; 4) The concatenation of the original
hidden vectors and new vectors, and the di erence and dot product of them
are put into another BiLSTM; 5) We use both max and average pooling and
concatenate all these vectors to represent the input sentences; 6) We feed the
concatenation of sentence semantic vectors into the MLP classi er with sigmoid
function in the output layer. The following experiments show that our re
nedESIM achieves great performance in the question matching task.
2.3</p>
        </sec>
      </sec>
      <sec id="sec-2-3">
        <title>Additional Features</title>
        <p>In addition to the neural network, there are many features that can re ect the
similarity between question pairs in a way. We roughly summarize these useful
features into three categories: character level features such as character overlap,
Levenshtein distance, and longest common subsequence (LCS), word level
features such as word overlap (TF-IDF weighted), word mover's distance (WMD),
and sentence level features such as topic models, average of word embedding. We
concatenate all these features including the output of deep models mentioned
above and try putting them into a random forest which is a typical ensemble
learning method to combine semantic sentence models with additional features.
2.4</p>
      </sec>
      <sec id="sec-2-4">
        <title>Ensemble of Deep Semantic Matching Models</title>
        <p>As shown in Figure 1, we respectively train a character-level R-ESIM model, a
word-level R-ESIM model, and a character-level BiLSTM model based on 10-fold
cross-validation. Thus there are 30 models in total. Word-level and
characterlevel models have the same structure, but the input of them are word and
character embeddings. We try to combine these methods to get a more comprehensive
model. Voting and averaging are the two simple but e ective ensemble methods.
In this paper, we average the output of 30 models as the nal prediction.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Experiments</title>
      <sec id="sec-3-1">
        <title>Experimental Setups</title>
        <p>Our proposed models was implemented in Keras2 with TensorFlow backend. We
used a TITAN X GPU device to train the model. We pre-trained 100-dimensional
word embedding and character embedding by gensim as the initial weight of the</p>
        <sec id="sec-3-1-1">
          <title>2 https://keras.io</title>
          <p>
            embedding layer which will be updated during the training process. We employed
binary cross-entropy as the loss function. The optimizer we utilized was Adam
[
            <xref ref-type="bibr" rid="ref7">7</xref>
            ] and the batch size was 128.
3.2
          </p>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>The Results of validation data</title>
        <p>We evaluated the performance of our models described in Section 2. Table 1
shows the experimental results of these models on the validation set in detail.</p>
        <p>We can nd that character-level models are better than word-level models
and 10-fold cross-validation can e ectively improve the performance. The
ensemble model of character and word level R-ESIM models and character level
BiLSTM models based on cross-validation achieves the best result. In other words,
our best model is the average of the output of 22 models. We only use the rst
two folds of the BiLSTM model due to the time limit. Moreover, we
incorporate additional features with R-ESIM models, and it can slightly improve the
performance. The method is time-consuming and not better than the ensemble
method of simple averaging, so we give up them in the nal evaluation.
3.3</p>
      </sec>
      <sec id="sec-3-3">
        <title>Final Results</title>
        <p>In the nal evaluation of test data, we submitted the result of our best model
which contains character and word level R-ESIM models (10 folds) and
character level BiLSTM models ( rst 2 folds). Table 2 shows the nal results of our
submission and other competitors'.</p>
        <p>We achieve the F1 score of 0.85085 and rank the second. We do not make
any post-processing for the output of our model. The distribution of positive and
negative samples is di erent between the validation set and the test set, but our
model is stable and achieves corresponding performance on both datasets which
can prove that our model has strong generalization ability.</p>
        <p>Model
R-ESIM word + char (cv) +
BiLSTM char (cv)
ThunderUp
DST
Laiye-Suda
GDUFSER
0.8524</p>
        <p>F1</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>In this paper, we describe an ensemble method of various deep neural networks
based on 10-fold cross-validation to solve the WeBank question matching task.
And the model can be migrated to other similar tasks easily. Furthermore, there
are many models that we haven't tried because of time constraint. Further work
will focus on combining the 10-fold cross-validation of other deep models and
nding a more appropriate method to add additional features.</p>
      <p>Acknowledgments This work was supported by the National Basic Research
Program of China (2014CB340404), the National Natural Science Foundation
of China (71571136), and the Project of Science and Technology Commission of
Shanghai Municipality (16JC1403000).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Blei</surname>
            ,
            <given-names>D.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ng</surname>
            ,
            <given-names>A.Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jordan</surname>
            ,
            <given-names>M.I.</given-names>
          </string-name>
          :
          <article-title>Latent dirichlet allocation</article-title>
          .
          <source>Journal of Machine Learning Research</source>
          <volume>3</volume>
          ,
          <issue>993</issue>
          {
          <fpage>1022</fpage>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>Q.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhu</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ling</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wei</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jiang</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Inkpen</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Enhanced lstm for natural language inference</article-title>
          .
          <source>In: Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics</source>
          . pp.
          <volume>1657</volume>
          {
          <issue>1668</issue>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Deerwester</surname>
            ,
            <given-names>S.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dumais</surname>
            ,
            <given-names>S.T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Landauer</surname>
            ,
            <given-names>T.K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Furnas</surname>
            ,
            <given-names>G.W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Harshman</surname>
            ,
            <given-names>R.A.</given-names>
          </string-name>
          :
          <article-title>Indexing by latent semantic analysis</article-title>
          .
          <source>Journal of the American Society of Information Science</source>
          <volume>41</volume>
          (
          <issue>6</issue>
          ),
          <volume>391</volume>
          {
          <fpage>407</fpage>
          (
          <year>1990</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Hochreiter</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schmidhuber</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>Long short-term memory</article-title>
          .
          <source>Neural computation 9(8)</source>
          ,
          <volume>1735</volume>
          {
          <fpage>1780</fpage>
          (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Hu</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lu</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>Q.</given-names>
          </string-name>
          :
          <article-title>Convolutional neural network architectures for matching natural language sentences</article-title>
          .
          <source>In: Advances in Neural Information Processing Systems</source>
          . pp.
          <year>2042</year>
          {
          <year>2050</year>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Kim</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>Convolutional neural networks for sentence classi cation</article-title>
          .
          <source>In: Proceedings of the Conference on Empirical Methods in Natural Language Processing</source>
          . pp.
          <volume>1746</volume>
          {
          <issue>1751</issue>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Kingma</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ba</surname>
          </string-name>
          , J.:
          <article-title>Adam: A method for stochastic optimization</article-title>
          .
          <source>arXiv preprint arXiv:1412.6980</source>
          (
          <year>2014</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>E cient estimation of word representations in vector space</article-title>
          .
          <source>arXiv preprint arXiv:1301.3781</source>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Mueller</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Thyagarajan</surname>
            ,
            <given-names>A.:</given-names>
          </string-name>
          <article-title>Siamese recurrent architectures for learning sentence similarity</article-title>
          .
          <source>In: AAAI</source>
          . pp.
          <volume>2786</volume>
          {
          <issue>2792</issue>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>