An essay off-topic detection method and system

By extracting key features from topic sentences and essay codes using a neural network model, and utilizing attention mechanism layers and feature association layers, the problem of insufficient accuracy in detecting off-topic essays by machines is solved, achieving higher detection accuracy.

CN113901202BActive Publication Date: 2025-11-28SHANGHAI LIULISHUO INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010573536.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-22
Publication Date
2025-11-28
Estimated Expiration
2040-06-22

AI Technical Summary

Technical Problem

In current technology, the accuracy of machine-based essay off-topic detection still needs improvement.

Method used

A neural network model is used to extract key features of the question from the topic sentence encoding and key features of the answer from the essay encoding. An attention mechanism layer is used to determine the topic sentence that the essay focuses on and the features of the essay that the topic sentence focuses on. A feature association layer is combined to determine the associated feature pairs. The correlation coefficient is calculated by using the sigmoid function to improve the detection accuracy.

Benefits of technology

By reducing interference from useless features and ensuring the comprehensiveness of feature selection, the accuracy of essay off-topic detection is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113901202B_ABST
    Figure CN113901202B_ABST
Patent Text Reader

Abstract

The application provides an off-topic detection method and system for compositions. The method extracts key features of questions from topic sentence encoding by a neural network model, and extracts key features of answers from composition encoding. The key features of questions and answers are input into an attention mechanism layer, ensuring that the features input into the attention mechanism layer are key features, reducing interference caused by other useless features when the attention mechanism layer processes data, and improving the accuracy of data processing by the attention mechanism layer. On this basis, the attention mechanism layer determines the features of the topic sentence that the composition is concerned about, and the features of the composition that the topic sentence is concerned about, completing feature selection from two directions, ensuring the comprehensiveness of the selected features, enabling the neural network model to classify based on more comprehensive features, improving the accuracy of the classification result, and thereby improving the accuracy of the detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of off-topic detection, and particularly relates to an essay off-topic detection method and system. BACKGROUND

[0002] With the development of artificial intelligence technology, more and more work can be replaced by machines, such as off-topic detection of an essay can be performed by a machine.

[0003] Although off-topic detection of an essay by a machine can improve work efficiency, the accuracy of detection still needs to be improved. SUMMARY

[0004] To solve the above technical problems, an essay off-topic detection method and system are provided to improve the accuracy of answer text recognition, and the technical solutions are as follows:

[0005] An essay off-topic detection method comprises the following steps:

[0006] obtaining a theme sentence and an essay corresponding to the theme sentence;

[0007] an encoding layer obtains the theme sentence and the essay, encodes the theme sentence to obtain theme sentence encoding, and encodes the essay to obtain essay encoding;

[0008] a pre-trained neural network model obtains the theme sentence encoding and the essay encoding, extracts question key features from the theme sentence encoding, and extracts answer key features from the essay encoding;

[0009] an attention mechanism layer obtains the question key features and the answer key features, and determines features of the theme sentence focused on by the essay and features of the essay focused on by the theme sentence based on the question key features and the answer key features;

[0010] the neural network model obtains a classification result based on the features of the theme sentence focused on by the essay and the features of the essay focused on by the theme sentence, and the classification result is that the essay is off-topic or the essay is not off-topic.

[0011] The neural network model comprises a convolution layer and a pooling layer.

[0012] The question key features comprise:

[0013] convolution two-dimensional question features extracted from the theme sentence encoding by the convolution layer, and pooling one-dimensional question features obtained by the pooling layer based on the convolution two-dimensional features;

[0014] The answer key features comprise:

[0015] the convolutional two-dimensional answer feature extracted from the composition encoding, and the pooling one-dimensional answer feature obtained based on the convolutional two-dimensional answer feature by the pooling layer;

[0016] the attention mechanism layer obtains the question key feature and the answer key feature, and determines the feature of the theme sentence focused on by the composition and the feature of the composition focused on by the theme sentence based on the question key feature and the answer key feature, including:

[0017] the attention mechanism layer obtains the convolutional two-dimensional question feature and the pooling one-dimensional answer feature, and determines the feature of the theme sentence focused on by the composition based on the convolutional two-dimensional question feature and the pooling one-dimensional answer feature;

[0018] the attention mechanism layer obtains the convolutional two-dimensional answer feature and the pooling one-dimensional question feature, and determines the feature of the composition focused on by the theme sentence based on the convolutional two-dimensional answer feature and the pooling one-dimensional question feature.

[0019] the attention mechanism layer obtains the convolutional two-dimensional question feature and the pooling one-dimensional answer feature, and determines the feature of the theme sentence focused on by the composition based on the convolutional two-dimensional question feature and the pooling one-dimensional answer feature, including:

[0020] the attention mechanism layer obtains the theme sentence encoding, the convolutional two-dimensional question feature and the pooling one-dimensional answer feature, and determines the feature of the theme sentence focused on by the composition based on the theme sentence encoding, the convolutional two-dimensional question feature and the pooling one-dimensional answer feature;

[0021] the attention mechanism layer obtains the convolutional two-dimensional answer feature and the pooling one-dimensional question feature, and determines the feature of the composition focused on by the theme sentence based on the convolutional two-dimensional answer feature and the pooling one-dimensional question feature, including:

[0022] the attention mechanism layer obtains the theme sentence encoding, the convolutional two-dimensional question feature and the pooling one-dimensional answer feature, and determines the feature of the theme sentence focused on by the composition based on the theme sentence encoding, the convolutional two-dimensional question feature and the pooling one-dimensional answer feature;

[0023] the neural network model further includes, before obtaining the classification result based on the feature of the theme sentence focused on by the composition and the feature of the composition focused on by the theme sentence:

[0024] the attention mechanism layer combines the feature of the theme sentence focused on by the composition with the pooling one-dimensional answer feature to obtain an answer feature set;

[0025] The attention mechanism layer combines the features of the composition focused on by the topic sentence with the pooled one-dimensional question features to obtain a question feature set;

[0026] The feature association layer determines an association degree of the answer feature set and the question feature set according to the answer feature set and the question feature set, and determines an associated feature pair in the answer feature set and the question feature set based on the association degree.

[0027] The neural network model obtains a classification result based on the features of the topic sentence focused on by the composition and the features of the composition focused on by the topic sentence.

[0028] The neural network model obtains the associated feature pair and obtains a classification result based on the associated feature pair.

[0029] The determination of the association degree of the answer feature set and the question feature set includes:

[0030] The correlation coefficient of the answer feature set and the question feature set is determined by using a sigmoid function.

[0031] The neural network model obtains the associated feature pair and obtains a classification result based on the associated feature pair.

[0032] The neural network model obtains the associated feature pair, the features of the topic sentence focused on by the composition, and the features of the composition focused on by the topic sentence.

[0033] The neural network model obtains a classification result based on the associated feature pair, the features of the topic sentence focused on by the composition, and the features of the composition focused on by the topic sentence.

[0034] The neural network model includes a CNN model and / or an RNN model.

[0035] A composition off-topic detection system includes:

[0036] An acquisition module is configured to acquire a topic sentence and a composition corresponding to the topic sentence.

[0037] An encoding layer is configured to acquire the topic sentence and the composition, encode the topic sentence to obtain a topic sentence encoding, and encode the composition to obtain a composition encoding.

[0038] A neural network model is configured to acquire the topic sentence encoding and the composition encoding, extract a question key feature from the topic sentence encoding, and extract an answer key feature from the composition encoding.

[0039] an attention mechanism layer configured to obtain the question key feature and the answer key feature, and determine, based on the question key feature and the answer key feature, a feature of the theme sentence focused on by the composition and a feature of the composition focused on by the theme sentence;

[0040] The neural network model is further configured to obtain a classification result based on the feature of the theme sentence focused on by the composition and the feature of the composition focused on by the theme sentence, the classification result being that the composition is off-topic or the composition is not off-topic.

[0041] The neural network model comprises a convolution layer and a pooling layer.

[0042] The question key feature comprises:

[0043] The convolution layer extracts a convolution two-dimensional question feature from the theme sentence encoding, and the pooling layer obtains a pooling one-dimensional question feature based on the convolution two-dimensional question feature.

[0044] The answer key feature comprises:

[0045] The convolution layer extracts a convolution two-dimensional answer feature from the composition encoding, and the pooling layer obtains a pooling one-dimensional answer feature based on the convolution two-dimensional answer feature.

[0046] The attention mechanism layer is specifically configured to:

[0047] obtain the convolution two-dimensional question feature and the pooling one-dimensional answer feature, and determine, based on the convolution two-dimensional question feature and the pooling one-dimensional answer feature, the feature of the theme sentence focused on by the composition;

[0048] obtain the convolution two-dimensional answer feature and the pooling one-dimensional question feature, and determine, based on the convolution two-dimensional answer feature and the pooling one-dimensional question feature, the feature of the composition focused on by the theme sentence.

[0049] The attention mechanism layer is specifically configured to:

[0050] obtain the theme sentence encoding, the convolution two-dimensional question feature and the pooling one-dimensional answer feature, and determine, based on the theme sentence encoding, the convolution two-dimensional question feature and the pooling one-dimensional answer feature, the feature of the theme sentence focused on by the composition;

[0051] or,

[0052] obtain the composition encoding, the convolution two-dimensional answer feature and the pooling one-dimensional question feature, and determine, based on the composition encoding, the convolution two-dimensional answer feature and the pooling one-dimensional question feature, the feature of the composition focused on by the theme sentence.

[0053] The attention mechanism layer is further configured to:

[0054] combine the features of the theme sentence focused on by the composition with the pooled one-dimensional answer features to obtain an answer feature set;

[0055] combine the features of the composition focused on by the theme sentence with the pooled one-dimensional question features to obtain a question feature set;

[0056] The system further comprises:

[0057] a feature association layer configured to determine an association degree of the answer feature set and the question feature set according to the answer feature set and the question feature set, and determine an associated feature pair in the answer feature set and the question feature set based on the association degree.

[0058] The neural network model is specifically configured to:

[0059] obtain the associated feature pair and obtain a classification result based on the associated feature pair.

[0060] The feature association layer is specifically configured to:

[0061] determine a correlation coefficient of the answer feature set and the question feature set by using a sigmoid function.

[0062] The neural network model is specifically configured to:

[0063] obtain the associated feature pair, the features of the theme sentence focused on by the composition, and the features of the composition focused on by the theme sentence.

[0064] obtain a classification result based on the associated feature pair, the features of the theme sentence focused on by the composition, and the features of the composition focused on by the theme sentence.

[0065] The neural network model comprises a CNN model and / or an RNN model.

[0066] Compared with the prior art, the application has the following beneficial effects:

[0067] In the present application, the neural network model extracts the question key features from the topic sentence encoding and the answer key features from the composition encoding, inputs the question key features and the answer key features into the attention mechanism layer, ensures that the features input into the attention mechanism layer are key features, reduces the interference caused by other useless features when the attention mechanism layer processes data, and improves the accuracy of data processing of the attention mechanism layer. On this basis, the attention mechanism layer determines the features of the topic sentence concerned by the composition and the features of the composition concerned by the topic sentence, completes the selection of features from two directions, ensures the comprehensiveness of the selected features, enables the neural network model to classify based on more comprehensive features, improves the accuracy of the classification result, and thus improves the detection accuracy. BRIEF DESCRIPTION OF DRAWINGS

[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0069] Figure 1 is a flowchart of a composition off-topic detection method provided by the present application, embodiment 1;

[0070] Figure 2 is a principle schematic diagram of the attention mechanism layer provided by the present application;

[0071] Figure 3 is an interaction relationship schematic diagram of the encoding layer, the attention mechanism layer and the neural network model provided by the present application;

[0072] Figure 4 is a flowchart of a composition off-topic detection method provided by the present application, embodiment 2;

[0073] Figure 5 is an interaction relationship schematic diagram between the encoding layer, the attention mechanism layer, the neural network model and the feature association layer provided by the present application;

[0074] Figure 6 is a flowchart of a composition off-topic detection method provided by the present application, embodiment 3;

[0075] Figure 7 is a flowchart of a composition off-topic detection method provided by the present application, embodiment 4;

[0076] Figure 8 is another interaction relationship schematic diagram between the encoding layer, the attention mechanism layer, the neural network model and the feature association layer provided by the present application;

[0077] Figure 9 is a flowchart of an essay off-topic detection method embodiment 5 provided by the present application;

[0078] Figure 10 is another schematic diagram of the interaction relationship between the encoding layer, the attention mechanism layer, the neural network model, and the feature correlation layer provided by the present application. DETAILED DESCRIPTION

[0079] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0080] In order to make the above objectives, characteristics and advantages of the present application more obvious and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0081] As shown in Figure 1 is a flowchart of an essay off-topic detection method embodiment 1 provided by the present application, which can include the following steps:

[0082] Step S11, obtaining a theme sentence and an essay corresponding to the theme sentence.

[0083] The theme sentence can be understood as a sentence containing information such as writing range and requirements. The essay corresponding to the theme sentence can be understood as an essay completed based on the theme sentence.

[0084] In this embodiment, the obtaining method of the theme sentence and the essay corresponding to the theme sentence is not limited. For example, but not limited to, obtaining the theme sentence and the essay corresponding to the theme sentence from the test paper. Of course, the theme sentence and the essay corresponding to the theme sentence can also be obtained from the network.

[0085] Step S12, the encoding layer obtains the theme sentence and the essay, encodes the theme sentence to obtain the theme sentence encoding, and encodes the essay to obtain the essay encoding.

[0086] In this embodiment, the encoding layer obtaining the theme sentence and the essay can include but is not limited to:

[0087] The encoding layer actively obtains the theme sentence and the essay; or, the encoding layer passively receives the theme sentence and the essay.

[0088] Encoding the theme sentence and encoding the essay can be understood as encoding the theme sentence and encoding the essay according to the data processing format of the neural network model.

[0089] In the embodiment, the encoding layer can encode each word or punctuation mark in the topic sentence by using a pre-trained word vector model, and take the encoding result as the topic sentence encoding. The encoding layer can also encode each word or punctuation mark in the composition by using the pre-trained word vector model, and take the encoding result as the composition encoding.

[0090] The pre-trained word vector model can be, but is not limited to, a global vector (GloVe) model.

[0091] In step S13, the pre-trained neural network model obtains the topic sentence encoding and the composition encoding, extracts the question key features from the topic sentence encoding, and extracts the answer key features from the composition encoding.

[0092] The pre-trained neural network model obtaining the topic sentence encoding and the composition encoding can include, but is not limited to:

[0093] The pre-trained neural network model actively obtains the topic sentence encoding and the composition encoding, or the pre-trained neural network model passively receives the topic sentence encoding and the composition encoding.

[0094] Since the topic sentence encoding and the composition encoding are determined according to the data processing format of the neural network model, the neural network model extracts the question key features from the topic sentence encoding and the answer key features from the composition encoding, which can shorten the extraction time and improve the feature extraction efficiency.

[0095] In the embodiment, the neural network model includes a convolution layer and a pooling layer. The process of the neural network model extracting the question key features from the topic sentence encoding can include, but is not limited to:

[0096] In S131, the convolution layer extracts a convolution two-dimensional question feature from the topic sentence encoding.

[0097] In the convolution two-dimensional question feature, the row elements represent the convolution question features, and the column elements represent the dimensions of the convolution question features.

[0098] In S132, the convolution layer inputs the convolution two-dimensional question feature to the pooling layer of the neural network model. The pooling layer pools the convolution two-dimensional question feature to obtain a pooling one-dimensional question feature.

[0099] In S133, the convolution two-dimensional question feature and / or the pooling one-dimensional question feature are taken as the question key features.

[0100] The process of the neural network model extracting the answer key features from the composition encoding can include:

[0101] In S134, the convolution layer of the neural network model extracts a convolution two-dimensional answer feature from the composition encoding.

[0102] wherein, the row elements in the convolution two-dimensional answer feature represent the convolution answer feature, and the column elements represent the dimension of the convolution answer feature.

[0103] S135, the convolution layer inputs the convolution two-dimensional answer feature to a pooling layer of the neural network model, and the pooling layer pools the convolution two-dimensional answer feature to obtain a pooling one-dimensional answer feature.

[0104] S136, the convolution two-dimensional answer feature and / or the pooling one-dimensional answer feature are taken as answer key features.

[0105] The neural network model can be, but is not limited to, a CNN (Convolutional Neural Networks) model or an RNN (Recurrent Neural Networks) model.

[0106] Step S14, the attention mechanism layer obtains the question key features and the answer key features, and determines the features of the theme sentence focused by the composition and the features of the composition focused by the theme sentence based on the question key features and the answer key features.

[0107] The process of determining the features of the theme sentence focused by the composition based on the question key features and the answer key features by the attention mechanism layer can be referred to as Figure 2 , which can include the following steps:

[0108] S141, the answer key features are taken as query information (which can be represented as Query), the key and the value in the key-value pair are both set to the question key features, the similarity between the query information and the key is calculated, and the weight of the key is determined according to the similarity between the query information and the key;

[0109] S142, the weight of the key is normalized to obtain a normalized weight.

[0110] The normalization of the weight of the key can include, but is not limited to, the normalization of the weight of the key by using a SoftMax function.

[0111] The normalization of the weight of the key can facilitate subsequent data processing and reduce the amount of calculation.

[0112] S143, the result of weighted summation of the normalized weight and the value is taken as the features of the theme sentence focused by the composition.

[0113] The process of determining the features of the composition focused by the theme sentence based on the question key features and the answer key features by the attention mechanism layer can also be referred to as Figure 2Different is that Query, key and value are changed, and the process can include the following steps:

[0114] S144, set the question key feature as query information (which can be represented as Query), set the key and value in the key-value pair as answer key features, calculate the similarity between the query information and the key, and determine the weight of the key according to the similarity between the query information and the key;

[0115] S145, normalize the weight of the key to obtain the normalized weight.

[0116] The normalization of the weight of the key can facilitate subsequent data processing and reduce the amount of calculation.

[0117] S146, the weighted sum of the normalized weight and the value is taken as the feature of the composition concerned by the theme sentence.

[0118] In the embodiment, corresponding to the above steps S131-S136, the attention mechanism layer obtains the question key feature and the answer key feature, and determines the feature of the theme sentence concerned by the composition and the feature of the composition concerned by the theme sentence based on the question key feature and the answer key feature, which can include:

[0119] S147, the attention mechanism layer obtains the convolution two-dimensional question feature and the pooling one-dimensional answer feature input, and determines the feature of the theme sentence concerned by the composition based on the convolution two-dimensional question feature and the pooling one-dimensional answer feature.

[0120] The process of determining the feature of the theme sentence concerned by the composition based on the convolution two-dimensional question feature and the pooling one-dimensional answer feature by the attention mechanism layer can include:

[0121] S1471, set the pooling one-dimensional answer feature as query information (which can be represented as Query), set the key and value in the key-value pair as convolution two-dimensional question features, calculate the similarity between the query information and the key, and determine the weight of the key according to the similarity between the query information and the key;

[0122] S1472, normalize the weight of the key to obtain the normalized weight.

[0123] S1473, the weighted sum of the normalized weight and the value is taken as the feature of the theme sentence concerned by the composition.

[0124] S148, the attention mechanism layer obtains the convolution two-dimensional answer feature and the pooling one-dimensional question feature, and determines the feature of the composition concerned by the theme sentence based on the convolution two-dimensional answer feature and the pooling one-dimensional question feature.

[0125] The attention mechanism layer determines the features of the composition focused on by the topic sentence based on the convolutional two-dimensional answer features and the pooled one-dimensional question features, and can include:

[0126] S1481, the question key features are taken as query information (which can be represented as Query), the key and the value in the key-value pair are both set as the answer key features, the similarity between the query information and the key is calculated, and the weight of the key is determined according to the similarity between the query information and the key;

[0127] S1482, the weight of the key is normalized to obtain the normalized weight.

[0128] The normalization of the weight of the key can facilitate subsequent data processing and reduce the amount of calculation.

[0129] S1483, the result of weighted summation of the normalized weight and the value is taken as the feature of the composition focused on by the topic sentence.

[0130] Step S15, the neural network model obtains a classification result based on the features of the topic sentence focused on by the composition and the features of the composition focused on by the topic sentence, and the classification result is that the composition is off-topic or the composition is not off-topic.

[0131] In this embodiment, the neural network model is trained by using positive training samples and negative training samples. The positive training samples are the features of the topic sentence focused on by the off-topic composition and the features of the off-topic composition focused on by the topic sentence. The negative training samples are the features of the topic sentence focused on by the off-topic composition and the features of the off-topic composition focused on by the topic sentence.

[0132] The neural network model obtains a classification result based on the features of the topic sentence focused on by the composition and the features of the composition focused on by the topic sentence, and the classification result is that the composition is off-topic or the composition is not off-topic. It can be understood that the features of the topic sentence focused on by the composition and the features of the composition focused on by the topic sentence are input into the full connection layer of the neural network model, the full connection layer maps the features of the topic sentence focused on by the composition and the features of the composition focused on by the topic sentence to the class label, the class label is that the composition is off-topic or the composition is not off-topic, and the softmax function is used to calculate the probability that the features of the topic sentence focused on by the composition and the features of the composition focused on by the topic sentence are mapped to the off-topic composition, and the probability that the features of the topic sentence focused on by the composition and the features of the composition focused on by the topic sentence are mapped to the off-topic composition. The class label corresponding to the maximum probability of the two probabilities is taken as the classification result.

