Research Article

Traditional Chinese Medicine Text Similarity Calculation Model Based on the Bidirectional Temporal Siamese Network

Algorithm 1

Bidirectional temporal Siamese network (BTSN).
(1)Input: dataset D
(2)Process:
(4)The dataset D is divided into training set and test set according to 7 : 3
(5)Import the pretrained language model ERNIE to obtain the dynamic character vector. The similarity calculation model is obtained through the training set.
(6)Forward-LEFT = LSTM-LEFT (vector); forward-RIGHT = LSTM-RIGHT (vector);
(7)Backward-LEFT = LSTM-LEFT (vector); backward-RIGHT = LSTM-RIGHT (vector)
(8)H-LEFT = connect (Forward-LEFT, Backward-LEFT); H-RIGHT = connect (Forward-RIGHT, Backward-RIGHT);
(9)Siamese (H-LEFT, H-RIGHT)
(10)Return similarity calculation model
(11)Use the test set to get various evaluations
(12)End