Human-computer interaction intention analysis method, device, computer equipment and storage medium
By performing syntactic dependency analysis and punctuation judgment in voice interaction, combined with negative word verification entities, the problem that semantic services cannot accurately determine user intentions is solved, and the efficiency and accuracy of voice interaction are improved.
Patent Information
- Application Number
- CN202111137060.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-27
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-09-27
AI Technical Summary
Existing semantic services cannot accurately determine the user's true intention in human-computer voice interaction, mainly because the text after speech conversion lacks punctuation marks, resulting in inefficient sound pickup results and the inability to accurately analyze the user's intention.
Using the human-computer interaction intention analysis method, by picking up speech and converting it into semantic text, we perform syntactic dependency analysis, determine the position of punctuation marks for sentence segmentation, determine the core relationship and the relationship between adverbials and central words, and combine negative words to determine the semantic text. Valid information is collected and entities are verified to improve the accuracy of intent extraction.
It effectively improves the accuracy of semantic services in understanding user intentions and enhances the efficiency and accuracy of voice interaction.
Smart Images

Figure CN113849620B
Abstract
Description
Technical Field
[0001] The present invention relates to a robot, and more specifically to a method, device, computer equipment and storage medium for analyzing human-machine interaction intentions. Background Art
[0002] In the current specific scenario of human-computer voice interaction, when the user says "I don't want to go to Shenzhen Bay Park, I want to go to Peking University Hospital" or similar sentences, the semantic service will most likely determine that the starting point is Shenzhen Bay Park and the end point is Peking University Hospital. That is, the semantic service in the current specific scenario cannot accurately judge the user's true intention, which is not conducive to the semantic service triggering related services; in the existing semantic interaction intention analysis algorithm, when the user's voice is directly converted into text, no matter how long the voice text is, the converted text has no punctuation marks, that is, no sentence breaks. For this kind of voice pickup result, the semantic service analysis efficiency is low and it cannot accurately judge the user's true intention.
[0003] Therefore, it is necessary to design a new method to solve the problem that current semantic services cannot accurately judge the user's true intentions, so that semantic service understanding can be more accurate. Summary of the invention
[0004] The purpose of the present invention is to overcome the defects of the prior art and provide a method, device, computer equipment and storage medium for analyzing human-computer interaction intention.
[0005] To achieve the above object, the present invention adopts the following technical solution: a method for analyzing human-computer interaction intention, comprising:
[0006] Picking up semantic interaction speech and converting the speech into semantic text;
[0007] Performing syntactic dependency analysis on the semantic text to obtain an analysis result;
[0008] Determining whether there are punctuation marks in the analysis result;
[0009] If there are punctuation marks in the analysis result, the analysis result is truncated according to the position of the first punctuation mark to obtain two sentences;
[0010] Determine the core relationship and the relationship between the adverbial clause and the central word of the clause where the core relationship is located;
[0011] Determine whether the semantic text contains valid information according to the rule of whether there is a negative word in the sentence, and when the semantic text contains valid information, determine the entity according to the sentence without the negative word, and verify the entity;
[0012] If there is no punctuation mark in the analysis result, determining whether the end of the semantic text is a function word;
[0013] If the end of the semantic text is a function word, the function word at the end of the semantic text is deleted, the end of the semantic text is re-determined, and the step of determining whether the end of the semantic text is a function word is performed;
[0014] If the end of the semantic text is not a function word, then searching for a core relationship;
[0015] Whether the semantic text contains valid information is determined in combination with the subscript length of the core relationship, and when the semantic text contains valid information, the entity is determined according to the sentence without the negative word, and the entity is verified.
[0016] The present invention also provides a human-computer interaction intention analysis device, comprising:
[0017] A pickup unit, used for picking up semantic interaction speech and converting the speech into semantic text;
[0018] A syntactic dependency analysis unit, used for performing syntactic dependency analysis on the semantic text to obtain an analysis result;
[0019] a punctuation mark judging unit, used for judging whether there are punctuation marks in the analysis result;
[0020] A truncation unit, configured to truncate the analysis result according to the position of the first punctuation mark if there are punctuation marks in the analysis result, so as to obtain two sentences;
[0021] A relationship determination unit, used to determine a core relationship and a relationship between an adverbial and a central word in a clause where the core relationship is located;
[0022] An entity acquisition unit, configured to determine whether the semantic text contains valid information according to a rule of whether a sentence contains a negative word, and when the semantic text contains valid information, determine an entity according to a sentence without a negative word, and verify the entity;
[0023] an ending judgment unit, configured to judge whether the end of the semantic text is a function word if there is no punctuation mark in the analysis result;
[0024] a deleting unit, configured to, if the end of the semantic text is a function word, delete the function word at the end of the semantic text, redetermine the end of the semantic text, and perform the step of determining whether the end of the semantic text is a function word;
[0025] A retrieval unit, configured to retrieve a core relationship if the semantic text does not end with a function word;
[0026] A combined judgment unit is used to judge whether the semantic text contains valid information in combination with the subscript length of the core relationship, and when the semantic text contains valid information, determine the entity according to the sentence without negative words, and verify the entity.
[0027] The present invention further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above method when executing the computer program.
[0028] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program can implement the above method when executed by a processor.
[0029] Compared with the prior art, the beneficial effects of the present invention are as follows: after picking up semantic interactive speech, the present invention converts it into semantic text, analyzes the semantic text using syntactic dependency analysis technology, and then makes punctuation judgment based on the analysis to determine the sentence division method, and then makes a negative word judgment on the two sentences to determine whether the semantic text contains valid information. When the semantic text contains valid information, the entity is determined according to the sentence without the negative word, and the entity is verified, and the boundary conditions are added, which effectively improves the accuracy of intent entity extraction; the problem that the current semantic service cannot accurately judge the user's true intention is solved, and the semantic service understanding is more accurate.
[0030] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0032] Figure 1 A schematic diagram of an application scenario of the human-computer interaction intention analysis method provided by an embodiment of the present invention;
[0033] Figure 2 A schematic diagram of a flow chart of a method for analyzing human-computer interaction intentions provided by an embodiment of the present invention;
[0034] Figure 3 A schematic diagram of a sub-process of a method for analyzing human-computer interaction intentions provided by an embodiment of the present invention;
[0035] Figure 4 A schematic diagram of a sub-process of a method for analyzing human-computer interaction intentions provided by an embodiment of the present invention;
[0036] Figure 5 A schematic diagram of a sub-process of a method for analyzing human-computer interaction intentions provided by an embodiment of the present invention;
[0037] Figure 6 A schematic block diagram of a human-computer interaction intention analysis device provided by an embodiment of the present invention;
[0038] Figure 7 A schematic block diagram of an entity acquisition unit of a human-computer interaction intention analysis device provided in an embodiment of the present invention;
[0039] Figure 8 A schematic block diagram of a verification subunit of a human-computer interaction intention analysis device provided by an embodiment of the present invention;
[0040] Fig. 9 A schematic block diagram of a combined judgment unit of a human-computer interaction intention analysis device provided by an embodiment of the present invention;
[0041] Fig.10 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0044] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0045] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0046] See also Figure 1 and Figure 2 , Figure 1A schematic diagram of an application scenario of the human-computer interaction intention analysis method provided in an embodiment of the present invention. Figure 2 A schematic flow chart of a human-computer interaction intention analysis method provided in an embodiment of the present invention. The human-computer interaction intention analysis method is applied in a server. The server interacts with a microphone for data exchange. The microphone and the server can be set on a robot or independently. After the semantic interaction speech picked up by the microphone is realized, text conversion is performed, and then the syntactic dependency analysis technology is used for analysis, which is divided into two results: with punctuation and without punctuation. Entity extraction is performed on the two results to obtain the corresponding intent.
[0047] Figure 2 FIG. 1 is a flow chart of a method for analyzing human-computer interaction intentions provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S200.
[0048] S110, picking up semantic interaction speech, and converting the speech into semantic text.
[0049] In this embodiment, the semantic interaction voice refers to the content picked up by the picker when the user interacts with the robot by voice, and the semantic text refers to the content obtained after converting the voice into text format.
[0050] When the user interacts with the robot by voice, the voice is converted into semantic text through ASR (Automatic Speech Recognition). It can meet the relevant requirements in actual voice interaction. The number of words displayed by the front-end sound pickup is limited, and ASR will truncate and recognize the semantics of voices that pause for more than 400 milliseconds.
[0051] S120: Perform syntactic dependency analysis on the semantic text to obtain an analysis result.
[0052] In this embodiment, the analysis result refers to the dependency relationship between all segmented words in the semantic text, such as: SBV-subject-verb relationship, VOB-verb-object relationship, ADV-relationship between adverbial and central word, MT-function word component, HED-core relationship. There is only one core relationship HED in the semantic text dependency relationship.
[0053] Specifically, the semantic text is subjected to syntactic dependency analysis by using Baidu's open source syntactic dependency analysis tool DDParser to obtain an analysis result.
[0054] Using Baidu's open source syntactic dependency analysis tool DDParser, we can perform syntactic dependency analysis on semantic text. Based on the analysis results, we can get the dependency relationship between all the word segments in the semantic text, and analyze the semantic interaction intention based on the dependency relationship of the semantic text, so as to solve the problem that the current semantic service cannot accurately judge the user's true intention, making the semantic service understanding more accurate.
[0055] S130: Determine whether there are punctuation marks in the analysis result.
[0056] In this embodiment, after using syntactic dependency analysis, it is clear whether there are punctuation marks such as commas in the corresponding semantic text. The determination of punctuation marks is to determine whether there is a sentence break. If there is a sentence break, the sentence splitting operation can be performed directly. If there is no sentence break, other methods can be used to split the sentence. The two sentences are judged one by one, thereby solving the problem that the current semantic service cannot accurately determine the user's true intention. Punctuation marks include commas, periods, and semicolons.
[0057] S140: If there are punctuation marks in the analysis result, the analysis result is truncated according to the position of the first punctuation mark to obtain two sentences.
[0058] In this embodiment, sentence segmentation refers to dividing the analysis result into two sub-sentences in a specific manner; the specific manner may be truncation according to the position of punctuation marks, or truncation in a manner related to a core relationship.
[0059] After the semantic text is parsed by DDParser, the comma will be parsed as a function word component. There may be multiple function word components in the semantic text, and it will be truncated according to the first function word component.
[0060] S150, determining the core relationship and the relationship between the adverbial clause and the central word of the clause where the core relationship is located.
[0061] Specifically, the core relationship is searched on both sides of the function word component, and the relationship between the adverbial with the shortest distance to the central word on the left side of the clause where the core relationship is located is searched.
[0062] S160, determining whether the semantic text contains valid information according to the rule of whether there is a negative word in the sentence, and when the semantic text contains valid information, determining an entity according to the sentence without the negative word, and verifying the entity.
[0063] In this embodiment, the entity refers to the segmented word corresponding to the subject-verb relationship of the clause without any negative word.
[0064] In one embodiment, see Figure 3, the above-mentioned step S160 may include steps S161 to S167.
[0065] S161, determining whether there is a negative word in the segmentation word corresponding to the relationship between the adverbial clause and the central word in the clause where the core relationship is located;
[0066] S162, if the segmentation word corresponding to the relationship between the adverbial and the central word in the clause where the core relationship is located has a negative word, then search for the starting verb-object relationship in another clause, and search for the relationship between the adverbial and the central word that is closest to the left side of the verb-object relationship;
[0067] S163, determining whether there is a negative word in the segmentation word corresponding to the relationship between the adverbial phrase closest to the left side of the subject-object relationship and the central word;
[0068] S164, if the segmented word corresponding to the relationship between the adverbial phrase closest to the left side of the subject-object relationship and the central word contains a negative word, it is determined that the semantic text does not contain valid information;
[0069] S165, if there is no negative word in the segmented word corresponding to the relationship between the adverbial phrase closest to the left side of the subject-object relationship and the central word, it is determined that the semantic text contains valid information, and the segmented word corresponding to the subject-object relationship is obtained as an entity;
[0070] S166: Verify the entity.
[0071] In one embodiment, see Figure 4 , the above-mentioned step S166 may include steps S1661 to S1663.
[0072] S1661, determining whether the entity meets the type of the corresponding task-based dialogue-related entity;
[0073] S1662. If the entity meets the type of the corresponding task-based dialogue-related entity, place the entity in the corresponding slot;
[0074] S1663. If the entity does not conform to the type of the corresponding task-based dialogue-related entity, the entity is discarded.
[0075] S167. If there is no negative word in the segmented word corresponding to the relationship between the adverbial and the central word in the clause where the core relationship is located, it is determined that the semantic text contains valid information, and the segmented word corresponding to the last subject-object relationship in the clause where the core relationship is located is obtained as an entity, and the step S166 is executed.
[0076] If there is no negative word in the word segment corresponding to the relationship between the retrieved adverbial and the central word, such as: no, don't, don't want, then directly obtain the word segment corresponding to the last verb-object relationship in the clause where the core relationship is located. If there is a negative word in the word segment corresponding to the relationship between the retrieved adverbial and the central word, then search for the starting verb-object relationship in the other half of the sentence, and search for the relationship between the adverbial and the central word closest to the left side of the verb-object relationship, and determine whether the word segment corresponding to the relationship between the adverbial and the central word contains a negative word. If there is a negative word in this sentence, it is determined that this semantic text does not contain valid relevant information for the corresponding task-based dialogue. Otherwise, directly obtain the word segment corresponding to the last verb-object relationship in this half of the sentence as an entity. Finally, verify whether the entity meets the type of the corresponding task-based dialogue-related entity. If the entity meets the entity type requirements of the corresponding task-based dialogue-related entity, then put the entity into the corresponding slot, otherwise discard the entity and do not put the entity into the corresponding slot.
[0077] S170: If there is no punctuation mark in the analysis result, determine whether the end of the semantic text is a function word;
[0078] S180: If the end of the semantic text is a function word, delete the function word at the end of the semantic text, redetermine the end of the semantic text, and execute the step of determining whether the end of the semantic text is a function word.
[0079] Specifically, if the position of the function word component is not limited when the text is truncated, for the unsigned pickup semantic text, if the mood function word component is located at the end of the semantic text, the semantic text will be truncated into two sentences, one sentence is all the semantic text on the left side of the function word component, and the second sentence is empty text or several function word components, resulting in entity extraction failure. Therefore, in order to solve the problem of entity extraction failure of unsigned semantic text ending with a function word component, a new boundary condition is added: if the end of the unsigned semantic text is a function word component, it will be deleted from the end of the semantic text, and the ending part of speech will be re-determined until the end of the semantic text is not a function word component. After the semantic text is parsed by DDParser, since it is impossible to determine whether the core relationship is located in the left clause or the right clause, it is necessary to first retrieve the core relationship, and then compare the subscript of the core relationship with the size of half the length of the entire semantic text segmentation.
[0080] S190, if the end of the semantic text is not a function word, searching for a core relationship;
[0081] S200, judging whether the semantic text contains valid information in combination with the subscript length of the core relationship, and when the semantic text contains valid information, determining entities according to clauses without negative words, and verifying the entities.
[0082] In one embodiment, see Figure 5, the above-mentioned step S200 may include steps S201 to S224.
[0083] S201, determining whether the subscript length of the core relationship is greater than half of the segmentation length;
[0084] S202: If the subscript length of the core relationship is not greater than half of the segmentation length, searching the left side of the core relationship for the relationship between the adverbial and the central word that has the shortest distance to the core relationship;
[0085] S203, searching the verb-object relationship on the right side of the relationship between the adverbial clause and the central word to obtain the verb-object relationship to be processed;
[0086] S204, determining whether there is a continuous subject-object relationship after the subject-object relationship to be processed;
[0087] S205. If there are continuous subject-object relationships after the subject-object relationship to be processed, the last subject-object relationship is obtained to obtain a target subject-object relationship; and step S207 is executed.
[0088] S206, if there is no continuous verb-object relationship after the verb-object relationship to be processed, obtaining the verb-object relationship after the relationship between the adverbial modifier and the central word to obtain the target verb-object relationship;
[0089] S207, when there is no negative word in the relationship between the adverbial and the central word, determining the segmented word corresponding to the target verb-object relationship, and when there is a negative word in the relationship between the adverbial and the central word, searching the verb-object relationship farthest from the end of the sentence on the right side of the target verb-object relationship, and determining the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word;
[0090] S208, determining whether the relationship between the adverbial clause closest to the left side of the subject-object relationship farthest from the end of the sentence and the central word contains a negative word;
[0091] S209, if the relationship between the adverbial clause closest to the left side of the subject-verb relationship farthest from the end of the sentence and the central word contains a negative word, it is determined that the semantic text does not contain valid information;
[0092] S210, if the relationship between the adverbial clause closest to the left side of the subject-verb relationship farthest from the end of the sentence and the central word does not contain a negative word, it is determined that the semantic text contains valid information, and the segmented word corresponding to the subject-verb relationship closest to the end of the sentence is obtained as an entity;
[0093] S211. Verify the entity.
[0094] S212, if the subscript length of the core relationship is greater than half of the segmentation length, searching the left side of the core relationship for the relationship between the adverbial and the central word that has the shortest distance to the core relationship;
[0095] S213, taking all the cut words from the beginning of the sentence of the analysis result to the relationship between the adverbial and the central word with the shortest distance from the core relationship as the clause where the core relationship is located, and taking the relationship between the adverbial and the central word with the shortest distance from the core relationship to the end of the sentence of the analysis result as another clause, so as to obtain two clauses;
[0096] S214, judging whether there are no negative words in all the segmented words between the relationship between the adverbial phrase with the shortest distance from the core relationship and the central word;
[0097] S215, if there is no negative word in all the cut words between the relationship between the adverbial and the central word with the shortest distance from the core relationship, then search for the verb-object relationship on the right side of the relationship between the adverbial and the central word to obtain the verb-object relationship to be processed;
[0098] S216, determining whether there is a continuous subject-object relationship after the subject-object relationship to be processed;
[0099] S217, if there are continuous subject-object relationships after the subject-object relationship to be processed, obtain the segmented word corresponding to the last subject-object relationship, take the segmented word as an entity, and execute step S224;
[0100] S218, if there is no continuous verb-object relationship after the verb-object relationship to be processed, then obtain the segmented word corresponding to the verb-object relationship after the relationship between the adverbial and the central word with the shortest distance from the core relationship, take the segmented word as an entity, and execute the step S224;
[0101] S219, if there are negative words in all the cut words between the relationship between the adverbial with the shortest distance from the core relationship and the central word, then search for the verb-object relationship farthest from the end of the sentence in another sentence;
[0102] S220, searching for the relationship between the nearest adverbial clause on the left side of the subject-verb relationship farthest from the end of the clause and the central word;
[0103] S221, determining whether the relationship between the nearest adverbial clause on the left side of the subject-verb relationship farthest from the end of the clause and the central word contains a negative word;
[0104] S222: If the relationship between the nearest adverbial clause on the left side of the subject-verb relationship farthest from the end of the clause and the central word contains a negative word, it is determined that the semantic text does not contain valid information;
[0105] S223, if the relationship between the nearest adverbial on the left side of the verb-object relationship farthest from the end of the clause and the central word does not contain a negative word, then obtain the segmented word corresponding to the verb-object relationship closest to the end of the clause as the entity;
[0106] S224: Verify the entity.
[0107] The above-mentioned step S224 and step S211 are respectively consistent with the implementation steps of step S166, and will not be repeated here.
[0108] Specifically, if the subscript length of the core relationship is less than or equal to half the length of the semantic text segmentation, the relationship between the adverbial and the central word with the shortest distance from the core relationship is retrieved on the left side of the core relationship (if the relationship between the adverbial and the central word is not retrieved, the segmentation corresponding to the verb-object relationship is directly obtained), and the verb-object relationship on the right side of the relationship between the adverbial and the central word is retrieved, and it is cyclically determined whether there is a continuous verb-object relationship after the verb-object relationship. If there is a continuous verb-object relationship, the last verb-object relationship is obtained. If there is no continuous verb-object relationship, the verb-object relationship after the relationship between the adverbial and the central word is obtained. If the verb-object relationship does not exist in the segmentation corresponding to the relationship between the adverbial and the central word, the verb-object relationship after the relationship between the adverbial and the central word is obtained. Negative words, directly obtain the word segmentation corresponding to the verb-object relationship; otherwise, search the verb-object relationship farthest from the end of the sentence on the right side of the verb-object relationship, and search the relationship between the adverbial and the central word closest to the left side of the verb-object relationship (if there is no relationship between the adverbial and the central word, directly obtain the word segmentation corresponding to the verb-object relationship closest to the end of the sentence), and then determine whether the relationship between the adverbial and the central word contains negative words. If it contains negative words, it is determined that this semantic text does not contain valid relevant information for the corresponding task-type dialogue. Otherwise, directly obtain the word segmentation corresponding to the verb-object relationship closest to the end of the sentence as an entity, and verify whether the entity meets the type of the corresponding task-type dialogue-related entity. If the entity meets the entity type requirements of the corresponding task-type dialogue-related entity, the entity is placed in the corresponding slot, otherwise the entity is discarded and not placed in the corresponding slot.
[0109] If the subscript of the core relationship is greater than half the length of the semantic text segmentation, the relationship between the adverbial and the central word closest to the core relationship is searched on the left side, and all segmentations from the beginning of the sentence to the relationship between the adverbial and the central word are used as clauses. If there is no negative word in the segmentation corresponding to the relationship between the adverbial and the central word, the verb-object relationship on the right side of the relationship between the adverbial and the central word is searched, and it is cyclically determined whether there is a continuous verb-object relationship after the verb-object relationship. If there is a continuous verb-object relationship, the segmentation corresponding to the last verb-object relationship is obtained. If there is no continuous verb-object relationship, the segmentation corresponding to the verb-object relationship after the relationship between the adverbial and the central word is obtained. Otherwise, search for the verb-object relationship farthest from the end of the clause in another sentence, and search for the relationship between the adverbial and the central word closest to the left side of the verb-object relationship (if there is no relationship between the adverbial and the central word, directly obtain the word segmentation corresponding to the verb-object relationship closest to the end of the clause), and then determine whether the relationship between the adverbial and the central word contains a negative word. If it contains a negative word, it is determined that the semantic text does not contain valid relevant information for the corresponding task-based dialogue. Otherwise, directly obtain the word segmentation corresponding to the verb-object relationship closest to the end of the clause as an entity, and verify whether the entity meets the type of the corresponding task-based dialogue-related entity. If the entity meets the entity type requirements of the corresponding task-based dialogue-related entity, the entity is placed in the corresponding slot, otherwise the entity is discarded and not placed in the corresponding slot.
[0110] For example, there is a service called "hailing a taxi" in the actual business. During the conversation, the user may need to change the destination. At this time, the user may have the following statements:
[0111] The first one is: "I don't want to go to Wuhan, nor do I want to go to Shenzhen." After syntactic dependency analysis, the dependency results obtained for this sentence are:
[0112] Semantic text segmentation: I don’t want to go to Wuhan or Shenzhen;
[0113] Syntactic dependency results: subject-predicate relationship, relationship between adverbial and central word, core relationship, verb-object relationship
[0114] Function word components Relationship between adverbial and central word Relationship between adverbial and central word COO verb-object relationship;
[0115] Analysis: After truncation according to the function word components, two clauses are obtained, namely "I don't want to go to Wuhan" and "Don't go to Shenzhen either". The core relationship is located in the left clause. The relationship between the adverbial near the core relationship and the central word is "don't", and the relationship between the adverbial and the central word is a negative word. Therefore, the object-verb relationship closest to the end of the sentence is retrieved in the other clause "Don't go to Shenzhen either", and "Shenzhen" is obtained. Then, the relationship between the adverbial closest to "Shenzhen" and the central word is "don't", which is also a negative word. Therefore, it is determined that this sentence cannot provide a valid word slot.
[0116] The second is "I want to go to Wuhan, not Shenzhen". After syntactic dependency analysis, the dependency results are:
[0117] Semantic text segmentation: I want to go to Wuhan, not Shenzhen;
[0118] Syntactic dependency results: subject-predicate relationship, relationship between adverbial and central word, IC, verb-object relationship, relationship between function word component adverbial and central word, core relationship, verb-object relationship;
[0119] Analysis: After truncation according to the function word components, two clauses are obtained, namely "I want to go to Wuhan" and "Don't go to Shenzhen". The core relationship is located in the right clause. The relationship between the adverbial near the core relationship and the central word is "don't", and the relationship between the adverbial and the central word is a negative word. Therefore, the other half of the sentence "I want to go to Wuhan" is searched for the subject-verb relationship closest to the end of the sentence, and "Wuhan" is obtained. Then, the relationship between the adverbial closest to "Wuhan" and the central word is "want", which is not a negative word. Therefore, the subject-verb relationship "Wuhan" on the far right of the sentence is directly obtained as the entity. After verification, "Wuhan" can be used as the destination entity.
[0120] The third type is: "I don't want to go to Wuhan, I want to go to Shenzhen" After syntactic dependency analysis, the dependency result obtained is:
[0121] Semantic text segmentation: I don’t want to go to Wuhan, I want to go to Shenzhen;
[0122] Syntactic dependency results: subject-predicate relationship, relationship between adverbial and central word, core relationship, verb-object relationship, function word component, subject-predicate relationship, relationship between adverbial and central word, IC, verb-object relationship;
[0123] Analysis: After truncation according to the function word components, two clauses are obtained, namely "I don't want to go to Wuhan" and "I want to go to Shenzhen". The core relationship is located in the left clause. The relationship between the adverbial near the core relationship and the central word is "don't", and the relationship between the adverbial and the central word is a negative word. Therefore, the other half of the sentence "I want to go to Shenzhen" is searched for the subject-verb relationship closest to the end of the sentence, and "Shenzhen" is obtained. Then, the relationship between the adverbial closest to "Shenzhen" and the central word is "want", which is not a negative word. Therefore, the cut word "Shenzhen" corresponding to the subject-verb relationship on the far right of the sentence is directly taken as the entity. After verification, "Shenzhen" can be used as the destination entity.
[0124] The fourth type is "I don't want to go to Wuhan or Shenzhen". After syntactic dependency analysis, the dependency results obtained are:
[0125] Semantic text segmentation: I don’t want to go to Wuhan or Shenzhen
[0126] Syntactic dependency results: subject-predicate relationship, relationship between adverbial and central word, core relationship, verb-object relationship, relationship between adverbial and central word, relationship between adverbial and central word, COO verb-object relationship
[0127] Analysis: The subscript of the core relationship is less than half the length of the cut word, and two clauses can be obtained, namely "I don't want to go to Wuhan" and "Don't go to Shenzhen either". The relationship between the adverbial closest to the left side of the core relationship and the central word is "don't", and the relationship between the adverbial and the central word is a negative word. Therefore, the other half of the sentence "Don't go to Shenzhen either" is retrieved for the verb-object relationship closest to the end of the sentence, and "Shenzhen" is obtained. Then, the relationship between the adverbial closest to "Shenzhen" and the central word is "don't", which is also a negative word. Therefore, it is determined that this sentence cannot provide a valid word slot.
[0128] The fifth type is: "I want to go to Wuhan instead of Shenzhen". After syntactic dependency analysis, the dependency result obtained for this sentence is:
[0129] Semantic text segmentation: I want to go to Wuhan instead of Shenzhen;
[0130] Syntactic dependency results: subject-predicate relationship core relationship verb-object relationship verb-object relationship relationship between adverbial and central word verb-object relationship verb-object relationship;
[0131] Analysis: The subscript of the core relationship is less than half the length of the word segmentation, and two clauses can be obtained, namely "I want to go to Wuhan" and "Don't go to Shenzhen". The core relationship is located in the left clause. The relationship between the adverbial and the central word is not retrieved on the left side of the core relationship, so the subject-verb relationship is retrieved on the right side of the core relationship. "Go" is a subject-verb relationship. Directly taking "go" as an entity will cause entity verification failure. Therefore, a boundary condition is added, that is, a loop is used to determine whether there is a continuous subject-verb relationship after the subject-verb relationship. "Go to Wuhan" is a continuous subject-verb relationship. The last subject-verb relationship, "Wuhan", is obtained as an entity. If the verification is passed, "Wuhan" can be used as the destination entity.
[0132] The sixth type is: "I don't want to go to Wuhan, I want to go to Shenzhen" After syntactic dependency analysis, the dependency result obtained is:
[0133] Semantic text segmentation: I don’t want to go to Wuhan, I want to go to Shenzhen;
[0134] Syntactic dependency results: subject-predicate relationship, relationship between adverbial and central word, core relationship, verb-object relationship, subject-predicate relationship, relationship between adverbial and central word, IC verb-object relationship;
[0135] Analysis: The subscript of the core relationship retrieved is less than half of the length of the word segmentation, so two clauses can be obtained, namely "I don't want to go to Wuhan" and "I want to go to Shenzhen". The core relationship is in the left clause. The relationship between the adverbial and the central word near the core relationship is "don't", and the relationship between this adverbial and the central word is a negative word. Therefore, retrieve the verb-object relationship closest to the end of the sentence in the other clause "I want to go to Shenzhen". The result is "Shenzhen". Then, the relationship between the adverbial closest to "Shenzhen" and the central word is retrieved as "want", and this word is not a negative word. Therefore, directly take the word segmentation "Shenzhen" corresponding to the verb-object relationship on the far right of this clause as the entity. If the verification passes, "Shenzhen" can be used as the destination entity.
[0136] The seventh type is: After syntactic dependency analysis of the sentence "I don't want to go to Wuhan and I want to go to Shenzhen now", the obtained dependency structure is:
[0137] Semantic text word segmentation: I don't want to go to Wuhan and I want to go to Shenzhen now;
[0138] Syntactic dependency result: Subject-predicate relationship, relationship between adverbial and central word, core relationship, verb-object relationship, subject-predicate relationship, IC, verb-object relationship, verb-object relationship, function word component, function word component;
[0139] Analysis: If the semantic text is truncated into "I don't want to go to Wuhan and I want to go to Shenzhen" and "now", the core relationship is in the left clause. The relationship between the adverbial and the central word retrieved is "don't", which is a negative word, and there is no entity that meets the requirements in "now", resulting in the failure of entity extraction.
[0140] After adding boundary conditions, first judge that the end of the semantic text is a function word component, delete the function word component of "now", and then continue to judge that the end is a function word component, delete the function word component of "already". After deletion, the end is not a function word component. The subscript of the core relationship retrieved is less than half of the length of the word segmentation, so two clauses can be obtained, namely "I don't want to go to Wuhan" and "I want to go to Shenzhen now". The core relationship is in the left clause. The relationship between the adverbial and the central word near the core relationship is "don't", and the relationship between this adverbial and the central word is a negative word. Therefore, retrieve the verb-object relationship closest to the end of the sentence in the other clause "I want to go to Shenzhen now". The result is "Shenzhen". Then, no relationship between the adverbial and the central word is retrieved. Therefore, directly take the word segmentation "Shenzhen" corresponding to the verb-object relationship on the far right of this clause as the entity. If the verification passes, "Shenzhen" can be used as the destination entity.
[0141] The above-mentioned human-computer interaction intention analysis method, after picking up the semantic interaction speech, converts it into semantic text, uses syntactic dependency analysis technology to analyze the semantic text, and then makes punctuation judgment on the basis of the analysis to determine the sentence division method, and then makes a negative word judgment on the two sentences to determine whether the semantic text contains valid information. When the semantic text contains valid information, the entity is determined according to the sentence without the negative word, and the entity is verified, and boundary conditions are added on this basis, which effectively improves the accuracy of intent entity extraction; it solves the problem that the current semantic service cannot accurately judge the user's true intention, making the semantic service understanding more accurate.
[0142] Figure 6 is a schematic block diagram of a human-computer interaction intention analysis device 300 provided in an embodiment of the present invention. Figure 6 As shown, corresponding to the above human-computer interaction intention analysis method, the present invention also provides a human-computer interaction intention analysis device 300. The human-computer interaction intention analysis device 300 includes a unit for executing the above human-computer interaction intention analysis method, and the device can be configured in a server. Figure 6 The human-computer interaction intention analysis device 300 includes a picking unit 301, a syntactic dependency analysis unit 302, a punctuation judgment unit 303, a truncation unit 304, a relationship determination unit 305, an entity acquisition unit 306, an ending judgment unit 307, a deletion unit 308, a retrieval unit 309 and a combination judgment unit 310.
[0143] The picking unit 301 is used to pick up the semantic interaction speech and convert the speech into a semantic text; the syntactic dependency analysis unit 302 is used to perform syntactic dependency analysis on the semantic text to obtain an analysis result; the punctuation mark judgment unit 303 is used to judge whether there are punctuation marks in the analysis result; the truncation unit 304 is used to truncate the analysis result according to the position of the first punctuation mark if there are punctuation marks in the analysis result to obtain two sentences; the relationship determination unit 305 is used to determine the core relationship and the relationship between the adverbial and the central word of the sentence where the core relationship is located; the entity acquisition unit 306 is used to determine whether the semantic text contains valid information according to the rule of whether there is a negative word in the sentence, and when the semantic text contains valid information, according to An entity is determined for a sentence without a negative word, and the entity is verified; an ending judgment unit 307 is used to judge whether the end of the semantic text is a function word if there is no punctuation mark in the analysis result; a deletion unit 308 is used to delete the function word at the end of the semantic text if the end of the semantic text is a function word, redetermine the end of the semantic text, and execute the judgment whether the end of the semantic text is a function word; a retrieval unit 309 is used to retrieve a core relationship if the end of the semantic text is not a function word; a combination judgment unit 310 is used to judge whether the semantic text contains valid information in combination with the subscript length of the core relationship, and when the semantic text contains valid information, an entity is determined according to the sentence without a negative word, and the entity is verified.
[0144] In one embodiment, if Figure 7 As shown, the entity acquisition unit 306 includes a first negation word judgment subunit 3061, a relationship retrieval subunit 3062, a second negation word judgment subunit 3063, an information determination subunit 3064, a second determination subunit 3065, a verification subunit 3066 and a third determination subunit 3067.
[0145] The first negation judgment subunit 3061 is used to judge whether there is a negation word in the segmentation corresponding to the relationship between the adverbial and the central word of the clause where the core relationship is located; the relationship retrieval subunit 3062 is used to retrieve the starting verb-object relationship in another clause and retrieve the relationship between the adverbial and the central word closest to the left side of the verb-object relationship if there is a negation word in the segmentation corresponding to the relationship between the adverbial and the central word of the clause where the core relationship is located; the second negation judgment subunit 3063 is used to judge whether there is a negation word in the segmentation corresponding to the relationship between the adverbial and the central word closest to the left side of the verb-object relationship; the information determination subunit 3064 is used to determine that the semantic text does not contain valid information if there is a negation word in the segmentation corresponding to the relationship between the adverbial and the central word closest to the left side of the verb-object relationship; the second determination subunit 3065 is used to determine that the semantic text contains valid information and obtain the segmentation corresponding to the verb-object relationship as an entity if there is no negation word in the segmentation corresponding to the relationship between the adverbial and the central word closest to the left side of the verb-object relationship; the verification subunit 3066 is used to verify the entity. The third determination subunit 3067 is used to determine that the semantic text contains valid information if there is no negative word in the segmentation corresponding to the relationship between the adverbial and the central word in the clause where the core relationship is located, obtain the segmentation corresponding to the last subject-object relationship in the clause where the core relationship is located as an entity, and execute the verification of the entity.
[0146] In one embodiment, if Figure 8 As shown, the check subunit 3066 includes a type judgment module 30661, an insertion module 30662 and a discarding module 30663.
[0147] The type judgment module 30661 is used to judge whether the entity meets the type of the corresponding task-based dialogue-related entity; the placement module 30662 is used to place the entity into the corresponding slot if the entity meets the type of the corresponding task-based dialogue-related entity; and the discarding module 30663 is used to discard the entity if the entity does not meet the type of the corresponding task-based dialogue-related entity.
[0148] In one embodiment, if Fig. 9As shown, the combined judgment unit 310 includes a length judgment subunit 3101, a first retrieval subunit 3102, a second retrieval subunit 3103, a first judgment subunit 3104, a first acquisition subunit 3105, a second acquisition subunit 3106, a first determination subunit 3107, a second judgment subunit 3108, a third acquisition subunit 3109, a first verification subunit 3110, a third retrieval subunit 3111, a sentence division unit 3112, a third judgment subunit 3113, a fourth retrieval subunit 3114, a fourth judgment subunit 3115, a fourth acquisition subunit 3116, a fifth retrieval subunit 3117, a sixth retrieval subunit 3118, a fifth judgment subunit 3119 and a second verification subunit 3120.
[0149] The length judgment subunit 3101 is used to judge whether the subscript length of the core relationship is greater than half of the word segmentation length; the first search subunit 3102 is used to search the relationship between the adverbial and the central word with the shortest distance from the core relationship on the left side of the core relationship if the subscript length of the core relationship is not greater than half of the word segmentation length; the second search subunit 3103 is used to search the verb-object relationship on the right side of the relationship between the adverbial and the central word to obtain the verb-object relationship to be processed; the first judgment subunit 3104 is used to judge whether there is a continuous verb-object relationship after the verb-object relationship to be processed; the first acquisition subunit 3105 is used to obtain the last verb-object relationship to obtain the target verb-object relationship if there is a continuous verb-object relationship after the verb-object relationship to be processed; the second acquisition subunit 3106 is used to obtain the verb-object relationship after the relationship between the adverbial and the central word to obtain the target verb-object relationship if there is no continuous verb-object relationship after the verb-object relationship to be processed; The first determination subunit 3107 is used to determine the word segmentation corresponding to the target verb-object relationship when there is no negative word in the relationship between the adverbial and the central word, and to retrieve the verb-object relationship farthest from the end of the sentence on the right side of the target verb-object relationship when there is a negative word in the relationship between the adverbial and the central word, and to determine the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word; the second judgment subunit 3108 is used to judge whether the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word contains a negative word; if the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word contains a negative word, it is determined that the semantic text does not contain valid information; the third acquisition subunit 3109 is used to determine that the semantic text contains valid information if the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word does not contain a negative word, and to acquire the word segmentation corresponding to the verb-object relationship closest to the end of the sentence as an entity; the first verification subunit 3110 is used to verify the entity.The third search subunit 3111 is used to search for the relationship between the adverbial and the central word with the shortest distance from the core relationship on the left side of the core relationship if the subscript length of the core relationship is greater than half of the word segmentation length; the sentence segmentation unit 3112 is used to take all the word segments from the beginning of the sentence of the analysis result to the relationship between the adverbial and the central word with the shortest distance from the core relationship as the clause where the core relationship is located, and the relationship between the adverbial and the central word with the shortest distance from the core relationship to the end of the sentence of the analysis result as another clause, so as to obtain two clauses; the third judgment subunit 3113 is used to judge the relationship between the adverbial and the central word with the shortest distance from the core relationship. Whether all the cut words between the relationship between the core word and the core word do not have negative words; the fourth search subunit 3114 is used to search the verb-object relationship on the right side of the relationship between the adverbial and the core word if all the cut words between the relationship between the adverbial and the core word with the shortest distance from the core relationship do not have negative words, so as to obtain the verb-object relationship to be processed; the fourth judgment subunit 3115 is used to judge whether there is a continuous verb-object relationship after the verb-object relationship to be processed; the fourth acquisition subunit 3116 is used to obtain the cut word corresponding to the last verb-object relationship if there is a continuous verb-object relationship after the verb-object relationship to be processed, take the cut word as an entity, and execute verification of the entity; The fourth acquisition subunit 3116 is used to obtain the word segmentation corresponding to the verb-object relationship after the relationship between the adverbial and the central word with the shortest distance from the core relationship if there is no continuous verb-object relationship after the verb-object relationship to be processed, take the word segmentation as an entity, and perform verification of the entity; the fifth retrieval subunit 3117 is used to retrieve the verb-object relationship farthest from the end of the sentence in another sentence if there is a negative word in all the word segments between the relationship between the adverbial and the central word with the shortest distance from the core relationship; the sixth retrieval subunit 3118 is used to retrieve the verb-object relationship farthest from the end of the sentence between the nearest adverbial and the central word on the left side of the verb-object relationship relationship; a fifth judging subunit 3119, used to judge whether the relationship between the nearest adverbial on the left side of the subject-verb relationship farthest from the end of the sentence and the central word contains a negative word; if the relationship between the nearest adverbial on the left side of the subject-verb relationship farthest from the end of the sentence and the central word contains a negative word, it is determined that the semantic text does not contain valid information; a fifth acquiring subunit, used to acquire the segmentation word corresponding to the subject-verb relationship closest to the end of the sentence as an entity if the relationship between the nearest adverbial on the left side of the subject-verb relationship farthest from the end of the sentence and the central word does not contain a negative word; a second verifying subunit 3120, used to verify the entity.
[0150] In one embodiment, the syntactic dependency analysis unit 302 is used to perform syntactic dependency analysis on the semantic text using Baidu's open source syntactic dependency analysis tool DDParser to obtain an analysis result.
[0151] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the above-mentioned human-computer interaction intention analysis device and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and conciseness of the description, it will not be repeated here.
[0152] The above-mentioned human-computer interaction intention analysis device 300 can be implemented in the form of a computer program. The computer program can be used in Fig.10 Runs on the computer device shown.
[0153] See also Fig.10 , Fig.10 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.
[0154] See also Fig.10 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .
[0155] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a method for analyzing human-computer interaction intentions.
[0156] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0157] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a method for analyzing human-computer interaction intentions.
[0158] The network interface 505 is used to communicate with other devices over the network. Fig.10 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0159] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:
[0160] Pick up semantic interaction speech and convert the speech into semantic text; perform syntactic dependency analysis on the semantic text to obtain analysis results; determine whether there are punctuation marks in the analysis results; if there are punctuation marks in the analysis results, truncate the analysis results according to the position of the first punctuation mark to obtain two sentences; determine the core relationship and the relationship between the adverbial and the central word of the sentence where the core relationship is located; determine whether the semantic text contains valid information according to the rule of whether there are negative words in the sentence, and when the semantic text contains valid information, determine the entity according to the sentence without negative words, and verifying the entity; if there is no punctuation mark in the analysis result, determining whether the end of the semantic text is a function word; if the end of the semantic text is a function word, deleting the function word at the end of the semantic text, re-determining the end of the semantic text, and executing the determination of whether the end of the semantic text is a function word; if the end of the semantic text is not a function word, retrieving the core relationship; determining whether the semantic text contains valid information in combination with the subscript length of the core relationship, and when the semantic text contains valid information, determining the entity according to the clause without negative words, and verifying the entity.
[0161] In one embodiment, the processor 502 implements the following steps when implementing the rule of determining whether the semantic text contains valid information according to whether a sentence contains a negative word, and when the semantic text contains valid information, determining an entity according to a sentence without a negative word, and performing a verification step on the entity:
[0162] Determine whether there is a negative word in the segmentation word corresponding to the relationship between the adverbial and the central word in the clause where the core relationship is located; if there is a negative word in the segmentation word corresponding to the relationship between the adverbial and the central word in the clause where the core relationship is located, retrieve the starting subject-verb relationship in another clause, and retrieve the relationship between the adverbial and the central word closest to the left side of the subject-verb relationship; determine whether there is a negative word in the segmentation word corresponding to the relationship between the adverbial and the central word closest to the left side of the subject-verb relationship; if there is a negative word in the segmentation word corresponding to the relationship between the adverbial and the central word closest to the left side of the subject-verb relationship, determine that the semantic text does not contain valid information; if there is no negative word in the segmentation word corresponding to the relationship between the adverbial and the central word closest to the left side of the subject-verb relationship, determine that the semantic text contains valid information, and obtain the segmentation word corresponding to the subject-verb relationship as an entity; verify the entity.
[0163] In one embodiment, after implementing the step of determining whether the segmentation word corresponding to the relationship between the adverbial clause and the central word in the clause where the core relationship is located contains a negative word, the processor 502 further implements the following steps:
[0164] If there is no negative word in the segmentation word corresponding to the relationship between the adverbial and the central word in the clause where the core relationship is located, it is determined that the semantic text contains valid information, and the segmentation word corresponding to the last subject-object relationship in the clause where the core relationship is located is obtained as an entity, and the entity is verified.
[0165] In one embodiment, when implementing the step of verifying the entity, the processor 502 specifically implements the following steps:
[0166] Determine whether the entity meets the type of the corresponding task-based dialogue-related entity; if the entity meets the type of the corresponding task-based dialogue-related entity, place the entity in the corresponding slot; if the entity does not meet the type of the corresponding task-based dialogue-related entity, discard the entity.
[0167] In one embodiment, the processor 502 implements the following steps when determining whether the semantic text contains valid information in combination with the subscript length of the core relationship, and when the semantic text contains valid information, determining an entity according to a sentence without a negative word, and performing a verification step on the entity:
[0168] Determine whether the subscript length of the core relationship is greater than half of the word segmentation length; if the subscript length of the core relationship is not greater than half of the word segmentation length, then search the relationship between the adverbial and the central word with the shortest distance from the core relationship on the left side of the core relationship; search the verb-object relationship on the right side of the relationship between the adverbial and the central word to obtain the verb-object relationship to be processed; determine whether there is a continuous verb-object relationship after the verb-object relationship to be processed; if there is a continuous verb-object relationship after the verb-object relationship to be processed, obtain the last verb-object relationship to obtain the target verb-object relationship; if there is no continuous verb-object relationship after the verb-object relationship to be processed, obtain the verb-object relationship after the relationship between the adverbial and the central word to obtain the target verb-object relationship; when the relationship between the adverbial and the central word does not exist Negative words, then determine the word segmentation corresponding to the target verb-object relationship, when there is a negative word in the relationship between the adverbial and the central word, then search the verb-object relationship farthest from the end of the sentence on the right side of the target verb-object relationship, and determine the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word; judge whether the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word contains a negative word; if the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word contains a negative word, then determine that the semantic text does not contain valid information; if the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word does not contain a negative word, then determine that the semantic text contains valid information, and obtain the word segmentation corresponding to the verb-object relationship closest to the end of the sentence as an entity; verify the entity.
[0169] In one embodiment, after implementing the step of determining whether the subscript length of the core relationship is greater than half of the segmentation length, the processor 502 further implements the following steps:
[0170] If the subscript length of the core relationship is greater than half of the word segmentation length, the relationship between the adverbial and the central word with the shortest distance from the core relationship is retrieved on the left side of the core relationship; all the word segments from the beginning of the sentence of the analysis result to the relationship between the adverbial and the central word with the shortest distance from the core relationship are taken as the clause where the core relationship is located, and the relationship between the adverbial and the central word with the shortest distance from the core relationship to the end of the analysis result is taken as another clause to obtain two clauses; it is determined whether all the word segments between the relationship between the adverbial and the central word with the shortest distance from the core relationship do not have negative words; if all the word segments between the relationship between the adverbial and the central word with the shortest distance from the core relationship do not have negative words, the verb-object relationship on the right side of the relationship between the adverbial and the central word is retrieved to obtain the verb-object relationship to be processed; it is determined whether there are continuous verb-object relationships after the verb-object relationship to be processed; if there are continuous verb-object relationships after the verb-object relationship to be processed, the word segmentation corresponding to the last verb-object relationship is obtained, the word segmentation is taken as an entity, and the entity is verified; if If there is no continuous verb-object relationship after the verb-object relationship to be processed, then the word segmentation corresponding to the verb-object relationship after the relationship between the adverbial and the central word with the shortest distance from the core relationship is obtained, the word segmentation is used as an entity, and the entity is verified; if there is a negative word in all the word segments between the relationship between the adverbial and the central word with the shortest distance from the core relationship, then the verb-object relationship farthest from the end of the sentence is retrieved in another sentence; the relationship between the nearest adverbial and the central word on the left side of the verb-object relationship farthest from the end of the sentence is retrieved; it is determined whether the relationship between the nearest adverbial and the central word on the left side of the verb-object relationship farthest from the end of the sentence contains a negative word; if the relationship between the nearest adverbial and the central word on the left side of the verb-object relationship farthest from the end of the sentence contains a negative word, it is determined that the semantic text does not contain valid information; if the relationship between the nearest adverbial and the central word on the left side of the verb-object relationship farthest from the end of the sentence does not contain a negative word, then the word segmentation corresponding to the verb-object relationship closest to the end of the sentence is obtained as an entity; and the entity is verified.
[0171] In one embodiment, when the processor 502 implements the step of performing syntactic dependency analysis on the semantic text to obtain an analysis result, the processor 502 specifically implements the following steps:
[0172] The semantic text is subjected to syntactic dependency analysis by using Baidu's open source syntactic dependency analysis tool DDParser to obtain an analysis result.
[0173] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0174] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.
[0175] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:
[0176] Pick up semantic interaction speech and convert the speech into semantic text; perform syntactic dependency analysis on the semantic text to obtain analysis results; determine whether there are punctuation marks in the analysis results; if there are punctuation marks in the analysis results, truncate the analysis results according to the position of the first punctuation mark to obtain two sentences; determine the core relationship and the relationship between the adverbial and the central word of the sentence where the core relationship is located; determine whether the semantic text contains valid information according to the rule of whether there are negative words in the sentence, and when the semantic text contains valid information, determine the entity according to the sentence without negative words, and verifying the entity; if there is no punctuation mark in the analysis result, determining whether the end of the semantic text is a function word; if the end of the semantic text is a function word, deleting the function word at the end of the semantic text, re-determining the end of the semantic text, and executing the determination of whether the end of the semantic text is a function word; if the end of the semantic text is not a function word, retrieving the core relationship; determining whether the semantic text contains valid information in combination with the subscript length of the core relationship, and when the semantic text contains valid information, determining the entity according to the clause without negative words, and verifying the entity.
[0177] In one embodiment, when the processor executes the computer program to implement the rule of determining whether the semantic text contains valid information according to whether there is a negative word in the sentence, and when the semantic text contains valid information, determining the entity according to the sentence without the negative word, and verifying the entity, the following steps are specifically implemented:
[0178] Determine whether there is a negative word in the segmentation word corresponding to the relationship between the adverbial and the central word in the clause where the core relationship is located; if there is a negative word in the segmentation word corresponding to the relationship between the adverbial and the central word in the clause where the core relationship is located, retrieve the starting subject-verb relationship in another clause, and retrieve the relationship between the adverbial and the central word closest to the left side of the subject-verb relationship; determine whether there is a negative word in the segmentation word corresponding to the relationship between the adverbial and the central word closest to the left side of the subject-verb relationship; if there is a negative word in the segmentation word corresponding to the relationship between the adverbial and the central word closest to the left side of the subject-verb relationship, determine that the semantic text does not contain valid information; if there is no negative word in the segmentation word corresponding to the relationship between the adverbial and the central word closest to the left side of the subject-verb relationship, determine that the semantic text contains valid information, and obtain the segmentation word corresponding to the subject-verb relationship as an entity; verify the entity.
[0179] In one embodiment, after executing the computer program to implement the step of determining whether the segmentation word corresponding to the relationship between the adverbial and the central word of the clause where the core relationship is located contains a negative word, the processor further implements the following steps:
[0180] If there is no negative word in the segmentation word corresponding to the relationship between the adverbial and the central word in the clause where the core relationship is located, it is determined that the semantic text contains valid information, and the segmentation word corresponding to the last subject-object relationship in the clause where the core relationship is located is obtained as an entity, and the entity is verified.
[0181] In one embodiment, when the processor executes the computer program to implement the step of verifying the entity, the processor specifically implements the following steps:
[0182] Determine whether the entity meets the type of the corresponding task-based dialogue-related entity; if the entity meets the type of the corresponding task-based dialogue-related entity, place the entity in the corresponding slot; if the entity does not meet the type of the corresponding task-based dialogue-related entity, discard the entity.
[0183] In one embodiment, when the processor executes the computer program to implement the step of determining whether the semantic text contains valid information in combination with the subscript length of the core relationship, and when the semantic text contains valid information, determining an entity according to a sentence without a negative word, and performing a verification step on the entity, the following steps are specifically implemented:
[0184] Determine whether the subscript length of the core relationship is greater than half of the word segmentation length; if the subscript length of the core relationship is not greater than half of the word segmentation length, then search the relationship between the adverbial and the central word with the shortest distance from the core relationship on the left side of the core relationship; search the verb-object relationship on the right side of the relationship between the adverbial and the central word to obtain the verb-object relationship to be processed; determine whether there is a continuous verb-object relationship after the verb-object relationship to be processed; if there is a continuous verb-object relationship after the verb-object relationship to be processed, obtain the last verb-object relationship to obtain the target verb-object relationship; if there is no continuous verb-object relationship after the verb-object relationship to be processed, obtain the verb-object relationship after the relationship between the adverbial and the central word to obtain the target verb-object relationship; when the relationship between the adverbial and the central word does not exist Negative words, then determine the word segmentation corresponding to the target verb-object relationship, when there is a negative word in the relationship between the adverbial and the central word, then search the verb-object relationship farthest from the end of the sentence on the right side of the target verb-object relationship, and determine the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word; judge whether the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word contains a negative word; if the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word contains a negative word, then determine that the semantic text does not contain valid information; if the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word does not contain a negative word, then determine that the semantic text contains valid information, and obtain the word segmentation corresponding to the verb-object relationship closest to the end of the sentence as an entity; verify the entity.
[0185] In one embodiment, after executing the computer program to implement the step of determining whether the subscript length of the core relationship is greater than half of the segmentation length, the processor further implements the following steps:
[0186] If the subscript length of the core relationship is greater than half of the word segmentation length, the relationship between the adverbial and the central word with the shortest distance from the core relationship is retrieved on the left side of the core relationship; all the word segments from the beginning of the sentence of the analysis result to the relationship between the adverbial and the central word with the shortest distance from the core relationship are taken as the clause where the core relationship is located, and the relationship between the adverbial and the central word with the shortest distance from the core relationship to the end of the analysis result is taken as another clause to obtain two clauses; it is determined whether all the word segments between the relationship between the adverbial and the central word with the shortest distance from the core relationship do not have negative words; if all the word segments between the relationship between the adverbial and the central word with the shortest distance from the core relationship do not have negative words, the verb-object relationship on the right side of the relationship between the adverbial and the central word is retrieved to obtain the verb-object relationship to be processed; it is determined whether there are continuous verb-object relationships after the verb-object relationship to be processed; if there are continuous verb-object relationships after the verb-object relationship to be processed, the word segmentation corresponding to the last verb-object relationship is obtained, the word segmentation is taken as an entity, and the entity is verified; if If there is no continuous verb-object relationship after the verb-object relationship to be processed, then the word segmentation corresponding to the verb-object relationship after the relationship between the adverbial and the central word with the shortest distance from the core relationship is obtained, the word segmentation is used as an entity, and the entity is verified; if there is a negative word in all the word segments between the relationship between the adverbial and the central word with the shortest distance from the core relationship, then the verb-object relationship farthest from the end of the sentence is retrieved in another sentence; the relationship between the nearest adverbial and the central word on the left side of the verb-object relationship farthest from the end of the sentence is retrieved; it is determined whether the relationship between the nearest adverbial and the central word on the left side of the verb-object relationship farthest from the end of the sentence contains a negative word; if the relationship between the nearest adverbial and the central word on the left side of the verb-object relationship farthest from the end of the sentence contains a negative word, it is determined that the semantic text does not contain valid information; if the relationship between the nearest adverbial and the central word on the left side of the verb-object relationship farthest from the end of the sentence does not contain a negative word, then the word segmentation corresponding to the verb-object relationship closest to the end of the sentence is obtained as an entity; and the entity is verified.
[0187] In one embodiment, when the processor executes the computer program to implement the step of performing syntactic dependency analysis on the semantic text to obtain an analysis result, the processor specifically implements the following steps:
[0188] The semantic text is subjected to syntactic dependency analysis by using Baidu's open source syntactic dependency analysis tool DDParser to obtain an analysis result.
[0189] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.
[0190] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0191] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0192] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0193] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.
[0194] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A human-computer interaction intention analysis method, characterized in that: include: Picking up semantic interaction speech and converting the speech into semantic text; Performing syntactic dependency analysis on the semantic text using Baidu's open source syntactic dependency analysis tool DDParser to obtain analysis results; Determining whether there are punctuation marks in the analysis result; If there are punctuation marks in the analysis result, the analysis result is truncated according to the position of the first punctuation mark to obtain two sentences; Determine the core relationship and the relationship between the adverbial clause and the central word of the clause where the core relationship is located; Determine whether the semantic text contains valid information according to the rule of whether there is a negative word in the sentence, and when the semantic text contains valid information, determine the entity according to the sentence without the negative word, and verify the entity; If there is no punctuation mark in the analysis result, determining whether the end of the semantic text is a function word; If the end of the semantic text is a function word, the function word at the end of the semantic text is deleted, the end of the semantic text is re-determined, and the step of determining whether the end of the semantic text is a function word is performed; if the end of the semantic text is not a function word, a core relationship is retrieved; Determine whether the semantic text contains valid information in combination with the subscript length of the core relationship, and when the semantic text contains valid information, determine the entity according to the clause without negative words, and verify the entity; specifically include: Determine whether the subscript length of the core relationship is greater than half of the segmentation length; If the subscript length of the core relationship is not greater than half of the segmentation length, the relationship between the adverbial and the central word with the shortest distance to the core relationship is searched on the left side of the core relationship; Retrieve the verb-object relationship on the right side of the relationship between the adverbial clause and the central word to obtain the verb-object relationship to be processed; Determine whether there is a continuous verb-object relationship after the verb-object relationship to be processed; if there is a continuous verb-object relationship, obtain the last verb-object relationship to obtain a target verb-object relationship; if there is no continuous verb-object relationship, obtain the verb-object relationship after the relationship between the adverbial and the central word to obtain the target verb-object relationship; When there is no negative word in the relationship between the adverbial and the central word, the word segmentation corresponding to the target verb-object relationship is determined; when there is a negative word in the relationship between the adverbial and the central word, the verb-object relationship farthest from the end of the sentence is searched on the right side of the target verb-object relationship, and the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word is determined; Determine whether the relationship between the adverbial clause closest to the left side of the subject-object relationship farthest from the end of the sentence and the central word contains a negative word; if a negative word is contained, determine that the semantic text does not contain valid information; if a negative word is not contained, determine that the semantic text contains valid information, and obtain the segmented word corresponding to the subject-object relationship closest to the end of the sentence as an entity; Validate the entity.
2. The method for analyzing human-computer interaction intention according to claim 1, characterized in that: The determining whether the semantic text contains valid information according to the rule of whether there is a negative word in the sentence, and when the semantic text contains valid information, determining the entity according to the sentence without the negative word, and verifying the entity, includes: Determine whether there is a negative word in the segmentation word corresponding to the relationship between the adverbial clause and the central word in the clause where the core relationship is located; If the segmentation word corresponding to the relationship between the adverbial and the central word in the clause where the core relationship is located has a negative word, then the starting verb-object relationship in another clause is searched, and the relationship between the adverbial and the central word closest to the left side of the verb-object relationship is searched; Determine whether there is a negative word in the segmentation word corresponding to the relationship between the adverbial phrase closest to the left side of the subject-object relationship and the central word; If there is a negative word in the segmented word corresponding to the relationship between the adverbial clause closest to the left side of the subject-object relationship and the central word, it is determined that the semantic text does not contain valid information; If there is no negative word in the segmented word corresponding to the relationship between the adverbial phrase closest to the left side of the subject-object relationship and the central word, it is determined that the semantic text contains valid information, and the segmented word corresponding to the subject-object relationship is obtained as an entity; Validate the entity.
3. The method for analyzing human-computer interaction intention according to claim 2, characterized in that: After determining whether there is a negative word in the segmentation word corresponding to the relationship between the adverbial clause and the central word in the clause where the core relationship is located, the method further includes: If there is no negative word in the segmentation word corresponding to the relationship between the adverbial and the central word in the clause where the core relationship is located, it is determined that the semantic text contains valid information, and the segmentation word corresponding to the last subject-object relationship in the clause where the core relationship is located is obtained as an entity, and the entity is verified.
4. The method for analyzing human-computer interaction intention according to claim 2, characterized in that: The verifying the entity comprises: Determining whether the entity meets the type of entity related to the corresponding task-based dialogue; If the entity matches the type of the corresponding task-based dialogue-related entity, the entity is placed in the corresponding slot; If the entity does not conform to the type of the corresponding task-based dialogue related entity, the entity is discarded.
5. The method for analyzing human-computer interaction intention according to claim 1, characterized in that: After determining whether the subscript length of the core relationship is greater than half of the word segmentation length, the method further includes: If the subscript length of the core relationship is greater than half of the segmentation length, the relationship between the adverbial and the central word with the shortest distance to the core relationship is searched on the left side of the core relationship; All the cut words from the beginning of the analysis result to the relationship between the adverbial and the central word with the shortest distance from the core relationship are taken as the clause where the core relationship is located, and the relationship between the adverbial and the central word with the shortest distance from the core relationship to the end of the analysis result is taken as another clause, so as to obtain two clauses; Determine whether all the segmented words between the relationship between the adverbial clause with the shortest distance from the core relationship and the central word do not have a negative word; If there is no negative word in all the cut words between the relationship between the adverbial and the central word with the shortest distance from the core relationship, the verb-object relationship on the right side of the relationship between the adverbial and the central word is retrieved to obtain the verb-object relationship to be processed; Determine whether there is a continuous subject-object relationship after the subject-object relationship to be processed; If there are continuous subject-object relationships after the subject-object relationship to be processed, then the segmented word corresponding to the last subject-object relationship is obtained, the segmented word is used as an entity, and the entity is verified; If there is no continuous verb-object relationship after the verb-object relationship to be processed, then obtain the segmented word corresponding to the verb-object relationship after the relationship between the adverbial and the central word with the shortest distance from the core relationship, take the segmented word as an entity, and perform verification on the entity; If there are negative words in all the cut words between the relationship between the adverbial clause with the shortest distance from the core relationship and the central word, then search for the verb-object relationship farthest from the end of the sentence in another clause; Retrieving the relationship between the nearest adverbial clause on the left side of the verb-object relationship farthest from the end of the clause and the central word; Determine whether the relationship between the nearest adverbial clause on the left side of the subject-verb relationship farthest from the end of the clause and the central word contains a negative word; If the relationship between the nearest adverbial clause on the left side of the subject-verb relationship farthest from the end of the clause and the central word contains a negative word, it is determined that the semantic text does not contain valid information; If the relationship between the nearest adverbial on the left side of the verb-object relationship farthest from the end of the clause and the central word does not contain a negative word, then the segmented word corresponding to the verb-object relationship closest to the end of the clause is obtained as the entity; Validate the entity.
6. A human-computer interaction intention analysis device, characterized in that: include: A pickup unit, used for picking up semantic interaction speech and converting the speech into semantic text; A syntactic dependency analysis unit, used to perform syntactic dependency analysis on the semantic text using Baidu's open source syntactic dependency analysis tool DDParser to obtain an analysis result; a punctuation mark judging unit, used for judging whether there are punctuation marks in the analysis result; A truncation unit, configured to truncate the analysis result according to the position of the first punctuation mark if there are punctuation marks in the analysis result, so as to obtain two sentences; A relationship determination unit, used to determine a core relationship and a relationship between an adverbial and a central word in a clause where the core relationship is located; An entity acquisition unit, configured to determine whether the semantic text contains valid information according to a rule of whether a sentence contains a negative word, and when the semantic text contains valid information, determine an entity according to a sentence without a negative word, and verify the entity; an ending judgment unit, configured to judge whether the end of the semantic text is a function word if there is no punctuation mark in the analysis result; a deleting unit, configured to, if the end of the semantic text is a function word, delete the function word at the end of the semantic text, redetermine the end of the semantic text, and perform the step of determining whether the end of the semantic text is a function word; A retrieval unit, configured to retrieve a core relationship if the semantic text does not end with a function word; A combination judgment unit is used to judge whether the semantic text contains valid information in combination with the subscript length of the core relationship, and when the semantic text contains valid information, determine the entity according to the sentence without negative words, and verify the entity; The combination judgment unit is specifically used to: judge whether the subscript length of the core relationship is greater than half of the segmentation length; If the subscript length of the core relationship is not greater than half of the segmentation length, the relationship between the adverbial and the central word with the shortest distance to the core relationship is searched on the left side of the core relationship; Retrieve the verb-object relationship on the right side of the relationship between the adverbial clause and the central word to obtain the verb-object relationship to be processed; Determine whether there is a continuous verb-object relationship after the verb-object relationship to be processed; if there is a continuous verb-object relationship, obtain the last verb-object relationship to obtain a target verb-object relationship; if there is no continuous verb-object relationship, obtain the verb-object relationship after the relationship between the adverbial and the central word to obtain the target verb-object relationship; When there is no negative word in the relationship between the adverbial and the central word, the word segmentation corresponding to the target verb-object relationship is determined; when there is a negative word in the relationship between the adverbial and the central word, the verb-object relationship farthest from the end of the sentence is searched on the right side of the target verb-object relationship, and the relationship between the adverbial closest to the left side of the verb-object relationship farthest from the end of the sentence and the central word is determined; Determine whether the relationship between the adverbial clause closest to the left side of the subject-object relationship farthest from the end of the sentence and the central word contains a negative word; if a negative word is contained, determine that the semantic text does not contain valid information; if a negative word is not contained, determine that the semantic text contains valid information, and obtain the segmented word corresponding to the subject-object relationship closest to the end of the sentence as an entity; verify the entity.
7. A computer device, characterized in that: The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 5 when executing the computer program.
8. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 can be implemented.
Citation Information
Patent Citations
Chinese structured event extraction method
CN112183059A
Methods, computer readable media, and systems for machine translation between arabic and arabic sign language
US20200192982A1