[0133] The neural network model is a binary classification model, and the output classification result has two types, which are off-topic composition or off-topic composition.

[0134] In this embodiment, the structure composed of the encoding layer, the attention mechanism layer and the neural network model can be understood as a deep learning model structure, and the interaction relationship among the encoding layer, the attention mechanism layer and the neural network model can be referred to Figure 3 As shown in Figure 3 , the encoding layer encodes the input theme sentence to obtain theme sentence encoding, and encodes the input composition to obtain composition encoding, and inputs the theme sentence encoding and the composition encoding into the neural network model; the convolution layer and the pooling layer of the neural network model extract question key features from the theme sentence encoding and answer key features from the composition encoding, and input the question key features and the answer key features into the attention mechanism layer; the attention mechanism layer determines the features of the theme sentence focused by the composition and the features of the composition focused by the theme sentence based on the question key features and the answer key features, and inputs the features of the theme sentence focused by the composition and the features of the composition focused by the theme sentence into the fully connected layer of the neural network model, and the fully connected layer outputs the classification result.

[0135] In this application, the neural network model extracts question key features from the theme sentence encoding and answer key features from the composition encoding, and inputs the question key features and the answer key features into the attention mechanism layer, which ensures that the features input into the attention mechanism layer are key features, reduces the interference caused by other useless features when the attention mechanism layer processes data, and improves the accuracy of data processing of the attention mechanism layer. On this basis, the attention mechanism layer determines the features of the theme sentence focused by the composition and the features of the composition focused by the theme sentence, completes the selection of features from two directions, ensures the comprehensiveness of the selected features, enables the neural network model to classify based on more comprehensive features, improves the accuracy of the classification result, and thus improves the accuracy of the detection.

[0136] As another optional embodiment of the present application, refer to Figure 4 , the flowchart of an embodiment 2 of the composition off-topic detection method provided by the present application, the embodiment mainly describes the detailed scheme of the composition off-topic detection method described in the above embodiment 1, as shown in Figure 4 , the method can include but is not limited to the following steps:

[0137] Step S21, obtaining a theme sentence and a composition corresponding to the theme sentence;

[0138] Step S22, the encoding layer obtains the theme sentence and the composition, encodes the theme sentence to obtain theme sentence encoding, and encodes the composition to obtain composition encoding;

[0139] Step S23, the pre-trained neural network model obtains the theme sentence encoding and the composition encoding, extracts question key features from the theme sentence encoding, and extracts answer key features from the composition encoding;

[0140] Step S24, the attention mechanism layer obtains the convolutional two-dimensional question feature and the pooled one-dimensional answer feature, and determines the feature of the theme sentence focused on by the composition based on the convolutional two-dimensional question feature and the pooled one-dimensional answer feature;

[0141] Step S25, the attention mechanism layer obtains the convolutional two-dimensional answer feature and the pooled one-dimensional question feature, and determines the feature of the composition focused on by the theme sentence based on the convolutional two-dimensional answer feature and the pooled one-dimensional question feature.

[0142] The detailed processes of steps S21-S25 can refer to the related introduction of steps S11-S14 in embodiment 1, which will not be described here.

[0143] Step S26, the feature association layer combines the feature of the theme sentence focused on by the composition and the pooled one-dimensional answer feature to obtain an answer feature set.

[0144] As introduced in steps S134-S136 in embodiment 1, the pooled one-dimensional answer feature is the feature obtained by the pooling layer of the neural network model on the convolutional two-dimensional answer feature.

[0145] Combining the feature of the theme sentence focused on by the composition and the pooled one-dimensional answer feature can include but is not limited to splicing the feature of the theme sentence focused on by the composition and the pooled one-dimensional answer feature.

[0146] Step S27, the feature association layer combines the feature of the composition focused on by the theme sentence and the pooled one-dimensional question feature to obtain a question feature set.

[0147] As introduced in steps S131-S133 in embodiment 1, the pooled one-dimensional question feature is the feature obtained by the pooling layer of the neural network model on the convolutional two-dimensional question feature.

[0148] Combining the feature of the composition focused on by the theme sentence and the pooled one-dimensional question feature can include but is not limited to splicing the feature of the composition focused on by the theme sentence and the pooled one-dimensional question feature.

[0149] Step S28, the feature association layer determines the association degree of the answer feature set and the question feature set according to the answer feature set and the question feature set, and determines the associated feature pair in the answer feature set and the question feature set based on the association degree.

[0150] Determining the association degree of the answer feature set and the question feature set can include:

[0151] The correlation coefficient of two feature sets is determined by using a sigmoid function:

[0152] g = sigmoid(W g [c ~R , c ~P ])

[0153] wherein g represents a correlation coefficient of two features in a feature pair, W g represents a weight, c ~R represents a set of answer features, c ~P represents a set of question features, and [c ~R , c ~P ] represents concatenation of the two sets of features.

[0154] Based on the correlation degree, the associated feature pair in the set of answer features and the set of question features is determined, which can include:

[0155] The associated feature pair in the set of answer features and the set of question features is determined by using the following relationship: [c ~R , c ~P ] * = g o [c ~R , c ~P ]

[0156] wherein [c ~R , c ~P ] * represents the associated feature pair, [c ~R , c ~P ] represents the concatenated feature pair, g represents a correlation coefficient of two features in a feature pair, and o represents element product.

[0157] In step S29, the neural network model obtains the associated feature pair and obtains the classification result based on the associated feature pair.

[0158] In this embodiment, the feature association layer can effectively control the relevance of the theme sentence and the composition, obtain the associated feature pair, ensure that the neural network model can obtain the classification result based on the associated feature pair, and improve the accuracy of classification.

[0159] In this embodiment, compared with the deep learning model structure in embodiment 1, a feature association layer is added, and correspondingly, the interaction relationship between the encoding layer, the attention mechanism layer, the neural network model and the feature association layer can be referred to Figure 5 As shown in Figure 5 , the encoding layer encodes the input theme sentence to obtain theme sentence encoding, and encodes the input composition to obtain composition encoding, and inputs the theme sentence encoding and the composition encoding into the neural network model.

[0160] The convolutional layer of the neural network model extracts convolutional two-dimensional question features from the topic sentence encoding, and the pooling layer obtains the pooling one-dimensional question features based on the convolutional two-dimensional features; the convolutional layer of the neural network model extracts convolutional two-dimensional answer features from the composition encoding, and the pooling layer obtains the pooling one-dimensional answer features based on the convolutional two-dimensional answer features;

[0161] The attention mechanism layer obtains the convolutional two-dimensional question features and the pooling one-dimensional answer features, and determines the features of the topic sentence focused on by the composition based on the convolutional two-dimensional question features and the pooling one-dimensional answer features; the attention mechanism layer obtains the convolutional two-dimensional answer features and the pooling one-dimensional question features, and determines the features of the composition focused on by the topic sentence based on the convolutional two-dimensional answer features and the pooling one-dimensional question features.

