Intention recognition method and device, electronic equipment, storage medium and program product

By adjusting the text in intent recognition and combining the initial and adjusted intent information, the problem of inaccuracy in intent recognition caused by broken sentences and polyphonic characters is solved, and the accuracy of intent recognition is improved.

CN118656454APending Publication Date: 2024-09-17MASHANG CONSUMER FINANCE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410551287.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-06
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In the intention recognition task, due to improper sentence segmentation and inaccurate recognition of multi-phonetic words, the accuracy of text intention recognition is poor.

Method used

By determining the initial intention of the first text to be recognized and adjusting it according to the preset text adjustment strategy, the initial intention of the second text to be recognized is obtained. The two are combined to determine the intention change information, and the intention is adjusted, thereby improving the accuracy of recognition. Goal intent accuracy.

Benefits of technology

The recognition accuracy of text intention is improved, making the recognized target intention more consistent with the actual intention to be expressed, and improving the accuracy of recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656454A
    Figure CN118656454A
Patent Text Reader

Abstract

The invention discloses an intention recognition method and device, electronic equipment, a storage medium and a program product. The intention recognition method comprises the steps of determining a first initial intention of a first to-be-recognized text; adjusting the first to-be-recognized text according to a preset text adjustment strategy to obtain a second to-be-recognized text, and determining a second initial intention of the second to-be-recognized text; determining intention change information according to the initial intention and the second initial intention, and adjusting the first initial intention according to the intention change information to obtain a target intention of the first to-be-recognized text. The intention recognition accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to an intent recognition method, device, electronic device, storage medium and program product. Background Art

[0002] At present, it is crucial to generate text based on the recognition results of Automatic Speech Recognition (ASR) and understand the intention of speech based on this text. In the intention recognition task, since the text converted from speech is directly recognized, there may be improper sentence segmentation and inaccurate recognition of polyphones, resulting in poor accuracy in text intention recognition. Summary of the invention

[0003] The embodiments of the present application provide an intent recognition method, device, electronic device, storage medium and program product, which are conducive to improving the accuracy of intent recognition.

[0004] On the one hand, an embodiment of the present application provides a method for identifying intent, the method comprising:

[0005] Determining a first initial intent of a first to-be-recognized text;

[0006] The first text to be recognized is adjusted according to a preset text adjustment strategy to obtain a second text to be recognized, and a second initial intention of the second text to be recognized is determined;

[0007] Intent change information is determined according to the first initial intent and the second initial intent, and the first initial intent is adjusted according to the intent change information to obtain a target intent of the first text to be recognized.

[0008] On the one hand, an embodiment of the present application provides an intention recognition device, the device comprising:

[0009] A first determining unit, used to determine a first initial intention of a first text to be recognized;

[0010] A second determination unit, configured to adjust the first text to be recognized according to a preset text adjustment strategy to obtain a second text to be recognized, and determine a second initial intention of the second text to be recognized;

[0011] The recognition unit is used to determine the intention change information according to the first initial intention and the second initial intention, and adjust the first initial intention according to the intention change information to obtain the target intention of the first text to be recognized.

[0012] On the one hand, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor performs the steps of any one of the above-mentioned intent recognition methods.

[0013] On the one hand, an embodiment of the present application provides a computer storage medium, which stores computer instructions. When the computer instructions are executed on a computer, the computer executes the steps of any one of the above-mentioned intent recognition methods.

[0014] On the one hand, an embodiment of the present application provides a computer program product, a computer program code, which, when executed on a computer, enables the computer to execute the steps of any one of the above-mentioned intent recognition methods.

[0015] The beneficial effects of this application are as follows:

[0016] In an embodiment of the present application, the first initial intent of the first text to be recognized can be adjusted based on the intent change information, and the intent change information is determined based on the first initial intent and the second initial intent, and the second initial intent is to adjust the first text to be recognized to the second text to be recognized according to a preset text adjustment strategy. In other words, the recognition of the target intent of the first text to be recognized is based on the second initial intent of the second text to be recognized which has an auxiliary nature after the transformation. Therefore, the determined target intent of the first text to be recognized is more in line with the actual intent to be expressed by the first text to be recognized, thereby improving the accuracy of recognizing the text intent.

[0017] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood through implementation. The purpose and other advantages of the present application can be realized and obtained through the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application, and do not constitute an improper limitation on the present application.

[0019] Figure 1 A schematic diagram of an application scenario in an embodiment of the present application;

[0020] Figure 2 A flowchart of an intention recognition method in an embodiment of the present application;

