Sentence intention recognition method, sentence response method, device and electronic device

By splitting long sentences into short sentences and allowing users to select target intentions, the problem of poor accuracy in identifying long sentence intentions in the dialogue system is solved, and the accuracy and efficiency of recognition and response are improved.

CN113887224BActive Publication Date: 2024-10-18JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111217604.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-19
Publication Date
2024-10-18
Estimated Expiration
2041-10-19

AI Technical Summary

Technical Problem

When existing dialogue systems process long sentences, it is difficult for the model to effectively learn scene information, resulting in poor intent recognition accuracy. Especially when the question is too long, the model only focuses on the previous part of the description and ignores the entire sentence expression.

Method used

By splitting a long sentence into multiple short sentences, the intention is recognized separately, and the intention of each short sentence is displayed as a candidate intention, allowing the user to select the target intention, thereby determining the target intention of the long sentence.

Benefits of technology

It improves the accuracy of identifying the intent of long sentences, reduces labor costs, improves labeling efficiency, and enables the trained model to more accurately identify and respond to the intent of long sentences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113887224B_ABST
    Figure CN113887224B_ABST
Patent Text Reader

Abstract

The present application proposes a sentence intention recognition method, a sentence response method, a device and an electronic device, wherein the method includes: obtaining a long sentence to be recognized, splitting the long sentence into multiple short sentences, performing intention recognition on the multiple short sentences, obtaining the intention of each short sentence, displaying the intention of each short sentence as a candidate intention of the long sentence, determining the target intention of the long sentence in response to a selection operation on the multiple candidate intentions, and determining the target intention of the long sentence by user selection based on the multiple intentions obtained by recognizing the multiple short sentences, thereby improving the accuracy of intention recognition of the long sentence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a sentence intention recognition method, a sentence response method, a device and an electronic device. Background Art

[0002] In a dialogue system, the most important part is intent recognition. The sentence provided by the questioner carries a certain intent, and the respondent answers based on the recognized intent. In a dialogue system, more than 90% of the consulting questions are within 15 words, which means that there are only a few long sentence questions in our training corpus. The model cannot effectively learn the scene information, resulting in poor accuracy in intent recognition when the question is too long. Summary of the invention

[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0004] To this end, the first purpose of the present application is to propose a sentence intent recognition method, a sentence response method, a device and an electronic device to improve the accuracy of intent recognition of long sentences.

[0005] The first embodiment of the present application proposes a method for identifying sentence intent, including:

[0006] Get the long sentence to be recognized;

[0007] Splitting the long sentence into multiple short sentences;

[0008] Performing intent recognition on the multiple short sentences to obtain the intent of each of the short sentences;

[0009] Displaying the intentions of each of the short sentences as candidate intentions of the long sentence;

[0010] In response to a selection operation on the multiple candidate intents, a target intent of the long sentence is determined.

[0011] The second aspect of the present application provides a statement answering method, including:

[0012] Get the long sentence to be recognized;

[0013] Inputting the long sentence into the trained long sentence recognition model to obtain the intent corresponding to the long sentence;

[0014] According to the intention, response information of the long sentence is determined.

[0015] The third aspect of the present application provides a sentence intention recognition device, including:

[0016] An acquisition module, used to acquire a long sentence to be recognized;

[0017] A splitting module, used for splitting the long sentence into multiple short sentences;

[0018] A recognition module, used for performing intention recognition on the plurality of short sentences to obtain the intention of each of the short sentences;

[0019] A display module, used for displaying the intentions of each of the short sentences as candidate intentions of the long sentence;

[0020] A determination module is used to determine the target intent of the long sentence in response to a selection operation on the multiple candidate intents.

[0021] The fourth aspect of the present application provides a sentence response device, including:

[0022] An acquisition module, used to acquire a long sentence to be recognized;

[0023] A recognition module, used for inputting the long sentence into the trained long sentence recognition model to obtain the intent corresponding to the long sentence;

[0024] A determination module is used to determine the response information of the long sentence according to the intention.

[0025] A fifth aspect of the present application provides an electronic device, including:

[0026] at least one processor; and a memory in communication with the at least one processor; wherein,

[0027] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in the first aspect, or execute the method described in the second aspect.

[0028] The sixth aspect embodiment of the present application proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect, or execute the method described in the second aspect.

[0029] The seventh aspect embodiment of the present application proposes a computer program product, comprising computer instructions, which, when executed by a processor, implement the method described in the first aspect, or implement the method described in the second aspect.

[0030] The technical solution of the embodiment of the present application has the following beneficial effects:

[0031] A long sentence to be recognized is obtained, the long sentence is split into multiple short sentences, intent recognition is performed on the multiple short sentences to obtain the intent of each short sentence, the intent of each short sentence is displayed as a candidate intent of the long sentence, and in response to a selection operation on the multiple candidate intents, the target intent of the long sentence is determined. The target intent of the long sentence is determined by the user through the multiple intents obtained by recognizing the multiple short sentences, thereby improving the accuracy of intent recognition of the long sentence.

[0032] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0034] Figure 1 A flowchart of a method for identifying sentence intent provided in an embodiment of the present application;

[0035] Figure 2 A flowchart of another method for identifying sentence intent provided in an embodiment of the present application;

[0036] Figure 3 A flowchart of a statement response method provided in an embodiment of the present application;

[0037] Figure 4 A schematic diagram of the structure of a sentence intention recognition device provided in an embodiment of the present application;

[0038] Figure 5 A schematic diagram of the structure of a sentence response device provided in an embodiment of the present application; and

[0039] Figure 6 A block diagram of an exemplary electronic device provided in accordance with an embodiment of the present application. DETAILED DESCRIPTION

[0040] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0041] The following describes the sentence intent recognition method, sentence response method, device and electronic device of the embodiments of the present application with reference to the accompanying drawings.

[0042] Figure 1 A flowchart of a method for identifying sentence intent provided in an embodiment of the present application.

[0043] like Figure 1 As shown, the method comprises the following steps:

[0044] Step 101: Obtain a long sentence to be recognized.

[0045] The long sentence can be a text of a long sentence obtained in response to a user input operation, or a long sentence obtained by collecting voice and recognizing the voice. A long sentence contains multiple short sentences. For example, the long sentence is "I bought a computer yesterday, but when I placed the order, they said it was out of stock and I had to get it from somewhere else. I want to ask when it can be shipped?"

[0046] Step 102: split the long sentence into multiple short sentences.

[0047] In an embodiment of the present application, a long sentence is split according to the sentence granularity to obtain multiple short sentences, among which meaningless sentences can be removed. For example, a long sentence is "I bought a computer yesterday, but when I placed the order, they said it was out of stock and I had to get it from somewhere else. I would like to ask, when can it be shipped?" After splitting the long sentence, multiple short sentences can be obtained, namely "I bought a computer yesterday", "When I placed the order, they said it was out of stock", "I have to get it from somewhere else", and "When can it be shipped".

[0048] Step 103, performing intent recognition on multiple short sentences to obtain the intent of each short sentence.

[0049] In one implementation of the embodiment of the present application, the short sentence recognition model obtained through training can be used to input multiple short sentences into the short sentence recognition model respectively to obtain the intention corresponding to each short sentence, so as to improve the accuracy of short sentence intention recognition.

[0050] Step 104, displaying the intent of each short sentence as a candidate intent of a long sentence.

[0051] In an embodiment of the present application, the intent of each short sentence is used as a candidate intent of a long sentence and displayed through a display interface so that the user can select the target intent of the long sentence to be identified from the intents of each phrase in the display interface.

[0052] Step 105, in response to the selection operation of multiple candidate intents, determine the target intent of the long sentence.

[0053] In the embodiment of the present application, in response to the user's selection operation of multiple candidate intents in the display interface, the candidate intent selected by the user is used as the target intent of the long sentence, and multiple intents based on the output of the short sentence recognition model are realized. The user selects and determines the target intent of the long sentence, and the intent of the long sentence is quickly labeled. Through the same method of determining the target intent of the long sentence, a large amount of long sentence labeling data can be obtained. Compared with the method of manually labeling each long sentence, only a small amount of manpower is needed to obtain the target intent of the long sentence, realize the labeling of the long sentence, and improve the efficiency of labeling.

[0054] In the sentence intention recognition method of the embodiment of the present application, a long sentence to be recognized is obtained, the long sentence is split into multiple short sentences, the intention recognition is performed on the multiple short sentences, the intention of each short sentence is obtained, the intention of each short sentence is displayed as a candidate intention of the long sentence, and the target intention of the long sentence is determined in response to the selection operation of the multiple candidate intentions. The target intention of the long sentence is determined by the user through the multiple intentions obtained by recognizing the multiple short sentences, thereby improving the accuracy of the intention recognition of the long sentence.

[0055] Based on the previous embodiment, this embodiment provides another sentence intention recognition method. Figure 2 A flowchart of another method for identifying sentence intent provided in an embodiment of the present application.

[0056] like Figure 2 As shown, the method may include the following steps:

[0057] Step 201: Obtain a long sentence to be recognized.

[0058] Step 202: split the long sentence into a corresponding plurality of short sentences.

[0059] Step 203, based on the short sentence recognition model, perform intent recognition on multiple short sentences of the long sentence to obtain the intent of each short sentence.

[0060] Step 204, displaying the intent of each short sentence as a candidate intent of a long sentence.

[0061] In the embodiment of the present application, there are multiple long sentences, wherein for each long sentence, the above steps 201 to 204 are executed, the principles are the same, and will not be repeated in this embodiment.

[0062] Step 205, in response to the last selection operation of multiple candidate intents, determine the target intent of the long sentence.

[0063] Among them, when the user selects multiple candidate intents in the display interface, there are cases of multiple selections and incorrect selections, which makes the target intent corresponding to the collected long sentences have certain errors. In order to ensure a high accuracy of intent determination, the target intent of the obtained long sentences is cleaned.

[0064] In one implementation of the embodiment of the present application, the selection operation is multiple times, that is, the user performs multiple selection operations on the candidate intentions of a long sentence in the display interface, wherein the last selection operation is the selection operation performed after the user determines the correct intention of the long sentence, and the intermediate selection operations are the selection operations during the thinking process. Therefore, the credibility of the last selection operation is higher than that of the intermediate selection operations, and thus, the candidate intention determined by the last selection operation is used as the target intention of the long sentence.

[0065] Step 206: perform similarity matching on the multiple long sentences to obtain multiple groups of matching long sentences.

[0066] In one implementation of the embodiment of the present application, a plurality of long sentences may be similarly matched according to the sentence structure and semantics of the long sentences to obtain a plurality of groups of matching long sentences. For example, in each group of long sentences, the questioning method of each long sentence is the same, wherein the extraction method matching may refer to the same number of sentences contained in each group of long sentences and the same overall semantics.

[0067] Step 207: For each long sentence in the same group, determine the position of the target short sentence corresponding to the target intent in the long sentence.

[0068] In the embodiment of the present application, for each long sentence in the same group, the position of the target short sentence corresponding to the target intent of the long sentence in the long sentence is determined. For example, in the long sentence "I installed a cabinet yesterday. During the installation, I found that the cabinet door had cracks and needed to be returned to the factory for processing. When can the cabinet door be repaired and shipped?", the target intent of the long sentence determined is "the delivery time of the cabinet door". The target short sentence corresponding to the target intent is "when can the cabinet door be repaired and shipped", and the position of the target short sentence in the long sentence is the fourth short sentence.

[0069] Step 208, modifying the target intention of each long sentence according to the position of the target short sentence in each long sentence in the same group.

[0070] In an embodiment of the present application, the positions of the target short sentences in each long sentence in the same group are counted to obtain the proportion of the target short sentences in the same position. Different proportions lead to different ways of correcting the target intent of each long sentence in the same group. Different implementation methods are used for specific explanation below.

[0071] In the first implementation method of the embodiment of the present application, the proportion of target short sentences with the same position is counted. When the proportion is greater than a threshold, the target intention of the long sentences in the same group is updated according to the intention of the target short sentences with the same position. That is to say, the proportion of target short sentences with the same position is greater than the threshold, that is to say, most of the long sentences in the same group have the same position distribution of target short sentences. Therefore, according to the position distribution of target short sentences with a larger proportion, the target short sentences with different positions in the same group are updated to achieve the update of the target intention. For example, there are three long sentences in a group, namely A, B and C. The target short sentences of long sentences A and B are both the second short sentences in long sentences A and B, while the target short sentence of long sentence C is the third short sentence in long sentence C. Therefore, it is necessary to update the target intention of long sentence C to the target intention of long sentence A or long sentence B, thereby correcting the target intention of long sentence C and improving the accuracy of the target intention of long sentences.

[0072] In a second implementation method of the embodiment of the present application, the proportion of target short sentences with the same position is counted. When the proportion is greater than a threshold, the positions of target short sentences with different positions in the same group are updated according to the positions of the target short sentences with the same position in the long sentence to which they belong, and then the target intent of the long sentence is updated according to the updated positions of the target short sentences.

[0073] For example, there are three long sentences in a group, namely A, B and C. The target short sentences of long sentences A and B are both the second short sentences in long sentences A and B, while the target short sentence of long sentence C is the third short sentence in long sentence C. Therefore, it is necessary to update the position of the target short sentence of long sentence C to the second short sentence, and use the intention of the second short sentence as the target intention of long sentence C, thereby realizing the correction of the target intention of long sentence C and improving the accuracy of the target intention of long sentences.

[0074] In a third implementation of the embodiment of the present application, when the proportion of target short sentences in the same position is less than or equal to a threshold, a prompt message is displayed, wherein the prompt message is used to prompt to re-execute the selection operation. Wherein, the proportion of target short sentences in the same position is less than or equal to the threshold, indicating that in the group of long sentences, the distribution deviation of the position of the target short sentences corresponding to the target intent of the long sentences in the long sentences is large. For example, a group of long sentences is 2, namely A and C, and the target short sentence of long sentence A is the second short sentence in long sentence A, while the target short sentence of long sentence C is the third short sentence in long sentence C. Therefore, it is impossible to update based on the distribution of the target phrases corresponding to the target intent in the group of long sentences in the long sentences to improve the accuracy. Therefore, it is necessary to display the prompt message, which can be prompted through the operation interface, or first prompted by voice, and then the operation interface is displayed, or first prompted by the indicator light, and then the operation interface is displayed, so that the user can re-execute the selection operation in the operation interface to select the target intent of long sentences A and long sentences C, so as to improve the accuracy of the target intent of the long sentences.

[0075] Step 209 , training the long sentence recognition model according to each long sentence and the target intention of the long sentence, so that the trained long sentence recognition model learns the correspondence between the long sentence and the target intention of the long sentence.

[0076] In the embodiment of the present application, multiple short sentences obtained by segmenting each long sentence are identified using a trained short sentence recognition model with high recognition accuracy to obtain the intent of each short sentence, and the target intent corresponding to the long sentence is accurately determined through the user's selection operation. The determined target intent of the long sentence is used as the annotation information of the long sentence, which improves the annotation effect compared to the user's tagging of each long sentence one by one. The long sentence recognition model is trained based on each long sentence and the target intent of the long sentence, and the intent of the long sentence obtained by the long sentence recognition model output is compared with the target intent of the labeled long sentence. The parameters of the long sentence recognition model are adjusted according to the difference, so that the long sentence recognition model converges to obtain a trained long sentence recognition model, so that the trained long sentence recognition model learns the correspondence between the long sentence and the target intent of the long sentence.

[0077] In the sentence intention recognition method of the embodiment of the present application, a long sentence to be recognized is obtained, the long sentence is split into multiple short sentences, the intention of the multiple short sentences is recognized, the intention of each short sentence is obtained, and the intention of each short sentence is displayed as a candidate intention of the long sentence. In response to the selection operation of the multiple candidate intentions, the target intention of the long sentence is determined, and then the long sentence and the target intention of the long sentence are used as training samples to train the long sentence recognition model, so that the trained long sentence recognition model can directly recognize the intention of the long sentence. By automatically obtaining training corpus in the interaction with the user, only a small amount of manual participation in annotation is required in the data cleaning stage. Finally, the long sentence recognition model is trained with the collected corpus to directly predict the intention, thereby achieving the purpose of low resource consumption and good recognition effect.

[0078] Based on the above embodiments, the present application provides a statement response method. Figure 3 A flowchart of a statement response method provided in an embodiment of the present application is shown as follows: Figure 3 As shown, the method includes:

[0079] Step 301: Obtain a long sentence to be recognized.

[0080] Step 302: input the long sentence into the trained long sentence recognition model to obtain the intent corresponding to the long sentence.

[0081] In the implementation of this application, the trained long sentence recognition model has learned the correspondence between long sentences and the target intentions of long sentences, so that the long sentence to be recognized is input into the long sentence recognition model, and the intention corresponding to the long sentence can be directly output.

[0082] Step 303: Determine the response information of the long sentence according to the intention.

[0083] As an implementation method, the intent output by the long sentence recognition model can be input into the response model to obtain the response information corresponding to the intent, that is, to obtain the response information of the long sentence.

