Car FAQ Assistant Based on BILSTM-Siamese Network

With the development of artificial intelligence, the automatic question answering technology has been paid more and more attention. Along with the technology’s maturing, the problem is gradually exposed. This technique has several major difficulties. There is semantic recognition. How accurate are the answers to the questions? Because Chinese grammar is relatively complex. There are many different ways of saying the same thing. There is a powerful challenge to semantic recognition. Due to poor semantic recognition, the accuracy of the corresponding questions and answers is low. Aiming at this kind of questions, we build a Q & A library for common use of cars. Firstly, TFIDF method is used to build a basic FAQ retrieval system. Then we use BILSTM-siamese network to construct a semantic similarity model. The accuracy rate on the test set was 99.52%. The final FAQ system: first retrieves 30 most similar questions using the TFIDF model, then uses BILSTM-siamese network matching and returns the answer of the most similar question. The system has a lot to be improved. For example, how to combine this system with speech recognition? How to realize speech recognition will be a great challenge.

KEYWORDS 1. Introduction

2. Construct Corpus

We collect the problems that car owners often encounter during their use. And expand it to build a question-answer corpus. The same Id is the same semantic question, and the first one is the standard question. There are 123 common questions in the corpus. The structure is shown in Table 1.

Table 1. Question and answer table.

3. TFIDF-Based FAQ System

TFIDF Value

TF-IDF Full name is Term Frequency/Inverse Document Frequency. In 1973 Salton  came up with TFIDF. It is a word frequency-inverse document frequency algorithm and is a statistical method. The number of times a given word appears in a document, we define it as the word frequency. In how many documents a word appears in, we define it as a reverse word frequency. Then multiplying the two parts of the word frequency is the TFIDF value .

$T{F}_{ij}=\frac{{n}_{ij}}{{N}_{j}}$

$ID{F}_{ij}=\mathrm{log}\frac{N}{{N}_{i}}$

${\omega }_{ij}=T{F}_{ij}\ast ID{F}_{ij}$ 

We can use “jieba” word segmentation to solve the problem of corpus, and then extract the keywords and part of speech tagging, and then statistical word frequency and reverse word frequency, calculate the TFIDF value. Its value can be approximated to a probability between 0 and 1. Arrange the value of TFIDF from small to large, the larger the value is, the more important it is. We can make the problem the row of the matrix and the keyword the column of the matrix. Form a TFIDF matrix and save it locally. When the user enters a question, the system participles the question and calculates the TFIDF. This value is mapped to the vector space, and then the inner product space cosine is applied to calculate their similarity with the previously saved TFIDF matrix locally. Eventually we return the answer to the most similar question to the user. The structural framework is shown below (Figure 1) .

Figure 1. System framework.

4. Semantic Similarity Model Based on BILSTM-Siamese

4.1. Model Architecture

We convert the problem pair (Q1, Q2) into a list of characters of length 15. According to previous research scholars, character-based models perform better. So here, we use a pre-trained 100-dimensional character vector to convert the Q1, Q2 character list into a character vector matrix. Use the BILSTM-32 network to extract the timing characteristics of the statement, then connect the neural node to the fully connected layer of 64 and output the advanced features. Finally, we use cosine similarity to calculate the similarity of advanced features.  In the entire model, the left subnetwork shares the weight parameters with the right subnetwork. Therefore, when Q1 is exactly the same as Q2, the model output is 1. The result is shown in Figure 2.

4.2. Sample Construction

1) Under the same problem, different questions are combined between two pairs to form a synonymous statement pair (positive sample set);

2) Using 123 standard problem sets, use tfidf to retrieve the k problems that are closest to each problem (removing themselves), and compose non-synonymous statement pairs (negative sample).

4.3. Positive Sample Expansion

1) Commonly used consultation words to expand, how to swear, how; where ® where, where, where, what position; why ® how, oh, for example: How to adjust the seat? Expanded to:

Where is the speedometer? Expanded to:

(Where is the speedometer? Where is the speedometer? Where is the speedometer? Where is the speedometer? Where is the speedometer?)

