# BiLSTM-CRF-KG: A Construction Method of Software Requirements Specification Graph
## 3 Structural Information Extraction Model of Functional Requirements
### Generation of Functional-Data Graph  
This study extracts the function data relationship pairs with \"C\", \"S\" and \"U\" relationships in the S/U/C matrix; generates the (function-relationship-data table) triplet (the relationships are create, send and use); and uses the py2 neo module of Python to save it to the neo4j database to realize the embedding of the function-data graph. The head node corresponding to the \"create\" and \"send\" relationship is the function entity, and the tail node is the data table entity; the head node corresponding to the \"use\" relationship is a data table entity, and the tail node is a function entity. The implementation of this part is shown in Algorithm 6. ```
0:U/C matrix
1:for j in functionSet do
2:if U[i][j] == \"C\" then
3:Cset.add(j)
4:endif
5:endif
6:endif
7:endif
8:endif
9:endif
10:endif
11:endif
12:endif
13:endif
14:endif
1

+++ ==WARNING: Truncated because of repetitions==



++

## 4 Experimental Results and Analysis

### Method of Converting Traditional U/C Matrix into S/U/C Matrix

The experimental data come from 150 real software system description documents collected manually to form the original business corpus, which can be divided into four categories according to the characteristics of the original business description corpus, as shown in Table 1.

In this experiment, the Python based deep learning framework tensorflow is utilized to realize the simulation of the BiLSTM-CRF model. The specific software and hardware configuration of the experimental environment is shown in Table 2. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Data Set Name** & **Data Set Characteristics** & **Number of Documents** & **Number of Sentences** \\ \hline Data set 1 & Normal & 46 & 69,941 \\ \hline Data set 2 & More words and sentences ambiguity & 42 & 50,019 \\ \hline Data set 3 & More implicit relations (punctuation) & 25 & 36,189 \\ \hline Data set 4 & More implied relations (numbers) & 37 & 43,851 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Data set grouping results. \begin{table}
\begin{tabular}{c c} \hline \hline
**Input:** S\(\_\)_UC_ \\
\begin{tabular}{c} **Output:** Function\_Data\_KG \\ \end{tabular} \\
1: **for** i in functionSet **do** \\
2: **for** x in functionSet **do** \\
3: **for** y in dataSet **do** \\
4: **if** SUC[f][x][y] == 'C’ **then** \\
5: **triple.append(x,’create’,y)** \\
6: **else if** SUC[f][x][y] == 'U’ **then** \\
7: **triple.append(y,’use’,x)** \\
8: **else if** SUC[f][x][y] == 'S’ **then** \\
9: **triple.append(x,’send’,y)** \\
10: **endif** \\
11: **end for** \\
12: **end for** \\
13: **end for** \\
14: **Function\_Data\_KG = triple2 KG(triple)** \\
15: **return** Function\_Data\_KG \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Configuration of experimental environment. ### Typical Experimental Results and Evaluation

Because the experiment in this study belongs to the problem of classification prediction, the accuracy rate, precision rate, recall rate and F1-score are used as evaluation indexes. After preprocessing the original corpus, the experiment divides the data into the training set, verification set and test set according to the ratio of 6:2:2. Then, the features and labels of each clause in the training set are input into BiLSTM-CRF to train the model. The training parameters are shown in Table 3.

The training loss is calculated by the loss_function interface function of the CRF model, and the change curve is shown in Figure 7.

When the epoch value is 9, the loss of the training set tends to converge, while the loss of the verification set has begun to increase, indicating that the model has been over fitted; therefore, the epoch in the training parameters is 9. After the model training, the performance of the model is tested through the test set, and then named entity recognition and context-based word meaning and entity disambiguation are carried out. Finally, the function-data graph is generated based on the tree model. The results of the typical experimental process are shown in Figure 8.