Training method, scoring method and related device of chapter structure scoring model

By analyzing rhetorical structure theory and training neural network models, a text structure scoring model is constructed, which solves the problem that existing technologies fail to effectively consider the article's organizational structure and achieves higher scoring accuracy and objectivity.

CN116089603BActive Publication Date: 2026-04-10GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU SHIYUAN ELECTRONICS CO LTD
Filing Date
2021-11-05
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing methods for scoring text structure fail to effectively consider the organizational structure of the text, resulting in low accuracy and relevance of the scoring results.

Method used

We use rhetorical structure theory to analyze the training corpus, construct a text structure scoring model, train it through a neural network model, and use the structural information of the text to score it until the loss function is minimized. We then save the model with the highest recognition rate.

Benefits of technology

It improves the accuracy and objectivity of essay structure scoring, and by comprehensively considering the organizational structure of the essay, the scoring effect is significantly better than existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116089603B_ABST
    Figure CN116089603B_ABST
Patent Text Reader

Abstract

The application provides a training method and a scoring method of a chapter structure scoring model and related equipment. When the model is trained, the system obtains artificially labeled training corpus, which includes multiple chapter texts, and each chapter text corresponds to an actual structure score. Then, the training corpus is analyzed based on the rhetorical structure theory to obtain the article rhetorical structure corresponding to each chapter text. The system inputs each chapter text, the actual structure score corresponding to each chapter text, and the article rhetorical structure as a training sample into a neural network model for model training until the loss function is minimized, and saves the model with the highest recognition rate as the chapter structure scoring model. After the training is completed, the chapter structure scoring model can comprehensively consider the chapter organization structure relationship of the article when scoring the structure of the article to be scored, so that the accuracy and objectivity of the structure score output by the model are higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of text processing technology, and in particular to a training method, scoring method and related equipment for a text structure scoring model. Background Technology

[0002] In automated essay grading systems, essay structure scoring is a crucial component. Existing scoring methods typically begin by constructing features, such as the number of paragraphs, the proportion of conjunctions, the number of clauses, and the number of words, and then use these features to fit a pre-labeled essay structure score. For new essays, the scoring model automatically generates an essay structure score. However, these features are relatively simple and not closely related to the essay's organizational structure. The scoring results are often more correlated with length and the number of paragraphs, rather than truly considering the essay's organizational structure, resulting in low accuracy and relevance of the final essay structure score. Summary of the Invention

[0003] The purpose of this disclosure is to provide a training method, scoring method, and related equipment for a text structure scoring model, which can comprehensively consider the text's organizational structure when scoring the structure of an article, resulting in a more objective and accurate scoring effect.

[0004] To achieve the above objectives, this application adopts the following technical solution: a training method for a text structure scoring model, comprising:

[0005] Acquire training corpus, which includes multiple text passages, each of which is labeled with an actual structure score;

[0006] Based on the analysis of the training corpus using rhetorical structure theory, the rhetorical structures of each of the aforementioned texts are obtained.

[0007] Each of the aforementioned texts, the corresponding actual structure score for each of the aforementioned texts, and the rhetorical structure of the article are used as training samples and input into the neural network model for model training until the loss function is minimized. The model with the highest recognition rate is then saved as the text structure scoring model.

[0008] This application also provides a method for scoring the structure of a text, including:

[0009] Get the articles to be rated;

[0010] The article to be scored is input into the text structure scoring model for analysis to obtain the structure score of the article to be scored. The text structure scoring model is a scoring model trained by the above-mentioned text structure scoring model training method.

[0011] This application also provides a training device for a text structure scoring model, including:

[0012] The first acquisition module is used to acquire training corpus, which includes multiple text passages, each of which is labeled with an actual structure score.

[0013] The parsing module is used to analyze the training corpus based on the theory of rhetorical structure to obtain the rhetorical structure of each of the texts.

[0014] The training module is used to input each of the aforementioned texts, the corresponding actual structure score of each text, and the article rhetorical structure as training samples into the neural network model for model training until the loss function is minimized, and to save the model with the highest recognition rate as the text structure scoring model.

[0015] This application also provides a scoring device for text structure, including:

[0016] The second acquisition module is used to acquire articles to be rated;

[0017] The scoring module is used to input the article to be scored into the article structure scoring model for parsing and to obtain the structure score of the article to be scored. The article structure scoring model is a scoring model trained by the above-mentioned article structure scoring model training method.

[0018] This application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described above.

[0019] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.