[0021] Figure 3 A schematic diagram of obtaining a new text in an embodiment of the present application;

[0022] Figure 4 A schematic diagram of an intent mapping adjustment set in an embodiment of the present application;

[0023] Figure 5 A structural block diagram of an intention recognition device in an embodiment of the present application;

[0024] Figure 6 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0026] In the embodiments of the present application, the number of nouns, unless otherwise specified, means "singular noun or plural noun", that is, "one or more". "At least one" means one or more, and "plural" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. For example, A / B means: A or B. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c means: a, b, c and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

[0027] The ordinal numbers such as "first" and "second" mentioned in the embodiments of the present application are used to distinguish multiple objects, and are not used to limit the size, content, order, timing, priority or importance of multiple objects. For example, the first model and the second model, this name does not indicate the difference in size, application scenario, priority or importance of the two models. In addition, the numbering of the steps in the various embodiments introduced in this application is only to distinguish different steps, and is not used to limit the order of the steps.

[0028] To facilitate understanding of the technical solutions provided in the embodiments of the present application, some key terms involved in the embodiments of the present application are explained here:

[0029] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0030] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, intent recognition technology, operation / interaction systems, mechatronics, and other technologies. Artificial intelligence software technologies mainly include computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0031] Natural language processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.

[0032] The pre-trained language representation model (Bidirectional Encoder Representation from Transformers, BERT) adopts a new masked language model (MLM), which aims to predict the masked real words. The purpose is to learn the correct word sequence distribution through the model, so that it can generate deep bidirectional language representation, thereby improving the generalization ability of the model.

[0033] At present, as mentioned above, there are various tasks related to automatic speech recognition in Neuro-Linguistic Programming (NLP). For example, in the intention recognition task, since the text converted from speech is directly recognized, there may be improper sentence segmentation and inaccurate recognition of polyphones, resulting in poor accuracy in text intention recognition.

[0034] In view of this, the embodiments of the present application provide an intent recognition method, device, electronic device, storage medium and program product, through which the first initial intent of a first text to be recognized can be adjusted based on intent change information, and the intent change information is determined based on the first initial intent and the second initial intent, and the second initial intent is to adjust the first text to be recognized to the second text to be recognized according to a preset text adjustment strategy. In other words, the recognition of the target intent of the first text to be recognized is based on the second initial intent of the second text to be recognized which has an auxiliary nature after the transformation. Therefore, the determined target intent of the first text to be recognized is more in line with the intent actually expressed by the first text to be recognized, thereby improving the accuracy of recognizing the text intent.

[0035] The following is a brief introduction to the application scenarios to which the technical solutions in the embodiments of the present application are applicable. It should be noted that the application scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions in the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art can appreciate that with the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0036] The embodiments of the present application provide any scenario that requires intent recognition of text, such as customer service scenarios of various businesses, product recommendation scenarios, etc., which are not limited in the embodiments of the present application.

[0037] See also Figure 1 FIG. 1 is a schematic diagram of a scenario to which the embodiment of the invention can be applied. The scenario includes a terminal device 101 and an electronic device 102. The intention recognition method of the embodiment of the present application can be Figure 1 The terminal device 101 and the electronic device 102 cooperate to achieve this.

[0038] In the embodiment of the present application, the aforementioned terminal device 101 can receive voice information or call information input by the user, and convert the voice information or call information into text. After the terminal device 101 obtains the converted text, the text can be sent to the electronic device 102 through the network 103. Exemplarily, the terminal device 101 can also be connected to other electronic devices to obtain the corresponding text.

[0039] The electronic device 102 may include one or more processors 1021, a memory 1022, and an I / O interface 1023 for interacting with the terminal device 101. In a specific implementation, multiple electronic devices 102 may interact with multiple terminal devices 101, or one electronic device 102 may interact with multiple terminal devices 101, or one electronic device 102 may interact with one terminal device 101, which is not limited in the embodiments of the present application. Specifically, the electronic device 102 may also be connected to other electronic devices and feed back processed data to other electronic devices. Figure 1 The interaction between an electronic device 102 and a terminal device 101 is taken as an example for illustration.

[0040] In the embodiment of the present application, the electronic device 102 can receive the text sent by the terminal device 101 through the I / O interface 1023, and then use the processor 1021 to process the text corresponding to the scheduling task, obtain the target intent of the text, and store the target intent in the memory 1022. Furthermore, the target intent can also be sent to the terminal device 101.

