CN117688449A - Question classification method, question classification model training method and device - Google Patents

Question classification method, question classification model training method and device Download PDF

Info

Publication number
CN117688449A
CN117688449A CN202311715578.0A CN202311715578A CN117688449A CN 117688449 A CN117688449 A CN 117688449A CN 202311715578 A CN202311715578 A CN 202311715578A CN 117688449 A CN117688449 A CN 117688449A
Authority
CN
China
Prior art keywords
topic
classification
classified
sample
feature vector
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
CN202311715578.0A
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.)
Beijing Ape Power Future Technology Co Ltd
Original Assignee
Beijing Ape Power Future Technology 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 Beijing Ape Power Future Technology Co Ltd filed Critical Beijing Ape Power Future Technology Co Ltd
Priority to CN202311715578.0A priority Critical patent/CN117688449A/en
Publication of CN117688449A publication Critical patent/CN117688449A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a topic classification method, a topic classification model training method and a device, wherein the topic classification method comprises the following steps: acquiring topic information to be classified and associated topic type information of the topic information to be classified, wherein the topic information to be classified comprises topics to be classified and subjects to be classified of the topics to be classified; inputting the topics to be classified and the subjects to be classified into a topic classification model to obtain topic classification results output by the topic classification model; and determining the target classification topic type of the topic to be classified in the topic classification result according to the topic to be classified and the associated topic type information. The method and the device have the advantages that the problems are classified by combining subjects corresponding to each problem while the manual labeling cost and the time are reduced, and the accuracy of the classification of the problems is improved.

Description

Question classification method, question classification model training method and device
Technical Field
The application relates to the technical field of computers, in particular to a topic classification method and a topic classification model training method. The present application relates to both a topic classification device and a topic classification model training device, a computing device, and a computer readable storage medium.
Background
With the progress and development of electronic technology, artificial intelligence gradually enters the field of view of the public and is widely applied, and life of people is affected. In practical applications, more and more students begin to get on the net in the rest of the class and do the related questions of the course on the network. And the provider of the questions needs to sort through a large number of questions before providing the questions to the student users to determine the questions that the student users need to acquire. For example, a student user needs to obtain a question with an english complete filling, and a provider of the question needs to provide the student user with the question with the english complete filling. Therefore, it is particularly important to classify a large number of topics.
Disclosure of Invention
In view of this, embodiments of the present application provide a topic classification method and a topic classification model training method. The present application is directed to both a topic classification device and a topic classification model training device, a computing device, and a computer readable storage medium to address the above-described problems in the prior art.
According to a first aspect of an embodiment of the present application, there is provided a topic classification method, including:
acquiring topic information to be classified and associated topic type information of the topic information to be classified, wherein the topic information to be classified comprises topics to be classified and subjects to be classified of the topics to be classified;
Inputting the topics to be classified and the subjects to be classified into a topic classification model to obtain topic classification results output by the topic classification model;
and determining the target classification topic type of the topic to be classified in the topic classification result according to the topic to be classified and the associated topic type information.
According to a second aspect of embodiments of the present application, there is provided a topic classification apparatus, including:
the acquisition module is configured to acquire topic information to be classified and associated topic type information of the topic information to be classified, wherein the topic information to be classified comprises topics to be classified and subjects to be classified of the topics to be classified;
the input module is configured to input the topics to be classified and the subjects to be classified into a topic classification model to obtain topic classification results output by the topic classification model;
and the determining module is configured to determine the target classification topic type of the topic to be classified in the topic classification result according to the topic to be classified and the associated topic type information.
According to a third aspect of embodiments of the present application, there is provided a method for training a topic classification model, including:
obtaining training sample data, wherein the training sample data comprises sample topic information, sample associated topic information of the sample topic information and sample classification topic types corresponding to the sample topic information, and the sample topic information comprises sample classification topics and sample classification subjects of the sample classification topics;
Inputting the sample classification subjects and the sample classification subjects into the subject classification model to obtain a predicted subject classification result output by the subject classification model;
calculating a model loss value of the topic classification model according to the prediction topic classification result and the sample classification topic model;
and adjusting model parameters of the topic classification model according to the model loss value, and continuously training the topic classification model until a training stopping condition is reached.
According to a fourth aspect of embodiments of the present application, there is provided a topic classification model training device, including:
the data acquisition module is configured to acquire training sample data, wherein the training sample data comprises sample topic information, sample associated topic information of the sample topic information and sample classification topic types corresponding to the sample topic information, and the sample topic information comprises sample classification topics and sample classification subjects of the sample classification topics;
the data input module is configured to input the sample classification subjects and the sample classification subjects into the subject classification model to obtain a predicted subject classification result output by the subject classification model;
A calculation module configured to calculate a model loss value of the topic classification model based on the predicted topic classification result and the sample classification topic;
and the training module is configured to adjust model parameters of the topic classification model according to the model loss value and continuously train the topic classification model until a training stop condition is reached.
According to a fifth aspect of embodiments of the present application, there is provided a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the topic classification method or topic classification model training method when executing the computer instructions.
According to a sixth aspect of embodiments of the present application, there is provided a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the topic classification method or topic classification model training method.
The title classification method provided by the application comprises the following steps: acquiring topic information to be classified and associated topic type information of the topic information to be classified, wherein the topic information to be classified comprises topics to be classified and subjects to be classified of the topics to be classified; inputting the topics to be classified and the subjects to be classified into a topic classification model to obtain topic classification results output by the topic classification model; and determining the target classification topic type of the topic to be classified in the topic classification result according to the topic to be classified and the associated topic type information.
According to the method and the device, the acquired topics are classified through the pre-trained topic classification model, the topics to be classified and the topics to be classified corresponding to the topics to be classified are used as the input of the topic classification model, and the topic classification result output by the topic classification model can be acquired, so that the topic types corresponding to the topics to be classified are determined in the topic classification result according to the topics to be classified and the associated topic type information. The method and the device have the advantages that the problems are classified by combining subjects corresponding to each problem while the manual labeling cost and the time are reduced, and the accuracy of the classification of the problems is improved.
Drawings
Fig. 1 is a schematic view of an application scenario of a topic classification method according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for classifying topics according to one embodiment of the present application;
FIG. 3 is a schematic diagram of a topic classification model according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a process of a topic classification model according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a topic classification device according to an embodiment of the present disclosure;
FIG. 6 is a flowchart of a method for training a topic classification model according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a training device for topic classification model according to an embodiment of the present application;
FIG. 8 is a block diagram of a computing device according to one embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is, however, susceptible of embodiment in many other ways than those herein described and similar generalizations can be made by those skilled in the art without departing from the spirit of the application and the application is therefore not limited to the specific embodiments disclosed below.
The terminology used in one or more embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the application. As used in this application in one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present application refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that, although the terms first, second, etc. may be used in one or more embodiments of the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, a first may also be referred to as a second, and similarly, a second may also be referred to as a first, without departing from the scope of one or more embodiments of the present application. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
First, terms related to one or more embodiments of the present application will be explained.
Pre-training language model: the pre-training language model is a natural language processing model based on deep learning technology, and is usually pre-trained on a large corpus and used for solving various problems in natural language processing tasks. The working principle of the model is to learn various rules and features in natural language through a deep neural network, including relations among words, sentence structures, grammar rules and the like. In the training process, the model can gradually grasp the complexity and characteristics of natural language by analyzing and learning texts in a large number of corpora, so that the model has higher language understanding capability and generating capability.
bert-wwm model: wwm is WholeWordMasking. The pre-training strategy of the bert-wwm model is similar to that of the bert model, and language characterization is learned by both the masked language model (mask language model) and next sentence prediction (next sentence prediction) pre-training tasks. However, the bert-wwm model uses a whole word mask to mask the input sequence. In the bert-wwm model, each word in the input sequence is masked by a "whole word mask" rather than randomly picking partial words to mask as in the bert model. The whole word mask mode can enable the model to better process whole word information, and therefore the performance of the model is improved.
Multidisciplinary topic type classification: given a subject content, standard answers, and analysis under the premise of known subject, the subject is classified into its subject type, such as English complete filling, mathematics application subject, etc.
In practical applications, more and more people begin to learn knowledge, test problems, etc. by using various application programs, and business parties need to record various problems from various channels before providing the various problems to users through the application programs. While different users have different requirements, for example, for pupil, pupil needs test, further, different pupil will also have different requirements, some pupil may need pupil math application, some pupil may need pupil reading questions in primary school, or some pupil may need pupil english complete filling questions, etc.
Based on this, after various topics are recorded, the business party needs to further classify the topics to determine the topic types corresponding to the topics. The magnitude of the questions recorded by the business side is often larger, and each question can be confirmed to be corresponding to the question in the grabbing process, but the condition that the classification of the question is incorrect often occurs, and the questions need to be confirmed for the second time. If manual labeling is performed by a teacher in order to ensure accuracy of topic classification, the cost of manual labeling is high and the time taken for labeling is also long.
In the present application, a topic classification method and a topic classification model training method are provided, and the present application relates to a topic classification device and a topic classification model training device, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments one by one.
Referring to fig. 1, fig. 1 shows an application scenario schematic diagram of a topic classification method according to an embodiment of the present application. As shown in fig. 1, a business party firstly captures topics from various channels to obtain initial classification topic information, wherein the initial topic classification information comprises captured topics needing classification and subjects corresponding to the topics. Each question to be classified comprises a question stem, an answer corresponding to the question stem and answer analysis. Since the topics are captured from various channels, various types of topics may exist in the captured topics, for example, the original topics may contain more html format tags, and the tags need to be deleted to obtain topic information to be classified after data cleaning, and topic classification is performed based on the topic information to be classified after data cleaning.
Specifically, after obtaining the topic information to be classified, the topic information to be classified can be input into the topic classification model, so that the topic classification result output by the topic classification model can be obtained. The topic classification result includes topic probability corresponding to each topic type, so after obtaining the topic classification result, the topic classification result needs to further determine the target classification topic type corresponding to the topic.
Based on the method, after the classification of the topic types corresponding to each topic is completed, the topic corresponding to the topic type can be provided for the user according to the user requirement when the user obtains the topic. Fig. 1 shows an application scenario taking an application problem in a certain subject as an example, after classifying each problem based on the above method, if a user requests to access the application problem in the primary school mathematics subject to a server through a user terminal thereof, the server will respond to the user request and return any application problem classified in the primary school mathematics subject application problem type to the user terminal.
According to the topic classification method, the acquired topics are classified through the pre-trained topic classification model, the topics corresponding to the topics, the answers and the answers are analyzed, and the subjects corresponding to the topics are used as the input of the topic classification model, so that topic classification results output by the topic classification model can be acquired, and the topic type corresponding to each topic is determined according to the topic classification results. The method and the device have the advantages that the problems are classified by combining subjects corresponding to each problem while the manual labeling cost and the time are reduced, and the accuracy of the classification of the problems is improved.
Fig. 2 shows a flowchart of a topic classification method according to an embodiment of the present application, which specifically includes the following steps:
step 202: and acquiring topic information to be classified and associated topic type information of the topic information to be classified, wherein the topic information to be classified comprises topics to be classified and subjects to be classified of the topics to be classified.
The topic information to be classified refers to topic information which needs topic classification after data cleaning. The topic information to be classified comprises a plurality of topics to be classified and topics to be classified corresponding to the topics to be classified. The questions to be classified are questions which need to be classified after data information is carried out, and specifically comprise stems, answers corresponding to the stems and answer analysis. The subject to be classified is the subject corresponding to the subject to be classified. For example, primary mathematics, primary school language, junior middle school history, senior high school creatures, and the like.
The associated topic information refers to a plurality of topic information which can be contained in each topic information to be classified. The topic type information can be specifically understood as a plurality of topic type information which can be contained in the subject to be classified corresponding to the topic to be classified. For example, the topic information to be classified includes a complete blank-filling topic, and the topic to be classified corresponding to the complete blank-filling topic is a high-school english, and then the topics that the high-school english may include are hearing topics, grammar blank-filling topics, reading and parsing topics, complete blank-filling topics, text error-correcting topics and composition topics. Namely, the associated question information of the question information to be classified is a hearing question, a grammar blank-filling question, a reading and cleavage question, a complete blank-filling question, a text error-correcting question and a composition question.
In practical application, the business party may grasp the questions from various channels, and various formats of questions may exist in the grasped questions, for example, the original questions may include more html and latex format labels, and may also include picture links and spaces, so that the obtained original questions need to be subjected to data cleaning to obtain the information of the questions to be classified after the data cleaning, and the questions to be classified are classified based on the information of the questions to be classified after the data cleaning.
In an embodiment provided in the present application, obtaining topic information to be classified includes:
acquiring initial classification topic information;
identifying information to be deleted in the initial classification topic information;
and deleting the to-be-deleted information from the initial classification topic information to obtain the to-be-classified topic information.
The initial classification topic information refers to the acquired original topic information which is not subjected to data cleaning. The information to be deleted refers to information which needs to be deleted in the initial classification topic information. Such as picture links, front and back spaces, sentence start and end spaces, html format tags, etc.
Specifically, the initial classification topic information is firstly obtained, then the information to be deleted in the initial classification topic information is identified, and the information to be deleted is deleted from the initial classification topic information, so that the topic information to be classified can be obtained. In addition, the initial classification question information may further include questions with a plurality of answers, and for this case, the plurality of answers need to be spliced into a character string, so as to obtain the question information to be classified.
In practical application, a question often includes a stem, an answer, and an answer analysis, so that data cleaning is performed on the initial classification question information, that is, the stem, the answer, and the answer analysis in the questions to be classified are data cleaned.
For example, the stem is "< p > Think it twice before you make a < input size=" "8" "" ready "=" "ready" "" type "=" "underline"/> (resolution) </p > "", and the data-washed stem is "Think it twice before you make a [ input ] (resolution)".
The answer is "{" "type": 202 "," "blanks": "[" < p > precision "]" ", and the answer after data cleaning is obtained as" precision ".
The answer is parsed into "< p style=" "text-align: just" "> examination noun. From the article a preceding the blank, it is known that the number of nouns should be filled. Meaning: one more pass is considered before you make a decision. The noun form of the resolution is resolution. The answer is therefore: precision. And (3) carrying out data cleaning on answer analysis to obtain the answer analysis after data cleaning into examination nouns. From the article a preceding the blank, it is known that the number of nouns should be filled. Meaning: one more pass is considered before you make a decision. The noun form of the resolution is resolution. The answer is therefore: precision. ".
According to the topic classification method, the initial classification topic information which is not subjected to data cleaning can be firstly obtained, the information to be deleted in the initial classification topic information is deleted, the data cleaning of the initial classification topic information is realized, the topic information to be classified is obtained, and the topic classification accuracy can be improved in the subsequent topic classification process by using the topic classification model. By acquiring the associated question type information of the questions to be classified, the question type range corresponding to the questions to be classified can be reduced in the process of determining the questions corresponding to the questions to be classified later, and the classification efficiency and accuracy are improved.
Step 204: and inputting the topics to be classified and the subjects to be classified into a topic classification model to obtain topic classification results output by the topic classification model.
In practical applications, the same topic type usually corresponds to a plurality of subjects, for example, a high school mathematics subject has a choice question, a high school language has a choice question, a high school creature has a choice question, and the like, in this case, the topics are classified only with respect to the topic information, and the accuracy of classification is difficult to ensure, so that the topics can be classified in combination with the subjects corresponding to the topics.
The topic classification model is used for classifying topics to be classified according to the topics to be classified and the subjects to be classified, and outputting topic classification results corresponding to the topics to be classified. The topic classification result is an output result of the topic classification model, is a classification result of the topic to be classified, and comprises a plurality of prediction classification topic types of the topic to be classified and topic type probabilities corresponding to the prediction classification topic types.
Specifically, after the initial classification topic information is subjected to data cleaning and the topic information to be classified is obtained, the topic to be classified and the topic subject to be classified in the topic information to be classified can be input into a topic classification model so as to obtain a topic classification result output by the topic classification model.
In a specific embodiment provided in the present application, the questions to be classified include stems to be classified, answers to be classified corresponding to the stems to be classified, and analyses to be classified corresponding to the stems to be classified;
inputting the topics to be classified into a topic classification model, comprising:
splicing the stem to be classified, the answer to be classified and the analysis to be classified to obtain a text to be input;
and inputting the text to be input into the topic classification model.
The problem stems to be classified are the problem stems of the problem to be classified; the answers to be classified are answers of the stems to be classified; and analyzing to be classified, namely analyzing the answers corresponding to the stems to be classified, namely analyzing the answers of the answers to be classified.
The text to be input refers to a spliced text formed by the stem to be classified, the answer to be classified and the analysis to be classified, and is used for inputting a topic classification model to obtain a topic classification result.
Specifically, the to-be-classified question stems, the to-be-classified answers and the to-be-classified analyses in the to-be-classified questions are spliced, spliced texts are used as to-be-input texts, and the to-be-input texts are input into the question classification model.
Along the above examples, the stem after data washing, i.e., the stem to be classified is "Think it twice before you make a [ input ] (derivative)"; the answer after data cleaning, namely the answer to be classified is "precision"; and analyzing the answers after data cleaning, namely analyzing to be classified into examination nouns. From the article a preceding the blank, it is known that the number of nouns should be filled. Meaning: one more pass is considered before you make a decision. The noun form of the resolution is resolution. The answer is therefore: precision. ". The method comprises the steps of splicing a to-be-classified question stem, a to-be-classified answer and a to-be-classified analysis, and in order to facilitate the recognition and processing of a to-be-input text by a question classification model, adding < cls > at the sentence head of the spliced text, and adding < eos > at the sentence tail of the spliced text, so that the to-be-input text can be obtained as "< cls > Think it twice before you make a [ input ] (resolution) & precision examination nouns. From the article a preceding the blank, it is known that the number of nouns should be filled. Meaning: one more pass is considered before you make a decision. The noun form of the resolution is resolution. The answer is therefore: precision. < eos > ", and inputting the text to be input into the topic classification model.
The method comprises the steps of obtaining the to-be-classified stems, the to-be-classified answers and the to-be-classified analysis, splicing, constructing the to-be-input text, and inputting the to-be-input text into the question classification model, so that the quality of the to-be-input text can be improved, and the question classification model is beneficial to processing the to-be-input text.
Further, referring to fig. 3, fig. 3 shows a schematic diagram of a model architecture of a topic classification model according to an embodiment of the present application. As shown in fig. 3, the topic classification model includes an embedding layer, an encoding layer, and an output layer, the embedding layer is used for generating an embedded feature vector of input data of the input topic classification model; the coding layer is used for coding the embedded feature vector to generate a coding feature vector; the input layer is used for generating and outputting a topic classification result based on the coding feature vector.
In one embodiment provided herein, the topic classification model includes an embedding layer, an encoding layer, and an output layer;
inputting the topics to be classified and the subjects to be classified into a topic classification model to obtain topic classification results output by the topic classification model, wherein the topic classification results comprise:
inputting the text to be input and the discipline to be classified into the embedding layer to obtain an initial text embedding feature vector corresponding to the text to be input and an initial discipline embedding feature vector corresponding to the discipline to be classified;
Inputting the initial text embedded feature vector and the initial subject embedded feature vector into the coding layer to obtain a coding feature vector;
and inputting the coding feature vector into the output layer to obtain the topic classification result of the topic to be classified.
Specifically, the text to be input and the subjects to be classified are input into the embedding layer of the subject classification model, the initial text embedded feature vector and the initial subjects embedded feature vector generated by the embedding layer can be obtained, the initial text embedded feature vector and the initial subjects embedded feature vector are input into the coding layer of the subject classification model, and the coding feature vector output by the coding layer can be obtained. And finally, inputting the coding feature vector into an output layer of the topic classification model, and obtaining a topic classification result output by the output layer.
In practical application, the topic classification model can be a bert-wwm model, and in the process of processing the text to be input and the subject to be classified, the bert-wwm model masks complete words and reserves the integrity of the words, so that the bert-wwm model can more accurately understand and learn word senses of the words, and the capability of the topic classification model for processing Chinese text is improved.
Further, in a specific embodiment provided herein, the embedded layers include a word embedded layer, a location embedded layer, and a disciplinary embedded layer;
inputting the text to be input and the discipline to be classified into the embedding layer to obtain an initial text embedding feature vector corresponding to the text to be input and an initial discipline embedding feature vector corresponding to the discipline to be classified, wherein the method comprises the following steps:
inputting the text to be input into the word embedding layer and the position embedding layer respectively to obtain a word embedding feature vector and a position embedding feature vector corresponding to the text to be input;
and inputting the subjects to be classified into the subject embedding layer to obtain initial subject embedding feature vectors corresponding to the subjects to be classified.
The word embedding layer is used for encoding each word or word in the text to be input and generating a word embedding feature vector corresponding to the text to be input. The size of the word embedding feature vector is batch_size_seq_length_hidden_size.
The position embedding layer is used for encoding the index position of each word or word in the text to be input and generating a position embedding feature vector corresponding to the text to be input. The size of the position-embedding feature vector is batch_size_seq_length_h_hidden_size.
The discipline embedding layer is used for encoding disciplines to be classified and generating initial discipline embedding feature vectors corresponding to the disciplines to be classified. The size of the initial disciplinary embedding feature vector is batch_size.
Specifically, a text to be input is input into a word embedding layer to obtain a word embedding feature vector, a text to be input is input into a position embedding layer to obtain a position embedding feature vector, a subject to be classified is input into a subject embedding layer to obtain an initial subject embedding feature vector.
After obtaining the word embedded feature vector, the position embedded feature vector and the initial subject embedded feature vector, feature fusion is required to be carried out on the word embedded feature vector, the position embedded feature vector and the initial subject embedded feature vector, and the fused feature vector is input to a coding layer for processing.
In a specific embodiment provided in the present application, inputting the initial text-embedded feature vector and the initial subject-embedded feature vector into the coding layer includes:
generating a target input embedded feature vector according to the word embedded feature vector, the position embedded feature vector and the initial subject embedded feature vector;
the target input embedded feature vector is input to the encoding layer.
The target input embedded feature vector refers to a feature vector obtained by feature fusion of a word embedded feature vector, a position embedded feature vector and an initial subject embedded feature vector.
Specifically, the target input embedded feature vector may be generated according to the word embedded feature vector, the position embedded feature vector and the initial subject embedded feature vector, that is, the word embedded feature vector, the position embedded feature vector and the initial subject embedded feature vector are subjected to feature fusion to obtain the target input embedded feature vector, and then the target input embedded feature vector is input to the encoding layer. The implementation of generating the target input embedded feature vector is as follows:
in a specific embodiment provided in the present application, generating a target input embedded feature vector according to the word embedded feature vector, the location embedded feature vector, and the initial subject embedded feature vector includes:
determining vector lengths of the word embedded feature vector and the position embedded feature vector;
expanding the initial subject embedding feature vector according to the vector length to generate a target subject embedding feature vector corresponding to the initial subject embedding feature vector;
And adding the word embedded feature vector, the position embedded feature vector and the target subject embedded feature vector to generate a target input embedded feature vector.
The target subject embedded feature vector is a feature vector obtained by expanding the vector length of the initial subject embedded feature vector, and the vector length is the same as the vector lengths of the word embedded feature vector and the position embedded feature vector. The size of the target subject embedding feature vector is batch_size_seq_length_hidden_size.
Since the size of the initial subject embedding feature vector is different from the sizes of the word embedding feature vector and the position embedding feature vector, the initial subject embedding feature vector needs to be expanded to a target subject embedding feature vector having the same size as the word embedding feature vector and the position embedding feature vector before feature fusion is performed on the word embedding feature vector, the position embedding feature vector, and the initial subject embedding feature vector. And generating a target input embedded feature vector according to the word embedded feature vector, the position embedded feature vector and the target subject embedded feature vector.
Specifically, the vector lengths of the word embedding feature vector and the position embedding feature vector are determined, and according to the vector lengths, the initial subject embedding feature vector copy is expanded to a target subject embedding feature vector of the vector lengths. And then carrying out vector addition on the word embedded feature vector, the position embedded feature vector and the target subject embedded feature vector to obtain a target input embedded feature vector. And then the encoding feature vector is input into an output layer for processing, so that a topic classification result output by the output layer is obtained.
Further, referring to fig. 4, fig. 4 is a schematic diagram illustrating a process of a topic classification model according to an embodiment of the present application. As shown in fig. 4, the text to be input is input to the word embedding layer and the position embedding layer, respectively, to obtain the word embedding feature vector output by the word embedding layer and the position embedding feature vector output by the position embedding layer. Inputting the subject to be classified into the subject embedding layer to obtain an initial subject embedding feature vector output by the subject embedding layer, and performing length expansion on the initial subject embedding feature vector to obtain a target subject embedding feature vector. And then carrying out vector addition on the word embedded feature vector, the position embedded feature vector and the target subject embedded feature vector to generate a target input embedded feature vector. And then, inputting the target input embedded feature vector into the coding layer to obtain the coding feature vector output by the coding layer, and inputting the coding feature vector into the output layer to obtain the topic classification result output by the output layer.
According to the topic classification method, the subject embedding layer is newly added in the embedding layer, so that topic classification results corresponding to topics to be classified can be generated by combining processing of subjects to be classified in the process of processing the text to be input.
Step 206: and determining the target classification topic type of the topic to be classified in the topic classification result according to the topic to be classified and the associated topic type information.
The target classification question type is the classification question type of the questions to be classified.
In practical application, the topic classification result output by the topic classification model includes a plurality of prediction classification topics and topic probabilities corresponding to the prediction classification topics, so after obtaining the topic classification result output by the topic classification model, the target classification topic corresponding to the topic to be classified needs to be further determined in the plurality of prediction classification topics.
In view of this, in a specific embodiment provided in the present application, the topic classification result includes a plurality of prediction classification topics and topic probabilities corresponding to the prediction classification topics;
according to the subject to be classified and the associated topic information, determining a target classification topic of the topic to be classified in the topic classification result comprises the following steps:
screening the classification topic types to be determined and topic type probabilities corresponding to the classification topic types to be determined from all prediction classification topic types according to the subject to be classified and the associated topic type information;
and determining the target classification question type in the classification question types to be determined according to the question type probability corresponding to the classification question types to be determined.
The to-be-determined classification question type refers to a question type which is determined in each prediction classification question type and has an association relation with the to-be-classified question based on the association question type information of the to-be-classified question. For example, the subject to be classified is mathematics of primary school, the type of the subject to be classified to be determined can be selected, judged, filled, applied, etc., and the type of the subject to be determined cannot be completely filled, hearing, etc.
The question type probability refers to the probability that the question to be classified corresponds to any question type to be determined. For example, the problem type to be determined is an application problem, the probability of the corresponding problem type is 2%, and the probability of the problem to be determined is 2%.
Specifically, after obtaining the topic classification result output by the topic classification model, according to the topic to be classified subject and the associated topic information of the topic to be classified, a plurality of topic types to be determined are screened from a plurality of prediction classification topic types of the topic classification result, and topic probability corresponding to the topic types to be determined. And further, determining the target classification question type of the questions to be classified in the classification question types to be determined according to the question type probability corresponding to the classification question types to be determined. Further, a maximum value of the question type probabilities can be determined in the question type probabilities corresponding to the to-be-determined classification question types, and the to-be-determined classification question type corresponding to the question type probability of the maximum value is determined as the target classification question type of the to-be-classified question.
The subject classification result of the subject to be classified is obtained by combining subjects to be classified corresponding to the subjects to be classified, and then the target classification subject type is determined in the subject classification result according to the associated subject type information, so that the accuracy of the subject classification is greatly improved.
In a specific embodiment provided in the present application, the topic classification model is obtained by training according to the following method:
obtaining training sample data, wherein the training sample data comprises sample topic information, sample associated topic information of the sample topic information and sample classification topic types corresponding to the sample topic information, and the sample topic information comprises sample classification topics and sample classification subjects of the sample classification topics;
inputting the sample classification subjects and the sample classification subjects into the subject classification model to obtain a predicted subject classification result output by the subject classification model;
calculating a model loss value of the topic classification model according to the prediction topic classification result and the sample classification topic model;
and adjusting model parameters of the topic classification model according to the model loss value, and continuously training the topic classification model until a training stopping condition is reached.
The training sample data is data for training a topic classification model, the training sample data comprises sample topic information, sample associated topic information of the sample topic information and sample classification topic types corresponding to the sample topic information, and the sample topic information comprises sample classification topics and sample classification subjects of the sample classification topics.
The sample topic information is topic information acquired from a sample topic information set and is a training sample of a topic classification model; the sample topic information set refers to a set formed by topic information obtained by collecting historical topic information; the sample classification question type refers to an actual classification question type corresponding to sample question information; the predicted topic classification result refers to a topic classification result output by inputting a sample classification topic and a sample classification subject into a topic classification model, and the predicted topic classification result comprises predicted classification topic types and topic probability corresponding to each predicted classification topic type; the model loss value refers to a difference value between the sample classification question type and each prediction classification question type, and is used for measuring the difference between the sample classification question type and each prediction classification question type.
Specifically, sample topic information and sample associated topic information are obtained through the above-mentioned obtaining mode for obtaining topic information to be classified and associated topic information, and sample classification topics and sample classification subjects are input into a topic classification model to obtain a prediction topic classification result.
The topic classification model is used for determining classification topic types of sample classification topic, the topic classification model is a model which is not trained yet, deviation exists between each prediction classification topic type determined and the actual sample classification topic type, corresponding adjustment is needed to be carried out on model parameters of the topic classification model, specifically, model loss values of the topic classification model are calculated according to each prediction classification topic type and the sample classification topic type which are output, a loss function of the calculated model loss values can be a 0-1 loss function, a square loss function, a cross entropy loss function and the like in actual application, in the application, preferably, the cross entropy function is selected as the loss function of the calculated model loss values, model parameters of the topic classification model are adjusted according to the model loss values, and the topic classification model is continuously trained based on the adjusted model parameters for training sample data of the next batch until a model training stop condition is reached.
Specifically, the model training stop condition includes the model loss value being less than a preset threshold and/or the training round reaching a preset round.
In a specific embodiment provided in the present application, taking the model loss value smaller than the preset threshold value as the training stop condition as an example, the preset threshold value is 0.3, and when the model loss value is smaller than 0.3, the training of the topic classification model is considered to be completed.
In another specific embodiment provided in the application, taking a preset training round as a training stop condition as an example, the preset training round is 30 rounds, and when the training round of training sample data reaches 30 rounds, training of the topic classification model is considered to be completed.
In still another specific embodiment provided in the present application, two training stop conditions of the preset threshold and the preset training round are set, and the model loss value and the training round are determined at the same time, and when any one of the model loss value or the training round satisfies the training stop condition, the training of the topic classification model is considered to be completed.
Since the prediction topic classification result output by the topic prediction model includes a plurality of prediction classification topics, it is necessary to calculate a loss value between each prediction classification topic and the sample classification topic, calculate an average value of the loss values, and use the average value as a model loss value of the topic classification model.
The title classification method provided by the application comprises the following steps: acquiring topic information to be classified and associated topic type information of the topic information to be classified, wherein the topic information to be classified comprises topics to be classified and subjects to be classified of the topics to be classified; inputting the topics to be classified and the subjects to be classified into a topic classification model to obtain topic classification results output by the topic classification model; and determining the target classification topic type of the topic to be classified in the topic classification result according to the topic to be classified and the associated topic type information.
According to the method and the device, the acquired topics are classified through the pre-trained topic classification model, the topics corresponding to the topics, the answers and the answers are analyzed, and the subjects corresponding to the topics are used as the input of the topic classification model, so that topic classification results output by the topic classification model can be acquired, and the topic type corresponding to each topic is determined according to the topic classification results. The method and the device have the advantages that the problems are classified by combining subjects corresponding to each problem while the manual labeling cost and the time are reduced, and the accuracy of the classification of the problems is improved.
Corresponding to the above method embodiment, the present application further provides an embodiment of a topic classification device, and fig. 5 shows a schematic structural diagram of the topic classification device according to an embodiment of the present application. As shown in fig. 5, the apparatus includes:
an obtaining module 502 configured to obtain topic information to be classified and associated topic information of the topic information to be classified, where the topic information to be classified includes a topic to be classified and a topic to be classified of the topic to be classified;
the input module 504 is configured to input the topics to be classified and the subjects to be classified into a topic classification model, and obtain topic classification results output by the topic classification model;
A determining module 506 is configured to determine a target classification topic type of the topic to be classified in the topic classification result according to the topic to be classified and the associated topic type information.
Optionally, the questions to be classified include the stems to be classified, answers to be classified corresponding to the stems to be classified, and analyses to be classified corresponding to the stems to be classified;
the input module 504 is further configured to:
splicing the stem to be classified, the answer to be classified and the analysis to be classified to obtain a text to be input;
and inputting the text to be input into the topic classification model.
Optionally, the topic classification model includes an embedded layer, an encoding layer and an output layer;
the input module 504 is further configured to:
inputting the text to be input and the discipline to be classified into the embedding layer to obtain an initial text embedding feature vector corresponding to the text to be input and an initial discipline embedding feature vector corresponding to the discipline to be classified;
inputting the initial text embedded feature vector and the initial subject embedded feature vector into the coding layer to obtain a coding feature vector;
and inputting the coding feature vector into the output layer to obtain the topic classification result of the topic to be classified.
Optionally, the embedded layers include a word embedded layer, a location embedded layer, and a discipline embedded layer;
the input module 504 is further configured to:
inputting the text to be input into the word embedding layer and the position embedding layer respectively to obtain a word embedding feature vector and a position embedding feature vector corresponding to the text to be input;
and inputting the subjects to be classified into the subject embedding layer to obtain initial subject embedding feature vectors corresponding to the subjects to be classified.
Optionally, the input module 504 is further configured to:
generating a target input embedded feature vector according to the word embedded feature vector, the position embedded feature vector and the initial subject embedded feature vector;
the target input embedded feature vector is input to the encoding layer.
Optionally, the input module 504 is further configured to:
determining vector lengths of the word embedded feature vector and the position embedded feature vector;
expanding the initial subject embedding feature vector according to the vector length to generate a target subject embedding feature vector corresponding to the initial subject embedding feature vector;
and adding the word embedded feature vector, the position embedded feature vector and the target subject embedded feature vector to generate a target input embedded feature vector.
Optionally, the topic classification result includes a plurality of prediction classification topics and topic probabilities corresponding to the prediction classification topics;
the determining module 506 is further configured to:
screening the classification topic types to be determined and topic type probabilities corresponding to the classification topic types to be determined from all prediction classification topic types according to the subject to be classified and the associated topic type information;
and determining the target classification question type in the classification question types to be determined according to the question type probability corresponding to the classification question types to be determined.
Optionally, the topic classification device further includes a model training module configured to:
obtaining training sample data, wherein the training sample data comprises sample topic information, sample associated topic information of the sample topic information and sample classification topic types corresponding to the sample topic information, and the sample topic information comprises sample classification topics and sample classification subjects of the sample classification topics;
inputting the sample classification subjects and the sample classification subjects into the subject classification model to obtain a predicted subject classification result output by the subject classification model;
calculating a model loss value of the topic classification model according to the prediction topic classification result and the sample classification topic model;
And adjusting model parameters of the topic classification model according to the model loss value, and continuously training the topic classification model until a training stopping condition is reached.
Optionally, the obtaining module 502 is further configured to:
acquiring initial classification topic information;
identifying information to be deleted in the initial classification topic information;
and deleting the to-be-deleted information from the initial classification topic information to obtain the to-be-classified topic information.
The title classification device that this application provided includes: the acquisition module is configured to acquire topic information to be classified and associated topic type information of the topic information to be classified, wherein the topic information to be classified comprises topics to be classified and subjects to be classified of the topics to be classified; the input module is configured to input the topics to be classified and the subjects to be classified into a topic classification model to obtain topic classification results output by the topic classification model; and the determining module is configured to determine the target classification topic type of the topic to be classified in the topic classification result according to the topic to be classified and the associated topic type information.
According to the method and the device, the acquired topics are classified through the pre-trained topic classification model, the topics corresponding to the topics, the answers and the answers are analyzed, and the subjects corresponding to the topics are used as the input of the topic classification model, so that topic classification results output by the topic classification model can be acquired, and the topic type corresponding to each topic is determined according to the topic classification results. The method and the device have the advantages that the problems are classified by combining subjects corresponding to each problem while the manual labeling cost and the time are reduced, and the accuracy of the classification of the problems is improved.
The above is an exemplary embodiment of a topic classification device according to this embodiment. It should be noted that, the technical solution of the topic classification device and the technical solution of the topic classification method belong to the same concept, and details of the technical solution of the topic classification device which are not described in detail can be referred to the description of the technical solution of the topic classification method.
Fig. 6 shows a flowchart of a method for training a topic classification model according to an embodiment of the present application, which specifically includes the following steps:
step 602: and obtaining training sample data, wherein the training sample data comprises sample topic information, sample associated topic type information of the sample topic information and sample classification topic types corresponding to the sample topic information, and the sample topic information comprises sample classification topics and sample classification subjects of the sample classification topics.
Step 604: and inputting the sample classification subjects and the sample classification subjects into the subject classification model to obtain a predicted subject classification result output by the subject classification model.
Step 606: and calculating a model loss value of the topic classification model according to the prediction topic classification result and the sample classification topic model.
Since the prediction topic classification result output by the topic prediction model includes a plurality of prediction classification topics, it is necessary to calculate a loss value between each prediction classification topic and the sample classification topic, calculate an average value of the loss values, and use the average value as a model loss value of the topic classification model.
In one embodiment provided in the present application, calculating a model loss value of the topic classification model according to the predicted topic classification result and the sample classification topic comprises:
calculating a loss value corresponding to each prediction classification question type according to each prediction classification question type and the sample classification question type in the prediction question classification result;
and calculating the model loss value of the topic classification model according to the loss value corresponding to each prediction classification topic.
The loss value corresponding to each prediction classification question type refers to a loss value between each prediction classification question type and a sample classification question type, and is used for measuring the difference between each prediction classification question type and the sample classification question type.
Specifically, the loss values between the prediction classification questions and the sample classification questions are calculated, and then the average value between the loss values corresponding to the prediction classification questions is calculated, and the average value is determined as the model loss value of the question classification model.
Step 608: and adjusting model parameters of the topic classification model according to the model loss value, and continuously training the topic classification model until a training stopping condition is reached.
The training method of the topic classification model is the same as that of the topic classification model in the topic classification method, and the training method of the topic classification model can be referred to in the above description, and the description of the training method of the topic classification model is omitted here.
According to the method for training the topic classification model, the prediction classification topic model corresponding to the sample classification topic is predicted by combining the processing of the sample classification subjects in the training process of the topic classification model, so that the training accuracy of the topic classification model is improved.
Corresponding to the method embodiment, the present application further provides an embodiment of a topic classification model training device, and fig. 7 shows a schematic structural diagram of the topic classification model training device according to an embodiment of the present application. As shown in fig. 7, the apparatus includes:
a data acquisition module 702 configured to acquire training sample data, wherein the training sample data includes sample topic information, sample associated topic information of the sample topic information, and a sample classification topic corresponding to the sample topic information, the sample topic information including a sample classification topic and a sample classification discipline of the sample classification topic;
A data input module 704 configured to input the sample classification topic and the sample classification discipline into the topic classification model to obtain a predicted topic classification result output by the topic classification model;
a calculation module 706 configured to calculate a model loss value of the topic classification model based on the predicted topic classification result and the sample classification topic;
a training module 708 configured to adjust model parameters of the topic classification model according to the model loss values and to continue training the topic classification model until a training stop condition is reached.
Optionally, the computing module 706 is further configured to:
calculating a loss value corresponding to each prediction classification question type according to each prediction classification question type and the sample classification question type in the prediction question classification result;
and calculating the model loss value of the topic classification model according to the loss value corresponding to each prediction classification topic.
According to the method for training the topic classification model, the prediction classification topic model corresponding to the sample classification topic is predicted by combining the processing of the sample classification subjects in the training process of the topic classification model, so that the training accuracy of the topic classification model is improved.
The above is a schematic scheme of the topic classification model training device of the present embodiment. It should be noted that, the technical solution of the topic classification model training device and the technical solution of the topic classification model training method belong to the same concept, and details of the technical solution of the topic classification model training device which are not described in detail can be referred to the description of the technical solution of the topic classification model training method.
Fig. 8 illustrates a block diagram of a computing device 800 provided in accordance with an embodiment of the present application. The components of computing device 800 include, but are not limited to, memory 810 and processor 820. Processor 820 is coupled to memory 810 through bus 830 and database 850 is used to hold data.
Computing device 800 also includes access device 840, access device 840 enabling computing device 800 to communicate via one or more networks 860. Examples of such networks include public switched telephone networks (PSTN, public Switched Telephone Network), local area networks (LAN, localAreaNetwork), wide area networks (WAN, wideAreaNetwork), personal area networks (PAN, personalAreaNetwork), or combinations of communication networks such as the internet. Access device 840 may include one or more of any type of network interface, wired or wireless, such as a network interface card (NIC, network interface controller), such as an IEEE802.11 wireless local area network (WLAN, wireless LocalAreaNetwork) wireless interface, a worldwide interoperability for microwave access (Wi-MAX, worldwide Interoperability for MicrowaveAccess) interface, an ethernet interface, a universal serial bus (USB, universal Serial Bus) interface, a cellular network interface, a bluetooth interface, a near field communication (NFC, near Field Communication) interface, and so forth.
In one embodiment of the present application, the above-described components of computing device 800, as well as other components not shown in FIG. 8, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device illustrated in FIG. 8 is for exemplary purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as desired.
Computing device 800 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smart phone), wearable computing device (e.g., smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or personal computer (PC, personal Computer). Computing device 800 may also be a mobile or stationary server.
Wherein processor 820 performs the steps of the subject classification method or subject classification model training method when executing the computer instructions.
The foregoing is a schematic illustration of a computing device of this embodiment. It should be noted that, the technical solution of the computing device and the technical solution of the above-mentioned topic classification method or topic classification model training method belong to the same concept, and the details of the technical solution of the computing device, which are not described in detail, can be referred to the description of the technical solution of the above-mentioned topic classification method or topic classification model training method.
An embodiment of the present application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the topic classification method or topic classification model training method described above.
The above is an exemplary version of a computer-readable storage medium of the present embodiment. It should be noted that, the technical solution of the storage medium and the technical solution of the above-mentioned topic classification method or topic classification model training method belong to the same concept, and the details of the technical solution of the storage medium that are not described in detail can be referred to the description of the technical solution of the above-mentioned topic classification method or topic classification model training method.
The foregoing describes specific embodiments of the present application. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The computer instructions include computer program code that may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, randomAccess Memory), an electrical carrier signal, a telecommunication signal, a software distribution medium, and so forth.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all necessary for the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The above-disclosed preferred embodiments of the present application are provided only as an aid to the elucidation of the present application. Alternative embodiments are not intended to be exhaustive or to limit the invention to the precise form disclosed. Obviously, many modifications and variations are possible in light of the teaching of this application. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best understand and utilize the invention. This application is to be limited only by the claims and the full scope and equivalents thereof.

Claims (15)

1. A method of topic classification comprising:
acquiring topic information to be classified and associated topic type information of the topic information to be classified, wherein the topic information to be classified comprises topics to be classified and subjects to be classified of the topics to be classified;
inputting the topics to be classified and the subjects to be classified into a topic classification model to obtain topic classification results output by the topic classification model;
and determining the target classification topic type of the topic to be classified in the topic classification result according to the topic to be classified and the associated topic type information.
2. The method of claim 1, wherein the questions to be classified comprise stems to be classified, answers to be classified corresponding to the stems to be classified, and analyses to be classified corresponding to the stems to be classified;
inputting the topics to be classified into a topic classification model, comprising:
splicing the stem to be classified, the answer to be classified and the analysis to be classified to obtain a text to be input;
and inputting the text to be input into the topic classification model.
3. The method of claim 2, wherein the topic classification model comprises an embedding layer, an encoding layer, and an output layer;
inputting the topics to be classified and the subjects to be classified into a topic classification model to obtain topic classification results output by the topic classification model, wherein the topic classification results comprise:
inputting the text to be input and the discipline to be classified into the embedding layer to obtain an initial text embedding feature vector corresponding to the text to be input and an initial discipline embedding feature vector corresponding to the discipline to be classified;
inputting the initial text embedded feature vector and the initial subject embedded feature vector into the coding layer to obtain a coding feature vector;
and inputting the coding feature vector into the output layer to obtain the topic classification result of the topic to be classified.
4. The method of claim 3, wherein the embedding layers comprise a word embedding layer, a location embedding layer, and a discipline embedding layer;
inputting the text to be input and the discipline to be classified into the embedding layer to obtain an initial text embedding feature vector corresponding to the text to be input and an initial discipline embedding feature vector corresponding to the discipline to be classified, wherein the method comprises the following steps:
inputting the text to be input into the word embedding layer and the position embedding layer respectively to obtain a word embedding feature vector and a position embedding feature vector corresponding to the text to be input;
and inputting the subjects to be classified into the subject embedding layer to obtain initial subject embedding feature vectors corresponding to the subjects to be classified.
5. The method of claim 4, wherein inputting the initial text-embedding feature vector and the initial subject-embedding feature vector into the encoding layer comprises:
generating a target input embedded feature vector according to the word embedded feature vector, the position embedded feature vector and the initial subject embedded feature vector;
the target input embedded feature vector is input to the encoding layer.
6. The method of claim 5, wherein generating a target input embedded feature vector from the word embedded feature vector, the location embedded feature vector, and the initial subject embedded feature vector comprises:
Determining vector lengths of the word embedded feature vector and the position embedded feature vector;
expanding the initial subject embedding feature vector according to the vector length to generate a target subject embedding feature vector corresponding to the initial subject embedding feature vector;
and adding the word embedded feature vector, the position embedded feature vector and the target subject embedded feature vector to generate a target input embedded feature vector.
7. The method of claim 1, wherein the topic classification result comprises a plurality of predictive classification topics and a topic probability corresponding to each predictive classification topic;
according to the subject to be classified and the associated topic information, determining a target classification topic of the topic to be classified in the topic classification result comprises the following steps:
screening the classification topic types to be determined and topic type probabilities corresponding to the classification topic types to be determined from all prediction classification topic types according to the subject to be classified and the associated topic type information;
and determining the target classification question type in the classification question types to be determined according to the question type probability corresponding to the classification question types to be determined.
8. The method of claim 1, wherein the topic classification model is trained to be obtained according to the following method:
Obtaining training sample data, wherein the training sample data comprises sample topic information, sample associated topic information of the sample topic information and sample classification topic types corresponding to the sample topic information, and the sample topic information comprises sample classification topics and sample classification subjects of the sample classification topics;
inputting the sample classification subjects and the sample classification subjects into the subject classification model to obtain a predicted subject classification result output by the subject classification model;
calculating a model loss value of the topic classification model according to the prediction topic classification result and the sample classification topic model;
and adjusting model parameters of the topic classification model according to the model loss value, and continuously training the topic classification model until a training stopping condition is reached.
9. The method of claim 1, wherein obtaining topic information to be categorized comprises:
acquiring initial classification topic information;
identifying information to be deleted in the initial classification topic information;
and deleting the to-be-deleted information from the initial classification topic information to obtain the to-be-classified topic information.
10. A method for training a topic classification model, comprising:
Obtaining training sample data, wherein the training sample data comprises sample topic information, sample associated topic information of the sample topic information and sample classification topic types corresponding to the sample topic information, and the sample topic information comprises sample classification topics and sample classification subjects of the sample classification topics;
inputting the sample classification subjects and the sample classification subjects into the subject classification model to obtain a predicted subject classification result output by the subject classification model;
calculating a model loss value of the topic classification model according to the prediction topic classification result and the sample classification topic model;
and adjusting model parameters of the topic classification model according to the model loss value, and continuously training the topic classification model until a training stopping condition is reached.
11. The method of claim 10, wherein calculating a model loss value for the topic classification model based on the predicted topic classification result and the sample classification topic comprises:
calculating a loss value corresponding to each prediction classification question type according to each prediction classification question type and the sample classification question type in the prediction question classification result;
And calculating the model loss value of the topic classification model according to the loss value corresponding to each prediction classification topic.
12. A topic classification device, comprising:
the acquisition module is configured to acquire topic information to be classified and associated topic type information of the topic information to be classified, wherein the topic information to be classified comprises topics to be classified and subjects to be classified of the topics to be classified;
the input module is configured to input the topics to be classified and the subjects to be classified into a topic classification model to obtain topic classification results output by the topic classification model;
and the determining module is configured to determine the target classification topic type of the topic to be classified in the topic classification result according to the topic to be classified and the associated topic type information.
13. A topic classification model training device, comprising:
the data acquisition module is configured to acquire training sample data, wherein the training sample data comprises sample topic information, sample associated topic information of the sample topic information and sample classification topic types corresponding to the sample topic information, and the sample topic information comprises sample classification topics and sample classification subjects of the sample classification topics;
The data input module is configured to input the sample classification subjects and the sample classification subjects into the subject classification model to obtain a predicted subject classification result output by the subject classification model;
a calculation module configured to calculate a model loss value of the topic classification model based on the predicted topic classification result and the sample classification topic;
and the training module is configured to adjust model parameters of the topic classification model according to the model loss value and continuously train the topic classification model until a training stop condition is reached.
14. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor, when executing the computer instructions, performs the steps of the method of any one of claims 1-9 or 10-11.
15. A computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the method of any one of claims 1-9 or 10-11.
CN202311715578.0A 2023-12-13 2023-12-13 Question classification method, question classification model training method and device Pending CN117688449A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311715578.0A CN117688449A (en) 2023-12-13 2023-12-13 Question classification method, question classification model training method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311715578.0A CN117688449A (en) 2023-12-13 2023-12-13 Question classification method, question classification model training method and device

