# Authorship Detection on Classical Chinese Text Using Deep Learning
## 3 Experiments
### BiLSTM-Based Authorship Detection on DRC  
The necessary samples are taken from the specified chapters, including 500-word, 2000-word, and 5000-word sequences. The sample sizes are shown in Table 3.  
The number of 500-word samples taken from the first 10 and last 10 chapters is 245. The number of 500-word samples taken from the first 20 and last 20 chapters is 484. The number of 500-word samples taken from the first 30 and last 30 chapters is 734. The number of 2000-word samples taken from the first 10 and last 10 chapters is 71. The number of 2000-word samples taken from the first 20 and last 20 chapters is 138. The number of 2000-word samples taken from the first 30 and last 30 chapters is 206. The number of 5000-word samples taken from the first 10 and last 10 chapters is 37. The number of 5000-word samples taken from the first 20 and last 20 chapters is 67. The number of 5000-word samples taken from the first 30 and last 30 chapters is 104. The entire structure of the BiLSTM-based authorship detection model is depicted in Figure 6. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Ch. 1–10 and** & **Ch. 1–20 and** & **Ch. 1–30 and** \\  & **111–120** & **101–120** & **91–120** \\ \hline
500 words & 245 & 484 & 734 \\
2000 words & 71 & 138 & 206 \\
5000 words & 37 & 67 & 104 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Size of training samples, including different lengths of sequences. Figure 5: Confusion matrix of the SVM-based method. It is challenging to convert Chinese texts into a form that BiLSTM can understand. After confirming the samples, Word2 vec is utilized to pre-process sequences of varying lengths [34]. Word2 vec mathematically detects the sequence vector in vector space and generates a set of feature vectors representing words, without human intervention. These vectorized words are suitable for deep neural networks. The word vectors are input into the convolutional network layer [35], where kernel function extracts features by sliding over the vectors. The key to the sliding process is determining the appropriate padding strategies. Valid padding is adopted, and the pooling operation is omitted to avoid destroying the sequential relationship of results [36]. Next, a two-tier stacked BiLSTM is applied. The results are passed into the BiLSTM layer without being modified by the activation function. BiLSTM is capable of retaining long-term information, and the high-level features are output. Softmax is used as a classifier, working as a normalization function [37]. It transforms the high-level features into probability values within the interval (0, 1). This function can be expressed as  
\[\sigma\left(\overset{\rightarrow}{z}\right)_{i}=\frac{\mathbf{e}^{\mathbf{z _{i}}}}{\sum_{\mathbf{j}=1}^{\mathbf{K}}\mathbf{e}^{\mathbf{z_{j}}}} \tag{4}\]  
\(\overset{\rightarrow}{z}\) is a vector containing K elements. The denominator creates a probability distribution by summing to standardize each element. The numerator applies the exponential function to each vector element, returning the corresponding output value of the i-th category. The detailed setting for the BiLSTM authorship detection model is shown in Table 4.  
Figure 6: Structure of BiLSTM-based authorship detection model. After 80 training epochs using samples from the first and last 10 chapters, the model achieved an accuracy of 68.23%. When the training was conducted for the same number of epochs but with samples from the first and last 20 chapters, the accuracy improved to 69.48%. By extending the sample range to the first and last 30 chapters and reducing the training epochs to just 14, the model's accuracy increased to 83.96%. The performance of the 2000-word sample is shown in Figure 8. \begin{table}
\begin{tabular}{c c} \hline
**Convolutional Network Layer** & **BiLSTM Layer** \\ \hline Sliding step: 1 & \\ Filter size: 3, 4, 5 & \\ Filter number: 128 & Hidden units number: 128 \\ Word embedding dimension: 256 & \\ \hline \end{tabular}
\end{table} 
Table 4: Settings of the BiLSTM-based authorship detection model.