[0041] The terminal device 101 and the electronic device 102 may be connected to each other through one or more networks 103. The network 103 may be a wired network or a wireless network, for example, a mobile cellular network or a wireless fidelity (WIRELESS-FIDELITY, WIFI) network, or other possible networks, which are not limited in the present application.

[0042] In the embodiment of the present application, the terminal device 101 may be, for example, a mobile phone, a tablet computer (PAD), a personal computer (PC), a smart TV, a smart car device, a wearable device, etc.

[0043] In an embodiment of the present application, the electronic device 102 may be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or it may be a physical server, but is not limited to this.

[0044] Of course, the method provided in the embodiment of the present application is not limited to Figure 1 The application scenario shown can also be used in other possible application scenarios, such as only the electronic device 102 executing the above method, that is, the electronic device 102 automatically obtains the text and processes the text, which is not limited in the embodiment of the present application. Figure 1The functions that can be implemented by each device in the application scenario shown will be described in the subsequent method embodiments, and will not be described in detail here.

[0045] To further illustrate the scheme of the intention identification method provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application. The method can be executed in the actual processing process or when the device is executed, it can be executed in sequence or in parallel according to the method shown in the embodiment or drawings (for example, an application environment of a parallel processor or multi-threaded processing).

[0046] The following combination Figure 2 The method flow chart shown in the figure illustrates the intention recognition method in the embodiment of the present application. Figure 2 The steps shown can be performed as follows Figure 1 The electronic device shown performs.

[0047] Step 201: Determine a first initial intention of a first text to be recognized.

[0048] In an embodiment of the present application, the electronic device may perform intent recognition on the first text to be recognized through an intent recognition model, thereby obtaining a first initial intent of the first text to be recognized.

[0049] In the embodiment of the present application, before introducing the intention recognition of the first to-be-recognized text, the process of training the intention recognition model is first introduced. Optionally, the electronic device can train the intention recognition model through the following steps:

[0050] Step A: Determine an intent sample set, where the intent sample includes a sample text and annotated intent of the sample text.

[0051] In the embodiment of the present application, the electronic device may determine the intention sample set by adopting but not limited to the following steps:

[0052] Step a: Determine the target text corpus based on the business scenario to which the sample text belongs;

[0053] Step b: for each text in the target text corpus, punctuation marks are added according to a preset punctuation strategy to obtain a first text set;

[0054] In an embodiment of the present application, the electronic device can perform word segmentation processing on each text in the target text corpus to obtain a word segmentation result, and determine a first adding position of punctuation marks based on the word segmentation result; obtain adding information, the adding information including adding symbol information and adding quantity information; determine a target adding position from the first adding position according to the adding quantity information, and add punctuation marks at the target adding position according to the adding symbol information to obtain a first text; and obtain a first text set based on the first text of each text.

[0055] For example, see Figure 3 As shown, it is a schematic diagram of obtaining a new text in an embodiment of the present application. Figure 3 In the example, it is assumed that the first text to be recognized in the target text corpus is: Yes, ah, who are you? The first text to be recognized is segmented to obtain the segmentation result: Yes (position 1) ah (position 2) you (position 3) is (position 4) who (position 5). That is to say, the maximum number of positions that can be added can be determined, and then the number of additions in the addition position information can be determined according to the number of addable positions that are pre-set or received input selection. Furthermore, the added addition position can also be determined to determine the addition position information. Obviously, in an embodiment of the present application, the addition position information of the same text can be multiple different information. And, the electronic device can also determine the target punctuation mark based on the pre-set or input information. In this way, for the same first text to be recognized, multiple different new texts can be obtained based on the change of at least one of the number of additions, the addition position, and the target punctuation mark.

[0056] Please continue to see Figure 3 If the added position information is to add 2, the positions are position 3 and position 1, and the target punctuation mark is a comma, the new text is: "Okay, ah, who are you"; if the added position information is to add 2, the positions are position 3 and position 2, and the target punctuation mark is a comma, the new text is: "Okay, you, who are you"; if the added position information is to add 1, the position is position 3, and the target punctuation mark is a comma, the new text is: "Okay, you, who are you"; if the added position information is to add 1, the position is position 2, and the target punctuation mark is a question mark, the new text is: "Okay? Who are you".

[0057] It can be seen that in the embodiment of the present application, the same text can generate multiple different new texts. Furthermore, the above-mentioned processing can be performed on each text in the target corpus to obtain the first text set.

[0058] Step c: for each polyphonic character in the first text set, mark the corresponding multiple tones to obtain a second text set;

[0059] In the embodiment of the present application, the electronic device can determine the polyphone in each first text in the first text set; determine the multiple tones corresponding to the polyphone, and mark the multiple tones for the polyphone to obtain the second text; and obtain the second text set based on the second text corresponding to each first text. That is, the text in the second text set is the second text to be recognized including punctuation and tones.

[0060] For example, continuing with the previous example, the new text is: "Yes, ah you, who are you", then the second text to be recognized is: "Yes, ah [ā] you, who are you"; "Yes, ah [á] you, who are you"; "Yes, ah [ǎ] you, who are you"; "Yes, ah [à] you, who are you"; and "Yes, ah [a] you, who are you".

[0061] For another example, assuming that the new text is: "You, clarify it", the second text to be recognized is: "You, clarify it" and "You, clarify it".

[0062] Step d: According to the intent included in the preset intent information set, perform intent annotation on each text in the target text corpus, the first text set, and the second text set to obtain an intent sample set.

[0063] In an embodiment of the present application, the electronic device may perform intent annotation on each text in the second text set, the first text set, and the target text corpus according to the intent included in the preset intent information set to obtain a data set.

[0064] Optionally, the preset intent information set includes an intent name, an intent interpretation for explaining the meaning of the text substantially indicated by the intent, an intent positive example for indicating an example where the concept conforms to the intent interpretation, and an intent negative example for indicating an example other than the intent positive example. In other words, the preset intent information set includes rules for annotating each text with intent, and the electronic device can annotate each text with intent based on the preset intent information set, thereby obtaining a data set containing intent labels.

[0065] Step B: Input the sample text into the initial intent recognition model for training to obtain the predicted intent of the sample text.

[0066] Optionally, the initial intent recognition model can be a combination model of the first model, the second model and the third model, wherein the first model can be a pre-trained language representation model, and of course, it can also be a network model with intent recognition. The second model can be an impact model after training a traditional classification model, such as a naive Bayes model. The second model can be understood as a model of the impact of punctuation and intonation on the change of text intent, that is, the second model is used to perform intent comparison processing on the first text to be recognized and the second.

[0067] Optionally, since the first model can perform intent recognition on various types of texts, the intent recognition can be performed on each text in the extended text corpus based on the first model, thereby obtaining a new data set with a larger data volume than the data set obtained directly based on the target text corpus. Among them, the extended text corpus and the text to be recognized can be in the same business scenario, or it can be a text corpus corresponding to a business scenario associated with the business scenario to which the text to be recognized belongs, which is not limited in the embodiment of the present application. Optionally, the aforementioned new data set can also be split into a training set and a test set according to a preset ratio, such as 8:2. In the embodiment of the present application, the electronic device can train and verify the preset second model based on the aforementioned training set and test set to obtain a second model.

[0068] In an embodiment of the present application, the electronic device can also train a preset third model based on the aforementioned new data set to obtain a third model. The third model can be understood as a model that infers the intent of marked text with the help of the intent of unmarked text.

[0069] Step C: Based on the predicted intent and annotated intent of the sample text, determine the intent difference information of the sample text, and based on the intent difference information and a preset loss function, determine to train the initial intent recognition model to obtain a trained intent recognition model.

[0070] It can be seen that the intent recognition model obtained after training the preset intent recognition model based on the intent sample set can perform intent recognition on the first text to be recognized, the text with punctuation, the text with tones, and the text with punctuation and tones.

[0071] Step 202: adjusting the first text to be recognized according to a preset text adjustment strategy to obtain a second text to be recognized, and determining the intention of the second text to be recognized.

[0072] In the embodiment of the present application, the preset text adjustment strategy is: adding a target symbol at a target adding position, and / or marking the tones of polyphonetic characters in the first text to be recognized.

[0073] In an embodiment of the present application, the electronic device can perform intent recognition on the second text to be recognized through the intent recognition model obtained through the aforementioned training to obtain a second initial intent of the second text to be recognized.

[0074] Step 203: Determine intent change information according to the first initial intent and the second initial intent, and adjust the first initial intent according to the intent change information to obtain a target intent of the first text to be recognized.

[0075] In an embodiment of the present application, the electronic device compares the first initial intention of the first text to be recognized with the second initial intention of the second text to be recognized after punctuation processing, and obtains the first change information as the intention change information corresponding to the text to be recognized; or compares the first initial intention of the first text to be recognized with the second initial intention of the second text to be recognized after tones processing, and obtains the second change information as the intention change information corresponding to the text to be recognized; or compares the first initial intention of the first text to be recognized with the second initial intention of the second text to be recognized after punctuation processing and tones processing, and obtains the third change information as the intention change information corresponding to the text to be recognized. Alternatively, the electronic device uses the change information comprehensively determined based on the first change information, the second change information, and the third change information as the intention change information, which is not limited in the embodiment of the present application.

