CN115510191A - Method and device for determining category of new idea - Google Patents

Method and device for determining category of new idea Download PDF

Info

Publication number
CN115510191A
CN115510191A CN202211213985.7A CN202211213985A CN115510191A CN 115510191 A CN115510191 A CN 115510191A CN 202211213985 A CN202211213985 A CN 202211213985A CN 115510191 A CN115510191 A CN 115510191A
Authority
CN
China
Prior art keywords
entity
target
existing
target entity
category
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
CN202211213985.7A
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.)
Pacific Insurance Technology Co Ltd
Original Assignee
Pacific Insurance 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 Pacific Insurance Technology Co Ltd filed Critical Pacific Insurance Technology Co Ltd
Priority to CN202211213985.7A priority Critical patent/CN115510191A/en
Publication of CN115510191A publication Critical patent/CN115510191A/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/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • 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/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3343Query execution using phonetics
    • 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
    • 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/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology

Abstract

The application discloses a method and a device for determining the category of a new idea, wherein in the method, voice data to be recognized are recognized through a double-layer entity recognition model to obtain a target entity combination; if the target entity combination does not belong to the entity library, inputting the target entity combination into a pre-training language model to obtain a target entity vector corresponding to the target entity combination; respectively carrying out distance calculation on a target entity vector and a plurality of existing intention category vectors to obtain a plurality of vector distances, wherein the plurality of intention category vectors are obtained by clustering the plurality of existing entity vectors corresponding to a plurality of existing entity combinations in an entity library; and if the distances of the vectors are all larger than a preset threshold value, determining the category of the new idea according to the voice data to be recognized. Therefore, the method avoids manual analysis to avoid the problem of subjectivity in the process of determining the new intention type, so that the determination result of the new intention type is more objective, and the accuracy of the determination result of the new intention type is improved.

Description