Publications (1)

Publication Number Publication Date
CN117688449A true CN117688449A (en) 2024-03-12

Family

ID=90131617

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311715578.0A Pending CN117688449A (en) 2023-12-13 2023-12-13 Question classification method, question classification model training method and device

Country Status (1)

Country Link
CN (1) CN117688449A (en)

Similar Documents

Publication Publication Date Title
CN110110585B (en) Intelligent paper reading implementation method and system based on deep learning and computer program
CN108549658B (en) Deep learning video question-answering method and system based on attention mechanism on syntax analysis tree
CN112818691A (en) Named entity recognition model training method and device
CN107798624B (en) Technical label recommendation method in software question-and-answer community
CN113987147A (en) Sample processing method and device
CN111930914A (en) Question generation method and device, electronic equipment and computer-readable storage medium
CN113536801A (en) Reading understanding model training method and device and reading understanding method and device
CN110852071B (en) Knowledge point detection method, device, equipment and readable storage medium
CN113988079A (en) Low-data-oriented dynamic enhanced multi-hop text reading recognition processing method
WO2023231576A1 (en) Generation method and apparatus for mixed language speech recognition model
CN113505589A (en) BERT model-based MOOC learner cognitive behavior identification method
CN114780723B (en) Portrayal generation method, system and medium based on guide network text classification
CN110969005B (en) Method and device for determining similarity between entity corpora
CN114218379A (en) Intelligent question-answering system-oriented method for attributing questions which cannot be answered
CN116975288A (en) Text processing method and text processing model training method
CN113010717B (en) Image verse description generation method, device and equipment
CN117688449A (en) Question classification method, question classification model training method and device
CN114443818A (en) Dialogue type knowledge base question-answer implementation method
CN115687910A (en) Data processing method and device, computer equipment and readable storage medium
CN110889289B (en) Information accuracy evaluation method, device, equipment and computer readable storage medium
CN114138947A (en) Text processing method and device
CN112580365A (en) Chapter analysis method, electronic device and storage device
CN114840697B (en) Visual question-answering method and system for cloud service robot
Sudharson A novel Sentimental Analysis framework using Gated Recurrent Units for Text Transliteration
CN117574241A (en) Data processing method and device

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