Computer Engineering and Applications ›› 2021, Vol. 57 ›› Issue (15): 171-177.

### Algorithm of Text Similarity Analysis Based on Capsule-BiGRU

ZHAO Qi, DU Yanhui, LU Tianliang, SHEN Shaoyu

1. School of Police Information Engineering and Cyber Security, People’s Public Security University of China, Beijing 100038, China
• Online:2021-08-01 Published:2021-07-26

### 基于Capsule-BiGRU的文本相似度分析算法

1. 中国人民公安大学 警务信息工程与网络安全学院，北京 100038

Abstract:

Aiming at the problem that the traditional neural network model cannot extract the features of the text well, a text similarity analysis method based on capsule-BiGRU is proposed. The local features matrix of the text extracted by the capsule network and the global features matrix of the text extracted by the BiGRU are analyzed for similarity separately to obtain the similarity matrix of the text, to judge the similarity of text. The traditional capsule network is improved, words that have nothing to do with text semantics are regarded as noise capsules, and smaller weights are assigned to reduce the impact on subsequent tasks. For the task of text similarity, a co-attention?mechanism is added before feature extraction. For two texts to be analyzed, weights are given by calculating the similarity between words in one text and all words in another text, so that determine the similarity of text more accurately. Experiment with the Quora Questions Pairs dataset. The experimental results show that the proposed method has an accuracy rate of 86.16% and an F1 value of 88.77%, which is better than other methods.