[0084] As another implementation method, the long sentence recognition model may include an intent recognition network and a response output network. The intent output by the intent recognition network is input into the response output network to obtain response information corresponding to the intent, that is, to obtain the response information of the long sentence.

[0085] In the sentence answering method of the embodiment of the present application, the long sentence recognition model obtained through training can directly recognize the corresponding intention of the long sentence and obtain the response information, thereby realizing accurate recognition and response output of the long sentence, and achieving better recognition effect with less cost investment.

[0086] In order to implement the above embodiment, the present application also proposes a sentence intention recognition device.

[0087] Figure 4 A schematic diagram of the structure of a sentence intent recognition device provided in an embodiment of the present application.

[0088] like Figure 4 As shown, the device comprises:

[0089] The acquisition module 41 is used to acquire the long sentence to be recognized.

[0090] The splitting module 42 is used to split the long sentence into multiple short sentences.

[0091] The recognition module 43 is used to perform intention recognition on the multiple short sentences to obtain the intention of each short sentence.

[0092] The display module 44 is used to display the intentions of each of the short sentences as candidate intentions of the long sentence.

[0093] The determination module 45 is used to determine the target intent of the long sentence in response to the selection operation of the multiple candidate intents.

[0094] Further, in an implementation of the embodiment of the present application, the selection operation is multiple times, and the determination module 45 includes:

[0095] The first determination unit is used to determine the target intent of the long sentence in response to the last selection operation of the multiple candidate intents.

[0096] In an implementation of the embodiment of the present application, there are multiple long sentences, and the determination module 45 further includes:

[0097] The matching unit is used to perform similarity matching on the plurality of long sentences to obtain a plurality of groups of matching long sentences.

[0098] The second determining unit is used to determine, for each long sentence in the same group, a position of the target short sentence corresponding to the target intent in the corresponding long sentence.

[0099] The correction unit is used to correct the target intention of each long sentence according to the position of the target short sentence in each long sentence in the same group.

[0100] In one implementation of the embodiment of the present application, the correction unit is specifically configured to:

[0101] Counting the proportion of target short sentences with the same position;

[0102] When the proportion is greater than a threshold, the target intent of the long sentences in the same group is updated according to the intent of the target short sentences in the same position;

[0103] When the proportion is less than or equal to a threshold, a prompt message is displayed; wherein the prompt message is used to prompt to re-execute the selection operation.

[0104] In an implementation of the embodiment of the present application, there are multiple long sentences, and the device further includes:

[0105] The training module is used to train the long sentence recognition model according to each of the long sentences and the target intention of the long sentences, so that the trained long sentence recognition model can learn the corresponding relationship between the long sentences and the target intention of the long sentences.

[0106] In one implementation of the embodiment of the present application, the identification module 43 is used to:

[0107] The multiple short sentences are respectively input into the short sentence recognition model to obtain the intention corresponding to each of the short sentences.

[0108] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment and will not be repeated here.

[0109] In the sentence intention recognition device of the embodiment of the present application, a long sentence to be recognized is obtained, the long sentence is split into multiple short sentences, the intention recognition is performed on the multiple short sentences to obtain the intention of each short sentence, and the intention of each short sentence is displayed as a candidate intention of the long sentence. In response to the selection operation of the multiple candidate intentions, the target intention of the long sentence is determined. The user selects the target intention of the long sentence based on the multiple intentions obtained by recognizing the multiple short sentences, thereby improving the accuracy of the intention recognition of the long sentence. Then, the long sentence and the target intention of the long sentence are used as training samples to train the long sentence recognition model, so that the trained long sentence recognition model can directly recognize the intention of the long sentence, thereby improving the accuracy of the long sentence recognition.

[0110] In order to implement the above-mentioned embodiment, the present application also proposes a sentence response device.

[0111] Figure 5 A schematic diagram of the structure of a sentence response device provided in an embodiment of the present application.

[0112] like Figure 5 As shown, the device comprises:

[0113] The acquisition module 51 is used to acquire the long sentence to be recognized.

[0114] The recognition module 52 is used to input the long sentence into the trained long sentence recognition model to obtain the intention corresponding to the long sentence.

[0115] The determination module 53 is used to determine the response information of the long sentence according to the intention.

[0116] It should be noted that the above explanation of the method embodiment is also applicable to the device of this embodiment and will not be repeated here.

[0117] In the sentence response device of the embodiment of the present application, the long sentence recognition model obtained through training can directly recognize the corresponding intention of the long sentence and obtain the response information, thereby realizing accurate recognition and response output of the long sentence.