[0076] In an embodiment of the present application, a first sentence vector of a first initial intent and a second sentence vector of a second initial intent can be determined; a first vector segment of the first sentence vector and a second vector segment of the second sentence vector are intercepted; the widths of the first vector segment and the second vector segment are the same; difference information between the first vector segment and the second vector segment is determined, and a target semantic element matching the difference information is searched in a preset semantic element vector library, and the target semantic element is used as the intent change information.

[0077] In an embodiment of the present application, the first initial intent and the second initial intent can be respectively input into the third model in the intent recognition model to determine the first sentence vector of the first initial intent and the second sentence vector of the second initial intent; then the first vector segment of the first sentence vector and the second vector segment of the second sentence vector are intercepted; the widths of the first vector segment and the second vector segment are the same; and, the difference information between the first vector segment and the second vector segment is determined, and the target semantic element matching the difference information is searched in the preset semantic element vector library, and the target semantic element is used as the intent change information.

[0078] In an embodiment of the present application, the preset semantic element vector library can be constructed by the following process: first, a large amount of annotated corpus is prepared, and the annotated corpus contains a large number of sentence pairs, each sentence pair includes a correct sentence, a word that is still correct after replacing one / several words in the sentence, a sentence in which one / several words in the sentence are acceptable but the acceptability is reduced (acceptability refers to the degree of acceptance of a sentence by a native speaker in judging whether it is acceptable in terms of grammar and semantics, and the degree of acceptance), and a sentence in which one / several words in the sentence are wrong. The included annotation information includes: the overall acceptability of the sentence (0-5), the number and compatibility of words incompatible with other words in the sentence and other words incompatible with the word (1-5), and whether the part of speech of the replacement word and the replaced word is the same (or the part of speech distance 0-5).

[0079] Furthermore, a semantic element vector can be generated for each sentence pair in the preset semantic element vector library by randomly generating an n-dimensional vector. Then, the semantic element vector can be corrected by using aggregation and combination relationships, that is, by replacing words in the sentence. All sentence pairs and corresponding semantic element vectors are stored in a separate semantic element vector library (table), thereby obtaining the aforementioned preset semantic element vector library.

[0080] In an embodiment of the present application, after the intention change information is determined, the third model in the intention recognition model can search for target change rules that match the intention change information in a preset intention adjustment set based on the intention change information, and the target change rules include the target change direction and the number of target sliding bits.

[0081] In the embodiment of the present application, the preset intention adjustment set includes an index indicating the intention change adjustment and a corresponding change rule. Figure 4 , Figure 4 Schematic diagram of the preset intention adjustment set in the embodiment of the present application. Figure 4 If the intention change information in the table is -2, the change rule is: the new intention is the intention corresponding to the new index corresponding to sliding 2 bits in the left direction of the preset coordinates; if the intention change information is -1, the change rule is: the new intention is the intention corresponding to the new index corresponding to sliding 1 bit in the left direction of the preset coordinates; if the intention change information is 0, the change rule is: the new intention is the same as the current intention and does not change; if the intention change information is 1, the change rule is: the new intention is the intention corresponding to the new index corresponding to sliding 1 bit in the right direction of the preset coordinates; if the intention change information is 2, the change rule is: it is the intention corresponding to the new index corresponding to sliding 2 bits in the right direction of the preset coordinates.

[0082] In an embodiment of the present application, an initial intent index corresponding to the initial intent can be searched in a preset index intent mapping table. The index intent mapping table includes multiple mapping relationships, each mapping relationship includes different intents and intent indexes. Optionally, the index intent mapping table can be constructed based on the business scenario to which the first text to be identified belongs.

[0083] In an embodiment of the present application, after determining the first coordinate of the first intention index in the preset index coordinate map, the first coordinate can be moved according to the target change direction and the target sliding bit number to obtain the second coordinate and its corresponding second index; in the preset index intention mapping table, the matching intention corresponding to the second index is searched, and the matching intention is used as the target intention of the text to be recognized. Among them, the preset index coordinate map includes two directions, left and right, and each intention index corresponds to a coordinate one by one. For example, the intention association expressed by intention A, intention B, and intention C, under the influence of punctuation, tone, etc., if the intention index of intention A in the preset index coordinate map is before the intention index of intention B, then the intention index of intention A + 1 = the intention index of intention B, which can be understood as sliding one position to the right from the intention index of intention A to the intention index of intention B.