[0162] The feature association layer combines the features of the topic sentence focused on by the composition with the pooling one-dimensional answer features to obtain an answer feature set, and combines the features of the composition focused on by the topic sentence with the pooling one-dimensional question features to obtain a question feature set; the feature association layer determines the association degree of the answer feature set and the question feature set according to the answer feature set and the question feature set, and determines the associated feature pair in the answer feature set and the question feature set based on the association degree.

[0163] The neural network model obtains the associated feature pair, and obtains a classification result based on the associated feature pair.

[0164] As another optional embodiment of the present application, referring to Figure 6 , a flowchart of an off-topic composition detection method embodiment 3 provided by the present application, the present embodiment mainly describes a detailed scheme of the off-topic composition detection method described in the above embodiment 2, as shown in the figure, the method can include but is not limited to the following steps: Figure 6

[0165] Step S31, obtaining a topic sentence and a composition corresponding to the topic sentence;

[0166] Step S32, the encoding layer obtains the topic sentence and the composition, encodes the topic sentence to obtain topic sentence encoding, and encodes the composition to obtain composition encoding;

[0167] Step S33, the pre-trained neural network model obtains the topic sentence encoding and the composition encoding, extracts question key features from the topic sentence encoding, and extracts answer key features from the composition encoding;

[0168] Step S34, the attention mechanism layer obtains the convolutional two-dimensional question features and the pooling one-dimensional answer features, and determines the features of the topic sentence focused on by the composition based on the convolutional two-dimensional question features and the pooling one-dimensional answer features;

[0169] ​Step S35, the attention mechanism layer obtains the convolution two-dimensional answer feature and the pooling one-dimensional question feature, and determines the feature of the composition focused by the theme sentence based on the convolution two-dimensional answer feature and the pooling one-dimensional question feature.

[0170] Step S36, the attention mechanism layer combines the feature of the theme sentence focused by the composition with the pooling one-dimensional answer feature to obtain an answer feature set.

[0171] Step S37, the attention mechanism layer combines the feature of the composition focused by the theme sentence with the pooling one-dimensional question feature to obtain a question feature set.

[0172] Step S38, the feature association layer determines the association degree of the answer feature set and the question feature set according to the answer feature set and the question feature set, and determines the associated feature pair in the answer feature set and the question feature set based on the association degree.

[0173] The detailed process of steps S31-S38 can be referred to the related introduction of steps S21-S28 in embodiment 2, and will not be described here.

[0174] Step S39, the neural network model obtains the associated feature pair, the feature of the theme sentence focused by the composition, and the feature of the composition focused by the theme sentence.

[0175] The neural network model obtaining the associated feature pair, the feature of the theme sentence focused by the composition, and the feature of the composition focused by the theme sentence can include:

[0176] The associated feature pair, the feature of the theme sentence focused by the composition, and the feature of the composition focused by the theme sentence are spliced to obtain a first short connection;

[0177] The first short connection is input into the neural network model.

[0178] Step S310, the neural network model obtains a classification result based on the associated feature pair, the feature of the theme sentence focused by the composition, and the feature of the composition focused by the theme sentence.

[0179] Steps S39-S310 are a specific implementation of step S29 in embodiment 2.

[0180] In this embodiment, the neural network model obtains the associated feature pair, the feature of the theme sentence focused by the composition, and the feature of the composition focused by the theme sentence, so that the input of the neural network model not only contains the information output by the feature association layer, but also contains the information output by the attention mechanism layer, ensuring that the neural network model not only has the ability to learn the identity mapping, but also has the ability to learn other mappings, which can enhance the expression ability of the deep learning model, and then the neural network model obtains the classification result based on the associated feature pair, the feature of the theme sentence focused by the composition, and the feature of the composition focused by the theme sentence, which can improve the accuracy of the classification result.

[0181] In addition, the first short connection can make information flow more easily between layers, providing feature reuse when forward propagating.

[0182] As another optional embodiment of the present application, referring to Figure 7 The flowchart of the composition off-topic detection method embodiment 4 provided by the present application is mainly a detailed scheme of the composition off-topic detection method described in the above embodiment 2. As shown in the figure, Figure 7 The method can include but is not limited to the following steps:

[0183] Step S41, obtaining a theme sentence and a composition corresponding to the theme sentence;

[0184] Step S42, the encoding layer obtains the theme sentence and the composition, encodes the theme sentence to obtain theme sentence encoding, and encodes the composition to obtain composition encoding;

[0185] Step S43, the pre-trained neural network model obtains the theme sentence encoding and the composition encoding, extracts convolutional two-dimensional question features and pooling one-dimensional question features from the theme sentence encoding, and extracts convolutional two-dimensional answer features and pooling one-dimensional answer features from the composition encoding;

[0186] The process of extracting convolutional two-dimensional question features and pooling one-dimensional question features from the theme sentence encoding can be referred to the related introduction of steps S131-S133 in embodiment 1, which will not be repeated here.

[0187] The process of extracting convolutional two-dimensional answer features and pooling one-dimensional answer features from the composition encoding can be referred to the related introduction of steps S34-S136 in embodiment 1, which will not be repeated here.

[0188] Step S44, the attention mechanism layer obtains the theme sentence encoding, the convolutional two-dimensional question features, and the pooling one-dimensional answer features, and determines the feature of the theme sentence focused by the composition based on the theme sentence encoding, the convolutional two-dimensional question features, and the pooling one-dimensional answer features.

[0189] In this embodiment, the attention mechanism layer obtains the topic sentence encoding, the convolution two-dimensional question feature and the pooling one-dimensional answer feature, and determines the feature of the topic sentence concerned by the composition based on the topic sentence encoding, the convolution two-dimensional question feature and the pooling one-dimensional answer feature, which can include:

[0190] The topic sentence encoding, the convolution two-dimensional question feature and the pooling one-dimensional answer feature are spliced to obtain a second short connection.

[0191] The second short connection is input into the attention mechanism layer.

[0192] Based on the second short connection, the feature of the topic sentence concerned by the composition is determined.

[0193] Step S44 is a specific implementation of step S24 in Embodiment 2.

[0194] Step S45, the attention mechanism layer obtains the composition encoding, the convolution two-dimensional answer feature and the pooling one-dimensional question feature, and determines the feature of the composition concerned by the topic sentence based on the composition encoding, the convolution two-dimensional answer feature and the pooling one-dimensional question feature.

[0195] The attention mechanism layer obtains the composition encoding, the convolution two-dimensional answer feature and the pooling one-dimensional question feature, and determines the feature of the composition concerned by the topic sentence based on the composition encoding, the convolution two-dimensional answer feature and the pooling one-dimensional question feature, which can include:

[0196] The composition encoding, the convolution two-dimensional answer feature and the pooling one-dimensional question feature are spliced to obtain a third short connection.

[0197] The third short connection is input into the attention mechanism layer.

[0198] The attention mechanism layer determines the feature of the composition concerned by the topic sentence based on the third short connection.

[0199] Step S45 is a specific implementation of step S25 in Embodiment 2.

[0200] Step S46, the attention mechanism layer combines the feature of the topic sentence concerned by the composition with the pooling one-dimensional answer feature to obtain an answer feature set.

[0201] Step S47, the attention mechanism layer combines the feature of the composition concerned by the topic sentence with the pooling one-dimensional question feature to obtain a question feature set.