Figure 2. Model framework.

Why is the warning light on? Expanded to:

(Why is the warning light on?, how does the warning light light up? Is the warning light on?)

2) Randomly exchange the position of two words. E.g.:

How to adjust the seat? Expanded to:

4.4. Negative Sample Expansion

The negative sample is expanded by the unexpanded positive sample, that is, if q1 and q2 are negative, the positive examples of q1 and q2 can form a negative example.

The sample set built is shown in Table 2.

The constructed sample set is divided into a training set and a test set according to a ratio of 7:3, as shown in Table 3.

5. Experiment

The model training batch size is 128, and the epoch (iteration period) is 30. Each layer of the model is processed by dropout, which speeds up the training iteration and prevents over-fitting.

The performance of the model on the test set is shown in Table 4.

Table 2. Expand problem.

Table 3. Sample collection.

Table 4. Performance table.

Accuracy (precision): (19,894 + 8590)/28,622 = 99.52%.

Recall rate (recall): 8590/8590 = 100%.

F1:2 * precision * recall/(precision + recall) = 99.20%.

6. FAQ System Structure

Use the data in Figure 1 to build a QA corpus. As shown in Figure 3, for a user input, we first use the TFIDF to recall k questions as candidate sets, and then use the BILSTM-Siamese semantic similarity model constructed above to calculate the semantic similarity between the input and k candidate sets. Eventually return the answer to the semantically most similar candidate question.

We feed the problem into the system. Run according to the program in our system. Can quickly output the most similar answer. The corresponding accuracy rate is high, as shown in Figure 4.

7. Summarize

This paper introduces the automatic question answering system model in the

Figure 3. System framework.

Figure 4. Actual presentation.

field of mathematical computing, and the specific operation process improves the accuracy of answering questions. In this paper, there are still some problems in expanding the vocabulary of automobile proper nouns and solving various names of the same parts. The characteristics of interaction between the two sentences of BILSTM are not perfect. These are the places that need to be improved next.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

Cite this paper

Jin, B. and Jin, Z. (2019) Car FAQ Assistant Based on BILSTM-Siamese Network. Open Access Library Journal, 6, 1-7. doi: 10.4236/oalib.1105817.

  Guo, H. (2008) Semantic-Based Online Book Automatic Question Answering System Research. Taiyuan University of Technology, Taiyuan.  Dong, Z.T., Bao, Y.Q. and Ma, X.H. (2010) Method for Calculating Similarity of Question Sentences in Intelligent Question Answering System. Journal of Wuhan University of Technology (Information and Management Engineering Edition), 32, 31-34.  Shi, J.X. (2010) Research on Automatic Question and Answer Technology Based on FAQ. Nankai University, Tianjin.  Sen, Z., Wang, B. and Jones, G.J.F. (2007) ICT-DCU Question Answering Task at NTCIR-6. Proceedings of the 6th Ntcir Workshop on Research in Information Access Technologies, Tokyo, 15-18 May 2007, 154-167.  Salton, G. and Clement, T.Y. (1973) On the Construction of Effective Vocabularies for Information Retrieval. Proceedings of the 1973 Meeting on Programming Languages and Information Retrieval, Gaithersburg, 4-6 November 1973, 48-60. https://doi.org/10.1145/951762.951766  Liu, Z. (2019) Application of TFIDF Algorithm in Article Recommendation System. Computer Knowledge and Technology, 15, 17-20.  Yang, Y., Yan, D.B., Xu, M., Wan, L., Li, Q. and Qiu, D. (2019) Clas-sification of 95598 Complaint Work Order Based on Improved TFIDF Feature Weighting Algorithm. Electricity and Energy, 40, 205-207+226.  Sun, H.F. and Hou, W. (2014) Application Research of Improved TFIDF Algorithm in Potential Cooperative Relationship Mining. Modern Book Information Technology, No. 10, 84-92.  Lin, S.M., Chen, T.Y. and Liang, W. (2019) DGA Domain Name Detection Method Based on BILSTM Neural Network. Network Security Technology and Application, No. 1, 15-17. 