[0084] In an embodiment of the present application, the index size between intent classes in different business scenarios is determined according to the order of business logic, and the index size of several intents in the intent class in the same business scenario is determined according to the semantic tendency. Among them, the order of business logic can be understood as determined by business experts according to the order of business flow. For example, the order of the major intent categories that normally appear from the beginning to the end of a call is sorted; for example: beginning intent-business 1 related intent-business 2 related intent-business 3 related intent...-closing intent. This classification determines which intents have the possibility of intent change (flow), that is, only several small intents in the same major intent category can flow with each other. Among them, the index size of semantic tendency can be determined based on the vectors corresponding to the two intents. For example, assuming that the vectors determined by the model for the two intents are both 218 dimensions, if there are 50-dimensional intents in the first 100 dimensions Figure 1 The vector value is less than Figure 2 The vector value of Figure 1 The index is less than Figure 2 .

[0085] Furthermore, the preset intention adjustment set in the embodiment of the present application can adjust the index size corresponding to the actual business and intention information, and adaptively adjust the corresponding change rules. In other words, the preset intention adjustment set is updateable and modifiable.

[0086] For example, assuming that the initial intent of the first text to be recognized is "unclear caller", and the intent change information is determined to be "-1", then according to the intent change information, the target change rule matching the intent change information is searched in the preset intent adjustment set, and the target change rule includes the target change direction and the target sliding digit. When the target change direction information is determined to be a new index determined by sliding one digit in the left direction of the preset coordinates and the matching intent corresponding to the new index in the preset index intent mapping table is determined, the target intent is determined to be "clear caller."

[0087] Based on the same inventive concept, the embodiment of the present application provides a device for intention recognition, which can realize the functions corresponding to the above-mentioned intention recognition method. The intention recognition device can be a hardware structure, a software module, or a hardware structure plus a software module. The intention recognition device can be implemented by a chip system, which can be composed of a chip or include a chip and other discrete devices. Please refer to Figure 5 As shown, the intention recognition device 500 includes:

[0088] A first determining unit 501, configured to determine a first initial intention of a first text to be recognized;

[0089] The second determining unit 502 is used to adjust the first text to be recognized according to a preset text adjustment strategy to obtain a second text to be recognized, and determine a second initial intention of the second text to be recognized;

[0090] The recognition unit 503 is used to determine the intent change information according to the first initial intent and the second initial intent, and adjust the first initial intent according to the intent change information to obtain the target intent of the first text to be recognized.

[0091] In a possible implementation manner, the first determining unit 501 is specifically configured to:

[0092] The first text to be recognized is subjected to intention recognition through an intention recognition model to obtain a first initial intention of the first text to be recognized.

[0093] In a possible implementation manner, the second determining unit 502 is specifically configured to:

[0094] The second text to be recognized is subjected to intention recognition through an intention recognition model to obtain a second initial intention of the second text to be recognized.

[0095] In a possible implementation manner, the device further includes a training unit, configured to:

[0096] Determine an intention sample set, wherein the intention sample includes a sample text and annotated intentions of the sample text;

[0097] Inputting the sample text into an initial intent recognition model for training to obtain a predicted intent of the sample text;

[0098] Based on the predicted intent and the annotated intent of the sample text, the intent difference information of the sample text is determined, and based on the intent difference information and a preset loss function, it is determined to train the initial intent recognition model to obtain a trained intent recognition model.

[0099] In a possible implementation manner, the device further includes a training unit, configured to:

[0100] Determining a target text corpus according to the business scenario to which the sample text belongs;

[0101] For each text in the target text corpus, punctuation marks are added according to a preset punctuation strategy to obtain a first text set;

[0102] For each polyphonic character in the first text set, marking corresponding multiple tones to obtain a second text set;

[0103] According to the intent included in the preset intent information set, intent annotation is performed on each text in the target text corpus, the first text set, and the second text set to obtain an intent sample set.

[0104] In a possible implementation manner, the device further includes a training unit, configured to:

[0105] For each text in the target text corpus, word segmentation processing is performed to obtain a word segmentation result, and a first adding position of the punctuation mark is determined based on the word segmentation result;

[0106] Acquire addition information, wherein the addition information includes addition symbol information and addition quantity information;

[0107] According to the addition quantity information, determine a target adding position from the first adding positions, and add punctuation marks at the target adding position according to the addition symbol information to obtain a first text;

[0108] Based on the first text of each text, a first text set is obtained.