Method and device for determining category of new idea
Technical Field
The present application relates to the field of natural language processing technologies, and in particular, to a method and an apparatus for determining a category of a new idea.
Background
With the rapid development of artificial intelligence, intelligent voice services are widely applied to various scenes such as intelligent home, medical care, voice payment and insurance services. When the client has the demand, the client dials the related telephone hotline and expresses the appeal by using the voice, and the intelligent voice service system can identify the intention of the client according to the voice data and correspondingly carry out intelligent response or guidance operation so as to meet the demand of the client.
In the prior art, a method based on text classification is generally adopted for recognizing new ideas, and the method specifically comprises the following steps: firstly, labeling a large amount of voice data, and extracting a feature training classification model to obtain an intention recognition model; then, recognizing the voice data to be recognized through an intention recognition model, if the output result is that the voice data cannot be classified into the existing intention type, manually analyzing the voice data, and considering whether the voice data needs to be determined as a new intention type; and finally, if the new intention type is determined through the voice data to be recognized, marking the new intention type and carrying out the training of the intention recognition model again.
However, the above-mentioned analysis of the voice data which does not belong to the existing intention category by manual work has a problem that the subjectivity is strong in the process of determining the new intention category, and the result of determining the new intention category has insufficient objectivity, so that the accuracy of the result of determining the new intention category is low.
Disclosure of Invention
In view of this, embodiments of the present application provide a method and an apparatus for determining a new intention category, which are intended to improve accuracy of a determination result of a new intention category. .
In a first aspect, an embodiment of the present application provides a method for determining a category of a new idea, where the method includes:
recognizing the voice data to be recognized through a double-layer entity recognition model to obtain a target entity combination;
if the target entity combination does not belong to the entity library, inputting the target entity combination into a pre-training language model to obtain a target entity vector corresponding to the target entity combination;
respectively carrying out distance calculation on the target entity vector and a plurality of existing intention category vectors to obtain a plurality of vector distances, wherein the existing intention category vectors are obtained by clustering a plurality of existing entity vectors corresponding to a plurality of existing entity combinations in the entity library;
and if the distances of the vectors are all larger than a preset threshold value, determining the category of the new idea according to the voice data to be recognized.
Optionally, the recognizing the speech data to be recognized through a double-layer entity recognition model to obtain a target entity combination includes:
recognizing voice data to be recognized through a first layer model based on a plurality of first preset entity categories in the double-layer entity recognition model to obtain a first target entity category corresponding to the voice data to be recognized and an entity corresponding to the first target entity category;
recognizing voice data to be recognized through a second layer model based on a plurality of second preset entity categories in the double-layer entity recognition model to obtain a second target entity category corresponding to the voice data to be recognized, an entity corresponding to the second target entity category and an unidentified entity, wherein the second preset entity categories are subcategories of the first preset entity categories;
and obtaining a target entity combination according to the second target entity type, the entity corresponding to the second target entity type and the unidentified entity.
Optionally, the obtaining a target entity combination according to the second target entity type, the entity corresponding to the second target entity type, and the unidentified entity includes:
if the unidentified entity is in the entity corresponding to the first target entity type, determining the unidentified entity as a new second preset entity type;
updating the second target entity type, the entity corresponding to the second target entity type and the unidentified entity according to the new second preset entity type to obtain the updated second target entity type and the entity corresponding to the updated second target entity type;
and overlapping the updated second target entity type and the entity corresponding to the updated second target entity type to obtain the target entity combination.
Optionally, the training step of the two-layer entity recognition model includes:
acquiring a plurality of voice sample data and first marking data and second marking data of each voice sample data, wherein the first marking data are used for marking a plurality of first preset entity types, and the second marking data are used for marking a plurality of second preset entity types;
inputting the voice sample data into a double-layer recognition network for recognition, and obtaining first recognition data and second recognition data of the voice sample data, wherein the first recognition data comprises recognition data based on the multiple first preset entity categories, and the second recognition data comprises recognition data based on the multiple second preset entity categories;
training model parameters of the double-layer recognition network according to the first recognition data, the second recognition data, the first marking data, the second marking data and a loss function of the double-layer recognition network;
and determining the trained double-layer recognition network as the double-layer entity recognition model.
Optionally, the step of constructing the entity library includes:
obtaining the plurality of existing entity combinations according to the second identification data;
and constructing the entity library according to the plurality of existing entity combinations.
Optionally, the constructing the entity library according to the combination of the existing entities includes:
mining the existing entity combinations through an association rule mining algorithm to obtain a target association rule;
processing the existing entity combinations according to the target association rule to obtain processed existing entity combinations;
and constructing the entity library according to the processed plurality of existing entity combinations.
Optionally, the plurality of first preset entity categories include: action words, proper nouns, interrogative words and question words to be processed.
Optionally, after the target entity combination does not belong to the entity library, the method further includes:
processing the target entity combination according to a preset rule to obtain a processed target entity combination;
the inputting the target entity combination into a pre-training language model to obtain a target entity vector corresponding to the target entity combination includes:
and inputting the processed target entity combination into the pre-training language model to obtain the target entity vector.
Optionally, the step of clustering the plurality of existing intention category vectors includes:
labeling the similar relation between each existing entity vector and the rest entity vectors in the existing entity vectors to obtain a plurality of labeled entity vectors;
sequencing the marked entity vectors according to the marked quantity of the marked entity vectors to obtain an entity vector sequence;
and sequentially clustering the existing entity vectors labeled with the close relations according to the sequence of the entity vector sequence to obtain a plurality of existing intention category vectors.
In a second aspect, an embodiment of the present application provides an apparatus for determining a category of new ideas, where the apparatus includes:
the recognition module is used for recognizing the voice data to be recognized through a double-layer entity recognition model to obtain a target entity combination;
an obtaining module, configured to input the target entity combination to a pre-training language model if the target entity combination does not belong to an entity library, and obtain a target entity vector corresponding to the target entity combination;
the calculation module is used for respectively calculating the distance between the target entity vector and a plurality of existing intention category vectors to obtain a plurality of vector distances, and the plurality of intention category vectors are obtained by clustering a plurality of existing entity vectors corresponding to a plurality of existing entity combinations in the entity library;
and the determining module is used for determining the category of the new idea according to the voice data to be recognized if the distances of the vectors are all larger than a preset threshold value.
In a third aspect, an embodiment of the present application provides a device for determining a category of new ideas, where the device includes:
a memory for storing a computer program;
a processor configured to execute the computer program to enable the apparatus to perform the method for determining a category of new ideas according to the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, an apparatus running the computer program implements the method for determining a new idea category according to the foregoing first aspect.
Compared with the prior art, the embodiment of the application has the following beneficial effects:
the embodiment of the application provides a method for determining the category of a new idea, which comprises the steps of identifying voice data to be identified through a double-layer entity identification model to obtain a target entity combination; if the target entity combination does not belong to the entity library, inputting the target entity combination into a pre-training language model to obtain a target entity vector corresponding to the target entity combination; respectively carrying out distance calculation on the target entity vector and a plurality of existing intention category vectors to obtain a plurality of vector distances, wherein the plurality of intention category vectors are obtained by clustering a plurality of existing entity vectors corresponding to a plurality of existing entity combinations in an entity library; and if the distances of the vectors are all larger than a preset threshold value, determining the category of the new idea according to the voice data to be recognized. Therefore, when the method judges that the entity combination of the voice data to be recognized does not belong to the entity library, the entity vector of the voice data to be recognized and the existing intention category vector are respectively subjected to distance calculation to obtain a plurality of vector distances, whether a new intention category is determined based on the voice data to be recognized is judged according to the comparison result of the plurality of vector distances and the preset threshold, manual analysis is avoided, the problem of subjectivity in the process of determining the new intention category is avoided, the determination result of the new intention category is more objective, and the accuracy of the determination result of the new intention category is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, and obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is an application scenario of a method for determining a new idea category according to an embodiment of the present application;
fig. 2 is a flowchart of a method for determining a new idea category according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a device for determining a category of new ideas according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
At present, in the prior art, a method for determining a new intention category includes labeling a large amount of voice data, extracting features, training a classification model, and obtaining an intention recognition model; then, recognizing the voice data to be recognized through an intention recognition model, and if the output result is that the voice data cannot be classified into the existing intention types, manually analyzing the voice data, and considering whether the voice data needs to be determined as a new intention type; and finally, if the new intention type is determined through the voice data to be recognized, marking the new intention type and carrying out the training of the intention recognition model again. However, the above-mentioned voice data which does not belong to the existing intention category is analyzed manually, so that there are problems that the subjectivity is strong in the process of determining the new intention category, and the objectivity of the determination result of the new intention category is insufficient, which results in low accuracy of the determination result of the new intention category.
Based on this, in order to solve the above problems and improve the accuracy of the determination result of the new idea category, the embodiments of the present application provide a method and an apparatus for determining a new idea category, in the method, speech data to be recognized is recognized through a double-layer entity recognition model, so as to obtain a target entity combination; if the target entity combination does not belong to the entity library, inputting the target entity combination into a pre-training language model to obtain a target entity vector corresponding to the target entity combination; respectively carrying out distance calculation on a target entity vector and a plurality of existing intention category vectors to obtain a plurality of vector distances, wherein the plurality of intention category vectors are obtained by clustering the plurality of existing entity vectors corresponding to a plurality of existing entity combinations in an entity library; and if the distances of the vectors are all larger than a preset threshold value, determining the category of the new idea according to the voice data to be recognized. Therefore, when the method judges that the entity combination of the voice data to be recognized does not belong to the entity library, the entity vector of the voice data to be recognized and the existing intention category vector are respectively subjected to distance calculation to obtain a plurality of vector distances, whether the new intention category is determined based on the voice data to be recognized is judged according to the comparison result of the plurality of vector distances and the preset threshold, manual analysis is avoided, the problem of subjectivity in the determination process of the new intention category is avoided, the determination result of the new intention category is more objective, and the accuracy of the determination result of the new intention category is improved.
For example, one of the scenarios in the embodiment of the present application may be applied to the scenario shown in fig. 1. The scenario includes a database 101 and a server 102, where the database 101 includes a plurality of existing intention category vectors, and the server 102 acquires the plurality of existing intention category vectors from the entity library 101 by using the implementation manner provided by the embodiment of the present application.
First, in the application scenario described above, although the actions of the embodiments provided by the embodiments of the present application are described as being performed by the server 102; however, the embodiments of the present application are not limited in terms of executing subjects as long as the actions disclosed in the embodiments provided by the embodiments of the present application are executed.
Next, the above scenario is only one example of the scenario provided in the embodiment of the present application, and the embodiment of the present application is not limited to this scenario.
The following describes in detail a specific implementation manner of the method and apparatus for determining a new idea category in the embodiment of the present application by using an embodiment in conjunction with the accompanying drawings.
Referring to fig. 2, which is a flowchart of a method for determining a category of a new idea provided in an embodiment of the present application, and shown in fig. 2, specifically, the method may include:
s201: and recognizing the voice data to be recognized through a double-layer entity recognition model to obtain a target entity combination.
And inputting the voice data to be recognized into the double-layer entity recognition model, recognizing a plurality of entity words contained in the voice data to be recognized, obtaining a target entity corresponding to the preset category of the double-layer entity recognition model, and obtaining a target entity combination. The method comprises the steps that voice data to be recognized are preprocessed based on a double-layer entity recognition model, target entities corresponding to preset categories of the double-layer entity recognition model can be extracted, or new entities not corresponding to the preset categories can be extracted, and a target entity combination is obtained; the obtained target entity combination is used for replacing the voice data to be recognized to perform the subsequent determination step of the new intention type, so that the length of the voice data to be recognized can be reduced to a certain extent, the semantic features of the voice data to be recognized can be enlarged, some non-key texts in the voice data to be recognized are removed, the input of high-quality texts for the subsequent determination step of the new intention recognition is facilitated, and the accuracy of the determination result of the new intention type is further improved.
The double-layer entity recognition model comprises an input layer, an encoding layer and a decoding layer. The input layer converts the voice data to be recognized into a distributed sequence which can be input into the coding layer, for example, a Word2vec model can be adopted; the coding layer codes a distributed sequence into which voice data to be recognized is converted to obtain coding characteristics, for example, a pre-training model Bert or a Transformer coder can be adopted; the decoding layer is used for predicting the boundary of an entity and the type of the entity, and generating a target entity combination through the abstract semantic representation of the context of the entity by the coding layer, wherein an Efficient-global pointer decoder can be adopted, and a Conditional Random Field decoder can also be adopted. Of course, the above description may also be adopted in other ways, and the implementation of the embodiments of the present application is not affected.
S202: and if the target entity combination does not belong to the entity library, inputting the target entity combination into the pre-training language model to obtain a target entity vector corresponding to the target entity combination.
Comparing a target entity combination obtained through a double-layer entity recognition model with a plurality of existing entity combinations in an entity library, wherein if an entity combination which is consistent with the target entity combination exists in the existing entity combinations, the intention category of the voice data to be recognized belongs to the existing intention categories, and a new intention category does not need to be determined; if the entity combination which is consistent with the target entity combination does not exist in the existing entity combinations, the target entity combination needs to be input into the pre-training language model, and the target entity vector corresponding to the target entity combination is obtained. The pre-training language model is a model obtained by pre-training through some tasks to obtain a set of model parameters and initializing the model by using the set of parameters, the model parameters are not initialized randomly any more, and meanwhile, the pre-trained language model comprises a plurality of semantic grammar knowledge, so that the effect of the subsequent training task is obviously improved. For example, the pre-training language model may be a Bert model or a GPT model, and of course, other pre-training language models may also be used without affecting the implementation of the embodiment of the present application.
S203: and respectively carrying out distance calculation on the target entity vector and a plurality of existing intention category vectors to obtain a plurality of vector distances, wherein the existing intention category vectors are obtained by clustering a plurality of existing entity vectors corresponding to a plurality of existing entity combinations in the entity library.
And respectively carrying out distance calculation on a target entity vector obtained by a pre-training language model and a plurality of existing intention category vectors to obtain a plurality of vector distances so as to judge whether the intention category of the voice data to be recognized belongs to a plurality of existing intention categories, combining a plurality of existing entity vectors corresponding to a plurality of existing entities in an entity library, and obtaining a plurality of existing intention categories through clustering. The distance calculation refers to calculating the similarity between the target entity vector and a plurality of existing intention category vectors. For example, an euclidean distance similarity calculation method, a cosine similarity calculation method, or a mahalanobis distance similarity calculation method may be used to calculate the distance, and of course, other vector similarity calculation methods may also be used without affecting the implementation of the embodiment of the present application.
S204: and if the distances of the vectors are all larger than a preset threshold value, determining the category of the new idea according to the voice data to be recognized.
Comparing a plurality of vector distances obtained by calculating vector similarity between a target entity vector and a plurality of existing intention category vectors with a preset threshold, and if the vector distance smaller than the preset threshold exists in the plurality of vector distances, indicating that the voice data to be recognized belongs to the intention category corresponding to the vector distance; if the vector distances are all larger than the preset threshold value, it is indicated that the voice data to be recognized do not belong to the existing intention categories, and a new intention category needs to be determined according to the voice data to be recognized. The preset threshold refers to a preset vector distance value, for example, the preset threshold may be a threshold obtained by a researcher through adjustment according to a plurality of experimental results, and is preset in the method for determining the category of the new idea, and certainly, the threshold may be preset in other manners without affecting implementation of the embodiment of the present application.
Based on the related contents of the above S201-S204, in the embodiment of the present application, the speech data to be recognized is recognized through a double-layer entity recognition model, so as to obtain a target entity combination; if the target entity combination does not belong to the entity library, inputting the target entity combination into a pre-training language model to obtain a target entity vector corresponding to the target entity combination; respectively carrying out distance calculation on the target entity vector and a plurality of existing intention category vectors to obtain a plurality of vector distances, wherein the plurality of intention category vectors are obtained by clustering a plurality of existing entity vectors corresponding to a plurality of existing entity combinations in an entity library; and if the distances of the vectors are all larger than a preset threshold value, determining the category of the new idea according to the voice data to be recognized. Therefore, when the method judges that the entity combination of the voice data to be recognized does not belong to the entity library, the entity vector of the voice data to be recognized and the existing intention category vector are respectively subjected to distance calculation to obtain a plurality of vector distances, whether the new intention category is determined based on the voice data to be recognized is judged according to the comparison result of the plurality of vector distances and the preset threshold, manual analysis is avoided, the problem of subjectivity in the determination process of the new intention category is avoided, the determination result of the new intention category is more objective, and the accuracy of the determination result of the new intention category is improved.
In the embodiment of the present application, S201 may specifically include the following S2021-S2023:
s2021: and recognizing the voice data to be recognized through a first layer model based on a plurality of first preset entity categories in a double-layer entity recognition model to obtain a first target entity category corresponding to the voice data to be recognized and an entity corresponding to the first target entity category.
The method comprises the steps that voice data to be recognized are recognized through a first layer model of a double-layer entity recognition model, the first layer model is built on the basis of a plurality of first preset entity types, and first target entity types corresponding to the first preset entity types in the voice data to be recognized and entities in the voice data to be recognized corresponding to the first target entity types are obtained.
The first preset entity category refers to a preset entity category, for example, four entity categories may be preset in a first layer model of a double-layer entity identification model, and specifically may include: action words, proper nouns, question words and question words to be processed. Of course, other multiple first preset entity categories may also be set, and the implementation of the embodiment of the present application is not affected.
S2022: recognizing the voice data to be recognized through a second layer model based on a plurality of second preset entity categories in the double-layer entity recognition model to obtain a second target entity category corresponding to the voice data to be recognized, an entity corresponding to the second target entity category and an unidentified entity, wherein the second preset entity categories are subcategories of the first preset entity categories;
and recognizing the voice data to be recognized through a second layer model of the double-layer entity recognition model, wherein the second layer model is built based on a plurality of second preset entity categories, so that second target entity categories corresponding to the second preset entity categories in the voice data to be recognized, entities in the voice data to be recognized corresponding to the second target entity categories and unidentified entities which do not belong to the second preset entity categories in the voice data to be recognized are obtained, and the second preset entity categories are sub-categories of the first preset entity categories respectively.
For example, if the method for determining the new idea category is applied to the insurance field, the first preset entity category specifically includes the four entity categories as described above, and the second preset entity category specifically includes the following, the sub-categories of action words may be promotion, continuation, complaint, query, and the like; the subclasses of proper nouns can be property risk names, responsibility risk names, expenses, value-added services and the like; subcategories of the interrogative word can be how to do, why, when, and what, etc.; subcategories of the problem words to be processed can be operation failure, payment failure, inability to contact, and the like. Of course, other second preset entity categories may also be set, and the implementation of the embodiment of the present application is not affected.
The execution sequence of step S2021 and step S2022 may be interchanged, or the above two steps may be executed simultaneously, and the execution sequence of step S2021 and step S2022 is not limited in this embodiment of the application.
S2023: and obtaining a target entity combination according to the second target entity type, the entity corresponding to the second target entity type and the unidentified entity.
And obtaining a target entity combination according to a second target entity type obtained through a second layer model of the double-layer entity recognition model, an entity corresponding to the second target entity type and an unidentified entity.
The embodiment of the present application may not specifically limit the obtaining process of the target entity combination, and for convenience of understanding, the following description is made in conjunction with a possible implementation manner.
In a possible implementation manner, whether an unidentified entity belongs to a plurality of entities corresponding to a first target entity category is judged, if the unidentified entity is in an entity corresponding to the first target entity category, the unidentified entity is determined to be a new entity category, the new entity category is added into a second preset entity category to obtain a new second preset entity category, and finally, according to the updated second preset entity category, the updated second target entity category and an entity corresponding to the updated second target entity category are obtained and are superposed to obtain a target entity combination.
Thus, S2023 may specifically include: if the unidentified entity is in the entity corresponding to the first target entity type, determining the unidentified entity as a new second preset entity type; updating a second target entity type, an entity corresponding to the second target entity type and an unidentified entity according to a new second preset entity type to obtain an updated second target entity type and an entity corresponding to the updated second target entity type; and overlapping the updated second target entity type with the entity corresponding to the updated second target entity type to obtain a target entity combination.
In the embodiment of the present application, the training process of the two-layer entity recognition model may not be specifically limited, and for convenience of understanding, the following description is made in conjunction with one possible implementation manner.
In a possible implementation manner, first, a plurality of voice sample data are obtained, and each voice sample data is labeled with first labeled data corresponding to a plurality of first preset entity categories and also labeled with second labeled data corresponding to a plurality of second preset entity categories; then, inputting a plurality of voice samples marked with first marking data and second marking data into a double-layer recognition network to obtain first recognition data corresponding to a plurality of first preset entity types in each voice sample data and second recognition data corresponding to a plurality of second preset entity types in each voice sample data; training model parameters of the double-layer recognition network according to comparison results of the labeled first labeling data and the labeled second labeling data with the obtained first recognition data and the second recognition data respectively and loss function values of the double-layer recognition network; and finally, determining the trained double-layer recognition network as a double-layer entity recognition model.
Therefore, the double-layer entity recognition model can be specifically trained through the following steps: acquiring a plurality of voice sample data and first marking data and second marking data of each voice sample data, wherein the first marking data is used for marking a plurality of first preset entity types, and the second marking data is used for marking a plurality of second preset entity types; inputting voice sample data into a double-layer recognition network for recognition, and obtaining first recognition data and second recognition data of the voice sample data, wherein the first recognition data comprises recognition data based on a plurality of first preset entity categories, and the second recognition data comprises recognition data based on a plurality of second preset entity categories; training model parameters of the double-layer recognition network according to the first recognition data, the second recognition data, the first marking data, the second marking data and a loss function of the double-layer recognition network; and determining the trained double-layer recognition network as a double-layer entity recognition model.
In the embodiment of the present application, the building process of the entity library may not be specifically limited, and for convenience of understanding, the following description is made in conjunction with one possible implementation manner.
In a possible implementation manner, a plurality of existing entity combinations in the plurality of voice sample data are obtained according to the second identification data corresponding to the plurality of second preset entity types in each voice sample data, and then the plurality of existing entity combinations are constructed into the entity library. Therefore, the entity library can be specifically constructed by the following steps: obtaining a plurality of existing entity combinations according to the second identification data; and constructing an entity library according to a plurality of existing entity combinations.
In the embodiment of the present application, another construction process of the entity library may also be provided.
In a possible implementation mode, mining a plurality of obtained existing entity combinations through an association rule mining algorithm to obtain target association rules of the existing entity combinations; processing the existing entity combinations according to a target association rule to obtain processed existing entity combinations; and finally, constructing an entity library according to the processed existing entity combinations. Therefore, the entity library can be specifically constructed by the following steps: mining a plurality of existing entity combinations through an association rule mining algorithm to obtain a target association rule; processing the existing entity combinations according to the target association rule to obtain the processed existing entity combinations; and constructing an entity library according to the processed plurality of existing entity combinations. For example, the association rule mining algorithm may be Apriori algorithm, eclat algorithm, or FP-Tree algorithm, and certainly, other association rule mining algorithms may also be adopted without affecting the implementation of the embodiment of the present application.
In addition, before the target entity combination is input into the pre-training language model, the target entity combination can be processed according to the preset rules, so that a better target entity combination can be obtained, and the accuracy of the determination result of the new intention category is further improved. Therefore, in an alternative embodiment of the present application, the method may further include S1: and processing the target entity combination according to a preset rule to obtain the processed target entity combination. Correspondingly, S202 may specifically include: and inputting the processed target entity combination into a pre-training language model to obtain a target entity vector.
For example, the preset rule may be to limit the number of entities corresponding to the second target entity category in the target entity combination, and to cut the target entity combination with an excessive number of entities; the preset rule can also be deleting entities without meaning in the target entity combination; the preset rule can also be that one of mutually exclusive entity words in the target entity combination is selected to be deleted; of course, other preset rules may be also possible, and the implementation of the embodiment of the present application is not affected.
In the embodiment of the present application, the clustering process of a plurality of existing entity vectors may not be specifically limited, and for ease of understanding, the following description is made in conjunction with a possible implementation manner.
In a possible implementation manner, the relationship between a plurality of existing entity vectors corresponding to a plurality of existing entity combinations in an entity library can be labeled, when two existing entity vectors have a close relationship, the two existing entity vectors are labeled until the close relationship between each existing entity vector and the rest entity vectors in the plurality of existing entity vectors is labeled; then, sequencing a plurality of existing entity vectors according to the marked number of each existing vector to obtain an entity vector sequence; and finally, scanning from the first existing entity vector to the last existing entity vector of the entity vector sequence, and classifying the existing entity vectors which are labeled with similar relations into one class when scanning a certain existing entity vector until a plurality of existing entity vectors of the entity vector sequence are classified to obtain a plurality of existing intention class vectors.
Therefore, a plurality of existing entity vectors can be specifically clustered by the following steps: labeling the similar relation between each existing entity vector and the rest entity vectors in the existing entity vectors to obtain a plurality of labeled entity vectors; sequencing the marked entity vectors according to the marked quantity of the marked entity vectors to obtain an entity vector sequence; and sequentially clustering the existing entity vectors marked with the close relation according to the sequence of the entity vector sequence to obtain a plurality of existing intention category vectors.
The foregoing provides some specific implementations of the method for determining a category of a new idea provided in the embodiment of the present application, and based on these, the present application also provides a corresponding apparatus. The device provided by the embodiment of the present application will be described in terms of functional modularity.
Referring to fig. 3, this figure is a schematic structural diagram of an apparatus 300 for determining a new idea category according to an embodiment of the present application, where the apparatus 300 includes:
the recognition module 301 is configured to recognize the voice data to be recognized through a double-layer entity recognition model to obtain a target entity combination;
an obtaining module 302, configured to input the target entity combination to the pre-training language model if the target entity combination does not belong to the entity library, and obtain a target entity vector corresponding to the target entity combination;
a calculating module 303, configured to perform distance calculation on the target entity vector and the existing intent category vectors respectively to obtain a plurality of vector distances, where the intent category vectors are obtained by clustering existing entity vectors corresponding to existing entity combinations in the entity library;
the determining module 304 is configured to determine a category of the new idea according to the voice data to be recognized if the distances of the plurality of vectors are greater than a preset threshold.
In the embodiment of the present application, through cooperation of the recognition module 301, the obtaining module 302, the calculating module 303, and the determining module 304, when it is determined that the entity combination of the voice data to be recognized does not belong to the entity library, distance calculation is performed on the entity vector of the voice data to be recognized and the existing intention category vector, so as to obtain a plurality of vector distances, and according to a comparison result between the plurality of vector distances and a preset threshold, it is determined whether to determine the category of the new intention based on the voice data to be recognized. By the method, manual analysis is avoided, so that the problem of subjectivity in the process of determining the new intention category is avoided, the determination result of the new intention category is more objective, and the accuracy of the determination result of the new intention category is improved.
As an embodiment, the identifying module 301 may specifically include:
the first recognition unit is used for recognizing the voice data to be recognized through a first layer model based on a plurality of first preset entity categories in a double-layer entity recognition model to obtain a first target entity category corresponding to the voice data to be recognized and an entity corresponding to the first target entity category;
the second recognition unit is used for recognizing the voice data to be recognized through a second layer model based on a plurality of second preset entity categories in the double-layer entity recognition model to obtain a second target entity category corresponding to the voice data to be recognized, an entity corresponding to the second target entity category and an unrecognized entity, wherein the second preset entity categories are sub-categories of the first preset entity categories;
and the first obtaining unit is used for obtaining the target entity combination according to the second target entity type, the entity corresponding to the second target entity type and the unidentified entity.
As an embodiment, the first obtaining unit may be specifically configured to:
if the unidentified entity is in the entity corresponding to the first target entity type, determining the unidentified entity as a new second preset entity type;
updating a second target entity type, an entity corresponding to the second target entity type and an unidentified entity according to a new second preset entity type to obtain an updated second target entity type and an entity corresponding to the updated second target entity type;
and overlapping the updated second target entity type and the entity corresponding to the updated second target entity type to obtain a target entity combination.
As an embodiment, the two-layer entity recognition model may be specifically trained by the following units:
the device comprises an acquisition unit, a storage unit and a processing unit, wherein the acquisition unit is used for acquiring a plurality of voice sample data and first marking data and second marking data of each voice sample data, the first marking data is used for marking a plurality of first preset entity types, and the second marking data is used for marking a plurality of second preset entity types;
the third identification unit is used for inputting voice sample data into the double-layer identification network for identification to obtain first identification data and second identification data of the voice sample data, wherein the first identification data comprise identification data based on a plurality of first preset entity categories, and the second identification data comprise identification data based on a plurality of second preset entity categories;
the training unit is used for training model parameters of the double-layer recognition network according to the first recognition data, the second recognition data, the first marking data, the second marking data and a loss function of the double-layer recognition network;
and the determining unit is used for determining the trained double-layer recognition network as a double-layer entity recognition model.
As an embodiment, the entity library may be specifically trained by the following units:
a second obtaining unit configured to obtain a plurality of existing entity combinations according to the second identification data;
and the building unit is used for building the entity library according to the combination of the existing entities.
As an embodiment, the building unit may specifically be configured to:
mining a plurality of existing entity combinations through an association rule mining algorithm to obtain a target association rule;
processing the existing entity combinations according to the target association rule to obtain the processed existing entity combinations;
and constructing an entity library according to the processed plurality of existing entity combinations.
As an embodiment, the multiple first preset entity categories of the first identification unit may specifically include: action words, proper nouns, question words and question words to be processed.
As an embodiment, the apparatus 300 for determining a new idea category may further include:
the processing module is used for processing the target entity combination according to a preset rule to obtain a processed target entity combination;
accordingly, the obtaining module 302 may specifically be configured to:
and inputting the processed target entity combination into a pre-training language model to obtain a target entity vector.
As an embodiment, the plurality of existing intention categories may be specifically clustered by:
the labeling unit is used for labeling the close relationship between each existing entity vector and the rest entity vectors in the existing entity vectors to obtain a plurality of labeled entity vectors;
the sorting unit is used for sorting the marked entity vectors according to the marked quantity of the marked entity vectors to obtain an entity vector sequence;
and the clustering unit is used for sequentially clustering the existing entity vectors labeled with the similar relations according to the sequence of the entity vector sequence to obtain a plurality of existing intention category vectors.
The embodiment of the application also provides corresponding equipment and a computer storage medium, which are used for realizing the scheme provided by the embodiment of the application.
The device comprises a memory and a processor, wherein the memory is used for storing instructions or codes, and the processor is used for executing the instructions or codes so as to enable the device to execute the method for determining the new idea category in any embodiment of the application.
The computer storage medium has code stored therein, and when the code is executed, a device running the code implements the method for determining the new idea category according to any embodiment of the present application.
In the embodiments of the present application, the names "first" and "second" (if any) in the names "first" and "second" are used merely for name identification, and do not represent the sequential first and second.
As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by software plus a general hardware platform. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a storage medium, such as a read-only memory (ROM)/RAM, a magnetic disk, an optical disk, or the like, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network communication device such as a router) to execute the method according to the embodiments or some parts of the embodiments of the present application.
It should be noted that, in the present specification, all the embodiments are described in a progressive manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus embodiment, since it is substantially similar to the method embodiment, it is relatively simple to describe, and reference may be made to some descriptions of the method embodiment for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts suggested as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only one specific embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for determining a category of new ideas, the method comprising:
recognizing the voice data to be recognized through a double-layer entity recognition model to obtain a target entity combination;
if the target entity combination does not belong to the entity library, inputting the target entity combination into a pre-training language model to obtain a target entity vector corresponding to the target entity combination;
respectively carrying out distance calculation on the target entity vector and a plurality of existing intention category vectors to obtain a plurality of vector distances, wherein the existing intention category vectors are obtained by clustering a plurality of existing entity vectors corresponding to a plurality of existing entity combinations in the entity library;
and if the vector distances are all larger than a preset threshold value, determining the category of the new idea according to the voice data to be recognized.
2. The method of claim 1, wherein the recognizing the speech data to be recognized through a two-layer entity recognition model to obtain a target entity combination comprises:
recognizing voice data to be recognized through a first layer model based on a plurality of first preset entity categories in the double-layer entity recognition model to obtain a first target entity category corresponding to the voice data to be recognized and an entity corresponding to the first target entity category;
recognizing voice data to be recognized through a second layer model based on a plurality of second preset entity categories in the double-layer entity recognition model to obtain a second target entity category corresponding to the voice data to be recognized, an entity corresponding to the second target entity category and an unidentified entity, wherein the second preset entity categories are subcategories of the first preset entity categories;
and obtaining a target entity combination according to the second target entity type, the entity corresponding to the second target entity type and the unidentified entity.
3. The method of claim 2, wherein obtaining a target entity combination according to the second target entity category, the entity corresponding to the second target entity category, and the unidentified entity comprises:
if the unidentified entity is in the entity corresponding to the first target entity type, determining the unidentified entity as a new second preset entity type;
updating the second target entity type, the entity corresponding to the second target entity type and the unidentified entity according to the new second preset entity type to obtain the updated second target entity type and the entity corresponding to the updated second target entity type;
and overlapping the updated second target entity type and the entity corresponding to the updated second target entity type to obtain the target entity combination.
4. The method of claim 2 or 3, wherein the step of training the two-layer entity recognition model comprises:
acquiring a plurality of voice sample data and first marking data and second marking data of each voice sample data, wherein the first marking data are used for marking a plurality of first preset entity types, and the second marking data are used for marking a plurality of second preset entity types;
inputting the voice sample data into a double-layer recognition network for recognition, and obtaining first recognition data and second recognition data of the voice sample data, wherein the first recognition data comprises recognition data based on the multiple first preset entity categories, and the second recognition data comprises recognition data based on the multiple second preset entity categories;
training model parameters of the double-layer recognition network according to the first recognition data, the second recognition data, the first marking data, the second marking data and a loss function of the double-layer recognition network;
and determining the trained double-layer recognition network as the double-layer entity recognition model.
5. The method of claim 4, wherein the step of constructing the entity library comprises:
obtaining the plurality of existing entity combinations according to the second identification data;
and constructing the entity library according to the plurality of existing entity combinations.
6. The method of claim 5, wherein said building said entity library from said plurality of existing entity combinations comprises:
mining the existing entity combinations through an association rule mining algorithm to obtain a target association rule;
processing the existing entity combinations according to the target association rule to obtain processed existing entity combinations;
and constructing the entity library according to the processed plurality of existing entity combinations.
7. The method of claim 2, wherein the plurality of first pre-determined entity categories comprise: action words, proper nouns, interrogative words and question words to be processed.
8. The method of claim 1, wherein if the target entity combination does not belong to the entity library, further comprising:
processing the target entity combination according to a preset rule to obtain a processed target entity combination;
the inputting the target entity combination into a pre-training language model to obtain a target entity vector corresponding to the target entity combination includes:
and inputting the processed target entity combination into the pre-training language model to obtain the target entity vector.
9. The method according to any one of claims 1 to 8, wherein the step of clustering the plurality of existing intention category vectors comprises:
labeling the similar relation between each existing entity vector and the rest entity vectors in the existing entity vectors to obtain a plurality of labeled entity vectors;
sequencing the marked entity vectors according to the marked quantity of the marked entity vectors to obtain an entity vector sequence;
and sequentially clustering the existing entity vectors labeled with the close relations according to the sequence of the entity vector sequence to obtain a plurality of existing intention category vectors.
10. An apparatus for determining a category of new ideas, the apparatus comprising:
the recognition module is used for recognizing the voice data to be recognized through a double-layer entity recognition model to obtain a target entity combination;
an obtaining module, configured to, if the target entity combination does not belong to an entity library, input the target entity combination to a pre-training language model, and obtain a target entity vector corresponding to the target entity combination;
the calculation module is used for respectively calculating the distance between the target entity vector and a plurality of existing intention category vectors to obtain a plurality of vector distances, and the plurality of intention category vectors are obtained by clustering a plurality of existing entity vectors corresponding to a plurality of existing entity combinations in the entity library;
and the determining module is used for determining the category of the new idea according to the voice data to be recognized if the distances of the vectors are all larger than a preset threshold value.
CN202211213985.7A 2022-09-30 2022-09-30 Method and device for determining category of new idea Pending CN115510191A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211213985.7A CN115510191A (en) 2022-09-30 2022-09-30 Method and device for determining category of new idea

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211213985.7A CN115510191A (en) 2022-09-30 2022-09-30 Method and device for determining category of new idea

Publications (1)

Publication Number Publication Date
CN115510191A true CN115510191A (en) 2022-12-23

Family

ID=84507550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211213985.7A Pending CN115510191A (en) 2022-09-30 2022-09-30 Method and device for determining category of new idea

Country Status (1)

Country Link
CN (1) CN115510191A (en)

Similar Documents

Publication Publication Date Title
CN110096570B (en) Intention identification method and device applied to intelligent customer service robot
CN108304372B (en) Entity extraction method and device, computer equipment and storage medium
CN110347787B (en) Interview method and device based on AI auxiliary interview scene and terminal equipment
CN111783474A (en) Comment text viewpoint information processing method and device and storage medium
CN109087205B (en) Public opinion index prediction method and device, computer equipment and readable storage medium
CN112257437B (en) Speech recognition error correction method, device, electronic equipment and storage medium
CN112468659B (en) Quality evaluation method, device, equipment and storage medium applied to telephone customer service
CN112036168B (en) Event main body recognition model optimization method, device, equipment and readable storage medium
CN115599901B (en) Machine question-answering method, device, equipment and storage medium based on semantic prompt
CN115357719B (en) Power audit text classification method and device based on improved BERT model
CN112464656A (en) Keyword extraction method and device, electronic equipment and storage medium
CN110399472B (en) Interview question prompting method and device, computer equipment and storage medium
CN110689881A (en) Speech recognition method, speech recognition device, computer equipment and storage medium
CN116719520B (en) Code generation method and device
CN113821605A (en) Event extraction method
CN115497465A (en) Voice interaction method and device, electronic equipment and storage medium
CN112632248A (en) Question answering method, device, computer equipment and storage medium
CN112084769A (en) Dependency syntax model optimization method, device, equipment and readable storage medium
CN111554275A (en) Speech recognition method, device, equipment and computer readable storage medium
CN113569021B (en) Method for classifying users, computer device and readable storage medium
CN113705207A (en) Grammar error recognition method and device
CN110362592B (en) Method, device, computer equipment and storage medium for pushing arbitration guide information
CN116702765A (en) Event extraction method and device and electronic equipment
CN111694936A (en) Method and device for identifying AI intelligent interview, computer equipment and storage medium
CN111400340A (en) Natural language processing method and device, computer equipment and storage medium

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