[0202] Step S48, the feature association layer determines the association degree of the answer feature set and the question feature set according to the answer feature set and the question feature set, and determines the associated feature pair in the answer feature set and the question feature set based on the association degree.

[0203] Step S49, the neural network model obtains the associated feature pairs, and obtains a classification result based on the associated feature pairs.

[0204] The detailed process of steps S46-S49 can refer to the related introduction of steps S26-S29 in Embodiment 2, which will not be repeated here.

[0205] In this embodiment, the attention mechanism layer obtains the topic sentence encoding, the convolution two-dimensional question feature and the pooling one-dimensional answer feature, obtains the composition encoding, the convolution two-dimensional answer feature and the pooling one-dimensional question feature, so that the input of the attention mechanism layer not only contains the local keyword information of the composition and the topic sentence (such as the convolution two-dimensional question feature and the pooling one-dimensional answer feature or the convolution two-dimensional answer feature and the pooling one-dimensional question feature), but also contains the information of the encoding layer (i.e., the topic sentence encoding or the composition encoding), which guarantees the ability of the attention mechanism layer to learn the identity mapping and also has the ability to learn other mappings, can enhance the expression ability of the deep learning model, and then, based on the topic sentence encoding, the convolution two-dimensional question feature and the pooling one-dimensional answer feature, the feature of the topic sentence concerned by the composition is determined, and based on the composition encoding, the convolution two-dimensional answer feature and the pooling one-dimensional question feature, the feature of the composition concerned by the topic sentence is determined, which can improve the accuracy of the classification result.

[0206] In addition, the second short connection and the third short connection can make the information (such as the topic sentence encoding or the composition encoding) flow more easily between layers, providing feature reuse when forward propagation.

[0207] In this embodiment, compared with the deep learning model structure in Embodiment 2, the interaction relationship between the encoding layer, the attention mechanism layer, the neural network model and the feature association layer can refer to Figure 8 As shown in Figure 8 the encoding layer encodes the input topic sentence to obtain the topic sentence encoding, and encodes the input composition to obtain the composition encoding, and inputs the topic sentence encoding and the composition encoding to the neural network model;

[0208] The convolution layer of the neural network model extracts the convolution two-dimensional question feature from the topic sentence encoding, and the pooling layer obtains the pooling one-dimensional question feature based on the convolution two-dimensional feature; the convolution layer of the neural network model extracts the convolution two-dimensional answer feature from the composition encoding, and the pooling layer obtains the pooling one-dimensional answer feature based on the convolution two-dimensional answer feature;

[0209] The attention mechanism layer obtains the topic sentence encoding, the convolution two-dimensional question feature and the pooling one-dimensional answer feature, and determines the feature of the topic sentence concerned by the composition based on the topic sentence encoding, the convolution two-dimensional question feature and the pooling one-dimensional answer feature; the attention mechanism layer obtains the composition encoding, the convolution two-dimensional answer feature and the pooling one-dimensional question feature, and determines the feature of the composition concerned by the topic sentence based on the composition encoding, the convolution two-dimensional answer feature and the pooling one-dimensional question feature;

[0210] The attention mechanism layer combines the features of the theme sentence concerned by the composition with the pooled one-dimensional answer features to obtain an answer feature set, and combines the features of the composition concerned by the theme sentence with the pooled one-dimensional question features to obtain a question feature set.

[0211] The feature association layer determines the association degree of the answer feature set and the question feature set according to the answer feature set and the question feature set, and determines the associated feature pair in the answer feature set and the question feature set based on the association degree.

[0212] The neural network model obtains the associated feature pair and obtains a classification result based on the associated feature pair.

[0213] As another optional embodiment of the present application, referring to Figure 9 , the flowchart of the composition off-topic detection method embodiment 5 provided by the present application, the present embodiment mainly describes the detailed scheme of the composition off-topic detection method described in the above embodiment 4, as shown in the figure, the method can include but is not limited to the following steps: Figure 9

[0214] Step S51, obtaining a theme sentence and a composition corresponding to the theme sentence;

[0215] Step S52, the encoding layer obtains the theme sentence and the composition, encodes the theme sentence to obtain theme sentence encoding, and encodes the composition to obtain composition encoding;

[0216] Step S53, the pre-trained neural network model obtains the theme sentence encoding and the composition encoding, extracts the convolution two-dimensional question features and the pooled one-dimensional question features from the theme sentence encoding, and extracts the convolution two-dimensional answer features and the pooled one-dimensional answer features from the composition encoding;

[0217] Step S54, the attention mechanism layer obtains the theme sentence encoding, the convolution two-dimensional question features and the pooled one-dimensional answer features, and determines the features of the theme sentence concerned by the composition based on the theme sentence encoding, the convolution two-dimensional question features and the pooled one-dimensional answer features.

[0218] Step S55, the attention mechanism layer obtains the composition encoding, the convolution two-dimensional answer features and the pooled one-dimensional question features, and determines the features of the composition concerned by the theme sentence based on the composition encoding, the convolution two-dimensional answer features and the pooled one-dimensional question features.

[0219] Step S56, the attention mechanism layer combines the features of the theme sentence concerned by the composition with the pooled one-dimensional answer features to obtain an answer feature set.

[0220] ​Step S57, the attention mechanism layer combines the features of the composition focused on by the topic sentence with the pooled one-dimensional question features to obtain a question feature set.

[0221] Step S58, the feature association layer determines the association degree of the answer feature set and the question feature set according to the answer feature set and the question feature set, and determines the associated feature pair in the answer feature set and the question feature set based on the association degree.

[0222] The detailed processes of steps S51-S58 can be referred to the related descriptions of steps S41-S48 in Embodiment 4, which will not be repeated here.

[0223] Step S59, the neural network model obtains the associated feature pair, the features of the topic sentence focused on by the composition, and the features of the composition focused on by the topic sentence.

[0224] Step S510, the neural network model obtains the classification result based on the associated feature pair, the features of the topic sentence focused on by the composition, and the features of the composition focused on by the topic sentence.

[0225] Steps S59-S510 are a specific implementation of step S49 in Embodiment 4.

[0226] In this embodiment, the information obtained by the attention mechanism layer and the neural network model is more abundant, which ensures that the attention mechanism layer and the neural network model not only have the ability to learn the identity mapping, but also have the ability to learn other mappings, can enhance the expression ability of the deep learning model, and further ensure that the classification result obtained by the neural network model is more accurate.

[0227] In addition, the first short connection, the second short connection and the third short connection can make the information flow more easily between the layers, and provide feature reuse when forward propagation.

[0228] In this embodiment, compared with the deep learning model structure in Embodiment 4, the interaction relationship between the encoding layer, the attention mechanism layer, the neural network model and the feature association layer can be referred to Figure 10 As shown in Figure 10 The encoding layer encodes the input topic sentence to obtain topic sentence encoding, and encodes the input composition to obtain composition encoding, and inputs the topic sentence encoding and the composition encoding to the neural network model.

[0229] The convolution layer of the neural network model extracts convolution two-dimensional question features from the topic sentence encoding, and the pooling layer obtains pooled one-dimensional question features based on the convolution two-dimensional question features; the convolution layer of the neural network model extracts convolution two-dimensional answer features from the composition encoding, and the pooling layer obtains pooled one-dimensional answer features based on the convolution two-dimensional answer features.

[0230] The attention mechanism layer obtains the topic sentence encoding, the convolution two-dimensional question feature, and the pooling one-dimensional answer feature, and determines the feature of the topic sentence focused on by the composition based on the topic sentence encoding, the convolution two-dimensional question feature, and the pooling one-dimensional answer feature; the attention mechanism layer obtains the composition encoding, the convolution two-dimensional answer feature, and the pooling one-dimensional question feature, and determines the feature of the composition focused on by the topic sentence based on the composition encoding, the convolution two-dimensional answer feature, and the pooling one-dimensional question feature;

[0231] The feature of the topic sentence focused on by the composition is combined with the pooling one-dimensional answer feature to obtain an answer feature set; and the feature of the composition focused on by the topic sentence is combined with the pooling one-dimensional question feature to obtain a question feature set;

[0232] The feature association layer determines the association degree of the answer feature set and the question feature set according to the answer feature set and the question feature set, and determines the associated feature pair in the answer feature set and the question feature set based on the association degree.

[0233] The neural network model obtains the associated feature pair, the feature of the topic sentence focused on by the composition, and the feature of the composition focused on by the topic sentence; and the neural network model obtains a classification result based on the associated feature pair, the feature of the topic sentence focused on by the composition, and the feature of the composition focused on by the topic sentence.

[0234] Next, the composition off-topic detection system provided in the present application is introduced, and the composition off-topic detection system introduced below can be correspondingly referred to the composition off-topic detection method introduced above.

[0235] The composition off-topic detection system comprises an acquisition module, an encoding layer, a neural network model, and an attention mechanism layer.

[0236] The acquisition module is configured to acquire a topic sentence and a composition corresponding to the topic sentence.

[0237] The encoding layer is configured to acquire the topic sentence and the composition, encode the topic sentence to obtain topic sentence encoding, and encode the composition to obtain composition encoding.

[0238] The neural network model is configured to acquire the topic sentence encoding and the composition encoding, extract a question key feature from the topic sentence encoding, and extract an answer key feature from the composition encoding.

[0239] The attention mechanism layer is configured to acquire the question key feature and the answer key feature, and determine the feature of the topic sentence focused on by the composition and the feature of the composition focused on by the topic sentence based on the question key feature and the answer key feature.

[0240] The neural network model is further configured to obtain a classification result based on the feature of the theme sentence focused on by the composition and the feature of the composition focused on by the theme sentence, the classification result being that the composition is off-topic or the composition is not off-topic.

[0241] In this embodiment, the question key features include:

[0242] The convolutional layer of the neural network model extracts convolutional two-dimensional question features from the theme sentence encoding, and the pooling layer obtains pooling one-dimensional question features based on the convolutional two-dimensional question features;

[0243] The answer key features include:

[0244] The convolutional layer of the neural network model extracts convolutional two-dimensional answer features from the composition encoding, and the pooling layer obtains pooling one-dimensional answer features based on the convolutional two-dimensional answer features;

[0245] The attention mechanism layer can be specifically configured to:

[0246] The convolutional two-dimensional question features and the pooling one-dimensional answer features are obtained, and the feature of the theme sentence focused on by the composition is determined based on the convolutional two-dimensional question features and the pooling one-dimensional answer features;

[0247] The convolutional two-dimensional answer features and the pooling one-dimensional question features are obtained, and the feature of the composition focused on by the theme sentence is determined based on the convolutional two-dimensional answer features and the pooling one-dimensional question features.

[0248] In this embodiment, the attention mechanism layer can be specifically configured to:

[0249] The theme sentence encoding, the convolutional two-dimensional question features, and the pooling one-dimensional answer features are obtained, and the feature of the theme sentence focused on by the composition is determined based on the theme sentence encoding, the convolutional two-dimensional question features, and the pooling one-dimensional answer features;

[0250] Or,

[0251] The composition encoding, the convolutional two-dimensional answer features, and the pooling one-dimensional question features are obtained, and the feature of the composition focused on by the theme sentence is determined based on the composition encoding, the convolutional two-dimensional answer features, and the pooling one-dimensional question features.

[0252] In this embodiment, the attention mechanism layer can be further configured to:

[0253] The feature of the theme sentence focused on by the composition and the pooling one-dimensional answer features are combined to obtain an answer feature set;

[0254] combining the characteristics of the composition concerned by the theme sentence and the pooled one-dimensional question characteristics, to obtain a question characteristic set;

[0255] The system can further include:

[0256] a characteristic association layer configured to determine an association degree of the answer characteristic set and the question characteristic set according to the answer characteristic set and the question characteristic set, and determine an associated characteristic pair in the answer characteristic set and the question characteristic set based on the association degree;

[0257] The neural network model can be specifically configured to:

[0258] obtain the associated characteristic pair, and obtain a classification result based on the associated characteristic pair.

[0259] The characteristic association layer can be specifically configured to:

[0260] determine the correlation coefficient of the answer characteristic set and the question characteristic set by using a sigmoid function.

[0261] The neural network model can be specifically configured to:

[0262] obtain the associated characteristic pair, the characteristics of the theme sentence concerned by the composition, and the characteristics of the composition concerned by the theme sentence.

[0263] obtain a classification result based on the associated characteristic pair, the characteristics of the theme sentence concerned by the composition, and the characteristics of the composition concerned by the theme sentence.

[0264] The neural network model can include a CNN model or an RNN model.

[0265] It should be noted that each embodiment focuses on the difference from other embodiments, and the same or similar parts between embodiments can be referred to each other. For system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.

[0266] Finally, it is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting; it is also to be understood that where the construction of a claim or claims is not explicitly recited in the specification, it is intended that the claim or claims be construed in accordance with 35 U.S.C. § 112(a) unless and except as specifically limited by the following claims. In this case, the reference numerals in the claims are merely provided as consistency checks.

[0267] For the convenience of description, the above system is described in various units by function. Of course, the functions of the units can be implemented in the same or more software and / or hardware in the implementation of the present application.

[0268] From the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software and the necessary general hardware platform. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments of the present application.

[0269] The above provides a kind of composition off-topic detection method and system provided by the present application, the principle and implementation of the present application are described in this paper by specific examples, the above embodiment is only used to help understand the method of the present application and its core idea;For those skilled in the art, according to the idea of the present application, there will be changes in specific implementation and application range, and the above description should not be understood as the limitation of the present application.

Claims

1. An essay off-topic detection method, characterized in that, The method comprises the following steps: obtaining a topic sentence and an essay corresponding to the topic sentence; an encoding layer obtains the topic sentence and the essay, encodes the topic sentence to obtain a topic sentence encoding, and encodes the essay to obtain an essay encoding; a pre-trained neural network model obtains the topic sentence encoding and the essay encoding, extracts question key features from the topic sentence encoding, and extracts answer key features from the essay encoding; the neural network model comprises a convolution layer and a pooling layer; wherein the process of extracting question key features from the topic sentence encoding comprises: the convolution layer extracts convolution two-dimensional question features from the topic sentence encoding, the convolution layer inputs the convolution two-dimensional question features into the pooling layer of the neural network model, the pooling layer pools the convolution two-dimensional question features to obtain pooling one-dimensional question features, and the convolution two-dimensional question features and / or the pooling one-dimensional question features are taken as the question key features; the process of extracting answer key features from the essay encoding comprises: the convolution layer extracts convolution two-dimensional answer features from the essay encoding, the convolution layer inputs the convolution two-dimensional answer features into the pooling layer of the neural network model, the pooling layer pools the convolution two-dimensional answer features to obtain pooling one-dimensional answer features, and the convolution two-dimensional answer features and / or the pooling one-dimensional answer features are taken as the answer key features; an attention mechanism layer obtains the question key features and the answer key features, and determines, based on the question key features and the answer key features, features of the topic sentence focused on by the essay and features of the essay focused on by the topic sentence; the neural network model obtains a classification result based on the features of the topic sentence focused on by the essay and the features of the essay focused on by the topic sentence, and the classification result is that the essay is off-topic or the essay is not off-topic.

2. The method of claim 1, wherein, The attention mechanism layer obtains the question key features and the answer key features, and determines, based on the question key features and the answer key features, features of the topic sentence focused on by the essay and features of the essay focused on by the topic sentence, comprising: the attention mechanism layer obtains the convolution two-dimensional question features and the pooling one-dimensional answer features, and determines, based on the convolution two-dimensional question features and the pooling one-dimensional answer features, the features of the topic sentence focused on by the essay; the attention mechanism layer obtains the convolution two-dimensional answer features and the pooling one-dimensional question features, and determines, based on the convolution two-dimensional answer features and the pooling one-dimensional question features, the features of the essay focused on by the topic sentence.

3. The method of claim 2, wherein, The attention mechanism layer obtains the convolution two-dimensional question features and the pooling one-dimensional answer features, and determines, based on the convolution two-dimensional question features and the pooling one-dimensional answer features, the features of the topic sentence focused on by the essay, comprising: the attention mechanism layer obtains the topic sentence encoding, the convolution two-dimensional question features, and the pooling one-dimensional answer features, and determines, based on the topic sentence encoding, the convolution two-dimensional question features, and the pooling one-dimensional answer features, the features of the topic sentence focused on by the essay; The attention mechanism layer acquires the convolutional two-dimensional answer features and the pooling one-dimensional question features, and based on the convolutional two-dimensional answer features and the pooling one-dimensional question features, determines the features of the essay that the topic sentence focuses on, including: The attention mechanism layer acquires the essay encoding, the convolutional two-dimensional answer features, and the pooling one-dimensional question features, and determines the features of the essay that the topic sentence focuses on based on the essay encoding, the convolutional two-dimensional answer features, and the pooling one-dimensional question features.

4. The method according to claim 2 or 3, characterized in that, Before obtaining the classification result based on the features of the topic sentence that the essay focuses on, and the features of the essay that the topic sentence focuses on, the neural network model further includes: The attention mechanism layer combines the features of the topic sentence that the essay focuses on with the pooled one-dimensional answer features to obtain the answer feature set; The attention mechanism layer combines the features of the essay that the topic sentence focuses on with the pooled one-dimensional question features to obtain a set of question features; The feature association layer determines the degree of association between the answer feature set and the question feature set based on the answer feature set and the question feature set, and determines the associated feature pairs between the answer feature set and the question feature set based on the degree of association; The neural network model, based on the features of the topic sentence that the essay focuses on, and the features of the essay that the topic sentence focuses on, obtains a classification result, including: The neural network model acquires the associated feature pairs and obtains the classification result based on the associated feature pairs.

5. The method of claim 4, wherein, Determining the correlation between the answer feature set and the question feature set includes: The correlation coefficient between the answer feature set and the question feature set is determined using the sigmoid function.

6. The method of claim 4, wherein, The neural network model acquires the associated feature pairs and, based on the associated feature pairs, obtains classification results, including: The neural network model acquires the associated feature pairs, the features of the topic sentence that the essay focuses on, and the features of the essay that the topic sentence focuses on; The neural network model obtains the classification result based on the associated feature pairs, the features of the topic sentence that the essay focuses on, and the features of the essay that the topic sentence focuses on.

7. The method according to any one of claims 1 to 6, characterized in that, The neural network model includes: CNN model and / or RNN model.

8. An off-task detection system for essays, the system comprising: include: The acquisition module is used to acquire the topic sentence and the essay corresponding to the topic sentence; An encoding layer is used to obtain the topic sentence and the essay, encode the topic sentence to obtain the topic sentence code, and encode the essay to obtain the essay code; a neural network model configured to obtain the topic sentence encoding and the composition encoding, extract question key features from the topic sentence encoding, and extract answer key features from the composition encoding; the neural network model comprises a convolution layer and a pooling layer; wherein the process of extracting question key features from the topic sentence encoding comprises: the convolution layer extracts convolution two-dimensional question features from the topic sentence encoding, the convolution layer inputs the convolution two-dimensional question features into the pooling layer of the neural network model, the pooling layer pools the convolution two-dimensional question features to obtain pooling one-dimensional question features, and the convolution two-dimensional question features and / or the pooling one-dimensional question features are taken as the question key features; the process of extracting answer key features from the composition encoding comprises: the convolution layer extracts convolution two-dimensional answer features from the composition encoding, the convolution layer inputs the convolution two-dimensional answer features into the pooling layer of the neural network model, the pooling layer pools the convolution two-dimensional answer features to obtain pooling one-dimensional answer features, and the convolution two-dimensional answer features and / or the pooling one-dimensional answer features are taken as the answer key features; an attention mechanism layer configured to obtain the question key features and the answer key features, and determine, based on the question key features and the answer key features, features of the topic sentence focused on by the composition and features of the composition focused on by the topic sentence; the neural network model is further configured to obtain a classification result based on the features of the topic sentence focused on by the composition and the features of the composition focused on by the topic sentence, the classification result being that the composition is off-topic or the composition is not off-topic.

9. The system of claim 8, wherein, The attention mechanism layer is specifically configured to: obtain the convolution two-dimensional question features and the pooling one-dimensional answer features, and determine, based on the convolution two-dimensional question features and the pooling one-dimensional answer features, the features of the topic sentence focused on by the composition; or obtain the convolution two-dimensional answer features and the pooling one-dimensional question features, and determine, based on the convolution two-dimensional answer features and the pooling one-dimensional question features, the features of the composition focused on by the topic sentence.

10. The system of claim 9, wherein, The attention mechanism layer is specifically configured to: obtain the topic sentence encoding, the convolution two-dimensional question features, and the pooling one-dimensional answer features, and determine, based on the topic sentence encoding, the convolution two-dimensional question features, and the pooling one-dimensional answer features, the features of the topic sentence focused on by the composition; or obtain the composition encoding, the convolution two-dimensional answer features, and the pooling one-dimensional question features, and determine, based on the composition encoding, the convolution two-dimensional answer features, and the pooling one-dimensional question features, the features of the composition focused on by the topic sentence. ​

Citation Information

Patent Citations

  • Off-subject composition detection method and apparatus, and terminal device

    CN107301169A

  • Method and device of answer selection based on cross-attention neural network and electronic equipment

    CN108875074A