[0020] This application provides a training method, scoring method, and related equipment for a discourse structure scoring model. During model training, the system acquires manually annotated training corpus, which includes multiple discourse texts, each with a corresponding actual structure score. Then, based on rhetorical structure theory, the training corpus is analyzed to obtain the rhetorical structure of each discourse text. The system uses each discourse text, its corresponding actual structure score, and the rhetorical structure as training samples to input into the neural network model for training until the loss function is minimized. The model with the highest recognition rate is then saved as the discourse structure scoring model. This application utilizes the structural information (i.e., the rhetorical structure) of the discourse text during model training. This structural information reveals the discourse relationships between sentences in the discourse text, enabling the trained discourse structure scoring model to comprehensively consider the discourse organization and structural relationships when scoring the discourse text. This results in higher accuracy and objectivity in the model's output structure scores, and the scoring effect far surpasses existing technologies. Attached Figure Description

[0021] Figure 1 This is a schematic diagram illustrating the steps of a training method for a chapter structure scoring model in one embodiment of this application;

[0022] Figure 2 This is a schematic diagram illustrating the steps of a chapter structure scoring method in one embodiment of this application;

[0023] Figure 3 This is a rhetorical structure diagram of a scoring method for chapter structure in one embodiment of this application;

[0024] Figure 4 This is a structural diagram of a chapter structure scoring model in one embodiment of this application;

[0025] Figure 5 This is a flowchart of the process for obtaining sentence representation vectors in one embodiment of this application;

[0026] Figure 6 This is an overall structural block diagram of the training device for the chapter structure scoring model in one embodiment of this application;

[0027] Figure 7 This is an overall structural block diagram of the scoring device for the chapter structure in one embodiment of this application.

[0028] Figure 8 This is a schematic block diagram of the structure of a computer device according to an embodiment of this application.

[0029] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0031] Reference Figure 1 One embodiment of this application provides a training method for a text structure scoring model, comprising:

[0032] S1: Obtain training corpus, which includes multiple text passages, each of which is labeled with an actual structure score;

[0033] S2: Based on the theory of rhetorical structure, analyze the training corpus to obtain the rhetorical structure of each of the texts;

[0034] S3: Input each of the aforementioned texts, the corresponding actual structure score of each text, and the article rhetorical structure as training samples into the neural network model for model training until the loss function is minimized, and save the model with the highest recognition rate as the text structure scoring model.

[0035] In this embodiment, the training system acquires training corpora input by developers. The training corpora include multiple text passages (which can be simply understood as articles, regardless of language), each with a manually annotated structural score. The training system parses each text passage in the training corpus using rhetorical structure theory (e.g., using the rhetorical structure parser proposed in the paper "Top-Down RST Parsing Utilizing GranularityLevels in Documents") to obtain the rhetorical structure of each text passage. Taking a single text passage as an example, the training system first divides the text passage into several basic discourse units. Then, based on the discourse relationships between two adjacent basic discourse units, and the discourse relationships between two adjacent basic discourse units and other basic discourse units (or combinations of other basic discourse units), it constructs the text passage's rhetorical structure. This rhetorical structure is a binary tree structure, with the basic discourse units located at the leaf nodes of the binary tree. The training system uses each text passage, its corresponding actual structure score, and the rhetorical structure as training samples to input into the neural network model for training. This process is iterated until the model's loss function is minimized (or the loss function no longer decreases). The model with the highest recognition performance (i.e., the highest recognition rate) on the validation set is then saved as the final trained text structure scoring model. Taking the calculation of the loss function for a single text passage as an example, the text is first segmented into sentences. Then, the neural network model extracts features from each sentence, obtaining sentence representation vectors for each sentence. Based on the textual organization relationships between sentences in the rhetorical structure, the sentence representation vectors are combined to obtain the root node representation vector (which is the representation vector of the entire text) and several non-leaf node representation vectors. The training system uses a classifier to classify the discourse relationships between the root node representation vector and each non-leaf node representation vector, obtaining the classifier output probability for each node. The root node representation vector is then input into a fully connected layer (i.e., the scorer) for score calculation, yielding the predicted structure score. Finally, the corresponding loss function is calculated based on the output probabilities of each classifier, the predicted structure score of the text, and the actual structure score.

[0036] In this embodiment, the model training utilizes the structural information of the text (i.e., the rhetorical structure of the article). This structural information shows the discourse relationship between sentences in the text, so that the trained text structure scoring model can comprehensively consider the text organization structure relationship when scoring the article, thus making the accuracy and objectivity of the structure score output by the model higher, and the scoring effect far superior to the existing technology.

[0037] Furthermore, in the step of analyzing the training corpus based on rhetorical structure theory to obtain the rhetorical structure of each of the aforementioned texts, the analysis steps for a single text are as follows:

[0038] S201: Divide the text into several basic discourse units;

[0039] S202: Based on the discourse relationship between two adjacent basic discourse units and the discourse relationship between two adjacent basic discourse units and the remaining basic discourse units, construct the article rhetorical structure of the text. The article rhetorical structure is a binary tree structure, and the leaf nodes of the binary tree structure are the basic discourse units.

[0040] In this embodiment, the training system analyzes each text in the training corpus based on rhetorical structure theory to obtain the rhetorical structure of each text. The analysis logic is the same for all texts; the following detailed explanation uses the analysis steps of a single text as an example. The training system first divides the text into several basic discourse units. Then, based on the discourse relationships between two adjacent basic discourse units, and the discourse relationships between two adjacent basic discourse units and the remaining basic discourse units, it constructs the rhetorical structure of the text. This embodiment uses a sentence as a basic discourse unit. Assuming the text is segmented into sentences as follows: (1. My father is a typical man, who is not very talkative. 2. When other fathers say how much they love their children, my father just keeps quiet. 3. He barely says sweet words to me. 4. But he will never miss every important moment for me, like the performance in school. 5. He is always one of the audience and watches my performance. 6. My father tells me to study with passion and he sets the good example for me because he loves his work. 7. Sometimes he shows me his design of work, and I admire him. 8. I know my father loves me so much. 9. Although he does not talk much, he will be right by my side whenever I need him.), each sentence is a basic discourse unit. The rhetorical structure of the article, obtained after analysis based on rhetorical structure theory, is as follows: Figure 3 As shown, the rhetorical structure of the article is a binary tree structure, and the leaf nodes of the binary tree structure are basic discourse units (i.e., Figure 3 (The numbers 1, 2, 3, etc. in the binary tree structure). The left node of the binary tree contains the core content of the text, and the right node contains the background information of that core content.

[0041] Furthermore, in the step of using each of the aforementioned texts, the corresponding actual structure score, and the rhetorical structure as training samples to input into the neural network model for model training until the loss function is minimized, and saving the model with the highest recognition rate as the text structure scoring model, the calculation steps for the loss function corresponding to a single text are as follows:

[0042] S301: Obtain the sentence representation vector corresponding to each of the basic discourse units;

[0043] S302: Based on the rhetorical structure of the article and the representation vectors of each sentence, the root node representation vector and several non-leaf node representation vectors of the rhetorical structure of the article are obtained by parsing.

[0044] S303: Perform discourse relation classification on the root node representation vector and each of the non-leaf node representation vectors to obtain the classifier output probability corresponding to each node; and calculate the score of the root node representation vector to obtain the predicted structure score.

[0045] S304: The loss function is calculated based on the classifier output probability, the predicted structure score, and the actual structure score.

[0046] In this embodiment, when the training samples include various text passages, their corresponding actual structural scores, and the article's rhetorical structure, the calculation logic for each loss function is the same during model training. The following explanation uses the calculation logic of the loss function for a single text passage as an example: First, the text passage is segmented into sentences. Since a single sentence is a single basic discourse unit in this embodiment, the segmented text passage yields several basic discourse units. Then, a neural network model is used to extract features from each basic discourse unit (i.e., each sentence), resulting in sentence representation vectors for each basic discourse unit. Next, combining the node distribution of each basic discourse unit within the article's rhetorical structure, the sentence representation vectors are combined to parsely obtain the root node representation vector and several non-leaf node representation vectors of the article's rhetorical structure. For example... Figure 4 As shown, e1 represents the sentence representation vector of sentence 1 in the text, e2 represents the sentence representation vector of sentence 2 in the text, and so on. Each sentence representation vector is a leaf node of the binary tree structure; span is a non-leaf node vector, which is obtained by combining two sentence representation vectors of the lower-level node, or by combining one sentence representation vector and one span node representation vector of the lower-level node, or by combining two span node representation vectors of the lower-level node; text embedding is the root node representation vector of the binary tree structure, which is obtained by combining two sentence representation vectors of the lower-level node, e2, e3, e4, e5, e6, e7, e8, e9, e1, e1, e2, e9, e1, e2, e9, e1, e9, e1, e1, e2 ... Figure 4It can be seen that the root node representation vector represents the representation vector of the entire text. The training system performs discourse relation classification on the root node representation vector and the non-leaf node representation vectors (each root node and each non-leaf node is connected to a classifier). Figure 4 For clarity, only one classifier is shown as an example. The process involves obtaining the classifier output probability for each node (including the root node and all non-leaf nodes); then inputting the root node representation vector into the fully connected layer (i.e., the scorer) to calculate the score, thus obtaining the predicted structure score for the corresponding text. The first formula for calculating the classifier output probability is: P... span = sofmax(span), where P span The classifier output probability is represented by the representation vector of a non-leaf node; similarly, the classifier output probability of the representation vector of the root node is calculated using the formula: P text embed = sofmax(text embed), P text embed That is, the classifier output probability of the root node representation vector; while the second formula for calculating the predicted structure score corresponding to the text is: That is, the predicted structure score corresponding to the text, w score and b score These are the parameters to be trained. Finally, based on the output probabilities of each classifier, the predicted structure score, and the actual structure score, the corresponding loss function is calculated according to the third formula. The third formula is: Among them, l val is the loss function; d refers to the d-th text in the training samples; N is the number of texts in the training set; M is the number of non-leaf nodes (including the root node) in each text; y d This is the actual structural score of the d-th text, where l is the discourse relation category index of non-leaf nodes (including the root node), obtained through a trained rhetorical structure parser. The discourse relation category of the ith non-leaf node is l. i P i This represents the classifier output probability at the i-th non-leaf node. λ is the probability corresponding to the actual discourse relation, and λ is a hyperparameter that serves as the weight of the scorer error.

[0047] Furthermore, the step of obtaining the sentence representation vector corresponding to each of the basic discourse units includes:

[0048] S3011: Input each of the basic text units into the BERT model to obtain the sentence representation vectors corresponding to each of the basic text units.

[0049] In this embodiment, the training system obtains the sentence representation vectors corresponding to each basic discourse unit (i.e., each sentence) in the text using a BERT model. Specifically, the input text is first segmented into sentences, assuming the i-th sentence is sentence i = {x1, x2, ..., xn}, where x1...xn represent the words in sentence i. Then, the sentence representation vector ei is obtained through a neural network model, such as... Figure 5 Taking BERT as an example, in addition to word vectors, the input layer also needs to include position vectors, as well as sentence identifier vectors [CLS] and [SEP]. The output of the [CLS] position is used as the sentence representation vector; the representation vectors of other sentences in the passage are obtained in the same way. The function representation is as follows: The sentence is: The sentence representation vector is: e i =Bert(S i ).

[0050] Furthermore, the step of parsing the root node representation vector and several non-leaf node representation vectors of the article's rhetorical structure based on the article's rhetorical structure and the representation vectors of each sentence includes:

[0051] S3021: According to the node level of each sentence representation vector in the article's rhetorical structure, combine two sentence representation vectors at the same level node in order from low to high to obtain the non-leaf node representation vector;

[0052] S3022: Combine the representation vectors of the two non-leaf nodes at the penultimate node level to obtain the root node representation vector.

[0053] In this embodiment, the text's rhetorical structure is a binary tree structure, with the sentence representation vectors of each basic text unit located at the leaf nodes of the binary tree structure. For example... Figure 4 As shown, the training system combines the representation vectors of two sentences at the same node in the rhetorical structure of the article, from low to high, according to the node hierarchy of each sentence representation vector in the article's rhetorical structure. This results in the representation vectors of non-leaf nodes (i.e., after each combination, the representation vectors of each non-leaf node are obtained). Figure 4 The span in the middle. Then, the representation vectors of the two non-leaf nodes at the penultimate node level are combined to obtain the root node representation vector (i.e., the span in the middle). Figure 4 (text embedding in the text). Specifically, the calculation logic for the representation vector of each node (non-leaf nodes and root node) is as follows: Span = g left ⊙e left +g right ⊙e right ,in, All of these are parameters to be trained, eleft The sentence representation vector on the left side of the binary tree is represented by the vector; similarly, e right The sentence representation vector on the right side of the binary tree; δ is the sigmoid function, and the left side of the equals sign is the output value, which is between 0 and 1; The results of the two sigmoid functions (between 0 and 1) are used to control how much information from the left and right sides is used, respectively; Span = g left ⊙e left +g right ⊙e right The representation vector of the parent node (or the node at the next higher level) is obtained by combining the representation vectors of the left and right sides of the binary tree structure.

[0054] Reference Figure 2 An embodiment of this application also provides a method for scoring the structure of a text, comprising:

[0055] A1: Get the articles to be rated;

[0056] A2: Input the article to be scored into the article structure scoring model for analysis to obtain the article structure score, wherein the article structure scoring model is a scoring model trained by any of the above-described article structure scoring models.

[0057] Preferably, the step of inputting the article to be scored into the discourse structure scoring model for analysis to obtain the discourse structure score includes:

[0058] A201: The rhetorical structure of the article to be scored is obtained through the analysis of rhetorical structure theory, and the sentence representation vectors corresponding to each sentence in the article to be scored are obtained.

[0059] A202: Based on the rhetorical structure of the article to be scored and the representation vectors of each sentence to be scored, the text representation vector corresponding to the article to be scored is obtained by combining them.

[0060] A203: Input the text representation vector into the fully connected layer for calculation to obtain the structure score.

[0061] In this embodiment, the operator inputs the article to be scored into the scoring system. The scoring system then inputs the received article into the discourse structure scoring model trained by the aforementioned training method for analysis. After appropriate processing, the discourse structure scoring model outputs the discourse structure score of the article to be scored. Specifically, the discourse structure scoring model (hereinafter referred to as the scoring model) first analyzes the article to be scored using rhetorical structure theory, performing basic discourse unit segmentation (in this embodiment, a single sentence is considered a single basic discourse unit). Then, based on the discourse relationship between two adjacent basic discourse units, and the discourse relationship between two adjacent basic discourse units and other basic discourse units, it constructs the rhetorical structure of the article to be scored. This rhetorical structure is a binary tree structure (refer to...). Figure 3 Furthermore, a neural network model is used to extract the sentence representation vectors corresponding to each sentence in the article to be scored. Based on the rhetorical structure of the article (structured as a binary tree) and the representation vectors of each sentence, the scoring model combines them from bottom to top to obtain the text representation vector corresponding to the article. The scoring model then inputs the text representation vector into a fully connected layer (i.e., the scorer) for calculation, thereby obtaining the structural score of the text to be scored.

[0062] Reference Figure 6 This application provides a training device for a text structure scoring model, comprising:

[0063] The first acquisition module 1 is used to acquire training corpus, which includes multiple text passages, each of which is labeled with an actual structure score.

[0064] Parsing module 2 is used to parse the training corpus based on rhetorical structure theory to obtain the rhetorical structure of each of the texts.

[0065] Training module 3 is used to input each of the aforementioned texts, the corresponding actual structure score of each text, and the article rhetorical structure as training samples into the neural network model for model training until the loss function is minimized, and to save the model with the highest recognition rate as the text structure scoring model.

[0066] Furthermore, the parsing module 2 includes:

[0067] A segmentation unit is used to divide the text into several basic discourse units;

[0068] A construction unit is used to construct the article rhetorical structure of the text based on the discourse relationship between two adjacent basic discourse units and the discourse relationship between two adjacent basic discourse units and the remaining basic discourse units. The article rhetorical structure is a binary tree structure, and the leaf nodes of the binary tree structure are the basic discourse units.

[0069] Furthermore, the training module 3 includes:

[0070] The acquisition unit is used to acquire the sentence representation vector corresponding to each of the basic discourse units;

[0071] The first parsing unit is used to parse the root node representation vector and several non-leaf node representation vectors of the article's rhetorical structure based on the article's rhetorical structure and the representation vectors of each sentence.

[0072] The first calculation unit is used to classify the discourse relations of the root node representation vector and each of the non-leaf node representation vectors to obtain the classifier output probability corresponding to each node; and to calculate the score of the root node representation vector to obtain the predicted structure score.

[0073] The second calculation unit is used to calculate the loss function based on the classifier output probability, the predicted structure score, and the actual structure score.

[0074] Furthermore, the acquisition unit includes:

[0075] The input sub-unit is used to input each of the basic text units into the BERT model to obtain the sentence representation vector corresponding to each of the basic text units.

[0076] Furthermore, the parsing unit includes:

[0077] The first combination subunit is used to combine two sentence representation vectors at the same level node in the article rhetorical structure in order from low to high according to the node level of each sentence representation vector, so as to obtain the non-leaf node representation vector.

[0078] The second combination subunit is used to combine the representation vectors of two non-leaf nodes at the penultimate node level to obtain the root node representation vector.

[0079] In this embodiment, each module, unit, and sub-unit in the training device of the discourse structure scoring model is used to perform each step in the training method of the discourse structure scoring model described above. The specific implementation process is not described in detail here.

[0080] Reference Figure 7 This application also provides a scoring device for text structure, including:

[0081] The second acquisition module 4 is used to acquire articles to be rated.

[0082] Scoring module 5 is used to input the article to be scored into the article structure scoring model for parsing and to obtain the structure score of the article to be scored. The article structure scoring model is a scoring model trained by the above-mentioned article structure scoring model training method.

[0083] Furthermore, the scoring module 5 includes:

[0084] The second parsing unit is used to analyze the rhetorical structure of the article to be scored through rhetorical structure theory, and to obtain the sentence representation vectors corresponding to each sentence in the article to be scored.

[0085] The combination unit is used to combine the rhetorical structure of the article to be scored and the representation vectors of each sentence to be scored to obtain the text representation vector corresponding to the article to be scored.

[0086] The third computational unit is used to input the text representation vector into the fully connected layer for computation to obtain the structure score.

[0087] In this embodiment, each module and unit in the chapter structure scoring device is used to perform the corresponding steps in the chapter structure scoring method described above, and the specific implementation process is not described in detail here.

[0088] This embodiment provides a training device and a scoring device for a discourse structure scoring model. During model training, the system acquires manually annotated training corpus, which includes multiple discourse texts, each with a corresponding actual structure score. Then, based on rhetorical structure theory, the training corpus is analyzed to obtain the rhetorical structure of each discourse text. The system uses each discourse text, its corresponding actual structure score, and the rhetorical structure as training samples to input into the neural network model for training until the loss function is minimized. The model with the highest recognition rate is then saved as the discourse structure scoring model. This application utilizes the structural information (i.e., the rhetorical structure) of the discourse text during model training. This structural information reveals the discourse relationships between sentences in the discourse text, enabling the trained discourse structure scoring model to comprehensively consider the discourse organization and structure relationships when scoring the discourse text. This results in higher accuracy and objectivity in the model's output structure score, and the scoring effect far surpasses existing technologies.

[0089] Reference Figure 8 This application also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 8As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores training corpora and other data. The network interface allows communication with external terminals via a network connection. When executed by the processor, the computer program implements a training method for a discourse structure scoring model and a discourse structure scoring method.

[0090] The processor described above executes the following steps of the training method for the above-described text structure scoring model:

[0091] S1: Obtain training corpus, which includes multiple text passages, each of which is labeled with an actual structure score;

[0092] S2: Based on the theory of rhetorical structure, analyze the training corpus to obtain the rhetorical structure of each of the texts;

[0093] S3: Input each of the aforementioned texts, the corresponding actual structure score of each text, and the article rhetorical structure as training samples into the neural network model for model training until the loss function is minimized, and save the model with the highest recognition rate as the text structure scoring model.

[0094] Furthermore, in the step of analyzing the training corpus based on rhetorical structure theory to obtain the rhetorical structure of each of the aforementioned texts, the analysis steps for a single text are as follows:

[0095] S201: Divide the text into several basic discourse units;

[0096] S202: Based on the discourse relationship between two adjacent basic discourse units and the discourse relationship between two adjacent basic discourse units and the remaining basic discourse units, construct the article rhetorical structure of the text. The article rhetorical structure is a binary tree structure, and the leaf nodes of the binary tree structure are the basic discourse units.

[0097] Furthermore, in the step of using each of the aforementioned texts, the corresponding actual structure score, and the rhetorical structure as training samples to input into the neural network model for model training until the loss function is minimized, and saving the model with the highest recognition rate as the text structure scoring model, the calculation steps for the loss function corresponding to a single text are as follows:

[0098] S301: Obtain the sentence representation vector corresponding to each of the basic discourse units;

[0099] S302: Based on the rhetorical structure of the article and the representation vectors of each sentence, the root node representation vector and several non-leaf node representation vectors of the rhetorical structure of the article are obtained by parsing.

[0100] S303: Perform discourse relation classification on the root node representation vector and each of the non-leaf node representation vectors to obtain the classifier output probability corresponding to each node; and calculate the score of the root node representation vector to obtain the predicted structure score.

[0101] S304: The loss function is calculated based on the classifier output probability, the predicted structure score, and the actual structure score.

[0102] Furthermore, the step of obtaining the sentence representation vector corresponding to each of the basic discourse units includes:

[0103] S3011: Input each of the basic text units into the BERT model to obtain the sentence representation vectors corresponding to each of the basic text units.

[0104] Furthermore, the step of parsing the root node representation vector and several non-leaf node representation vectors of the article's rhetorical structure based on the article's rhetorical structure and the representation vectors of each sentence includes:

[0105] S3021: According to the node level of each sentence representation vector in the article's rhetorical structure, combine two sentence representation vectors at the same level node in order from low to high to obtain the non-leaf node representation vector;

[0106] S3022: Combine the representation vectors of the two non-leaf nodes at the penultimate node level to obtain the root node representation vector.

[0107] The processor described above executes the following steps in the scoring method for the above-described chapter structure:

[0108] A1: Get the articles to be rated;

[0109] A2: Input the article to be scored into the article structure scoring model for analysis to obtain the article structure score, wherein the article structure scoring model is a scoring model trained by any of the above-described article structure scoring models.

[0110] Preferably, the step of inputting the article to be scored into the discourse structure scoring model for analysis to obtain the discourse structure score includes:

[0111] A201: The rhetorical structure of the article to be scored is obtained through the analysis of rhetorical structure theory, and the sentence representation vectors corresponding to each sentence in the article to be scored are obtained.

[0112] A202: Based on the rhetorical structure of the article to be scored and the representation vectors of each sentence to be scored, the text representation vector corresponding to the article to be scored is obtained by combining them.

[0113] A203: Input the text representation vector into the fully connected layer for calculation to obtain the structure score.

[0114] One embodiment of this application also provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it implements a training method for a text structure scoring model and a text structure scoring method. The training method for the text structure scoring model specifically includes:

[0115] S1: Obtain training corpus, which includes multiple text passages, each of which is labeled with an actual structure score;

[0116] S2: Based on the theory of rhetorical structure, analyze the training corpus to obtain the rhetorical structure of each of the texts;

[0117] S3: Input each of the aforementioned texts, the corresponding actual structure score of each text, and the article rhetorical structure as training samples into the neural network model for model training until the loss function is minimized, and save the model with the highest recognition rate as the text structure scoring model.

[0118] Furthermore, in the step of analyzing the training corpus based on rhetorical structure theory to obtain the rhetorical structure of each of the aforementioned texts, the analysis steps for a single text are as follows:

[0119] S201: Divide the text into several basic discourse units;

[0120] S202: Based on the discourse relationship between two adjacent basic discourse units and the discourse relationship between two adjacent basic discourse units and the remaining basic discourse units, construct the article rhetorical structure of the text. The article rhetorical structure is a binary tree structure, and the leaf nodes of the binary tree structure are the basic discourse units.

[0121] Furthermore, in the step of using each of the aforementioned texts, the corresponding actual structure score, and the rhetorical structure as training samples to input into the neural network model for model training until the loss function is minimized, and saving the model with the highest recognition rate as the text structure scoring model, the calculation steps for the loss function corresponding to a single text are as follows:

[0122] S301: Obtain the sentence representation vector corresponding to each of the basic discourse units;

[0123] S302: Based on the rhetorical structure of the article and the representation vectors of each sentence, the root node representation vector and several non-leaf node representation vectors of the rhetorical structure of the article are obtained by parsing.

[0124] S303: Perform discourse relation classification on the root node representation vector and each of the non-leaf node representation vectors to obtain the classifier output probability corresponding to each node; and calculate the score of the root node representation vector to obtain the predicted structure score.

[0125] S304: The loss function is calculated based on the classifier output probability, the predicted structure score, and the actual structure score.

[0126] Furthermore, the step of obtaining the sentence representation vector corresponding to each of the basic discourse units includes:

[0127] S3011: Input each of the basic text units into the BERT model to obtain the sentence representation vectors corresponding to each of the basic text units.

[0128] Furthermore, the step of parsing the root node representation vector and several non-leaf node representation vectors of the article's rhetorical structure based on the article's rhetorical structure and the representation vectors of each sentence includes:

[0129] S3021: According to the node level of each sentence representation vector in the article's rhetorical structure, combine two sentence representation vectors at the same level node in order from low to high to obtain the non-leaf node representation vector;

[0130] S3022: Combine the representation vectors of the two non-leaf nodes at the penultimate node level to obtain the root node representation vector.

[0131] The specific scoring method for the chapter structure is as follows:

[0132] A1: Get the articles to be rated;

[0133] A2: Input the article to be scored into the article structure scoring model for analysis to obtain the article structure score, wherein the article structure scoring model is a scoring model trained by any of the above-described article structure scoring models.

[0134] Preferably, the step of inputting the article to be scored into the discourse structure scoring model for analysis to obtain the discourse structure score includes:

[0135] A201: The rhetorical structure of the article to be scored is obtained through the analysis of rhetorical structure theory, and the sentence representation vectors corresponding to each sentence in the article to be scored are obtained.

[0136] A202: Based on the rhetorical structure of the article to be scored and the representation vectors of each sentence to be scored, the text representation vector corresponding to the article to be scored is obtained by combining them.

[0137] A203: Input the text representation vector into the fully connected layer for calculation to obtain the structure score.

[0138] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media provided in this application and in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0139] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, first object, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, first object, or method. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, first object, or method that includes that element.

[0140] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for training a discourse structure scoring model, wherein, The method comprises the following steps: obtaining a training corpus, wherein the training corpus comprises a plurality of texts, and each text is labeled with an actual structure score; analyzing the training corpus based on a rhetorical structure theory to obtain an article rhetorical structure corresponding to each text; inputting each text, the actual structure score corresponding to each text and the article rhetorical structure as a training sample into a neural network model to perform model training until a loss function is minimized, and saving a model with the highest recognition rate as a text structure scoring model; in the step of analyzing the training corpus based on the rhetorical structure theory to obtain an article rhetorical structure corresponding to each text, the analysis step of a single text comprises the following steps: segmenting the text into a plurality of basic discourse units; constructing an article rhetorical structure of the text according to the discourse relationship between adjacent two basic discourse units and the discourse relationship between adjacent two basic discourse units and the remaining basic discourse units, wherein the article rhetorical structure is a binary tree structure, and the leaf nodes of the binary tree structure are the basic discourse units; in the step of inputting each text, the actual structure score corresponding to each text and the article rhetorical structure as a training sample into a neural network model to perform model training until a loss function is minimized, and saving a model with the highest recognition rate as a text structure scoring model, the calculation step of a loss function corresponding to a single text comprises the following steps: obtaining a sentence representation vector corresponding to each basic discourse unit; analyzing a root node representation vector and a plurality of non-leaf node representation vectors of the article rhetorical structure according to the article rhetorical structure and the sentence representation vectors; performing discourse relationship classification on the root node representation vector and the non-leaf node representation vectors to obtain a classifier output probability corresponding to each node, and performing scoring calculation on the root node representation vector to obtain a predicted structure score; calculating the loss function according to the classifier output probability, the predicted structure score and the actual structure score; in the step of obtaining a sentence representation vector corresponding to each basic discourse unit, the step comprises the following steps: inputting each basic discourse unit into a BERT model to obtain a sentence representation vector corresponding to each basic discourse unit. 2.The method of Claim 1, wherein, in the step of analyzing a root node representation vector and a plurality of non-leaf node representation vectors of the article rhetorical structure according to the article rhetorical structure and the sentence representation vectors, the step comprises the following steps: combining two sentence representation vectors at the same node level from low to high in the article rhetorical structure to obtain the non-leaf node representation vectors; combining two non-leaf node representation vectors at the second last node level to obtain the root node representation vector.