[0118] In order to implement the above embodiment, the present application embodiment provides an electronic device, including:

[0119] at least one processor; and a memory in communication with the at least one processor; wherein,

[0120] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the foregoing method embodiment, for example, to implement the method described in FIG. 1 to FIG. Figure 2 The method corresponding to the embodiment of the present invention is to implement Figure 3 The method corresponding to the embodiment.

[0121] In order to implement the above embodiment, the present application embodiment proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the method described in the above method embodiment, for example, to implement Figure 1 and Figure 2 The method corresponding to the embodiment of the present invention is to implement Figure 3 The method corresponding to the embodiment.

[0122] In order to implement the above embodiment, the present application embodiment proposes a computer program product, including computer instructions, which, when executed by a processor, implement the method described in the above method embodiment, for example, to implement Figure 1 to Figure 2 The method corresponding to the embodiment of the present invention is to implement Figure 3 The method corresponding to the embodiment.

[0123] Figure 6 A block diagram of an exemplary electronic device provided in accordance with an embodiment of the present application. Figure 6 The electronic device 12 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0124] like Figure 6 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that connects various system components (including the memory 28 and the processing unit 16).

[0125] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.

[0126] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0127] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6Not shown, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read only memory (CD-ROM), a digital versatile disc read only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.

[0128] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0129] The electronic device 12 may also communicate with one or more external devices 14 (e.g., a keyboard, a pointing device, a display 24, etc.), one or more devices that enable a user to interact with the electronic device 12, and / or any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although Figure 6 Not shown, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0130] The processing unit 16 executes various functional applications and data processing by running the programs stored in the memory 28, such as implementing the methods mentioned in the above embodiments.

[0131] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, a person skilled in the art may combine and combine different embodiments or examples described in this specification and features of different embodiments or examples, without contradiction.

[0132] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0133] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0134] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0135] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented with hardware, as in another embodiment, any one of the following technologies known in the art or their combination can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0136] A person skilled in the art may understand that all or part of the steps in the method of the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0137] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0138] The storage medium mentioned above may be a read-only memory, a disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. Ordinary technicians in the field of technology can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for identifying sentence intention, characterized in that: include: Get the long sentence to be recognized; Splitting the long sentence into multiple short sentences; Performing intent recognition on the multiple short sentences to obtain the intent of each of the short sentences; Displaying the intentions of each of the short sentences as candidate intentions of the long sentence; In response to a selection operation on the plurality of candidate intents, determining a target intent of the long sentence; The selection operation is multiple times, and the determination of the target intent of the long sentence in response to the selection operation of the multiple intents includes: In response to a last selection operation on the plurality of candidate intents, determining a target intent of the long sentence; Performing similarity matching on the plurality of long sentences to obtain a plurality of groups of matching long sentences; For each long sentence in the same group, determining the position of the target short sentence corresponding to the target intention in the corresponding long sentence; Counting the proportion of target short sentences with the same position; When the proportion is greater than a threshold, the target intent of the long sentences in the same group is updated according to the intent of the target short sentences in the same position; When the proportion is less than or equal to a threshold, a prompt message is displayed; wherein the prompt message is used to prompt to re-execute the selection operation.

2. The method according to claim 1, characterized in that The number of the long sentences is multiple, and after determining the target intention of the long sentences, the method further includes: According to each of the long sentences and the target intention of the long sentences, the long sentence recognition model is trained so that the trained long sentence recognition model learns the corresponding relationship between the long sentences and the target intention of the long sentences.

3. The method according to claim 1, characterized in that The performing intention recognition on the multiple short sentences to obtain the intention corresponding to each of the short sentences includes: The multiple short sentences are respectively input into the short sentence recognition model to obtain the intention corresponding to each of the short sentences.