[0109] In a possible implementation manner, the device further includes a training unit, configured to:

[0110] For each first text in the first text set, determining polyphones in the text;

[0111] Determining multiple tones corresponding to the polyphonetic character, and marking the multiple tones on the polyphonetic character to obtain a second text;

[0112] Based on the second text corresponding to each of the first texts, a second text set is obtained.

[0113] In a possible implementation, the preset text adjustment strategy is: adding a target symbol at a target adding position, and / or marking tones for polyphonetic characters in the first text to be recognized.

[0114] In a possible implementation manner, the identification unit 503 is configured to:

[0115] Determine a first sentence vector of the first initial intent and a second sentence vector of the second initial intent;

[0116] intercepting a first vector segment of the first sentence vector and a second vector segment of the second sentence vector; the first vector segment and the second vector segment have the same width;

[0117] The difference information between the first vector segment and the second vector segment is determined, and a target semantic element matching the difference information is searched in a preset semantic element vector library, and the target semantic element is used as the intention change information.

[0118] In a possible implementation manner, the identification unit 503 is configured to:

[0119] According to the intention change information, searching for a target change rule matching the intention change information in a preset intention adjustment set, wherein the target change rule includes a target change direction and a target sliding bit number;

[0120] In a preset index intent mapping table, searching for a first intent index corresponding to the first initial intent;

[0121] Determine a first coordinate of the first intention index in a preset index coordinate map, and move the first coordinate according to the target change direction and the target sliding bit number to obtain a second coordinate and a second intention index corresponding thereto;

[0122] In a preset index intent mapping table, search for a matching intent corresponding to the second intent index, and use the matching intent as the target intent of the first text to be recognized.

[0123] All relevant contents of each step involved in the embodiment of the aforementioned intention recognition method can be referred to the functional description of the functional module corresponding to the intention recognition device in the embodiment of the present application, and will not be repeated here.

[0124] The division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a controller, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0125] Based on the same inventive concept, the present application embodiment provides an electronic device, see Figure 6As shown, the electronic device includes at least one processor 601 and a memory 602 connected to the at least one processor. The specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present application. Figure 6 In the example, the processor 601 and the memory 602 are connected via a bus 600. Figure 6 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 600 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. In addition, the intention recognition device also includes a communication interface 603 for receiving or sending data.

[0126] In an embodiment of the present application, the memory 602 stores instructions that can be executed by at least one processor 601. The at least one processor 601 can execute the steps included in the aforementioned intention recognition method by executing the instructions stored in the memory 602.

[0127] Among them, the processor 601 is the control center of the electronic device, which can use various interfaces and lines to connect various parts of the entire electronic device, and monitor the electronic device as a whole by running or executing instructions stored in the memory 602 and calling data stored in the memory 602, various functions of the electronic device and processing data.

[0128] Optionally, the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.

[0129] Processor 601 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor to be executed, or a combination of hardware and software modules in the processor can be executed.

[0130] The memory 602 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 602 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 602 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 602 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0131] By designing and programming the processor 601, the code corresponding to the intent recognition method introduced in the aforementioned embodiment can be solidified into the chip, so that the chip can execute the steps of the aforementioned intent recognition method during operation. How to design and program the processor 601 is a technology well known to those skilled in the art and will not be repeated here.

[0132] Based on the same inventive concept, an embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the intention recognition method as described above are implemented.

[0133] In some possible implementations, various aspects of the intent recognition method provided by the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a control electronic device, the program code is used to enable the control electronic device to execute the steps of the intent recognition method according to various exemplary implementations of the present application described above in this specification.

[0134] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0135] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable intent recognition device to generate a machine, so that the instructions executed by the processor of the computer or other programmable intent recognition device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable intent recognition device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0137] These computer program instructions may also be loaded onto a computer or other programmable intent recognition device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0138] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for intention recognition, characterized in that: The method comprises: Determining a first initial intent of a first to-be-recognized text; The first text to be recognized is adjusted according to a preset text adjustment strategy to obtain a second text to be recognized, and a second initial intention of the second text to be recognized is determined; Intent change information is determined according to the first initial intent and the second initial intent, and the first initial intent is adjusted according to the intent change information to obtain a target intent of the first text to be recognized.

2. The method according to claim 1, characterized in that The determining of the first initial intention of the first to-be-recognized text includes: Performing intent recognition on the first text to be recognized by using an intent recognition model to obtain a first initial intent of the first text to be recognized; The determining the intention of the second text to be recognized includes: The second text to be recognized is subjected to intention recognition through an intention recognition model to obtain a second initial intention of the second text to be recognized.

3. The method according to claim 2, characterized in that The training process of the intent recognition model includes the following steps: Determine an intention sample set, wherein the intention sample includes a sample text and annotated intentions of the sample text; Inputting the sample text into an initial intent recognition model for training to obtain a predicted intent of the sample text; Based on the predicted intent and the annotated intent of the sample text, the intent difference information of the sample text is determined, and based on the intent difference information and a preset loss function, it is determined to train the initial intent recognition model to obtain a trained intent recognition model.

4. The method according to claim 3, characterized in that The determining of the intention sample set includes: Determining a target text corpus according to the business scenario to which the sample text belongs; For each text in the target text corpus, punctuation marks are added according to a preset punctuation strategy to obtain a first text set; For each polyphonic character in the first text set, marking corresponding multiple tones to obtain a second text set; According to the intent included in the preset intent information set, intent annotation is performed on each text in the target text corpus, the first text set, and the second text set to obtain an intent sample set.

5. The method according to claim 4, characterized in that The step of adding punctuation marks to each text in the target text corpus according to a preset punctuation strategy to obtain a first text set includes: For each text in the target text corpus, word segmentation processing is performed to obtain a word segmentation result, and a first adding position of the punctuation mark is determined based on the word segmentation result; Acquire addition information, wherein the addition information includes addition symbol information and addition quantity information; According to the addition quantity information, determine a target adding position from the first adding positions, and add punctuation marks at the target adding position according to the addition symbol information to obtain a first text; Based on the first text of each text, a first text set is obtained.

6. The method according to claim 4, characterized in that For each polyphonic character in the first text set, marking corresponding multiple tones to obtain a second text set includes: For each first text in the first text set, determining polyphones in the text; Determining multiple tones corresponding to the polyphonetic character, and marking the multiple tones on the polyphonetic character to obtain a second text; Based on the second text corresponding to each of the first texts, a second text set is obtained.

7. The method according to claim 1, characterized in that The preset text adjustment strategy is: adding a target symbol at a target adding position, and / or marking tones for polyphones in the first text to be recognized.

8. The method according to any one of claims 1 to 6, characterized in that: The determining, according to the first initial intention and the second initial intention, the intention change information includes: Determine a first sentence vector of the first initial intent and a second sentence vector of the second initial intent; intercepting a first vector segment of the first sentence vector and a second vector segment of the second sentence vector; the first vector segment and the second vector segment have the same width; The difference information between the first vector segment and the second vector segment is determined, and a target semantic element matching the difference information is searched in a preset semantic element vector library, and the target semantic element is used as the intention change information.

9. The method according to any one of claims 1 to 6, characterized in that: The initial intent is adjusted based on the intent change information to obtain the target intent of the text to be recognized, including: According to the intention change information, searching for a target change rule matching the intention change information in a preset intention adjustment set, wherein the target change rule includes a target change direction and a target sliding bit number; In a preset index intent mapping table, searching for a first intent index corresponding to the first initial intent; Determine a first coordinate of the first intention index in a preset index coordinate map, and move the first coordinate according to the target change direction and the target sliding bit number to obtain a second coordinate and a second intention index corresponding thereto; In a preset index intent mapping table, search for a matching intent corresponding to the second intent index, and use the matching intent as the target intent of the first text to be recognized.

10. An intention recognition device, characterized in that: The device comprises: A first determining unit, used to determine a first initial intention of a first text to be recognized; A second determination unit, configured to adjust the first text to be recognized according to a preset text adjustment strategy to obtain a second text to be recognized, and determine a second initial intention of the second text to be recognized; The recognition unit is used to determine the intention change information according to the first initial intention and the second initial intention, and adjust the first initial intention according to the intention change information to obtain the target intention of the first text to be recognized.

11. An electronic device, characterized in that: It includes a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the intention recognition method described in any one of claims 1-9.

12. A computer-readable storage medium, characterized in that: It includes program code, and when the storage medium is run on an electronic device, the program code is used to enable the electronic device to execute the steps of any one of the intention recognition methods in claims 1-9.

13. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method for intention identification as claimed in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Intention recognition method and device, computer equipment and storage medium

    CN109800407A

  • Intention recognition method and device, electronic equipment and readable storage medium

    CN116150357A

  • Intention recognition method and device, computer equipment and storage medium

    CN116955551A

  • Intention recognition method and device, electronic equipment and storage medium

    CN117708266A

  • User interface for correcting recognition errors

    US20180330730A1