3. A method of scoring a discourse structure, referring to the training method of the discourse structure scoring model according to any one of claims 1-2, wherein, The method comprises the following steps: obtaining an article to be scored; inputting the article to be scored into a discourse structure scoring model for analysis to obtain a structure score of the article to be scored, wherein the discourse structure scoring model is a scoring model trained by the training method of any one of claims 1-2.

4. The method of claim 3, wherein, The step of inputting the article to be scored into a discourse structure scoring model for analysis to obtain a structure score of the article to be scored comprises: obtaining an article to be scored rhetoric structure of the article to be scored by rhetoric structure theory analysis, and obtaining a to-be-scored sentence representation vector corresponding to each sentence in the article to be scored; combining the article to be scored rhetoric structure and each to-be-scored sentence representation vector to obtain a text representation vector corresponding to the article to be scored; inputting the text representation vector into a full connection layer for calculation to obtain the structure score.

5. An apparatus for training a discourse structure scoring model for implementing the method of scoring a discourse structure according to claim 4, wherein, comprises: a first obtaining module configured to obtain a training corpus, the training corpus comprising a plurality of discourse texts, each discourse text corresponding to an actual structure score marked; an analysis module configured to analyze the training corpus based on rhetoric structure theory to obtain an article rhetoric structure corresponding to each discourse text; a training module configured to input each discourse text, the actual structure score corresponding to each discourse text, and the article rhetoric structure as a training sample into a neural network model for model training until a loss function is minimized, and save a model with the highest recognition rate as the discourse structure scoring model.

6. A computer device comprising a memory and a processor, the memory having stored therein a computer program, wherein, The processor executes the computer program to implement the steps of the method of any one of claims 1-2.

7. A computer readable storage medium having stored thereon a computer program, wherein, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-2.

Citation Information

Patent Citations

  • Method and system for article grading

    CN107506360A

  • Method for automatically evaluating structural rationality of person describing composition chapter

    CN110427609A