4. A statement answering method, characterized in that: include: Get the long sentence to be recognized; Inputting the long sentence into the trained long sentence recognition model to obtain the intent corresponding to the long sentence; Determining response information of the long sentence according to the intention; The training method of the long sentence recognition model is as follows: Obtain a long sentence to be recognized, and split the long sentence into multiple short sentences; Performing intent recognition on the multiple short sentences to obtain the intent of each short sentence, displaying the intent of each short sentence as a candidate intent of the long sentence, and determining the target intent of the long sentence in response to a selection operation on the multiple candidate intents; The long sentence and the target intention of the long sentence are used as training samples to train the long sentence recognition model The selecting operation is performed multiple times, and the determining of the target intent of the long sentence in response to the selecting operation of the multiple candidate intents includes: In response to a last selection operation on the plurality of candidate intents, determining a target intent of the long sentence; Performing similarity matching on the plurality of long sentences to obtain a plurality of groups of matching long sentences; For each long sentence in the same group, determining the position of the target short sentence corresponding to the target intention in the corresponding long sentence; Counting the proportion of target short sentences with the same position; When the proportion is greater than a threshold, the target intent of the long sentences in the same group is updated according to the intent of the target short sentences in the same position; When the proportion is less than or equal to a threshold, a prompt message is displayed; wherein the prompt message is used to prompt to re-execute the selection operation.

5. A sentence intention recognition device, characterized in that: include: An acquisition module, used to acquire a long sentence to be recognized; A splitting module, used for splitting the long sentence into multiple short sentences; A recognition module, used for performing intention recognition on the plurality of short sentences to obtain the intention of each of the short sentences; A display module, used for displaying the intentions of each of the short sentences as candidate intentions of the long sentence; A determination module, configured to determine a target intent of the long sentence in response to a selection operation on the plurality of candidate intents; The selection operation is performed multiple times, and the determination module includes: A first determining unit, configured to determine a target intent of the long sentence in response to a last selection operation on the plurality of candidate intents; A matching unit, used for performing similarity matching on the plurality of long sentences to obtain a plurality of groups of matching long sentences; A second determination unit is used to determine, for each long sentence in the same group, a position of the target short sentence corresponding to the target intent in the long sentence; The correction unit is used to count the proportion of the target short sentences with the same position; when the proportion is greater than a threshold, the target intention of the long sentences in the same group is updated according to the intention of the target short sentences with the same position; when the proportion is less than or equal to the threshold, a prompt message is displayed; wherein the prompt message is used to prompt to re-execute the selection operation.

6. The device according to claim 5, characterized in that The number of the long sentences is multiple, and the device further includes: The training module is used to train the long sentence recognition model according to each of the long sentences and the target intention of the long sentences, so that the trained long sentence recognition model can learn the corresponding relationship between the long sentences and the target intention of the long sentences.

7. The device according to claim 5, characterized in that The identification module is used to: The multiple short sentences are respectively input into the short sentence recognition model to obtain the intention corresponding to each of the short sentences.

8. A sentence response device, characterized in that: include: An acquisition module, used to acquire a long sentence to be recognized; A recognition module, used for inputting the long sentence into the trained long sentence recognition model to obtain the intent corresponding to the long sentence; A determination module, used to determine the response information of the long sentence according to the intention; The training method of the long sentence recognition model is as follows: Obtain a long sentence, and split the long sentence into multiple short sentences; Performing intent recognition on the multiple short sentences to obtain the intent of each short sentence, displaying the intent of each short sentence as a candidate intent of the long sentence, and determining the target intent of the long sentence in response to a selection operation on the multiple candidate intents; The long sentence and the target intention of the long sentence are used as training samples to train the long sentence recognition model The selecting operation is performed multiple times, and the determining of the target intent of the long sentence in response to the selecting operation of the multiple candidate intents includes: In response to a last selection operation on the plurality of candidate intents, determining a target intent of the long sentence; Performing similarity matching on the plurality of long sentences to obtain a plurality of groups of matching long sentences; For each long sentence in the same group, determining the position of the target short sentence corresponding to the target intention in the corresponding long sentence; Counting the proportion of target short sentences with the same position; When the proportion is greater than a threshold, the target intent of the long sentences in the same group is updated according to the intent of the target short sentences in the same position; When the proportion is less than or equal to a threshold, a prompt message is displayed; wherein the prompt message is used to prompt to re-execute the selection operation.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in any one of claims 1 to 3, or implement the method described in claim 4.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute the method according to any one of claims 1 to 3, or to implement the method according to claim 4.

11. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the method described in any one of claims 1 to 3 is implemented, or the method described in claim 4 is implemented.

Citation Information

Patent Citations

  • User intention identification method and system

    CN110909138A

  • Sentence segmentation-based multi-intention identification method and device, equipment and storage medium

    CN111444324A

  • Natural language processing method and device, electronic equipment and storage medium

    CN112925889A

  • Response information obtaining method and apparatus, computer device, and storage medium

    WO2021051521A1