CN113657092B - Method, device, equipment and medium for identifying tag - Google Patents
Method, device, equipment and medium for identifying tag Download PDFInfo
- Publication number
- CN113657092B CN113657092B CN202110740862.8A CN202110740862A CN113657092B CN 113657092 B CN113657092 B CN 113657092B CN 202110740862 A CN202110740862 A CN 202110740862A CN 113657092 B CN113657092 B CN 113657092B
- Authority
- CN
- China
- Prior art keywords
- text
- vector
- recognized
- word
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 80
- 239000013598 vector Substances 0.000 claims abstract description 314
- 238000012549 training Methods 0.000 claims abstract description 51
- 239000011159 matrix material Substances 0.000 claims description 29
- 238000000926 separation method Methods 0.000 claims description 25
- 238000012545 processing Methods 0.000 claims description 17
- 238000004590 computer program Methods 0.000 claims description 15
- 238000013507 mapping Methods 0.000 claims description 14
- 230000011218 segmentation Effects 0.000 claims description 13
- 230000008569 process Effects 0.000 abstract description 19
- 239000002699 waste material Substances 0.000 abstract description 9
- 238000013473 artificial intelligence Methods 0.000 description 18
- 238000005516 engineering process Methods 0.000 description 14
- 230000006870 function Effects 0.000 description 12
- 238000004891 communication Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 9
- 238000010801 machine learning Methods 0.000 description 8
- 241000272201 Columbiformes Species 0.000 description 6
- 238000003058 natural language processing Methods 0.000 description 6
- 238000011160 research Methods 0.000 description 6
- 238000013135 deep learning Methods 0.000 description 5
- 238000004422 calculation algorithm Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 4
- 238000006243 chemical reaction Methods 0.000 description 4
- 230000001360 synchronised effect Effects 0.000 description 4
- 230000003993 interaction Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000009118 appropriate response Effects 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006698 induction Effects 0.000 description 1
- 230000002787 reinforcement Effects 0.000 description 1
- 238000013526 transfer learning Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
- G06F40/211—Syntactic parsing, e.g. based on context-free grammar [CFG] or unification grammars
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2415—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/237—Lexical tools
- G06F40/242—Dictionaries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/289—Phrasal analysis, e.g. finite state techniques or chunking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Health & Medical Sciences (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Evolutionary Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Probability & Statistics with Applications (AREA)
- Machine Translation (AREA)
Abstract
Provided are a method, apparatus, device, and medium for identifying a tag, the method including: acquiring a text to be identified; obtaining a first feature vector based on a text to be identified; the first feature vector comprises a first sentence vector and a first word vector, wherein the first sentence vector represents sentence-level information of a text to be recognized, and each numerical value in the first word vector represents one word in the text to be recognized; inputting the first feature vector into an identification model to obtain an intention label of a text to be identified and attribute labels of all words in the text to be identified, wherein the intention label of the text to be identified is identified based on the first sentence vector, and the attribute labels of all words in the text to be identified are identified based on the first word vector; according to the method provided by the application, the recognition model is obtained by carrying out joint training on the task of recognizing the intention label of the text to be recognized and the task of recognizing the attribute label of each word in the text, so that the waste of computing resources in the recognition process is reduced, and the recognition efficiency of the two tasks is improved.
Description
Technical Field
The embodiment of the application relates to the technical field of natural language processing, and more particularly relates to a method, a device, equipment and a medium for identifying a tag.
Background
With the continued advancement and in-depth application of artificial intelligence and 5G technology, traditional hardware is also fusing new features and is endowed with powerful computing, sensing and interconnection capabilities, wherein voice interaction is also becoming more and more commonly applied to many scenarios, such as mobile phones, customer service, home, driving, etc., with the objective of understanding the intent of the user and providing appropriate response to the user according to the intent. And understand the intent of the user, i.e., understand the intent of the text information conveyed in the interaction, wherein understanding the intent of the text information is in turn related to the attribute tags of the individual words in the text information.
At present, the problems of calculation resource waste and low recognition efficiency generally exist in the intention of recognizing the text and the attribute tags of each word in the recognized text.
Therefore, how to improve the intention of recognizing text and the efficiency of recognizing attribute tags of individual words in text, and to reduce the resource consumption of the recognition process are urgent problems in the art.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a medium for identifying labels, which can improve the identification efficiency of intention labels of texts and attribute labels of words in the texts and reduce the waste of resources in the identification process.
In one aspect, a method of identifying a tag is provided, comprising:
Acquiring a text to be identified;
based on the text to be identified, a first feature vector of the text to be identified is obtained;
The first feature vector comprises a first sentence vector and a first word vector, wherein the first sentence vector is used for representing sentence level information of the text to be recognized, and each numerical value in the first word vector is used for representing one word in the text to be recognized;
And inputting the first feature vector into a recognition model to obtain an intention label of the text to be recognized and attribute labels of all words in the text to be recognized, wherein the intention label of the text to be recognized is recognized based on the first sentence vector, and the attribute labels of all words in the text to be recognized are recognized based on the first word vector.
In another aspect, there is provided an apparatus for identifying a tag, comprising:
the acquisition unit is used for acquiring the text to be identified;
The determining unit is used for obtaining a first feature vector of the text to be recognized based on the text to be recognized;
The first feature vector comprises a first sentence vector and a first word vector, wherein the first sentence vector is used for representing sentence level information of the text to be recognized, and each numerical value in the first word vector is used for representing one word in the text to be recognized;
The recognition unit is used for inputting the first feature vector into a recognition model to obtain an intention label of the text to be recognized and attribute labels of all words in the text to be recognized, wherein the intention label of the text to be recognized is recognized based on the first sentence vector, and the attribute labels of all words in the text to be recognized are recognized based on the first word vector.
In another aspect, an embodiment of the present application provides an electronic device, including:
a processor adapted to execute a computer program;
A computer readable storage medium having a computer program stored therein, which when executed by the processor, implements the method of identifying tags described above.
In another aspect, embodiments of the present application provide a computer-readable storage medium storing computer instructions that, when read and executed by a processor of a computer device, cause the computer device to perform a method of identifying a tag as described above.
Based on the scheme, the text to be recognized is processed to obtain the first feature vector, and based on the first feature vector, the intention label of the text to be recognized and the attribute labels of the words in the text to be recognized are obtained by using the recognition model. On the one hand, through the recognition model, the intention label of the text to be recognized and the attribute labels of all words in the text to be recognized can be obtained simultaneously, so that the recognition efficiency is improved. On the other hand, the recognition model is obtained by jointly training the task of recognizing the intention label of the text to be recognized and the task of recognizing the attribute label of each word in the text to be recognized through the first sentence vector and the first word vector, so that the waste of calculation resources in the recognition process can be reduced while the recognition accuracy of the two tasks is ensured.
In summary, according to the method provided by the application, based on the first sentence vector in the first feature vector and the first word vector in the first feature vector, the task of identifying the intention label of the text to be identified and the task of identifying the attribute label of each word in the text to be identified are jointly trained to obtain the identification model, so that the accuracy of identifying the two tasks is ensured, the waste of computing resources in the identification process is reduced, and the identification efficiency of the two tasks is improved.
Drawings
Fig. 1 is a system frame diagram provided in an embodiment of the present application.
Fig. 2 is a schematic flow chart of a method of identifying a tag provided by an embodiment of the present application.
Fig. 3 is a schematic block diagram of the working principle of the identification model provided by the embodiment of the application.
Fig. 4 is a schematic block diagram of an apparatus for identifying a tag according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The scheme provided by the application can relate to artificial intelligence technology.
Wherein artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) is the theory, method, technique, and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend, and expand human intelligence, sense the environment, acquire knowledge, and use knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision.
It should be appreciated that artificial intelligence techniques are a comprehensive discipline involving a wide range of fields, both hardware-level and software-level techniques. Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
With research and advancement of artificial intelligence technology, research and application of artificial intelligence technology is being developed in various fields, such as common smart home, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned, automatic driving, unmanned aerial vehicles, robots, smart medical treatment, smart customer service, etc., and it is believed that with the development of technology, artificial intelligence technology will be applied in more fields and with increasing importance value.
Embodiments of the application may relate to machine learning (MACHINE LEARNING, ML) and deep learning (DEEP LEARNING, DL) in artificial intelligence techniques, where ML is a multi-domain interdisciplinary, involving multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and the like. It is specially studied how a computer simulates or implements learning behavior of a human to acquire new knowledge or skills, and reorganizes existing knowledge structures to continuously improve own performance. Machine learning is the core of artificial intelligence, a fundamental approach to letting computers have intelligence, which is applied throughout various areas of artificial intelligence. DL is a new research direction in the field of machine learning, and is a complex machine learning algorithm that is introduced into machine learning to make it closer to the original target-artificial intelligence (ARTIFICIAL INTELLIGENCE, AI), and deep learning is the inherent law and presentation hierarchy of learning sample data, and the information obtained in these learning processes greatly helps the interpretation of data such as text, images and sounds. The final goal is to have the machine have the ability to analyze and learn like a person, and to recognize text, images, sounds, etc. Machine learning and deep learning typically include techniques such as artificial neural networks, confidence networks, reinforcement learning, transfer learning, induction learning, teaching learning, and the like.
Embodiments of the application may also relate to natural language processing (Nature Language processing, NLP) technology, an important direction in the computer science and artificial intelligence fields. It is studying various theories and methods that enable effective communication between a person and a computer in natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Thus, the research in this field will involve natural language, i.e. language that people use daily, so it has a close relationship with the research in linguistics. Natural language processing techniques typically include text processing, semantic understanding, machine translation, robotic questions and answers, knowledge graph techniques, and the like.
It should be noted that, the device provided in the embodiment of the present application may be integrated in a server, where the server may include an independently operated server or a distributed server, or may include a server cluster or a distributed system formed by a plurality of servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, and basic cloud computing services such as big data and an artificial intelligent platform, where the servers may be directly or indirectly connected through wired or wireless communication modes, and the present application is not limited herein.
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 is a schematic scene diagram of a system framework 100 provided by an embodiment of the present application.
It should be understood that fig. 1 is only an example of the present application and should not be construed as limiting the present application.
As shown in fig. 1, the system framework may include terminal device 110, terminal device 120, terminal device 130, network 140, and server 150. Wherein terminal device 110, terminal device 120, terminal device 130 may communicate with server 150 over network 140.
A user may interact with server 150 via network 140 using terminal device 110, terminal device 120, and terminal device 130 to receive or send messages. Wherein the network 140 is used as a medium to provide communication links between the terminal devices 110, 120, 130 and the server 150.
For example, the user inputs a text to be recognized using the terminal device 110, transmits the text to be recognized to the server 150 through the network 140, the server 150 recognizes an intention tag of the text to be recognized and an attribute tag of each word in the text to be recognized using the recognition model therein, and transmits the recognized result to the terminal device 110 through the network 140.
It should be noted that the terminal device 110, the terminal device 120, and the terminal device 130 may be any electronic device having a display screen and supporting web browsing, and the terminal device includes, but is not limited to, smart phones, tablet computers, and other small Personal portable devices, such as a Personal computer (Personal DIGITAL ASSISTANT, PDA), an electronic book (E-book), etc., which are not particularly limited in the present application. The server 150 may include an independently operated server or a distributed server, or may include a server cluster or a distributed system formed by a plurality of servers, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, and basic cloud computing services such as big data and an artificial intelligent platform, where the servers may be directly or indirectly connected through wired or wireless communication, so long as the server may perform analysis processing on text data input by a received user and feed back the processing result to a terminal device. The network 140 may include various connection types, such as wired and/or wireless communication links, etc.
It should be noted that, the means for identifying intent provided in the embodiment of the present application may be integrated in the server 150, or the means for identifying intent may be integrated in the terminal devices 110, 120, 130, or in a terminal device different from the terminal devices 110, 120, 130, which is not particularly limited in the present application.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative and that any number of terminal devices, networks and servers may be provided as desired.
The method provided by the present application will be described in detail below taking the case that the means for intent recognition are integrated in a server.
Fig. 2 is a schematic flow chart of a method 200 of identifying tags provided by an embodiment of the present application.
It should be noted that, the scheme provided by the embodiment of the present application may be executed by any electronic device having data processing capability. For example, the electronic device may be implemented as a server. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, a cloud database, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, basic cloud computing services such as big data and an artificial intelligent platform, and the server may be directly or indirectly connected through a wired or wireless communication manner; such as the server shown in fig. 1.
As shown in fig. 2, the method 200 may include some or all of the following:
S201, acquiring a text to be identified;
S202, obtaining a first feature vector of the text to be recognized based on the text to be recognized;
The first feature vector comprises a first sentence vector and a first word vector, wherein the first sentence vector is used for representing sentence level information of the text to be recognized, and each numerical value in the first word vector is used for representing one word in the text to be recognized;
S203, inputting the first feature vector into a recognition model to obtain an intention label of the text to be recognized and attribute labels of all words in the text to be recognized, wherein the intention label of the text to be recognized is recognized based on the first sentence vector, and the attribute labels of all words in the text to be recognized are recognized based on the first word vector.
In other words, the server acquires the text to be identified sent by the terminal equipment, firstly, the text to be identified is processed into a first feature vector, secondly, the first feature vector is input into the identification model to obtain an intention label of the text to be identified and an attribute label of each word in the text to be identified, and finally, the intention label of the text to be identified and the attribute label of each word in the text to be identified are sent to the terminal equipment; the first feature vector comprises a first sentence vector and a first word vector, the first sentence vector is used for representing sentence level information of the text to be recognized, and each numerical value in the first word vector is used for representing one word in the text to be recognized.
Based on the scheme, the text to be recognized is processed to obtain the first feature vector, and based on the first feature vector, the intention label of the text to be recognized and the attribute labels of the words in the text to be recognized are obtained by using the recognition model. On the one hand, through the recognition model, the intention label of the text to be recognized and the attribute labels of all words in the text to be recognized can be obtained simultaneously, so that the recognition efficiency is improved. On the other hand, the recognition model is obtained by jointly training the task of recognizing the intention label of the text to be recognized and the task of recognizing the attribute label of each word in the text to be recognized through the first sentence vector and the first word vector, so that the waste of calculation resources in the recognition process can be reduced while the recognition accuracy of the two tasks is ensured.
In summary, according to the method provided by the application, based on the first sentence vector in the first feature vector and the first word vector in the first feature vector, the task of identifying the intention label of the text to be identified and the task of identifying the attribute label of each word in the text to be identified are jointly trained to obtain the identification model, so that the accuracy of identifying the two tasks is ensured, the waste of computing resources in the identification process is reduced, and the identification efficiency of the two tasks is improved.
In one implementation, the recognition model may be a model trained based on an electric model.
The identification model is subjected to fine adjustment training by the encoder (EFFICIENTLY LEARNING AN Encoder THAT CLASSIFIES Token Replacements Accurately, electric) model based on effective learning and accurate classification token replacement, so that on one hand, the marking data required by training is reduced, the data marking cost required by the identification model training is reduced, and on the other hand, the identification model is trained based on the electric model, and the convergence rate of the identification model is accelerated.
Of course, the recognition model may also be a fine-tuning training based on a bi-directional encoder representation (Bidirectional Encoder Representation from Transformers, BERT) model from the converter, which is not particularly limited by the present application.
It should be noted that the text to be recognized may include one text sentence or may include a plurality of text sentences, which is not particularly limited in the present application. It should be noted that the electric model essentially is a method for training parameters of the BERT model, and mainly uses the ideas of the generator and the discriminator to achieve the purpose of multi-classification.
It should be understood that the Electrora model is the preferred pre-training model of the present application, but should not be limiting of the pre-training model in embodiments of the present application.
The method for identifying the tag provided by the embodiment of the application will be described in detail below by taking a model in which the identification model is trained based on an electric model as an example.
In some embodiments of the present application, S202 may include:
word segmentation is carried out on the text to be recognized so as to obtain a plurality of words;
adding a classification CLS symbol before a first word of the plurality of words and a separation SEP symbol after a last word of the plurality of words;
and matching the words, the CLS symbol and the SEP symbol with words in a dictionary respectively to obtain the first feature vector.
In other words, firstly, the server divides the acquired text to be recognized into words to obtain a plurality of words; then, adding a Classification (CLS) symbol before the first word in the obtained plurality of words, and adding a Separation (SEP) symbol after the last word; and finally, matching the words, the CLS symbol and the SEP symbol with the words in the dictionary respectively to obtain the first feature vector.
It should be noted that, the text to be recognized may be a sentence or a text composed of multiple sentences, for example, when the text to be recognized is a text composed of multiple sentences, firstly, the text to be recognized is divided into sentences, then, each sentence in the text to be recognized is divided into words, CLS symbols and SEP symbols are added at the beginning and the end of each sentence, and finally, the multiple words and CLS symbols and SEP symbols of each sentence are matched with words in a dictionary, so as to obtain a first feature vector corresponding to each sentence. For another example, when the text to be recognized is a text composed of a sentence, the text may be directly segmented and CLS symbols and SEP symbols may be added head and tail. In addition, the word segmentation process may be to segment the text to be recognized according to the word, or segment the text according to the word, which is not particularly limited in the present application.
In one implementation, after adding a CLS symbol and an SEP symbol to a text to be identified, the plurality of words in the dictionary, the CLS symbol and the index number of the SEP symbol are respectively determined as the numerical values of the word, the CLS symbol and the SEP symbol in the first feature vector, so as to obtain the first feature vector.
The index numbers of the words, the CLS symbol and the SEP symbol in the dictionary are respectively determined to be the numerical values of the words, the CLS symbol and the SEP symbol in the first feature vector, so that the data sparseness of the first feature vector can be prevented, only effective data can be calculated, and the calculation efficiency is improved.
Of course, the first feature vector may also be a vector matrix, where the length of each column in the vector matrix may be the number of words or words in the dictionary, and each numerical value in each column corresponds to one word or word, for example, there are 100 words in the dictionary, the first word in the text to be recognized is "five" which corresponds to the 10 th position in the dictionary, and then the column vector length of Wu Duiying is 100, where the 10 th position is1, and the rest are all 0.
It should be noted that, CLS symbols are added before the first word of the text to be recognized, semantic vectors obtained through electric can be used for subsequent classification tasks, SEP symbols are added after the last word of the words of the text to be recognized, and the text to be recognized is identified to be ended.
In some embodiments of the present application, before performing word segmentation on the text to be recognized to obtain a plurality of words, the method further includes:
Processing the text to be recognized into a text in a first format, wherein the text in the first format is used for representing the text meeting the word segmentation condition;
word segmentation is carried out on the text in the first format to obtain a plurality of words.
For example, at least one of the following processes is performed on the text to be recognized:
full-angle conversion half-angle, english character lower case conversion upper case and punctuation mark removal.
In some embodiments of the present application, S203 may include:
Inputting the first feature vector into an identification model, and encoding the first sentence vector by using the identification model to obtain a semantic vector corresponding to the first sentence vector;
mapping the semantic vector corresponding to the first sentence vector into a first probability distribution vector corresponding to the first sentence vector;
and determining the intention label of the text to be identified based on the first probability distribution vector.
In other words, the server inputs the first feature vector into the recognition model, and encodes a first sentence vector in the first feature vector by using the recognition model, which is equivalent to adding position information to the first sentence vector and extracting semantic information of the text to be recognized, so as to obtain a semantic vector corresponding to the first sentence vector; mapping the semantic vector corresponding to the first sentence vector into a first probability distribution vector corresponding to the first sentence vector, which is equivalent to mapping the semantic vector corresponding to the first sentence vector into a first probability distribution vector corresponding to the intention label of the text to be recognized, and determining the intention label of the text to be recognized based on the first probability distribution vector; for example, the length of the first probability distribution vector may be the total number of intention labels in the library of intention labels, and the value of each bit in the first probability distribution vector may be one probability value in the interval 0-1.
In one implementation, a maximum value in the first probability distribution vector is determined based on the first probability distribution vector;
Determining an intention label corresponding to the maximum value in the first probability distribution vector in an intention label library;
And determining the intention label corresponding to the maximum value as the intention label of the text to be identified, wherein the intention label of the text to be identified is used for representing the intention of the text to be identified.
In other words, the intention label of the text to be identified is determined by determining the maximum value in the first probability distribution vector and determining the intention label corresponding to the maximum value.
Of course, in another implementation manner, the label corresponding to the minimum value in the first probability distribution vector may also be determined as the intended label of the text to be identified.
It should be noted that, each value in the first probability distribution vector corresponds to an intention label, and the size of each value characterizes the probability that the intention label corresponding to each value is the intention label of the text to be recognized, that is, the value in the first probability distribution vector may be used to represent the estimation accuracy of estimating the label corresponding to the value as the intention label of the text to be recognized.
In some embodiments of the present application, S203 may further include:
inputting the first feature vector into an identification model, and encoding the first word vector by using the identification model to obtain a semantic vector corresponding to the first word vector;
mapping the semantic vector corresponding to the first word vector into a vector matrix corresponding to the first word vector;
based on the vector matrix, determining attribute tags of the words in the text to be recognized.
In other words, the server inputs the first feature vector into the recognition model, and encodes a first word vector in the first feature vector by using the recognition model, which is equivalent to adding position information and text information to the first word vector and extracting semantic information of each word in the text to be recognized to obtain a semantic vector corresponding to the first word vector; mapping the semantic vector corresponding to the first word vector into a vector matrix corresponding to the first word vector, which is equivalent to mapping the semantic vector corresponding to the first word vector into probability distribution vectors corresponding to each word in the text to be recognized, combining the probability distribution vectors corresponding to each word into a vector matrix, and determining attribute tags of each word in the text to be recognized based on the vector matrix.
For example, the vector matrix may be a m×n×k dimensional matrix, where M represents the number of sentences in the text to be recognized, N represents the number of words obtained after the text to be recognized is segmented, and K represents the total number of attribute tags in the attribute tag library; for another example, when the text to be recognized is a sentence, the vector matrix is in n×k dimensions, and each numerical value of the column vector in the vector matrix corresponds to an attribute tag.
In one implementation, a second feature vector is determined based on the vector matrix, each value in the second feature vector for a corresponding one of the attribute tags;
determining attribute labels corresponding to each numerical value in the second feature vector;
and determining the attribute label corresponding to each numerical value as the attribute label of each word in the text to be identified.
For example, the vector matrix may be processed into a second feature vector, each value in which may be an index number of the attribute tag of the corresponding word. For example, the text to be identified is "play Wu white pigeon", five and herborist correspond to number 8B-aritist and number 9I-aitist of the attribute tag library, respectively, and the position of Wu in the second feature vector is 8 and 9, respectively.
In another implementation, the vector matrix is passed through a conditional random field (Conditional Random Fields, CRF) to obtain the second feature vector.
For example, the text to be identified is a "white pigeon playing Wu", a column vector corresponding to "five" and a column vector corresponding to "Bai" exist in the middle of the column vector in the vector matrix obtained after processing, wherein the column vector of "does not have a corresponding attribute tag in the attribute tag library, and the attribute tag of" is O; when the vector matrix passes through the CRF, the CRF performs part-of-speech judgment according to the Viterbi algorithm, for example, when O cannot appear between B-aritist and I-aitist according to the part-of-speech judgment, the positions of column vectors corresponding to different words are adjusted, and therefore an optimal attribute tag sequence is finally obtained.
Through carrying out a Viterbi algorithm on the vector matrix through a conditional random field CRF, the sequence of attribute labels of a plurality of words in the text to be recognized is adjusted, and the accuracy of the attribute labels of each word in the text to be recognized which is finally output is improved.
The process of obtaining the intention label of the text to be recognized and the attribute labels of the words in the text to be recognized by using the recognition model will be described in detail below by taking the recognition model as a model trained based on the electric model as an example in combination with fig. 3.
Fig. 3 is a schematic block diagram of the working principle of the identification model provided by the embodiment of the application.
Taking as an example that the text to be recognized is a white pigeon playing Wu and the recognition model is an electric-based recognition model, as shown in fig. 3, the block diagram may include the text to be recognized, "the white pigeon playing Wu", the electric-based recognition model, the intention label of the text to be recognized "playmusic" and the attribute label of each word in the text to be recognized "0B-aritist I-aritist 0B-song I-song 0" below will be described in detail through steps 1 to 3
Step 1, firstly, performing word segmentation on a white pigeon playing Wu of a text to be recognized, then adding CLS symbols and SEP symbols from head to tail of the divided words, and finally, respectively matching the words of the text to be recognized, the added CLS symbols and the added SEP symbols with words in a dictionary to obtain a first feature vector; for example, the index numbers of the words, CLS symbols and SEP symbols of the text to be recognized in the dictionary are respectively determined as the numerical values of the words, CLS symbols and SEP symbols in the first feature vector; for example, the dictionary has 2000 words, index number 101 of CLS symbol, index number 102 of sep symbol, index numbers of white pigeons playing Wu are 1234567 respectively, and the first feature vector is [101 1234567 102].
Step2, inputting the first feature vector into the recognition model, namely [101 123 45 67 102] into the recognition model, wherein first, encoding CLS sign bits in the first feature vector, namely E [ CLS ], to obtain a semantic vector T [ CLS ] of the first sentence vector, then mapping the T [ CLS ] into a first probability distribution vector, and finally, obtaining an intention label playmusic of the text to be recognized based on the maximum value in the first probability distribution vector.
And 3, firstly, encoding other bits except CLS sign bits in the first feature vector, namely E1-E8, to obtain semantic vectors T1-T8 of the first word vector, then mapping the semantic vectors T1-T8 of the first word vector into vector matrixes corresponding to T1-T8, and obtaining a second feature vector through a conditional random field CRF, wherein each numerical value in the second feature vector is an index number of an attribute tag, and thus the attribute tag of each word in the text to be recognized can be obtained.
It should be noted that, step 2 and step 3 may not have a sequence, and an intention label of the text to be recognized and an attribute label of each word in the text to be recognized may be obtained at the same time.
In summary, by using the recognition model, the intention label of the text to be recognized is recognized based on the first sentence vector in the first feature vector, and the attribute labels of the words in the text to be recognized are recognized based on the first word vector in the first feature vector, so that the recognition accuracy of the two tasks is ensured, the waste of computing resources in the recognition process is reduced, and the recognition efficiency of the two tasks is improved.
In some embodiments of the present application, before obtaining the first feature vector of the text to be recognized based on the text to be recognized, the method 200 may further include:
Acquiring a training text;
based on the training text, obtaining a third feature vector of the training text;
The third feature vector comprises a third sentence vector and a third word vector, the third sentence vector is used for representing sentence level information of the training text, and each numerical value in the third word vector is used for representing one word in the training text;
acquiring an intention label of the training text and attribute labels of all words in the training text;
Training by taking the third feature vector, the intention label of the training text and the attribute labels of the words in the training text as training samples to obtain the intention recognition model.
Based on the scheme, a third feature vector is obtained by processing the training text, and the third feature vector, the intention label of the training text and the attribute labels of all words in the training text are used as training samples to train to obtain the intention recognition model, which is equivalent to the joint training of a task for recognizing the intention label of the training text and a task for recognizing the attribute labels of all words in the training text through a first sentence vector and a first word vector in the first feature vector, on one hand, the waste of computing resources in the recognition process can be reduced while the recognition accuracy of the two tasks is ensured; on the other hand, the recognition accuracy of the two tasks is ensured, and meanwhile, the recognition efficiency of the two tasks is improved.
It should be noted that, the method for obtaining the third feature vector may refer to the method for obtaining the first feature vector in the method 200, which is not described herein.
The preferred embodiments of the present application have been described in detail above with reference to the accompanying drawings, but the present application is not limited to the specific details of the above embodiments, and various simple modifications can be made to the technical solution of the present application within the scope of the technical concept of the present application, and all the simple modifications belong to the protection scope of the present application. For example, the specific features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various possible combinations are not described further. As another example, any combination of the various embodiments of the present application may be made without departing from the spirit of the present application, which should also be regarded as the disclosure of the present application.
It should be further understood that, in the various method embodiments of the present application, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic of the processes, and should not constitute any limitation on the implementation process of the embodiments of the present application.
The method provided by the embodiment of the application is described above, and the device provided by the embodiment of the application is described below.
Fig. 4 is a schematic block diagram of an apparatus 400 for identifying tags provided by an embodiment of the present application.
As shown in fig. 4, the apparatus 400 may include:
an obtaining unit 410, configured to obtain a text to be identified;
a determining unit 420, configured to obtain a first feature vector of the text to be recognized based on the text to be recognized;
The first feature vector comprises a first sentence vector and a first word vector, wherein the first sentence vector is used for representing sentence level information of the text to be recognized, and each numerical value in the first word vector is used for representing one word in the text to be recognized;
The identifying unit 430 is configured to input the first feature vector into an identifying model to obtain an intent tag of the text to be identified and an attribute tag of each word in the text to be identified, where the intent tag of the text to be identified is identified based on the first sentence vector, and the attribute tag of each word in the text to be identified is identified based on the first word vector.
In some embodiments of the application, the determining unit 420 may be configured to:
word segmentation is carried out on the text to be recognized so as to obtain a plurality of words;
adding a classification CLS symbol before a first word of the plurality of words and a separation SEP symbol after a last word of the plurality of words;
and matching the words, the CLS symbol and the SEP symbol with words in a dictionary respectively to obtain the first feature vector.
In some embodiments of the present application, the determining unit 420 may further be configured to:
Processing the text to be recognized into a text in a first format, wherein the text in the first format is used for representing the text meeting the word segmentation condition;
word segmentation is carried out on the text in the first format to obtain a plurality of words.
For example, at least one of the following processes is performed on the text to be recognized:
full-angle conversion half-angle, english character lower case conversion upper case and punctuation mark removal.
In some embodiments of the present application, the determining unit 420 may further be configured to:
and respectively determining the index numbers of the words, the CLS symbols and the SEP symbols in the dictionary as the numerical values of the words, the CLS symbols and the SEP symbols in the first feature vector to obtain the first feature vector.
In some embodiments of the present application, the identification unit 430 may be configured to:
Inputting the first feature vector into an identification model, and encoding the first sentence vector by using the identification model to obtain a semantic vector corresponding to the first sentence vector;
mapping the semantic vector corresponding to the first sentence vector into a first probability distribution vector corresponding to the first sentence vector;
and determining the intention label of the text to be identified based on the first probability distribution vector.
In some embodiments of the present application, the identification unit 430 may be further configured to:
Determining a maximum value in the first probability distribution vector based on the first probability distribution vector;
Determining an intention label corresponding to the maximum value in the first probability distribution vector in an intention label library;
And determining the intention label corresponding to the maximum value as the intention label of the text to be identified, wherein the intention label of the text to be identified is used for representing the intention of the text to be identified.
In some embodiments of the present application, the identification unit 430 may be further configured to:
inputting the first feature vector into an identification model, and encoding the first word vector by using the identification model to obtain a semantic vector corresponding to the first word vector;
mapping the semantic vector corresponding to the first word vector into a vector matrix corresponding to the first word vector;
based on the vector matrix, determining attribute tags of the words in the text to be recognized.
In some embodiments of the present application, the identification unit 430 may be further configured to:
determining a second feature vector based on the vector matrix, wherein each numerical value in the second feature vector is used for corresponding to one attribute tag;
determining attribute labels corresponding to each numerical value in the second feature vector;
and determining the attribute label corresponding to each numerical value as the attribute label of each word in the text to be identified.
In some embodiments of the present application, the identification unit 430 may be further configured to:
the vector matrix is passed through a conditional random field CRF to obtain the second eigenvector.
In some embodiments of the application, the each value is an index number of the attribute tag.
In some embodiments of the application, the recognition model is a model trained based on an electric model.
In some embodiments of the present application, the apparatus 400 may further include:
training unit for:
Acquiring a training text;
based on the training text, obtaining a third feature vector of the training text;
The third feature vector comprises a third sentence vector and a third word vector, the third sentence vector is used for representing sentence level information of the training text, and each numerical value in the third word vector is used for representing one word in the training text;
acquiring an intention label of the training text and attribute labels of all words in the training text;
Training by taking the third feature vector, the intention label of the training text and the attribute labels of the words in the training text as training samples to obtain the intention recognition model.
It should be understood that apparatus embodiments and method embodiments may correspond with each other and that similar descriptions may refer to the method embodiments. To avoid repetition, no further description is provided here. Specifically, the apparatus 400 may correspond to a corresponding main body in the method 200 for performing the embodiment of the present application, which is not described herein for brevity.
It should also be understood that each unit in the apparatus 400 according to the embodiment of the present application may be separately or all combined into one or several additional units, or some unit(s) thereof may be further split into a plurality of units with smaller functions to form a unit, which may achieve the same operation without affecting the implementation of the technical effect of the embodiment of the present application. The above units are divided based on logic functions, and in practical applications, the functions of one unit may be implemented by a plurality of units, or the functions of a plurality of units may be implemented by one unit. In other embodiments of the present application, the apparatus 400 may also include other units, and in practical applications, the functions may also be implemented with assistance from other units, and may be implemented by cooperation of a plurality of units. According to another embodiment of the present application, the apparatus 400 according to the embodiment of the present application may be constructed by running a computer program (including a program code) capable of executing the steps involved in the respective methods on a general-purpose computing device of a general-purpose computer including a processing element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read only storage medium (ROM), etc., and a storage element, and a method of implementing the identification tag of the embodiment of the present application. The computer program may be recorded on a computer readable storage medium, and loaded into an electronic device and executed therein to implement a corresponding method according to an embodiment of the present application.
In other words, the units referred to above may be implemented in hardware, or may be implemented by instructions in software, or may be implemented in a combination of hardware and software. Specifically, each step of the method embodiment in the embodiment of the present application may be implemented by an integrated logic circuit of hardware in a processor and/or an instruction in software form, and the steps of the method disclosed in connection with the embodiment of the present application may be directly implemented as a hardware decoding processor or implemented by a combination of hardware and software in the decoding processor. Alternatively, the software may reside in a well-established storage medium in the art such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, and the like. The storage medium is located in a memory, and the processor reads information in the memory, and in combination with hardware, performs the steps in the above method embodiments.
Fig. 5 is a schematic structural diagram of an electronic device 500 provided in an embodiment of the present application.
As shown in fig. 5, the electronic device 500 includes at least a processor 510 and a computer-readable storage medium 520. Wherein the processor 510 and the computer-readable storage medium 520 may be connected by a bus or other means. The computer-readable storage medium 520 is used to store a computer program 521, the computer program 521 including computer instructions, and the processor 510 is used to execute the computer instructions stored in the computer-readable storage medium 520. Processor 510 is a computing core and a control core of electronic device 500 that are adapted to implement one or more computer instructions, in particular to load and execute one or more computer instructions to implement a corresponding method flow or a corresponding function.
By way of example, processor 510 may also be referred to as a central processing unit (Central Processing Unit, CPU). Processor 510 may include, but is not limited to: a general purpose Processor, digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field programmable gate array (Field Programmable GATE ARRAY, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like.
By way of example, computer-readable storage medium 520 may be high-speed RAM memory or Non-volatile memory (Non-VolatileMemory), such as at least one disk memory; alternatively, it may be at least one computer-readable storage medium located remotely from the aforementioned processor 510. In particular, computer-readable storage media 520 includes, but is not limited to: volatile memory and/or nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM) which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available, such as static random access memory (STATIC RAM, SRAM), dynamic random access memory (DYNAMIC RAM, DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate Synchronous dynamic random access memory (Double DATA RATE SDRAM, DDR SDRAM), enhanced Synchronous dynamic random access memory (ENHANCED SDRAM, ESDRAM), synchronous link dynamic random access memory (SYNCH LINK DRAM, SLDRAM), and Direct memory bus RAM (DR RAM).
In one implementation, the electronic device 500 may be the apparatus 400 of the identification tag shown in FIG. 4; the computer-readable storage medium 520 has stored therein computer instructions; computer instructions stored in computer-readable storage medium 520 are loaded and executed by processor 510 to implement the corresponding steps in the method embodiment shown in fig. 2; in particular, the computer instructions in the computer-readable storage medium 520 are loaded by the processor 510 and perform the corresponding steps, and are not repeated here.
According to another aspect of the present application, the embodiment of the present application further provides a computer-readable storage medium (Memory), which is a Memory device in the electronic device 500, for storing programs and data. Such as computer-readable storage medium 520. It is understood that the computer readable storage medium 520 herein may include both built-in storage media in the electronic device 500 and extended storage media supported by the electronic device 500. The computer-readable storage medium provides storage space that stores an operating system of the electronic device 500. Also stored in this memory space are one or more computer instructions, which may be one or more computer programs 521 (including program code), adapted to be loaded and executed by processor 510.
According to another aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. Such as a computer program 521. At this time, the electronic device 500 may be a computer, and the processor 510 reads the computer instructions from the computer-readable storage medium 520, and the processor 510 executes the computer instructions, so that the computer performs the method of identifying the tag provided in the above-described various alternatives.
In other words, when implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, runs the processes of, or implements the functions of, embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, from one website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
Those of ordinary skill in the art will appreciate that the elements and process steps of the examples described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or as a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
Finally, it should be noted that the above is only a specific embodiment of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes or substitutions are included in the scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims (12)
1. A method of identifying a tag, comprising:
Acquiring a text to be identified;
Based on the text to be identified, a first feature vector of the text to be identified is obtained;
The first feature vector comprises a first sentence vector and a first word vector, the first sentence vector is used for representing sentence level information of the text to be recognized, and each numerical value in the first word vector is used for representing one word in the text to be recognized;
Inputting the first feature vector into a recognition model to obtain an intention label of the text to be recognized and an attribute label of each word in the text to be recognized, wherein the intention label of the text to be recognized is recognized based on the first sentence vector, and the attribute label of each word in the text to be recognized is recognized based on the first word vector;
The step of inputting the first feature vector into a recognition model to obtain an intention label of the text to be recognized and an attribute label of each word in the text to be recognized, comprising:
inputting the first feature vector into an identification model, and encoding the first sentence vector by using the identification model to obtain a semantic vector corresponding to the first sentence vector;
Mapping the semantic vector corresponding to the first sentence vector into a first probability distribution vector corresponding to the first sentence vector;
determining an intention label of the text to be identified based on the first probability distribution vector;
The step of inputting the first feature vector into a recognition model to obtain an intention label of the text to be recognized and an attribute label of each word in the text to be recognized, comprising:
inputting the first feature vector into an identification model, and encoding the first word vector by using the identification model to obtain a semantic vector corresponding to the first word vector;
Mapping the semantic vector corresponding to the first word vector into a vector matrix corresponding to the first word vector;
and determining attribute tags of words in the text to be recognized based on the vector matrix.
2. The method according to claim 1, wherein the obtaining a first feature vector of the text to be recognized based on the text to be recognized includes:
Word segmentation is carried out on the text to be recognized so as to obtain a plurality of words;
adding a classification CLS symbol before a first word of the plurality of words and a separation SEP symbol after a last word of the plurality of words;
And matching the words, the CLS symbols and the SEP symbols with words in a dictionary respectively to obtain the first feature vector.
3. The method of claim 2, wherein before the word segmentation of the text to be recognized to obtain a plurality of words, the method further comprises:
Processing the text to be recognized into a text in a first format, wherein the text in the first format is used for representing the text meeting the word segmentation condition;
and performing word segmentation processing on the text in the first format to obtain a plurality of words.
4. The method of claim 2, wherein the matching the plurality of words, the CLS symbol, and the SEP symbol with words in a dictionary, respectively, to obtain the first feature vector comprises:
and respectively determining the index numbers of the words, the index numbers of the CLS symbols and the index numbers of the SEP symbols in the dictionary as the numerical values corresponding to the words, the numerical values corresponding to the CLS symbols and the numerical values corresponding to the SEP symbols in the first feature vector to obtain the first feature vector.
5. The method of claim 1, wherein the determining the intent tag of the text to be identified based on the first probability distribution vector comprises:
Determining a maximum value in the first probability distribution vector based on the first probability distribution vector;
Determining an intention label corresponding to the maximum value in the first probability distribution vector in an intention label library;
And determining the intention label corresponding to the maximum value as the intention label of the text to be recognized, wherein the intention label of the text to be recognized is used for representing the intention of the text to be recognized.
6. The method of claim 1, wherein the determining, based on the vector matrix, the attribute tags for each word in the text to be identified comprises:
Determining a second feature vector based on the vector matrix, wherein each numerical value in the second feature vector is used for corresponding to one attribute tag;
determining attribute tags corresponding to each numerical value in the second feature vector;
And determining the attribute label corresponding to each numerical value as the attribute label of each word in the text to be identified.
7. The method of claim 6, wherein the determining a second feature vector based on the vector matrix comprises:
and obtaining the second eigenvector by using the vector matrix through a conditional random field CRF.
8. The method of claim 6, wherein each value in the second feature vector is an index number of an attribute tag.
9. The method of claim 1, wherein prior to obtaining the first feature vector of the text to be recognized based on the text to be recognized, the method further comprises:
Acquiring a training text;
Obtaining a third feature vector of the training text based on the training text;
the third feature vector comprises a third sentence vector and a third word vector, the third sentence vector is used for representing sentence level information of the training text, and each numerical value in the third word vector is used for representing one word in the training text;
Acquiring an intention label of the training text and attribute labels of all words in the training text;
training by taking the third feature vector, the intention label of the training text and the attribute labels of the words in the training text as training samples to obtain the recognition model.
10. An apparatus for identifying a tag, comprising:
the acquisition unit is used for acquiring the text to be identified;
The determining unit is used for obtaining a first feature vector of the text to be recognized based on the text to be recognized;
The first feature vector comprises a first sentence vector and a first word vector, the first sentence vector is used for representing sentence level information of the text to be recognized, and each numerical value in the first word vector is used for representing one word in the text to be recognized;
the recognition unit is used for inputting the first feature vector into a recognition model to obtain an intention label of the text to be recognized and an attribute label of each word in the text to be recognized, wherein the intention label of the text to be recognized is recognized based on the first sentence vector, and the attribute label of each word in the text to be recognized is recognized based on the first word vector;
The step of inputting the first feature vector into a recognition model to obtain an intention label of the text to be recognized and an attribute label of each word in the text to be recognized, comprising:
inputting the first feature vector into an identification model, and encoding the first sentence vector by using the identification model to obtain a semantic vector corresponding to the first sentence vector;
Mapping the semantic vector corresponding to the first sentence vector into a first probability distribution vector corresponding to the first sentence vector;
determining an intention label of the text to be identified based on the first probability distribution vector;
The step of inputting the first feature vector into a recognition model to obtain an intention label of the text to be recognized and an attribute label of each word in the text to be recognized, comprising:
inputting the first feature vector into an identification model, and encoding the first word vector by using the identification model to obtain a semantic vector corresponding to the first word vector;
Mapping the semantic vector corresponding to the first word vector into a vector matrix corresponding to the first word vector;
and determining attribute tags of words in the text to be recognized based on the vector matrix.
11. An electronic device, comprising:
A processor and a memory for storing a computer program, the processor being for invoking and running the computer program stored in the memory to perform the method of any of claims 1 to 9.
12. A computer readable storage medium storing a computer program for causing a computer to perform the method of any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110740862.8A CN113657092B (en) | 2021-06-30 | 2021-06-30 | Method, device, equipment and medium for identifying tag |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110740862.8A CN113657092B (en) | 2021-06-30 | 2021-06-30 | Method, device, equipment and medium for identifying tag |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113657092A CN113657092A (en) | 2021-11-16 |
CN113657092B true CN113657092B (en) | 2024-08-09 |
Family
ID=78477834
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110740862.8A Active CN113657092B (en) | 2021-06-30 | 2021-06-30 | Method, device, equipment and medium for identifying tag |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113657092B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114330364B (en) * | 2021-12-27 | 2022-11-11 | 北京百度网讯科技有限公司 | Model training method, intention recognition device and electronic equipment |
CN114912445A (en) * | 2022-04-15 | 2022-08-16 | 北京北大软件工程股份有限公司 | Method and device for identifying case source line text data, storage medium and electronic equipment |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110147445A (en) * | 2019-04-09 | 2019-08-20 | 平安科技(深圳)有限公司 | Intension recognizing method, device, equipment and storage medium based on text classification |
CN111859947A (en) * | 2019-04-24 | 2020-10-30 | 北京嘀嘀无限科技发展有限公司 | Text processing device and method, electronic equipment and storage medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109388793B (en) * | 2017-08-03 | 2023-04-07 | 阿里巴巴集团控股有限公司 | Entity marking method, intention identification method, corresponding device and computer storage medium |
CN111985209B (en) * | 2020-03-31 | 2024-03-29 | 北京来也网络科技有限公司 | Text sentence recognition method, device and equipment combining RPA and AI and storage medium |
CN112749556B (en) * | 2020-08-04 | 2022-09-13 | 腾讯科技(深圳)有限公司 | Multi-language model training method and device, storage medium and electronic equipment |
CN112182217B (en) * | 2020-09-28 | 2024-07-12 | 云知声智能科技股份有限公司 | Method, device, equipment and storage medium for identifying multi-label text category |
CN112613324B (en) * | 2020-12-29 | 2024-11-12 | 北京中科闻歌科技股份有限公司 | Semantic emotion recognition method, device, equipment and storage medium |
-
2021
- 2021-06-30 CN CN202110740862.8A patent/CN113657092B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110147445A (en) * | 2019-04-09 | 2019-08-20 | 平安科技(深圳)有限公司 | Intension recognizing method, device, equipment and storage medium based on text classification |
CN111859947A (en) * | 2019-04-24 | 2020-10-30 | 北京嘀嘀无限科技发展有限公司 | Text processing device and method, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113657092A (en) | 2021-11-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111444340B (en) | Text classification method, device, equipment and storage medium | |
US11501182B2 (en) | Method and apparatus for generating model | |
CN110795543B (en) | Unstructured data extraction method, device and storage medium based on deep learning | |
CN113672708B (en) | Language model training method, question-answer pair generation method, device and equipment | |
CN115115913A (en) | A data processing method, device, electronic device and storage medium | |
CN110532558B (en) | Multi-intention recognition method and system based on sentence structure deep parsing | |
WO2023241410A1 (en) | Data processing method and apparatus, and device and computer medium | |
CN113704460B (en) | Text classification method and device, electronic equipment and storage medium | |
CN115599901B (en) | Machine Question Answering Method, Device, Equipment and Storage Medium Based on Semantic Prompts | |
CN113723105A (en) | Training method, device and equipment of semantic feature extraction model and storage medium | |
WO2023137911A1 (en) | Intention classification method and apparatus based on small-sample corpus, and computer device | |
CN113779225B (en) | Training method of entity link model, entity link method and device | |
CN112749556B (en) | Multi-language model training method and device, storage medium and electronic equipment | |
CN114676255A (en) | Text processing method, device, equipment, storage medium and computer program product | |
CN113657105A (en) | Medical entity extraction method, device, equipment and medium based on vocabulary enhancement | |
CN113657092B (en) | Method, device, equipment and medium for identifying tag | |
CN110851597A (en) | Method and device for sentence annotation based on similar entity replacement | |
CN114462418B (en) | Event detection method, system, intelligent terminal and computer readable storage medium | |
CN114492661B (en) | Text data classification method and device, computer equipment and storage medium | |
WO2023134085A1 (en) | Question answer prediction method and prediction apparatus, electronic device, and storage medium | |
CN114297353A (en) | Data processing method, device, storage medium and equipment | |
CN115081452B (en) | Method for extracting entity relationship | |
CN114003708B (en) | Automatic question-answering method and device based on artificial intelligence, storage medium and server | |
CN116680392A (en) | Relation triplet extraction method and device | |
CN115221284A (en) | Text similarity calculation method and device, electronic 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |