CN115129858A - Test question classification model training method, device, equipment, medium and program product - Google Patents

Test question classification model training method, device, equipment, medium and program product Download PDF

Info

Publication number
CN115129858A
CN115129858A CN202210348773.3A CN202210348773A CN115129858A CN 115129858 A CN115129858 A CN 115129858A CN 202210348773 A CN202210348773 A CN 202210348773A CN 115129858 A CN115129858 A CN 115129858A
Authority
CN
China
Prior art keywords
test question
node
prediction
layer
classification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210348773.3A
Other languages
Chinese (zh)
Inventor
蔡晓凤
叶礼伟
杨晖
刘萌
孙朝旭
卢鑫鑫
吴嫒博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210348773.3A priority Critical patent/CN115129858A/en
Publication of CN115129858A publication Critical patent/CN115129858A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

The application provides a method, a device, equipment, a medium and a product for training a test question classification model, wherein the model comprises the following steps: the method comprises a first classification layer, a second classification layer and a mapping layer, and comprises the following steps: obtaining a first test question sample carrying a first label and a second test question sample carrying a second label, wherein the first test question sample and the second test question sample have the same test question text; classifying and predicting based on the first test question sample through a first classification layer to obtain a first prediction node to which the test question text belongs, and classifying and predicting based on the second test question sample through a second classification layer to obtain a second prediction node to which the test question text belongs; mapping the second prediction node through the mapping layer based on the incidence relation among the nodes in the textbook system to obtain a mapping node corresponding to the second prediction node; and updating the model parameters of the test question classification model by combining the first label, the second label, the first prediction node, the second prediction node and the mapping node. Therefore, the training efficiency and the classification accuracy of the test question classification model can be improved.

Description

Test question classification model training method, device, equipment, medium and program product
Technical Field
The present application relates to artificial intelligence technology, and in particular, to a method and an apparatus for training a test question classification model, an electronic device, a computer-readable storage medium, and a computer program product.
Background
Teaching material systems of various subjects in teaching often include nodes at different levels in the teaching material systems, such as chapters (units), sections (lessons), knowledge points and the like, in the related art, nodes corresponding to test questions are judged, and if knowledge points to which the test questions belong are judged, the nodes can be realized by training corresponding classification models.
Disclosure of Invention
The embodiment of the application provides a test question classification model training method and device, electronic equipment, a computer readable storage medium and a computer program product, which can improve the training efficiency and the classification accuracy of the test question classification model.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a training method of a test question classification model, wherein the test question classification model comprises the following steps: first classification layer, second classification layer and mapping layer include:
acquiring a first test question sample and a second test question sample with the same test question text, wherein the first test question sample carries a first label, and the second test question sample carries a second label;
the first label is used for indicating that a first node to which the test question text belongs in a textbook system comprising a plurality of content nodes, the second label is used for indicating a second node to which the test question text belongs, and the first node and the second node are in different node levels in the textbook system;
classifying and predicting based on the first test question sample through the first classification layer to obtain a first prediction node to which the test question text belongs, and classifying and predicting based on the second test question sample through the second classification layer to obtain a second prediction node to which the test question text belongs;
mapping the second prediction node through the mapping layer based on the incidence relation among the nodes in the textbook system to obtain a mapping node corresponding to the second prediction node, wherein the mapping node and the first prediction node are in the same node level;
and updating the model parameters of the test question classification model by combining the first label, the second label, the first prediction node, the second prediction node and the mapping node.
The embodiment of the application provides a training device of test question classification model, test question classification model includes: first classification layer, second classification layer and mapping layer include:
the system comprises an acquisition module, a storage module and a display module, wherein the acquisition module is used for acquiring a first test question sample and a second test question sample which have the same test question text, the first test question sample carries a first label, and the second test question sample carries a second label; the first label is used for indicating that a first node to which the test question text belongs in a textbook system comprising a plurality of content nodes, the second label is used for indicating a second node to which the test question text belongs, and the first node and the second node are in different node levels in the textbook system;
the classification module is used for performing classification prediction on the basis of the first test question sample through the first classification layer to obtain a first prediction node to which the test question text belongs, and performing classification prediction on the basis of the second test question sample through the second classification layer to obtain a second prediction node to which the test question text belongs;
the mapping module is used for mapping the second prediction node based on the incidence relation among the nodes in the textbook system to obtain a mapping node corresponding to the second prediction node, and the mapping node and the first prediction node are in the same node level;
and the updating module is used for updating the model parameters of the test question classification model by combining the first label, the second label, the first prediction node, the second prediction node and the mapping node.
In the above solution, the first classification layer includes a first coding layer and a first prediction layer, and the second classification layer includes a second coding layer and a second prediction layer; wherein the first coding layer shares model parameters with the second coding layer; the classification module is further configured to perform vector coding on the first test question sample through the first coding layer to obtain a first coding vector, and perform classification prediction based on the first coding vector through the first prediction layer to obtain a first prediction node to which the test question text belongs; and carrying out vector coding on the second test question sample through the second coding layer to obtain a second coding vector, and carrying out classified prediction on the basis of the second coding vector through the second prediction layer to obtain a second prediction node to which the test question text belongs.
In the above scheme, the classification module is further configured to perform word segmentation processing on the first test question sample through the first coding layer to obtain a plurality of sample words; respectively coding each sample word to obtain a word vector corresponding to each sample word; and carrying out vector averaging on the word vectors corresponding to the sample words to obtain the first encoding vector.
In the above scheme, the classification module is further configured to perform keyword extraction on the first test question sample through the first coding layer to obtain a plurality of keywords; coding each keyword respectively to obtain a keyword vector corresponding to each keyword; and acquiring the weight corresponding to each keyword, and performing weighted summation on the keyword vector corresponding to each keyword based on the weight to obtain the first coding vector.
In the above scheme, the obtaining module is further configured to obtain a question stem and an answer of the target test question and an analysis content corresponding to the answer when the test question text corresponds to the target test question; splicing the question stem and the answer of the target test question and the analysis content corresponding to the answer to obtain the test question text; and labeling labels based on the test question text to obtain the first test question sample carrying the first label and the second test question sample carrying the second label.
In the foregoing solution, the updating module is further configured to determine a value of a first loss function corresponding to the first classification layer based on the first label and the first prediction node, determine a value of a second loss function corresponding to the second classification layer based on the second label and the second prediction node, and determine a value of a third loss function corresponding to the mapping layer based on the first label and the mapping node; obtaining a loss function of the test question classification model constructed by the first loss function, the second loss function and the third loss function; determining a value of a loss function of the test question classification model based on the value of the first loss function, the value of the second loss function, and the value of the third loss function; and updating the model parameters of the test question classification model based on the value of the loss function of the test question classification model.
In the above scheme, the apparatus further comprises an application module, wherein the application module is configured to obtain a test question text of a test question to be classified; classifying and predicting the test question texts of the test questions to be classified through the first classification layer to obtain target nodes to which the test question texts of the test questions to be classified belong; or, classifying and predicting the test question texts of the test questions to be classified through the second classification layer to obtain nodes to be mapped to which the test question texts of the test questions to be classified belong, and mapping the nodes to be mapped through the mapping layer based on the association relationship among the nodes in the teaching material system to obtain target nodes to which the test question texts of the test questions to be classified belong.
In the above scheme, the application module is further configured to label the test questions to be classified based on the target node to obtain labeled test questions carrying labels; obtaining a test question outline, and matching the label of the labeled test question with the content in the test question outline to obtain a matching result; and when the matching result represents that the label is not matched with the content in the test question schema, determining that the labeled test question is a super-dimensional test question.
In the above scheme, the apparatus further includes an association module, where the association module is configured to obtain a node association relation table corresponding to the teaching material system; and updating the association relation among the nodes in the teaching material system based on the node association relation table.
In the above solution, the textbook system includes a plurality of unit nodes, each of the unit nodes includes at least two unit sub-nodes, and each of the unit sub-nodes includes at least one knowledge point; when the first node is the unit sub-node and the second node is the knowledge point, the first prediction node is a prediction unit sub-node and the second prediction node is a prediction knowledge point; the mapping module is further configured to map the predicted knowledge points through the mapping layer based on the association relationship between the unit sub-nodes and the knowledge points in the teaching material system, and obtain unit sub-nodes corresponding to the predicted knowledge points as the mapping nodes.
An embodiment of the present application provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the training method of the test question classification model provided by the embodiment of the application when the executable instructions stored in the memory are executed.
The embodiment of the present application provides a computer-readable storage medium, which stores executable instructions for causing a processor to execute the computer-readable storage medium, so as to implement the method for training the test question classification model provided in the embodiment of the present application.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the training method of the test question classification model provided by the embodiment of the application.
The embodiment of the application has the following beneficial effects:
the method comprises the steps of respectively carrying out classification prediction on a first test question sample and a second test question sample which have the same test question text and carry different labels to obtain a first prediction node and a second prediction node, mapping the second prediction node through the incidence relation among nodes in a teaching material system to obtain a mapping node which is in the same node level with the first prediction node, and finally updating a test question classification model based on the first prediction node, the second prediction node, the mapping node and the corresponding labels. Therefore, the test question classification model is updated by combining the mapping nodes obtained based on the incidence relation among the nodes in the teaching material system in the training process, so that the training efficiency of the test question classification model can be improved, and the classification accuracy of the test question classification model on the test questions can be improved.
Drawings
FIG. 1 is a schematic diagram of an architecture of a training system 100 for a test question classification model provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
FIG. 3 is a flowchart illustrating a method for training a test question classification model according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a test question classification model provided in an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a teaching material system provided in an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a test question classification model provided in an embodiment of the present application;
fig. 7 is a flowchart illustrating a process of determining a first predicted node and a second predicted node according to an embodiment of the present application;
fig. 8 is a schematic diagram of a process for determining a first code vector according to an embodiment of the present application;
fig. 9 is a schematic diagram of a process for determining a first encoding vector according to an embodiment of the present application;
FIG. 10 is a schematic structural diagram of a test question classification model provided in an embodiment of the present application;
FIG. 11 is a schematic structural diagram of a test question classification model provided in an embodiment of the present application;
FIG. 12 is a flowchart illustrating a method for training a test question classification model according to an embodiment of the present application;
FIG. 13 is a schematic diagram of a classification interface for test questions to be classified according to an embodiment of the present application;
FIG. 14 is a schematic diagram of a classification interface for test questions to be classified according to an embodiment of the present application;
fig. 15 is a comparison diagram of the effects provided by the embodiments of the present application.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, references to the terms "first \ second \ third" are only to distinguish similar objects and do not denote a particular order, but rather the terms "first \ second \ third" are used to interchange specific orders or sequences, where appropriate, so as to enable the embodiments of the application described herein to be practiced in other than the order shown or described herein. In the following description, the term "plurality" referred to means at least two.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
1) The BERT model (Bidirectional Encoder expressions from Transformer) is a pre-training technology for natural language processing, which is used for training by utilizing large-scale unmarked corpus to obtain semantic representation of texts containing rich semantic information, and then finely adjusting the semantic representation of the texts in a specific natural language processing task and finally applying the task to the natural language processing task.
2) In response to the condition or state indicating that the executed operation depends on, one or more of the executed operations may be in real-time or may have a set delay when the dependent condition or state is satisfied; there is no restriction on the order of execution of the operations performed unless otherwise specified.
3) The terminal comprises a client and application programs which are operated in the terminal and used for providing various services, such as a video client, an instant messaging client, a browser client, an education client, a live broadcast client map client and the like.
4) The LSTM (Long short-term memory) model, a Long short-term memory model, can be used for modeling sequences.
5) Convolutional Neural Network (CNN): a feedforward neural network generally consists of one or more convolution layers (network layers adopting convolution mathematical operation) and a terminal full-connection layer, and neurons in the network can respond to partial areas of an input image and generally have excellent performance in the field of visual image processing.
6) Adam (adaptive momentum) algorithm: a stochastic optimization method of adaptive momentum is often used as an optimizer algorithm in deep learning.
7) batch _ size: indicating the number of parameters that are passed to the program for training in a single pass,
in order to respond to the policy that the education department cannot surpass the rules of the student homework, whether the homework arranged by the teacher needs to be surpassed or not is detected, and the examination point of correctly identifying the test questions is particularly important in the scene. However, in the related art, the examination point identification of the test questions is only to identify the test question knowledge points, but one test question may correspond to a plurality of test question examination points such as chapters and knowledge points in different levels in the teaching material system, so that the related art cannot accurately identify the test question examination points, and further cannot accurately detect whether the test questions are overdimensioned; meanwhile, the related art only identifies the test question knowledge points for identifying the test question examination points, so that the number of labels corresponding to the test question examination points except the knowledge points is small, and if the chapter labels of the test questions are far less than the knowledge point labels of the test questions, the test question chapters need to be manually labeled, however, if only the test question chapters are manually labeled, the method is time-consuming and labor-consuming.
Based on this, the embodiment of the application provides a training method, a training device, an electronic device, a computer-readable storage medium, and a computer program product for a test question classification model, which can improve the training efficiency and the classification accuracy of the test question classification model, so as to accurately identify test points corresponding to test questions at different levels in a teaching material system, thereby improving the efficiency of labeling test points of test questions except for knowledge points, and greatly improving the accuracy of super-class detection of the test questions.
Referring to fig. 1, fig. 1 is a schematic diagram of an architecture of a training system 100 for a test question classification model provided in an embodiment of the present application, where a terminal (terminal 400 is exemplarily shown) is connected to a server 200 through a network 300, and the network 300 may be a wide area network or a local area network, or a combination of both. The terminal 400 and the server 200 are connected to each other through a wired or wireless network.
The terminal 400 is configured to send a first test question sample carrying a first label and a second test question sample carrying a second label to the server 200, where the first test question sample and the second test question sample have the same test question text;
the server 200 is configured to obtain a first test question sample and a second test question sample having the same test question text, where the first test question sample carries a first tag, and the second test question sample carries a second tag; the first label is used for indicating a first node to which the test question text belongs in a teaching material system comprising a plurality of content nodes, the second label is used for indicating a second node to which the test question text belongs, and the first node and the second node are positioned in different node levels in the teaching material system; classifying and predicting based on a first test question sample through a first classification layer of a test question classification model to obtain a first prediction node to which a test question text belongs, and classifying and predicting based on a second test question sample through a second classification layer of the test question classification model to obtain a second prediction node to which the test question text belongs; mapping the second prediction node through a mapping layer of the test question classification model based on the incidence relation among the nodes in the teaching material system to obtain a mapping node corresponding to the second prediction node, wherein the mapping node and the first prediction node are in the same node level; and updating the model parameters of the test question classification model by combining the first label, the second label, the first prediction node, the second prediction node and the mapping node.
The server 200 is further configured to perform classification prediction on the test questions to be classified based on the updated test question classification model, and determine target nodes to which test question texts of the test questions to be classified belong; and labels the corresponding test questions based on the target node and sends the corresponding labels to the terminal 400.
The terminal 400 is configured to present the annotations retrieved from the server 200 in the display interface 401-1.
In some embodiments, the server 200 may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like. The terminal 400 may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a set-top box, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a mobile device (e.g., a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable game device, a smart speaker, and a smart watch), and the like. The terminal device and the server may be directly or indirectly connected through wired or wireless communication, and the embodiment of the present application is not limited.
Referring to fig. 2, fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present application, in practical application, the electronic device may be the server 200 or the terminal 400 shown in fig. 1, and referring to fig. 2, the electronic device shown in fig. 2 includes: at least one processor 410, memory 450, at least one network interface 420, and a user interface 430. The various components in the terminal 400 are coupled together by a bus system 440. It is understood that the bus system 440 is used to enable communications among the components. The bus system 440 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 440 in fig. 2.
The Processor 410 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The user interface 430 includes one or more output devices 431, including one or more speakers and/or one or more visual displays, that enable the presentation of media content. The user interface 430 also includes one or more input devices 432, including user interface components to facilitate user input, such as a keyboard, mouse, microphone, touch screen display screen, camera, other input buttons and controls.
The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. Memory 450 optionally includes one or more storage devices physically located remote from processor 410.
The memory 450 includes both volatile memory and nonvolatile memory, and can include both volatile and nonvolatile memory. The nonvolatile memory may be a Read Only Memory (ROM), and the volatile memory may be a Random Access Memory (RAM). The memory 450 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.
An operating system 451, including system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks;
a network communication module 452 for communicating to other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
a presentation module 453 for enabling presentation of information (e.g., user interfaces for operating peripherals and displaying content and information) via one or more output devices 431 (e.g., display screens, speakers, etc.) associated with user interface 430;
an input processing module 454 for detecting one or more user inputs or interactions from one of the one or more input devices 432 and translating the detected inputs or interactions.
In some embodiments, the event processing apparatus based on the event processing model provided in the embodiments of the present application may be implemented in software, and fig. 2 illustrates a training apparatus 455 of the test question classification model stored in the memory 450, which may be software in the form of programs and plug-ins, and includes the following software modules: an acquisition module 4551, a classification module 4552, a mapping module 4553 and an update module 4554, which are logical and thus arbitrarily combined or further split depending on the functions implemented.
In other embodiments, the training Device of the test question classification model provided in the embodiments of the present Application may be implemented in hardware, and as an example, the training Device of the base test question classification model provided in the embodiments of the present Application may be a processor in the form of a hardware decoding processor, which is programmed to perform the training method of the test question classification model provided in the embodiments of the present Application, for example, the processor in the form of the hardware decoding processor may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), or other electronic components.
In some embodiments, the terminal or the server may implement the method for training the test question classification model provided in the embodiments of the present application by running a computer program. For example, the computer program may be a native program or a software module in an operating system; the Application program may be a local (Native) Application program (APP), that is, a program that needs to be installed in an operating system to run, such as an instant messaging APP and a web browser APP; or may be an applet, i.e. a program that can be run only by downloading it to the browser environment; but also an applet that can be embedded into any APP. In general, the computer programs described above may be any form of application, module, or plug-in.
Based on the above description of the system and the electronic device for training the test question classification model provided in the embodiment of the present application, a method for training the test question classification model provided in the embodiment of the present application is described below. In practical implementation, the method for training the test question classification model provided in the embodiment of the present application may be implemented by a terminal or a server alone, or implemented by a terminal and a server in cooperation, and the method for training the test question classification model provided in the embodiment of the present application is performed by the server 200 in fig. 1 alone as an example. Referring to fig. 3, fig. 3 is a schematic flowchart of a training method of a test question classification model provided in the embodiment of the present application, and it should be noted that the test question classification model includes: referring to fig. 4, fig. 4 is a schematic structural diagram of a test question classification model provided in an embodiment of the present application, and the following describes steps shown in fig. 3 and fig. 4.
Step 101, a server obtains a first test question sample and a second test question sample with the same test question text, wherein the first test question sample carries a first label, and the second test question sample carries a second label.
The first label is used for indicating a first node to which the test question text belongs in a teaching material system comprising a plurality of content nodes, the second label is used for indicating a second node to which the test question text belongs, and the first node and the second node are in different node levels in the teaching material system. It should be noted that the textbook system includes a plurality of node levels and a plurality of content nodes, the plurality of content nodes are at the same or different node levels, wherein the first node and the second node are at different node levels in the textbook system.
As an example, referring to fig. 5, fig. 5 is a schematic structural diagram of a textbook system provided in an embodiment of the present application, based on fig. 5, the textbook system includes three node levels and a plurality of content nodes, the plurality of content nodes are at the same or different node levels, and when a first node is located at a first node level of the textbook system, a second node may be located at a second node level or a third node level of the textbook system; when the first node is positioned at a second node level of the textbook system, the second node can also be positioned at a third node level; therefore, the embodiments of the present application are not limited.
In practical implementation, the teaching material system can be a teaching material for different subjects, or a teaching material for different versions of the same subject; the content nodes included in the teaching material system may be chapters (or units), sections (or sub-units) and knowledge points of the teaching material, and the plurality of node levels included in the teaching material system may be determined according to the chapters, sections and knowledge points of the teaching material, for example, referring to fig. 5, a first node level corresponds to the chapters of the teaching material, a second node level corresponds to the sections of the teaching material, and a third node level corresponds to the knowledge points of the teaching material.
In practical implementation, a first test question sample and a second test question sample with the same test question text are firstly obtained, and specifically, when the test question text corresponds to a target test question, a question stem, an answer and analysis content corresponding to the answer of the target test question are obtained; splicing the question stem and the answer of the target test question and the analysis content corresponding to the answer to obtain a test question text; and labeling labels based on the test question text to obtain a first test question sample carrying the first label and a second test question sample carrying the second label.
It should be noted that the same test question text indicates that the question stem, the answer, and the analysis content corresponding to the answer of the test question are the same, and the label indicates the node to which the test question belongs, such as the chapter and the knowledge point corresponding to the test question, so the first label here may be the chapter corresponding to the test question, and the second label may be the knowledge point corresponding to the test question.
And 102, carrying out classification prediction on the basis of the first test question sample through the first classification layer to obtain a first prediction node to which the test question text belongs, and carrying out classification prediction on the basis of the second test question sample through the second classification layer to obtain a second prediction node to which the test question text belongs.
In practical implementation, referring to fig. 6, fig. 6 is a schematic structural diagram of a test question classification model provided in the embodiment of the present application, where based on fig. 6, a first classification layer includes a first coding layer and a first prediction layer, and a second classification layer includes a second coding layer and a second prediction layer; the first coding layer and the second coding layer share model parameters, and here, after the first test question sample and the second test question sample are obtained, a process of obtaining a first prediction node and a second prediction node is obtained based on the first coding layer and the first prediction layer, and the second coding layer and the second prediction layer, see fig. 7, where fig. 7 is a flowchart illustrating a process of determining the first prediction node and the second prediction node provided in an embodiment of the present application, and based on fig. 3, step 102 may be implemented in the following manner:
and step 1021, performing vector coding on the first test question sample through the first coding layer to obtain a first coding vector, and performing classified prediction based on the first coding vector through the first prediction layer to obtain a first prediction node to which the test question text belongs.
In actual implementation, there are two ways of obtaining the first encoding vector by vector-encoding the first test question sample through the first encoding layer, and then two ways of obtaining the first encoding vector by vector-encoding the first test question sample will be described.
In some embodiments, referring to fig. 8, fig. 8 is a schematic diagram of a determination process of a first encoding vector provided in an embodiment of the present application, and based on fig. 8, a word segmentation process is performed on a first test question sample through a first encoding layer to obtain a plurality of sample words; then, coding each sample word respectively to obtain a word vector corresponding to each sample word; and carrying out vector averaging on the word vectors corresponding to the sample words to obtain a first coding vector.
As an example, firstly, performing word segmentation processing on a first test question sample to obtain a plurality of sample words; then, each sample word is coded to obtain a word vector h corresponding to each sample word cls ,h 1 ,h 2 ,……,h n Is recorded as H ═{h cls ,h 1 ,h 2 ,……,h n H is then given by the formula (1) to H cls ,h 1 ,h 2 ,……,h n Performing vector averaging on each word vector to obtain a first encoding vector, namely
Figure BDA0003578286080000131
Wherein n is the number of sample words, r is a first coding vector, and "cls" is a distinguishing identifier corresponding to each test question sample, and is obtained before coding each test question sample, and here, the distinguishing identifier distinguishes different test question samples, so that each test question sample is coded based on the distinguishing identifier.
In other embodiments, referring to fig. 9, fig. 9 is a schematic diagram of a determination process of a first encoding vector provided in the embodiment of the present application, and based on fig. 9, firstly, a first test question sample is subjected to keyword extraction through a first encoding layer to obtain a plurality of keywords; coding each keyword respectively to obtain a keyword vector corresponding to each keyword; and acquiring weights corresponding to the keywords, and performing weighted summation on keyword vectors corresponding to the keywords based on the weights to obtain a first coding vector.
As an example, firstly, keyword extraction is performed on a first test question sample through a first coding layer to obtain a plurality of keywords; then, each keyword is coded respectively to obtain a keyword vector h corresponding to each keyword cls ,h 1 ,h 2 ,……,h n And is denoted as H ═ H cls ,h 1 ,h 2 ,……,h n }; then obtaining the weight p corresponding to each keyword cls ,p 1 ,p 2 ,……,p n Finally, H is { H over the equation (2) pair cls ,h 1 ,h 2 ,……,h n Weighting and summing the keyword vectors corresponding to the keywords in the code to obtain a first code vector, namely the first code vector
r=p cls *h cls +p 1 *h 1 +……+p n *h n … … equation (2);
wherein n is the number of sample words, r is a first coding vector, and "cls" is a distinguishing identifier corresponding to each test question sample, and is obtained before coding each test question sample, and here, the distinguishing identifier distinguishes different test question samples, so that each test question sample is coded based on the distinguishing identifier.
It should be noted that the weights corresponding to the keywords may be the same, and when the weights corresponding to the keywords are the same, the keyword vectors corresponding to the keywords are subjected to weighted summation to obtain the first coding vector, that is, the keyword vectors corresponding to the keywords are subjected to vector averaging to obtain the first coding vector.
In practical implementation, after the first coding vector is obtained, classification prediction is performed on the basis of the first coding vector through the first prediction layer, and a first prediction node to which the test question text belongs is obtained.
In the above example, after the first coding vector r is obtained, the first prediction layer performs classified prediction based on the first coding vector to obtain a first prediction node to which the test question text belongs, that is, the first prediction node
y k =W k R … … formula (3);
wherein y is a prediction node, W is a model parameter to be updated, k belongs to {1, 2, 3}, and when k is 1, y 1 Is a first predicted node, W 1 Model parameters to be updated in the first classification layer; when k is 2, y 2 As a second predicted node, W 2 The model parameters to be updated in the second classification layer.
And 1022, performing vector coding on the second test question sample through the second coding layer to obtain a second coding vector, and performing classified prediction based on the second coding vector through the second prediction layer to obtain a second prediction node to which the test question text belongs.
In practical implementation, since the first coding layer and the second coding layer share the model parameters, the process of obtaining the second prediction node to which the test question text belongs by vector coding the second test question sample through the second coding layer to obtain the second coding vector, and performing classification prediction based on the second coding vector through the second prediction layer is the same as the process of obtaining the first prediction node to which the test question text belongs by vector coding the first test question sample through the first coding layer to obtain the first coding vector, and performing classification prediction based on the first coding vector through the first prediction layer to obtain the first prediction node to which the test question text belongs, and therefore, the process of determining the second prediction node is not described in detail. Meanwhile, the first coding layer and the second coding layer share the model parameters, so that the calculation amount during updating of the model parameters is reduced in the training process of the test question classification model, the consumption of calculation resources is reduced, and the convergence speed of the model is accelerated.
And 103, mapping the second prediction node through the mapping layer based on the incidence relation among the nodes in the textbook system to obtain a mapping node corresponding to the second prediction node.
Here, the mapping node is at the same node level as the first prediction node.
In actual implementation, the incidence relation between the nodes in the teaching material system is obtained, and then the second prediction node is mapped through the mapping layer based on the incidence relation between the nodes in the teaching material system to obtain the mapping node corresponding to the second prediction node. It should be noted that the association relationship between the nodes in the teaching material system is preset for each teaching material.
In connection with the above example, after the second prediction node is determined, the second prediction node is mapped through the mapping layer based on the association relationship between the nodes in the teaching material system, so as to obtain a mapping node corresponding to the second prediction node, that is, the mapping node is obtained
y g =G*y 2 … … equation (4);
wherein, y g To map a node, y 2 And G is a model parameter to be updated in the mapping layer.
And step 104, updating model parameters of the test question classification model by combining the first label, the second label, the first prediction node, the second prediction node and the mapping node.
In practical implementation, after determining the first prediction node, the second prediction node and the mapping node, the process of updating the model parameters of the test question classification model specifically includes determining a value of a first loss function corresponding to the first classification layer based on the first label and the first prediction node, determining a value of a second loss function corresponding to the second classification layer based on the second label and the second prediction node, and determining a value of a third loss function corresponding to the mapping layer based on the first label and the mapping node; obtaining a loss function of a test question classification model constructed by a first loss function, a second loss function and a third loss function; determining a value of a loss function of the test question classification model based on the value of the first loss function, the value of the second loss function and the value of the third loss function; and updating the model parameters of the test question classification model based on the value of the loss function of the test question classification model.
As an example, the first loss function, the second loss function, the third loss function, and the loss function of the test question classification model may be sigmoid functions, and after the first prediction node, the second prediction node, and the mapping node are determined, the value loss of the first loss function corresponding to the first classification layer is determined based on the first label and the first prediction node 1 Determining a value loss of a second loss function corresponding to a second classification layer based on a second label and the second prediction node 2 And determining the value loss of a third loss function corresponding to the mapping layer based on the first label and the mapping node 3 Then, based on the value of the first loss function, the value of the second loss function, and the value of the third loss function, the value of the loss function of the test question classification model is determined
Figure BDA0003578286080000161
Finally, the value of the loss function based on the test question classification model
Figure BDA0003578286080000162
And updating the model parameters of the test question classification model.
In practical implementation, after the trained test question classification model is obtained, the test questions to be classified can be classified based on the trained test question classification model, and specifically, test question texts of the test questions to be classified are obtained; classifying and predicting test question texts of test questions to be classified through a first classification layer to obtain target nodes to which the test question texts of the test questions to be classified belong; or classifying and predicting the test question texts of the test questions to be classified through the second classification layer to obtain nodes to be mapped to which the test question texts of the test questions to be classified belong, and mapping the nodes to be mapped through the mapping layer based on the association relation among the nodes in the teaching material system to obtain target nodes to which the test question texts of the test questions to be classified belong.
It should be noted that, after determining the target node to which the test question text of the test questions to be classified belongs, labeling the test question text based on the target node to which the test question text belongs to obtain labeled test questions carrying labels, and performing corresponding application based on the labeled test questions.
As an example, when the super-outline test question detection is performed based on the labeled test questions, specifically, a test question schema is obtained first, and the label of the labeled test question is matched with the test question schema to obtain a matching result; and when the representation label of the matching result is not matched with the test question outline, determining the labeled test question as a super-outline test question.
As an example, when a test question is recommended based on labeled test questions, specifically, user information is first obtained, a target label adapted to a user is determined based on the user information, and based on the target label, a target test question is screened from a plurality of labeled test questions and is recommended to the user. It should be noted that, in the embodiments of the present application, related data such as user information, when the embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use and processing of related data need to comply with related laws and regulations and standards of related countries and regions.
In actual implementation, because the node association relation table is preset, when the node association relation table is updated, the node association relation table corresponding to the updated teaching material system is obtained; and then updating the association relation among the nodes in the textbook system based on the node association relation table. Therefore, the timely updating of the incidence relation among the nodes is ensured, so that the model is trained by combining the updated incidence relation among the nodes in the training process of the test question classification model, and the precision of the test question classification model is improved.
In some embodiments, referring to fig. 5, the textbook architecture includes a plurality of unit nodes of a first node level, each unit node including at least two unit sub-nodes of a second node level, each unit sub-node including at least one knowledge point of a third node level.
As an example, when the first node is a unit sub-node and the second node is a knowledge point, the first prediction node is a prediction unit sub-node and the second prediction node is a prediction knowledge point, and the mapping layer is used to map the second prediction node based on the association relationship between the nodes in the textbook system to obtain the mapping node corresponding to the second prediction node. And then updating the test question classification model by combining the prediction unit sub-nodes, the prediction knowledge points, the unit sub-nodes obtained by mapping, the first label and the second label.
In practical implementation, when the first node is a unit sub-node and the second node is a knowledge point, the trained test question classification model can be used for determining a sub-unit to which a corresponding test question belongs, and specifically, a test question text of the test question to be classified is obtained; classifying and predicting test question texts of test questions to be classified through a first classification layer to obtain sub-units to which the test question texts of the test questions to be classified belong; or classifying and predicting the test question texts of the test questions to be classified through the second classification layer to obtain knowledge points to which the test question texts of the test questions to be classified belong, and mapping the knowledge points through the mapping layer based on the association relation among the nodes in the teaching material system to obtain subunits to which the test question texts of the test questions to be classified belong.
It should be noted that the test question classification model may also be used to determine knowledge points to which corresponding test questions belong, see fig. 10, where fig. 10 is a schematic structural diagram of the test question classification model provided in the embodiment of the present application, and based on fig. 10, a mapping layer in the test question classification model may map a first prediction node in addition to a second prediction node, specifically, after determining the first prediction node and the second prediction node to which test question texts belong, the mapping layer maps the first prediction node based on an association relationship between nodes in a teaching material system to obtain a mapping node corresponding to the first prediction node, where the mapping node and the second prediction node are in the same node level.
In practical implementation, after determining the first prediction node, the second prediction node and the mapping node, the process of updating the model parameters of the test question classification model specifically includes determining a value of a first loss function corresponding to the first classification layer based on the first label and the first prediction node, determining a value of a second loss function corresponding to the second classification layer based on the second label and the second prediction node, and determining a value of a third loss function corresponding to the mapping layer based on the second label and the mapping node; obtaining a loss function of a test question classification model constructed by a first loss function, a second loss function and a third loss function; determining a value of a loss function of the test question classification model based on the value of the first loss function, the value of the second loss function and the value of the third loss function; and updating the model parameters of the test question classification model based on the value of the loss function of the test question classification model.
With continued reference to fig. 5, the textbook architecture includes a plurality of unit nodes of a first node level, each unit node including at least two unit sub-nodes of a second node level, each unit sub-node including at least one knowledge point of a third node level.
As an example, when the first node is a unit sub-node and the second node is a knowledge point, the first prediction node is a prediction unit sub-node and the second prediction node is a prediction knowledge point, and the mapping layer is used for mapping the first prediction node based on the association relationship between the nodes in the textbook system to obtain the mapping node corresponding to the first prediction node. And then updating the test question classification model by combining the child nodes of the prediction unit, the prediction knowledge points, the knowledge points obtained by mapping, the first label and the second label.
In practical implementation, when the first node is a unit sub-node and the second node is a knowledge point, the trained test question classification model can be used for determining the knowledge point to which the corresponding test question belongs, and specifically, a test question text of the test question to be classified is obtained; classifying and predicting test question texts of test questions to be classified through a second classification layer to obtain knowledge points to which the test question texts of the test questions to be classified belong; or, classifying and predicting the test question texts of the test questions to be classified through the first classification layer to obtain the sub-units to which the test question texts of the test questions to be classified belong, and mapping the sub-units through the mapping layer based on the association relation among the nodes in the teaching material system to obtain the knowledge points to which the test question texts of the test questions to be classified belong.
In some embodiments, the test question classification model may further be configured to determine sub-units and knowledge points to which corresponding test questions belong at the same time, referring to fig. 11, where fig. 11 is a schematic structural diagram of the test question classification model provided in this embodiment of the present application, and based on fig. 11, a mapping layer in the test question classification model may further map a first prediction node and a second prediction node at the same time, specifically, after determining the first prediction node and the second prediction node to which test question texts belong, the first prediction node is mapped through the first mapping layer based on an association relationship between nodes in a textbook system to obtain a first mapping node corresponding to the first prediction node, and the second prediction node is mapped through the second mapping layer to obtain a second mapping node corresponding to the second prediction node, where the first mapping node and the first prediction node are at the same node level, the second mapping node is at the same node level as the second prediction node.
In actual implementation, after determining the first prediction node, the second prediction node, the first mapping node, and the second mapping node, the process of updating the model parameters of the test question classification model specifically includes determining a value of a first loss function corresponding to the first classification layer based on the first label and the first prediction node, determining a value of a second loss function corresponding to the second classification layer based on the second label and the second prediction node, determining a value of a third loss function corresponding to the first mapping layer based on the first label and the first mapping node, and determining a value of a fourth loss function corresponding to the second mapping layer based on the second label and the second mapping node; obtaining a loss function of a test question classification model constructed by a first loss function, a second loss function, a third loss function and a fourth loss function; determining the value of a loss function of the test question classification model based on the value of the first loss function, the value of the second loss function, the value of the third loss function and the value of the fourth loss function; and updating the model parameters of the test question classification model based on the value of the loss function of the test question classification model.
With continued reference to fig. 5, the textbook architecture includes a plurality of unit nodes of a first node hierarchy, each unit node including at least two unit sub-nodes of a second node hierarchy, each unit sub-node including at least one knowledge point of a third node hierarchy.
As an example, when the first node is a unit sub-node and the second node is a knowledge point, the first prediction node is a prediction unit sub-node, and the second prediction node is a prediction knowledge point, the mapping layer is used to map the first prediction node based on the association relationship between the nodes in the textbook system to obtain a first mapping node corresponding to the first prediction node, and the mapping layer is used to map the second prediction node to obtain a second mapping node corresponding to the second prediction node. And then updating the test question classification model by combining the prediction unit sub-node, the prediction knowledge point, the mapping unit sub-node, the mapping knowledge point, the first label and the second label.
In practical implementation, when the first node is a unit sub-node and the second node is a knowledge point, the trained test question classification model can be used for simultaneously determining the sub-unit to which the corresponding test question belongs and the knowledge point, and specifically, obtaining a test question text of the test question to be classified; classifying and predicting test question texts of test questions to be classified through a first classification layer to obtain sub-units to which the test question texts of the test questions to be classified belong, or classifying and predicting the test question texts of the test questions to be classified through a second classification layer to obtain knowledge points to which the test question texts of the test questions to be classified belong, and mapping the knowledge points through a mapping layer based on the association relationship among nodes in a teaching material system to obtain sub-units to which the test question texts of the test questions to be classified belong; through the second classification layer, the test question texts of the test questions to be classified are classified and predicted to obtain knowledge points to which the test question texts of the test questions to be classified belong, or through the first classification layer, the test question texts of the test questions to be classified are classified and predicted to obtain subunits to which the test question texts of the test questions to be classified belong, and through the mapping layer, the subunits are mapped based on the association relationship among the nodes in the teaching material system to obtain the knowledge points to which the test question texts of the test questions to be classified belong.
Next, a method for training a test question classification model provided in the embodiment of the present application is continuously described, fig. 12 is a flowchart illustrating the method for training a test question classification model provided in the embodiment of the present application, and referring to fig. 12, the method for training a test question classification model provided in the embodiment of the present application is cooperatively implemented by a client and a server.
Step 201, the client responds to the uploading operation of the first test question sample and the second test question sample with the same test question text, and obtains the first test question sample carrying the first label and the second test question sample carrying the second label.
In practical implementation, the client may be a test question classification client arranged in the terminal, the first test question sample and the second test question sample may be uploaded locally from the terminal based on a human-computer interaction interface of the client by a user, and the first test question sample and the second test question sample are uploaded locally from the terminal by the user based on the human-computer interaction interface of the client.
Step 202, the client sends a first test question sample carrying the first label and a second test question sample carrying the second label to the server.
Step 203, the server inputs the received first test question sample and the second test question sample to the test question classification model.
And 204, outputting a first prediction node aiming at the first test question sample, a second prediction node aiming at the second test question sample and a mapping node corresponding to the second prediction node.
And step 205, updating model parameters of the test question classification model by combining the first label, the second label, the first prediction node, the second prediction node and the mapping node.
In practical implementation, the server iterates the training process until the loss function converges, and completes training of the test question classification model.
In step 206, the server generates a prompt message for completing the training of the test question classification model.
Step 207, the server sends a prompt message to the client.
And step 208, the client responds to the uploading operation aiming at the test questions to be classified, and obtains the test question texts of the test questions to be classified.
In practical implementation, a client can present a classification interface of test questions to be classified, wherein the classification interface comprises a question stem input frame, an answer input frame, an analysis input frame and a prediction result frame, specifically, the test questions to be classified can be obtained by shooting through a camera in communication connection with a terminal, and after the test questions to be classified are obtained through shooting through the camera, the test questions to be classified are transmitted to the terminal and automatically uploaded to the client through the terminal, so that the client identifies the test questions to be classified based on the test questions to be classified obtained through shooting, and corresponding analysis of the question stem, the answer and the answer of test question texts of the test questions to be classified is presented in corresponding input frames; or the client responds to the received trigger operation aiming at the test question acquisition function items to be classified in the classification interface and acquires the test question from the question bank; or, the test questions to be classified may be input by the user based on the input boxes on the classification interface, so as to upload the test questions to be classified to the client. It should be noted that, in the process of uploading the test questions to be classified, the classification interface may also present the selection items of the classification ranges such as primary mathematics, primary language, primary and secondary mathematics, so that the server classifies the test questions to be classified based on the corresponding classification ranges, thereby improving the efficiency of classifying the test questions.
For example, referring to fig. 13, fig. 13 is a schematic diagram of a classification interface of test questions to be classified provided in this embodiment of the present application, and based on fig. 13, a question stem corresponding to a test question text of the test questions to be classified is "0.625 ton? Kilogram, 0.3 square meter? Is the square decimeter, 3.16 km? Kilometer? Meter ", the answer is" 625, 30, 3, 160 ", the corresponding resolution of the answer is" test question analysis: (1) the method is characterized in that the conversion of unit of mass is realized by converting a high-grade unit into a low-grade unit kilogram, the multiplication rate is 1000.(2) is the conversion of unit of area, the conversion of a high-grade unit into a square meter into a low-grade unit is realized by converting a square decimeter into a square meter into a square unit, the multiplication rate is 100.(3) is the conversion of unit of length, the conversion of a single-name complex number is realized, the kilometer is regarded as the sum of kilometer (namely 3 kilometers) and kilometer, the multiplication rate of the kilometer is 1000 meters, and the kilometer (namely 3 kilometer) are written together. Solution: (1) 625 kg from 0.625 ton; (2)0.3 square meter to 30 square decimeters; (3)3.16 km to 3 km 160 m, the answers are 625, 30, 3, 160. And (4) commenting: the unit conversion firstly determines whether the high-level unit is converted into the low-level unit or the low-level unit is converted into the high-level unit, and secondly remembers the advance rate between the units; the high-level unit low-level unit multiplication rate is divided by the low-level unit high-level unit multiplication rate, the classification range is 'primary mathematics', and the test question acquisition function item to be classified is a function item of 'the next question' in the interface.
It should be noted that, before determining the classification result of the test questions to be classified, the prediction result frame in the classification interface is blank, and after determining the classification result of the test questions to be classified, the prediction result frame presents the corresponding prediction result, that is, the classification result of the test questions to be classified.
Step 209, the client sends the test question text of the test question to be classified to the server in response to the classification instruction for the test question to be classified.
In practical implementation, the classification instruction of the test questions to be classified may be automatically generated by the client under a certain trigger condition, for example, the classification instruction for the test questions to be classified is automatically generated by the client after the client acquires the test questions to be classified, may be sent to the client by another device in communication connection with the terminal, or may be generated by the user triggering a corresponding submission function item based on a human-computer interaction interface of the client.
Step 210, the server inputs the received test question text of the test question to be classified into the test question classification model, so that the test question classification model classifies the test question to obtain the target node to which the test question text of the test question to be classified belongs.
And step 211, labeling the test questions to be classified based on the target nodes to obtain labeled test questions carrying labels.
Step 212, sending the corresponding label to the client.
In step 213, the client outputs the received annotations.
In actual implementation, the client may present the classification result for the test question to be classified in a human-computer interaction interface of the client, store the classification result to the local terminal, and send the classification result to other devices in communication connection with the terminal.
In connection with the above example, referring to fig. 14, fig. 14 is a schematic diagram of a classification interface of test questions to be classified provided in the embodiment of the present application, and based on fig. 14, the classification interface presents classification results of corresponding test questions to be classified based on a prediction result frame, that is, "north teachers 'three-year-level underscription-four kg, g, ton-multiple", and "north teachers' three-year-level underscription-four kg, g, ton-1 ton multiple".
By applying the embodiment of the application, the first test question sample and the second test question sample which have the same test question text and carry different labels are respectively classified and predicted to obtain the first prediction node and the second prediction node, the second prediction node is mapped through the incidence relation among the nodes in the teaching material system to obtain the mapping node which is at the same node level with the first prediction node, and finally the test question classification model is updated based on the first prediction node, the second prediction node, the mapping node and the corresponding labels. Therefore, the test question classification model is updated by combining the mapping nodes obtained based on the incidence relation among the nodes in the teaching material system in the training process, so that the training efficiency of the test question classification model can be improved, and the classification accuracy of the test question classification model on the test questions can be improved.
Next, an exemplary application of the embodiment of the present application in a practical application scenario will be described.
In order to respond to the policy that the education department cannot surpass the rules of the student homework, whether chapters corresponding to the homework arranged by the teacher need to be detected to surpass the rules or not is required, and in addition, the test question chapter prediction is widely applied to education products such as test question resource search, test question recommendation, question bank construction, personalized learning and the like, so that the correct identification of the chapters of the test questions is particularly important in the scene. However, the test questions in the question bank have a condition that the labeling data of the test question chapters are less, and if only the data of the teaching and research labeling chapters are relied on, the test question bank is time-consuming and labor-consuming; meanwhile, for the test questions, a certain relation exists between the chapters and the knowledge points, and if the relation between the chapters and the knowledge points can be well utilized, the marking precision and the marking efficiency of the chapters can be improved.
Based on the method, the test question chapter marking method fusing knowledge point chapter relation information is provided, namely a test question classification model fusing chapter and knowledge point relations is constructed by using knowledge point chapter corresponding relations organized by teaching and research teachers.
In practical implementation, firstly, training test questions, chapter data and knowledge point data corresponding to the training test questions are obtained, then, the question stems, the answers and the analyses corresponding to the answers of the training test questions are spliced to obtain test question texts (first test question samples) carrying the test question chapter data (first labels) and the chapter test question texts (second test question samples) carrying the test question knowledge point data (second labels), the chapter test question texts are input to a bert model (a first coding layer) of the chapters, the knowledge point test question texts are input to a bert model (a second coding layer) of the knowledge points, and accordingly the text labels of the test question texts are obtainedH ═ H cls ,h 1 ,h 2 ,……,h n H and text identification H ═ H of test question text of knowledge point cls ,h 1 ,h 2 ,……,h n H here, denotes the final output of each word, and the section of the question and the bert model part of the knowledge points are parameter-shared; then, based on formula (1), adding and averaging the word vectors in the H to obtain a text representation (a first coding vector) of the test question text of the chapter and a text representation (a second coding vector) of the test question text of the knowledge point; then, the text representation of the test question text of the chapter is input into a chapter task layer (a first prediction layer), a prediction chapter (a first prediction node) is obtained based on a formula (3), the text of the test question text of the knowledge point is represented into a knowledge point task layer (a second prediction layer), a prediction knowledge point (a second prediction node) is obtained by the formula (3), then the prediction knowledge point is input into a knowledge point chapter association layer (a mapping layer), and a mapping chapter (a mapping node) is obtained based on a formula (4) based on the association relationship between the chapter and the knowledge point. Finally, after the prediction section, the prediction knowledge point and the mapping section are determined, the value loss of the first loss function corresponding to the task layer of the section is determined based on the first label and the prediction section 1 Determining the value loss of a second loss function corresponding to the task layer of the knowledge point based on the second label and the predicted knowledge point 2 And determining the value loss of a third loss function corresponding to the knowledge point chapter association layer based on the first label and the mapping node 3 Then based on loss 1 、loss 2 And loss 3 Determining the value of the loss function of the test question classification model
Figure BDA0003578286080000241
Finally, based on the value of the loss function of the test question classification model
Figure BDA0003578286080000251
And updating the model parameters of the test question classification model. Illustratively, the Adam algorithm may be used to optimize the parameters of each layer of the model, and the learning rate is set to 0.0000125, with a size of 6 for batch _ size. Here, after the test question classification model is trained, the test question classification model is savedHere, the test question classification model may be used to predict the section of the test question investigation.
It should be noted that the bert model is selected as the common layer in the above process, and in addition, a conventional CNN model and an lstm model may also be selected as the common layer.
In practical implementation, referring to fig. 15, fig. 15 is a schematic comparison of effects provided by the embodiment of the present application, based on fig. 15, a first action of the table is based on the bert model only to perform test question chapter marking, and a second action is based on the test question classification model of the present application to perform test question chapter marking.
By applying the embodiment of the application, the first test question sample and the second test question sample which have the same test question text and carry different labels are respectively classified and predicted to obtain the first prediction node and the second prediction node, the second prediction node is mapped through the incidence relation among the nodes in the teaching material system to obtain the mapping node which is at the same node level with the first prediction node, and finally the test question classification model is updated based on the first prediction node, the second prediction node, the mapping node and the corresponding labels. Therefore, the test question classification model is updated by combining the mapping nodes obtained based on the incidence relation among the nodes in the teaching material system in the training process, so that the training efficiency of the test question classification model can be improved, and the classification accuracy of the test question classification model on the test questions can be improved.
The following proceeds to describe an exemplary structure of the training apparatus 455 implemented as a software module of the test question classification model provided in the embodiment of the present application, where the test question classification model includes: the first classification layer, the second classification layer and the mapping layer, in some embodiments, as shown in fig. 2, the software modules stored in the training device 455 of the test question classification model in the memory 440 may include:
an obtaining module 4551, configured to obtain a first test question sample and a second test question sample that have the same test question text, where the first test question sample carries a first tag, and the second test question sample carries a second tag; the first label is used for indicating that a first node to which the test question text belongs in a textbook system comprising a plurality of content nodes, the second label is used for indicating a second node to which the test question text belongs, and the first node and the second node are in different node levels in the textbook system;
the classification module 4552 is configured to perform classification prediction based on the first test question sample through the first classification layer to obtain a first prediction node to which the test question text belongs, and perform classification prediction based on the second test question sample through the second classification layer to obtain a second prediction node to which the test question text belongs;
a mapping module 4553, configured to map the second prediction node based on an association relationship between nodes in the textbook system, to obtain a mapping node corresponding to the second prediction node, where the mapping node and the first prediction node are in the same node level;
an updating module 4554, configured to update the model parameters of the test question classification model in combination with the first label, the second label, the first prediction node, the second prediction node, and the mapping node.
In some embodiments, the first classification layer comprises a first coding layer and a first prediction layer, and the second classification layer comprises a second coding layer and a second prediction layer; wherein the first coding layer shares model parameters with the second coding layer; the classification module 4552 is further configured to perform vector coding on the first test question sample through the first coding layer to obtain a first coding vector, and perform classification prediction based on the first coding vector through the first prediction layer to obtain a first prediction node to which the test question text belongs; and carrying out vector coding on the second test question sample through the second coding layer to obtain a second coding vector, and carrying out classified prediction on the basis of the second coding vector through the second prediction layer to obtain a second prediction node to which the test question text belongs.
In some embodiments, the classification module 4552 is further configured to perform word segmentation on the first test question sample through the first coding layer to obtain a plurality of sample words; respectively encoding each sample word to obtain a word vector corresponding to each sample word; and carrying out vector averaging on the word vectors corresponding to the sample words to obtain the first encoding vector.
In some embodiments, the classification module 4552 is further configured to perform, through the first coding layer, keyword extraction on the first test question sample to obtain a plurality of keywords; coding each keyword respectively to obtain a keyword vector corresponding to each keyword; and acquiring the weight corresponding to each keyword, and performing weighted summation on the keyword vector corresponding to each keyword based on the weight to obtain the first coding vector.
In some embodiments, the obtaining module 4551 is further configured to, when the test question text corresponds to a target test question, obtain a question stem, an answer of the target test question, and an analysis content corresponding to the answer; splicing the question stem and the answer of the target test question and the analysis content corresponding to the answer to obtain the test question text; and labeling labels based on the test question text to obtain the first test question sample carrying the first label and the second test question sample carrying the second label.
In some embodiments, the updating module 4554 is further configured to determine a value of a first loss function corresponding to the first classification layer based on the first label and the first prediction node, determine a value of a second loss function corresponding to the second classification layer based on the second label and the second prediction node, and determine a value of a third loss function corresponding to the mapping layer based on the first label and the mapping node; obtaining a loss function of the test question classification model constructed by the first loss function, the second loss function and the third loss function; determining a value of a loss function of the test question classification model based on the value of the first loss function, the value of the second loss function, and the value of the third loss function; and updating the model parameters of the test question classification model based on the value of the loss function of the test question classification model.
In some embodiments, the apparatus further includes an application module, configured to obtain a test question text of a test question to be classified; through the first classification layer, classifying and predicting the test question texts of the test questions to be classified to obtain target nodes to which the test question texts of the test questions to be classified belong; or, classifying and predicting the test question texts of the test questions to be classified through the second classification layer to obtain nodes to be mapped to which the test question texts of the test questions to be classified belong, and mapping the nodes to be mapped through the mapping layer based on the association relationship among the nodes in the teaching material system to obtain target nodes to which the test question texts of the test questions to be classified belong.
In some embodiments, the application module is further configured to label the test questions to be classified based on the target node, so as to obtain labeled test questions carrying labels; obtaining a test question outline, and matching the label of the labeled test question with the content in the test question outline to obtain a matching result; and when the matching result represents that the label is not matched with the content in the test question schema, determining the labeled test question as a super-class test question.
In some embodiments, the apparatus further includes an association module, where the association module is configured to obtain a node association table corresponding to the textbook system; and updating the association relation among the nodes in the teaching material system based on the node association relation table.
In some embodiments, the textbook architecture comprises a plurality of unit nodes, each of the unit nodes comprising at least two unit sub-nodes, each of the unit sub-nodes comprising at least one knowledge point; when the first node is the unit sub-node and the second node is the knowledge point, the first prediction node is a prediction unit sub-node and the second prediction node is a prediction knowledge point; the mapping module 4553 is further configured to map, through the mapping layer, the predicted knowledge points based on the association relationship between the unit sub-nodes and the knowledge points in the teaching material system, and obtain unit sub-nodes corresponding to the predicted knowledge points as the mapping nodes.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the training method of the test question classification model described in the embodiment of the present application.
Embodiments of the present application provide a computer-readable storage medium storing executable instructions, which when executed by a processor, will cause the processor to perform a training method of a test question classification model provided by embodiments of the present application, for example, the training method of a test question classification model shown in fig. 3.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
In summary, the following technical effects can be achieved through the embodiments of the present application:
(1) the test question classification model is updated by combining the mapping nodes obtained based on the incidence relation among the nodes in the teaching material system in the training process, so that the training efficiency of the test question classification model can be improved, and the classification accuracy of the test question classification model on the test questions can be improved.
(2) By sharing the model parameters between the first coding layer and the second coding layer, the calculation amount of the model parameters during updating is reduced in the training process of the test question classification model, so that the consumption of calculation resources is reduced, and the convergence speed of the model is accelerated.
(3) By ensuring the timely update of the incidence relation among the nodes, the model is trained by combining the updated incidence relation among the nodes in the training process of the test question classification model, and the precision of the test question classification model is improved.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (14)

1. A method for training a test question classification model is characterized in that the test question classification model comprises the following steps: a first classification layer, a second classification layer, and a mapping layer, the method comprising:
obtaining a first test question sample and a second test question sample with the same test question text, wherein the first test question sample carries a first label, and the second test question sample carries a second label;
the first label is used for indicating that a first node to which the test question text belongs in a textbook system comprising a plurality of content nodes, the second label is used for indicating a second node to which the test question text belongs, and the first node and the second node are in different node levels in the textbook system;
classifying and predicting based on the first test question sample through the first classification layer to obtain a first prediction node to which the test question text belongs, and classifying and predicting based on the second test question sample through the second classification layer to obtain a second prediction node to which the test question text belongs;
mapping the second prediction node through the mapping layer based on the incidence relation among the nodes in the textbook system to obtain a mapping node corresponding to the second prediction node, wherein the mapping node and the first prediction node are in the same node level;
and updating the model parameters of the test question classification model by combining the first label, the second label, the first prediction node, the second prediction node and the mapping node.
2. The method of claim 1, wherein the first classification layer comprises a first coding layer and a first prediction layer, and the second classification layer comprises a second coding layer and a second prediction layer; wherein the first coding layer shares model parameters with the second coding layer;
through the first classification layer, classification prediction is carried out based on the first test question sample, and a first prediction node to which the test question text belongs is obtained, wherein the method comprises the following steps:
vector coding is carried out on the first test question sample through the first coding layer to obtain a first coding vector, and classified prediction is carried out on the basis of the first coding vector through the first prediction layer to obtain a first prediction node to which the test question text belongs;
the obtaining of the second prediction node to which the test question text belongs by performing classification prediction based on the second test question sample through the second classification layer includes:
and performing vector coding on the second test question sample through the second coding layer to obtain a second coding vector, and performing classified prediction based on the second coding vector through the second prediction layer to obtain a second prediction node to which the test question text belongs.
3. The method of claim 2, wherein vector-coding the first test question samples by the first coding layer to obtain a first coded vector, comprises:
performing word segmentation processing on the first test question sample through the first coding layer to obtain a plurality of sample words;
respectively encoding each sample word to obtain a word vector corresponding to each sample word;
and carrying out vector averaging on the word vectors corresponding to the sample words to obtain the first encoding vector.
4. The method of claim 2, wherein vector-coding the first test question samples by the first coding layer to obtain a first coded vector, comprises:
extracting keywords from the first test question sample through the first coding layer to obtain a plurality of keywords;
coding each keyword respectively to obtain a keyword vector corresponding to each keyword;
and acquiring the weight corresponding to each keyword, and performing weighted summation on the keyword vector corresponding to each keyword based on the weight to obtain the first coding vector.
5. The method of claim 1, wherein obtaining a first sample of questions and a second sample of questions having the same test question text comprises:
when the test question text corresponds to a target test question, obtaining a question stem and an answer of the target test question and analysis content corresponding to the answer;
splicing the question stem and the answer of the target test question and the analysis content corresponding to the answer to obtain the test question text;
and labeling labels based on the test question text to obtain the first test question sample carrying the first label and the second test question sample carrying the second label.
6. The method of claim 1, wherein updating the model parameters of the test question classification model in combination with the first label, the second label, the first prediction node, the second prediction node, and the mapping node comprises:
determining a value of a first loss function corresponding to the first classification layer based on the first label and the first prediction node, determining a value of a second loss function corresponding to the second classification layer based on the second label and the second prediction node, and determining a value of a third loss function corresponding to the mapping layer based on the first label and the mapping node;
obtaining a loss function of the test question classification model constructed by the first loss function, the second loss function and the third loss function;
determining a value of a loss function of the test question classification model based on the value of the first loss function, the value of the second loss function, and the value of the third loss function;
and updating the model parameters of the test question classification model based on the value of the loss function of the test question classification model.
7. The method of claim 1, wherein the method further comprises:
acquiring test question texts of test questions to be classified;
classifying and predicting the test question texts of the test questions to be classified through the first classification layer to obtain target nodes to which the test question texts of the test questions to be classified belong; alternatively, the first and second electrodes may be,
and classifying and predicting the test question texts of the test questions to be classified through the second classification layer to obtain nodes to be mapped to which the test question texts of the test questions to be classified belong, and mapping the nodes to be mapped through the mapping layer based on the association relationship among the nodes in the textbook system to obtain target nodes to which the test question texts of the test questions to be classified belong.
8. The method of claim 7, wherein the method further comprises:
labeling the test questions to be classified based on the target nodes to obtain labeled test questions carrying labels;
obtaining a test question outline, and matching the label of the labeled test question with the content in the test question outline to obtain a matching result;
and when the matching result represents that the label is not matched with the content in the test question schema, determining that the labeled test question is a super-dimensional test question.
9. The method of claim 1, wherein the method further comprises:
acquiring a node incidence relation table corresponding to the teaching material system;
and updating the association relation among the nodes in the teaching material system based on the node association relation table.
10. The method of claim 1 wherein said textbook architecture comprises a plurality of unit nodes, each of said unit nodes comprising at least two unit sub-nodes, each of said unit sub-nodes comprising at least one knowledge point;
when the first node is the unit sub-node and the second node is the knowledge point, the first prediction node is a prediction unit sub-node and the second prediction node is a prediction knowledge point;
the mapping the second prediction node through the mapping layer based on the incidence relation between the nodes in the textbook system to obtain the mapping node corresponding to the second prediction node includes:
and mapping the predicted knowledge points through the mapping layer based on the incidence relation between the unit sub-nodes and the knowledge points in the textbook system to obtain the unit sub-nodes corresponding to the predicted knowledge points as the mapping nodes.
11. A training device for test question classification models is characterized in that the test question classification models comprise: a first classification layer, a second classification layer, and a mapping layer, the apparatus comprising:
the system comprises an acquisition module, a detection module and a display module, wherein the acquisition module is used for acquiring a first test question sample and a second test question sample which have the same test question text, the first test question sample carries a first label, and the second test question sample carries a second label; the first label is used for indicating that a first node to which the test question text belongs in a textbook system comprising a plurality of content nodes, the second label is used for indicating a second node to which the test question text belongs, and the first node and the second node are in different node levels in the textbook system;
the classification module is used for performing classification prediction on the basis of the first test question sample through the first classification layer to obtain a first prediction node to which the test question text belongs, and performing classification prediction on the basis of the second test question sample through the second classification layer to obtain a second prediction node to which the test question text belongs;
the mapping module is used for mapping the second prediction node based on the incidence relation among the nodes in the textbook system to obtain a mapping node corresponding to the second prediction node, and the mapping node and the first prediction node are in the same node level;
and the updating module is used for updating the model parameters of the test question classification model by combining the first label, the second label, the first prediction node, the second prediction node and the mapping node.
12. An electronic device, comprising:
a memory for storing executable instructions;
a processor for implementing the method of any one of claims 1 to 10 when executing executable instructions stored in the memory.
13. A computer-readable storage medium having stored thereon executable instructions for causing a processor, when executed, to implement the method of any one of claims 1-10.
14. A computer program product comprising a computer program or instructions, characterized in that the computer program or instructions, when executed by a processor, implement the method of any of claims 1 to 10.
CN202210348773.3A 2022-04-01 2022-04-01 Test question classification model training method, device, equipment, medium and program product Pending CN115129858A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210348773.3A CN115129858A (en) 2022-04-01 2022-04-01 Test question classification model training method, device, equipment, medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210348773.3A CN115129858A (en) 2022-04-01 2022-04-01 Test question classification model training method, device, equipment, medium and program product

Publications (1)

Publication Number Publication Date
CN115129858A true CN115129858A (en) 2022-09-30

Family

ID=83376954

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210348773.3A Pending CN115129858A (en) 2022-04-01 2022-04-01 Test question classification model training method, device, equipment, medium and program product

Country Status (1)

Country Link
CN (1) CN115129858A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11816573B1 (en) * 2023-04-24 2023-11-14 Wevo, Inc. Robust systems and methods for training summarizer models

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11816573B1 (en) * 2023-04-24 2023-11-14 Wevo, Inc. Robust systems and methods for training summarizer models

Similar Documents

Publication Publication Date Title
CN111274815B (en) Method and device for mining entity focus point in text
KR102040400B1 (en) System and method for providing user-customized questions using machine learning
CN111275133B (en) Fusion method, device and storage medium of classification model
CN110825956A (en) Information flow recommendation method and device, computer equipment and storage medium
CN113254785B (en) Recommendation model training method, recommendation method and related equipment
CN113762052A (en) Video cover extraction method, device, equipment and computer readable storage medium
CN111897934A (en) Question and answer pair generation method and device
CN113010702A (en) Interactive processing method and device for multimedia information, electronic equipment and storage medium
CN112015896B (en) Emotion classification method and device based on artificial intelligence
CN110362663A (en) Adaptive more perception similarity detections and parsing
CN115269786B (en) Interpretable false text detection method and device, storage medium and terminal
CN114281957A (en) Natural language data query method and device, electronic equipment and storage medium
CN113392197A (en) Question-answer reasoning method and device, storage medium and electronic equipment
CN113705191A (en) Method, device and equipment for generating sample statement and storage medium
CN116894188A (en) Service tag set updating method and device, medium and electronic equipment
CN115129858A (en) Test question classification model training method, device, equipment, medium and program product
Sonawane et al. ChatBot for college website
CN117033649A (en) Training method and device for text processing model, electronic equipment and storage medium
CN112182179B (en) Entity question-answer processing method and device, electronic equipment and storage medium
Selviandro et al. Context awareness system on ubiquitous learning with case based reasoning and nearest neighbor algorithm
Karthikeyan et al. Mobile Artificial Intelligence Projects: Develop seven projects on your smartphone using artificial intelligence and deep learning techniques
CN111833676A (en) Interactive learning auxiliary method, device and system
Gong Research on interactive English grammar learning system based on Android platform
CN114328797B (en) Content search method, device, electronic apparatus, storage medium, and program product
CN116027946B (en) Picture information processing method and device in interactive novel

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination