Human-computer interaction method, device, intelligent robot and storage medium

By extracting the backbone and matching the corpus for the user input statements of the intelligent robot, the problem of semantic matching failure is solved, ensuring that the intelligent robot can respond to user input correctly, and improving the reliability of human-computer interaction.

CN112632234BActive Publication Date: 2024-11-01ECOVACS COMML ROBOTICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910955688.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-09
Publication Date
2024-11-01
Estimated Expiration
2039-10-09

AI Technical Summary

Technical Problem

In human-computer interaction, existing intelligent robots are difficult to effectively process the non-trunk part of the user input statement, resulting in the failure of semantic matching and the inability to respond to user input correctly.

Method used

By extracting the trunk of the statements entered by the user, removing the modification and supplementary parts, using the pre-established corpus for semantic matching, determining the second statement that matches the trunk of the statement, and thus responding.

Benefits of technology

It avoids semantic matching failures to the greatest extent, ensures that intelligent robots can respond to user input normally, and improves the reliability and accuracy of human-computer interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112632234B_ABST
    Figure CN112632234B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a human-computer interaction method, device, intelligent robot and storage medium, the method comprising: the intelligent robot receives a first sentence input by a user and extracts the trunk thereof to obtain the sentence trunk of the first sentence. Then, a second sentence that semantically matches the sentence trunk is determined in a pre-established corpus. Finally, the intelligent robot responds to the first sentence according to the second sentence, thereby realizing human-computer interaction. After extracting the trunk of the first sentence, all the modified and supplementary parts in the first sentence can be removed, avoiding interference of the non-trunk parts with the semantic matching process, and avoiding the situation where the robot cannot match the second sentence to the greatest extent, which further avoids the situation where the robot cannot respond to the first sentence, ensuring the normal human-computer interaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a human-computer interaction method, device, intelligent robot and storage medium. Background Art

[0002] With the development of artificial intelligence technology, various intelligent robots are increasingly entering people's lives, such as service robots, cleaning robots, self-moving vending robots, etc. In order to facilitate users' use, intelligent robots usually support multiple human-computer interaction methods, such as human-computer interaction methods based on touch operations and human-computer interaction methods based on voice, etc.

[0003] But no matter what kind of interaction method is used, in actual applications, after receiving the dialogue content input by the user, the intelligent robot will usually first determine the semantics of the dialogue content, and further output the response content corresponding to the dialogue content based on the semantics, thereby realizing human-computer interaction. Summary of the invention

[0004] The embodiments of the present invention provide a human-computer interaction method, device, intelligent robot and storage medium, which are used to ensure the normal progress of human-computer dialogue and avoid the situation where the user input sentence cannot be responded to.

[0005] An embodiment of the present invention provides a human-computer interaction method, including:

[0006] receiving a first sentence input by a user;

[0007] Performing trunk extraction on the first sentence to obtain a sentence trunk;

[0008] In the corpus, determining a second sentence that semantically matches the sentence trunk;

[0009] The first statement is responded to according to the second statement.

[0010] An embodiment of the present invention provides a human-computer interaction device, including:

[0011] A receiving module, used for receiving a first sentence input by a user;

[0012] An extraction module, used for performing trunk extraction on the first sentence to obtain a sentence trunk;

[0013] A first determination module is used to determine a second sentence in the corpus that semantically matches the sentence trunk;

[0014] A response module is used to respond to the first statement according to the second statement.

[0015] An embodiment of the present invention provides an intelligent robot, comprising: a processor and a memory; wherein the memory is used to store one or more computer instructions, wherein when the one or more computer instructions are executed by the processor, the following are implemented:

[0016] receiving a first sentence input by a user;

[0017] Performing trunk extraction on the first sentence to obtain a sentence trunk;

[0018] In the corpus, determining a second sentence that semantically matches the sentence trunk;

[0019] The first statement is responded to according to the second statement.

[0020] An embodiment of the present invention provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to perform at least the following actions:

[0021] receiving a first sentence input by a user;

[0022] Performing trunk extraction on the first sentence to obtain a sentence trunk;

[0023] In the corpus, determining a second sentence that semantically matches the sentence trunk;

[0024] The first statement is responded to according to the second statement.

[0025] In an embodiment of the present invention, when a user performs human-computer interaction with an intelligent robot, the user can send an interactive sentence, i.e., a first sentence, to the intelligent robot. The intelligent robot will collect the first sentence and perform trunk extraction on it to obtain the sentence trunk of the first sentence. Then, a second sentence that semantically matches the sentence trunk is determined in a pre-established corpus. Finally, the intelligent robot responds to the first sentence according to the second sentence, thereby realizing human-computer interaction.

[0026] If the first sentence is used directly for semantic matching, the non-main part of the first sentence will affect the matching during the matching process, and it is easy to fail to match the second sentence. However, by extracting the main part of the first sentence, all the modifications and supplements in the first sentence can be removed, avoiding the interference of the non-main part in the semantic matching process, and avoiding the failure to match the second sentence to the greatest extent. This further avoids the situation where the robot cannot respond to the first sentence, ensuring the normal human-computer interaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 A flowchart of a human-computer interaction method provided by an embodiment of the present invention;

[0029] Figure 2 A flowchart of another human-computer interaction method provided by an embodiment of the present invention;

[0030] Figure 3 A flowchart of a second statement determination method provided by an embodiment of the present invention;

[0031] Figure 4 A flowchart of a specific implementation method of step 304 provided in an embodiment of the present invention;

[0032] Figure 5 A schematic diagram of the structure of a human-computer interaction device provided by an embodiment of the present invention;

[0033] Figure 6 For Figure 5 A schematic structural diagram of an intelligent robot corresponding to the human-machine interaction device provided in the illustrated embodiment. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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.

[0035] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms. Unless the context clearly indicates otherwise, "plurality" generally includes at least two.

[0036] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.

[0037] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a product or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a product or system. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the product or system including the elements.

[0038] Before introducing the human-computer interaction method provided by the embodiment of the present invention in detail, the current method of realizing the interaction between a user and an intelligent robot is introduced first: One of the most common methods is to input the sentence input by the user into a semantic recognition model, so as to classify the sentence by using the model, and the classification result is the semantics of the sentence. Then, the intelligent robot further outputs the corresponding response result according to the recognized semantics, thereby realizing human-computer interaction.

[0039] When this method is used, the accuracy of semantic recognition will directly affect the accuracy of the response results. In order to ensure the recognition effect of the semantic recognition model, it is necessary to obtain a large amount of corpus corresponding to each semantic in advance, and use this large amount of corpus as training samples for model training. At this time, higher requirements are placed on the collection of corpus. At the same time, since the training samples corresponding to different semantics often have repeated content, this repetition will lead to unsatisfactory semantic recognition effects. In addition, in practical applications, due to the limitations of training samples, semantic recognition models usually cannot learn all semantics. When the sentence input by the user is a completely new semantics that has not been learned by the semantic model, the effect of semantic recognition cannot be guaranteed. At this time, it is often necessary to re-collect corpus for this new semantics and retrain the semantic recognition model. It can be seen that using a semantic recognition model to obtain sentences will have the above problems.

[0040] In order to avoid the above problems, the human-computer interaction method provided in this article is described in detail in conjunction with the following embodiments. In addition, the sequence of steps in the following method embodiments is only an example and not a strict limitation.

[0041] In practical applications, the human-computer interaction method can be performed by intelligent robots such as service robots, cleaning robots, and self-moving vending robots. Of course, the human-computer interaction method can also be performed by human-computer interaction plug-ins (or human-computer interaction interfaces, human-computer interaction function modules) integrated in online shopping systems, and can also be performed by intelligent terminals such as smart home appliances and smart wearable devices. Generally speaking, the human-computer interaction method can be applied to any device or system that supports interaction with users in voice mode.

[0042] Figure 1 A flowchart of a human-computer interaction method provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method may include the following steps:

[0043] 101. Receive a first sentence input by a user.

[0044] The intelligent robot may be provided with an operation screen for the user to input interactive sentences, in which case the input interactive sentences are in text form. In addition, the intelligent robot may also be provided with a sound pickup device such as a microphone, and when the user speaks an interactive sentence, the intelligent robot may collect the interactive sentence in voice form through the sound pickup device. In this embodiment and the following embodiments, the interactive sentence input by the user is referred to as the first sentence, and the first sentence may be an interactive sentence in text form, or may be a text content obtained by converting the interactive sentence in voice form into text.

[0045] Of course, in different application scenarios, the content of the first sentence is also varied. For example, when a user wants to check the weather, he can send a first sentence to the intelligent robot such as "What will the weather be like tomorrow?" When a user is shopping, he can send a first sentence to the intelligent robot such as "Is there any group purchase recently?"

[0046] 102. Perform trunk extraction on the first sentence to obtain a sentence trunk.

[0047] Next, the intelligent robot will perform a trunk extraction on the received first sentence. In an optional manner, a labeling model may be configured in the intelligent robot, and the first sentence will be input into the labeling model so that the model outputs a labeling result corresponding to the first sentence. The intelligent robot may perform a trunk extraction on the first sentence based on the output labeling result to obtain the sentence trunk of the first sentence.

[0048] Specifically, the annotation model can use the BIO annotation method to annotate the first sentence. Assume that the first sentence input by the user is "I want to apply for a bank card to deposit my salary." After this sentence is input into the annotation model, it can be divided into characters, and the annotation model will generate a annotation result for each single character, and then all the annotation results will form an annotation sequence. For the above-mentioned first sentence, the annotation sequence output by the annotation model is "BIIIIIIIOOOOO". Optionally, the first sentence can also be divided into words, that is, it can be segmented, and each word will correspond to a annotation result. Continuing with the above example, the segmentation result of the first sentence is "I want to apply for a bank card to deposit my salary", and the annotation sequence output by the annotation model is "BIIIIOOOO".

[0049] Regardless of which of the above methods is used to obtain the annotation sequence, "B" in the sequence is used to indicate the beginning of the sentence trunk, "I" is used to indicate the middle of the sentence trunk, and "O" is used to indicate a non-sentence trunk. At this time, the intelligent robot can determine the text corresponding to "B" and "I" in the above annotation sequence as the sentence trunk of the first sentence and extract it.

[0050] Among them, the annotation model usually adopts a supervised training method, that is, it is necessary to manually annotate the main trunk of the acquired training corpus, and then input the manually annotated training samples into the model for training, so as to obtain the annotation model. In practical applications, the annotation model can be optionally a hidden Markov model (HMM), a conditional random field (CRF), a maximum entropy model (MEM), a long short-term memory network (LSTM), etc.

[0051] 103. In the corpus, determine a second sentence that semantically matches the sentence stem.

[0052] After the intelligent robot extracts the main sentence of the first sentence, it will also semantically match the main sentence with the sentences contained in the pre-established corpus, thereby searching the corpus for a second sentence that semantically matches the main sentence. This semantic match is mainly reflected by the semantic similarity between the main sentence and the sentences in the corpus.

[0053] As for the search method for the second sentence, an optional method is that the intelligent robot can first divide the sentence trunk and the sentences contained in the corpus into words. The word division here can be either a division based on characters or a word segmentation process for the sentence. Based on the division results, the text overlap rate between the sentence trunk and the sentences in the corpus is calculated in turn. This text overlap rate can be understood as the semantic similarity between sentences. The higher the text overlap rate, the higher the semantic similarity between the sentences. The most common method is to directly determine the sentence in the corpus that has the highest text overlap rate with the sentence trunk as the second sentence.

[0054] Alternatively, the sentence trunk and the sentences in the corpus can form sentence pairs respectively, and the intelligent robot can input the sentence pairs into the semantic matching model in sequence, so that the semantic matching model outputs a score of 0 to 1 for each sentence pair. This score represents the semantic similarity between the two sentences in a sentence pair. The intelligent robot can determine the sentence corresponding to the highest semantic similarity in the corpus as the second sentence.

[0055] Among them, similar to the annotation model, when training the semantic matching model, it is also necessary to manually annotate the semantic similarity of each sentence pair in the training corpus, that is, supervised training is used to train the semantic matching model. And optionally, in practical applications, the above-mentioned semantic matching model can be a Bidirectional Encoder Representation From Transformers (BERT) model, a Deep Structured Semantic Models (DSSM), a Siamese network model, and the like.

[0056] It should be noted that the second sentence determined in the above manner has a high semantic similarity with the sentence trunk of the first sentence. Although the semantics of the two sentences cannot generally be completely identical, in practical applications, the semantics of the two sentences can be considered the same, so as to facilitate further response to the first sentence containing the sentence trunk based on the second sentence.

[0057] 104. Respond to the first statement according to the second statement.

[0058] After determining the second sentence, the intelligent robot can respond to the first sentence based on the second sentence and the corpus used in determining the second sentence, that is, output a response sentence corresponding to the first sentence. This response sentence is the fifth sentence in the following embodiment. Taking the most common question-and-answer interaction scenario as an example, the response to the first sentence is specifically that the intelligent robot determines the answer corresponding to the first sentence from the corpus based on the second sentence, that is, the fifth sentence.

[0059] In summary, in the human-computer interaction method provided above, the intelligent robot receives the first sentence input by the user and extracts the trunk thereof to obtain the sentence trunk of the first sentence. Then, the second sentence that matches the sentence trunk semantically is determined in the pre-established corpus. Finally, the intelligent robot responds to the first sentence according to the accurate second sentence, thereby realizing human-computer interaction. On the one hand, after the trunk extraction, the modified and supplementary parts in the first sentence can be completely removed, so as to avoid the interference of the non-trunk part on the semantic matching process, and to avoid the situation that the second sentence cannot be matched to the greatest extent, which further avoids the situation that the robot cannot respond to the first sentence, and ensures the normal progress of human-computer interaction. On the other hand, as described in step 103, for the extracted sentence trunk, the second sentence that matches its semantics is searched and matched according to the sentence trunk, that is, the semantics of the sentence trunk is determined by searching and matching. Since the semantic recognition model is not used in the search and matching process, the above-mentioned various problems generated in the process of using the semantic recognition model are avoided.

[0060] Figure 1 In the embodiment shown, the basis for determining the second sentence is the sentence trunk of the first sentence, which can improve the situation where the second sentence cannot be matched. In practical applications, of course, there are also situations where the first sentence can be directly used to match the second sentence. Based on this, Figure 2 A flowchart of another human-computer interaction method provided by an embodiment of the present invention, such as Figure 2 As shown, the method may include the following steps:

[0061] 201. Receive a first sentence input by a user.

[0062] The execution process of step 201 is similar to the corresponding steps of the above-mentioned embodiment, and can be seen in FIG. Figure 1 The relevant description in the illustrated embodiment will not be repeated here.

[0063] 202. Determine whether there is a third sentence in the corpus that semantically matches the first sentence. If so, execute step 203; if not, execute steps 204 to 206.

[0064] 203. Respond to the first statement according to the third statement.

[0065] The intelligent robot can first determine the third sentence that matches the first sentence semantically based on the first sentence. The determination process is consistent with the process of determining the second sentence based on the sentence trunk of the first sentence in step 103 of the above embodiment. The specific process can be found in the relevant description of step 103, which will not be repeated here. Figure 1 The method provided in the embodiment shown can also be used as follows Figure 3 , Figure 4 The third statement is determined in the manner shown, and the specific description can be found in the following description.

[0066] If it is determined in the above manner that there is a third sentence in the corpus that semantically matches the first sentence, the semantic similarity between the first sentence and the third sentence should be greater than a preset threshold, and at this time, the semantics of the first sentence and the third sentence can be considered the same. Then the intelligent robot can directly respond to the first sentence according to the third sentence. If it is determined in the above manner that there is no third sentence in the corpus that semantically matches the first sentence, the intelligent robot will further execute the following steps 204 to 206.

[0067] 204. Perform trunk extraction on the first sentence to obtain a sentence trunk.

[0068] Figure 1 A method for trunk extraction has been provided in the illustrated embodiment. In addition, in another optional manner, the intelligent robot performs word segmentation and part-of-speech classification on the acquired first sentence, and then performs grammatical analysis on the obtained result to obtain a grammatical analysis result. This grammatical analysis result may include the sentence components that each word in the first sentence assumes in the first sentence. Among them, the sentence components may include a subject, a predicate, an object, an attributive, an adverbial, and the like. Then, trunk extraction is performed based on the grammatical analysis result.

[0069] For example, assuming that the first sentence input by the user is "I want to know how to apply for a bank card", the intelligent robot will perform word segmentation and part-of-speech division on this first sentence and obtain the following results: "I" is a personal pronoun, "want" is a verb, "know" is a verb, "how" is an adverb, "apply" is a verb, and "bank card" is a noun; and further perform grammatical analysis based on the word part-of-speech, and the grammatical analysis result may be: "I" is the subject of "know", "want" is the adverbial of "know", "apply" is the object of "know", "how" is the adverbial of "apply", and "bank card" is the object of "apply". According to the above grammatical analysis results, for the verb "know", there is an object connected to it, and this object is also connected to other words. At this time, the words "how to apply for a bank card" connected to the verb "know" can be directly extracted as the sentence trunk.

[0070] It should be noted that in actual applications, in order to improve the overall implementation speed of the process, step 202 and step 204 can also be performed simultaneously. However, if a third sentence that semantically matches the first sentence can be directly determined in the corpus, the sentence trunk extracted in step 204 will not be used.

[0071] 205. In the corpus, determine a second sentence that semantically matches the extracted sentence trunk.

[0072] 206. Respond to the first statement according to the second statement.

[0073] The execution process of the above steps 205 to 206 is similar to the corresponding steps of the above embodiment, and can be seen in FIG. Figure 1 The relevant description in the illustrated embodiment will not be repeated here.

[0074] In this embodiment, after receiving the first sentence, the intelligent robot directly uses the first sentence for semantic matching. If the third sentence can be matched, the first sentence is directly responded to according to the third sentence. In this case, the response process of the statement is relatively concise, and the quick and accurate response of the statement can be guaranteed to a certain extent. If the third sentence cannot be matched according to the first sentence, the intelligent robot will extract the trunk of the first sentence again, and use the extracted sentence trunk for semantic matching, and complete the response to the first sentence according to the matched second sentence. Executing the process shown in this embodiment can avoid the situation where the second sentence or the third sentence that semantically matches the first sentence cannot be matched, and ensure the normal human-computer interaction.

[0075] According to the descriptions in the above embodiments, determining the second sentence that matches the semantics of the first sentence based on the sentence trunk is an important process for achieving normal human-computer interaction. Although the above embodiments have provided a variety of ways to determine the second sentence, it is found in actual use that the generalization ability of using the word overlap rate to determine the second sentence is relatively weak; and using the semantic matching model to determine the second sentence has the problem of large amount of calculation and complex calculation process.

[0076] In order to improve the above problems, the following can be optionally combined Figure 3 , Figure 4 The method shown is to determine the second sentence, and the following method is actually a combination of the text overlap rate and the semantic matching model.

[0077] 301. Perform word division on sentence stems and sentences included in the corpus.

[0078] 302. According to the division result, determine the text overlap rate between the sentence trunk and the sentences included in the corpus.

[0079] 303. Search the corpus for a fourth sentence according to the text overlap rate.

[0080] 304. Determine a second statement from the searched fourth statement.

[0081] Specifically, the intelligent robot can first divide the sentence trunk and the sentences in the corpus into words. Based on the division results, the word overlap rate between the sentence trunk and the sentences in the corpus is calculated in turn. This part of the processing process can be seen in Figure 1 The relevant description in step 103 of the illustrated embodiment. In addition to the above method, since words of different parts of speech in the sentence trunk have different degrees of influence on the semantics of the sentence, such as the influence of verbs on semantics is greater than that of nouns on semantics, therefore, optionally, different weight values ​​can be set for words of different parts of speech in the sentence trunk, and then the text overlap rate is calculated based on the weight value. Then, sentences with a text overlap rate higher than a preset threshold are searched from the corpus to determine these sentences as fourth sentences, and the number of fourth sentences is usually multiple.

[0082] In actual applications, the text overlap rate is a value between 0 and 1, so the preset threshold used in searching for the fourth sentence can be set to a larger value, such as 0.8, to form a more stringent search condition, so that the fourth sentences searched out all have a high text overlap rate with the main sentence of the first sentence. At this time, the intelligent robot can randomly determine one of the sentences as the second sentence.

[0083] However, the above-mentioned method of randomly selecting the second sentence from the fourth sentence is obviously rough, resulting in low accuracy of the second sentence. Therefore, another implementation method of step 304 can be as follows Figure 4 As shown:

[0084] 3041. Calculate a first semantic similarity between the sentence trunk and the fourth sentence.

[0085] 3042. Input the fourth sentence whose first semantic similarity is not less than the first preset threshold into the semantic matching model.

[0086] The intelligent robot first calculates the first semantic similarity between the sentence trunk and the fourth sentence. Optionally, the first semantic similarity can be specifically embodied as the edit distance or cosine similarity of the two sentences. The first semantic similarity can be understood as indirectly judging the semantic similarity between the two sentences from the perspective of text differences.

[0087] Then, the first semantic similarity is compared with the first preset threshold, and the fourth sentences whose first semantic similarity is not less than the first threshold are divided into the first group, and the fourth sentences whose first semantic similarity is less than the first threshold are divided into the second group. That is, compared with the second group, the fourth sentence in the first group has a higher first semantic similarity with the sentence trunk of the first sentence, and the two are closer in terms of textual appearance.

[0088] Next, the sentence trunk and the sentences in the first group are input into the semantic matching model. At this time, the sentence trunk and the fourth sentence in the first group will form a sentence pair, and the semantic matching model will output a second semantic similarity for each sentence pair. This second similarity directly judges the similarity between sentences from a semantic perspective. Among them, the first semantic similarity and the second semantic similarity can both be a value between 0 and 1.

[0089] 3043. If the second semantic similarity output by the semantic matching model is not less than the second preset threshold, determine the second sentence from the fourth sentences whose first semantic similarity is not less than the first preset threshold.

[0090] If the second semantic similarity output by the semantic model is not less than the second preset threshold, it indicates that the fourth sentence in the first group and the sentence trunk are not only similar in text surface but also highly similar in semantics. At this time, the intelligent robot can determine the fourth sentence corresponding to the maximum second semantic similarity in the first group as the second sentence.

[0091] 3044. If the second semantic similarity output by the semantic matching model is less than the second preset threshold, input the fourth sentence whose first semantic similarity is less than the first preset threshold into the semantic matching model.

[0092] 3045. Determine a second sentence from the fourth sentences whose first semantic similarity does not meet a first preset threshold value according to the second semantic similarity output by the semantic matching model.

[0093] If the second semantic similarity output by the semantic matching model is less than the second preset threshold, it indicates that the fourth sentence in the first group and the sentence trunk are only similar in words, but the semantics are not the same. At this time, the fourth sentence in the first group is completely discarded. The intelligent robot will then input the fourth sentence in the second group into the semantic matching model. The semantic matching model will generate a second semantic similarity for each sentence pair consisting of the sentence trunk and the fourth sentence in the second group. The intelligent robot can determine the fourth sentence corresponding to the highest second semantic similarity in the second group as the second sentence.

[0094] The first preset threshold and the second preset threshold can be set to a value between 0 and 1 according to actual needs, and the two can be equal or unequal, and there is no limitation on the size relationship between the two. For example, the first preset threshold can be set to 0.5, and the second preset threshold can be set to 0.8.

[0095] Figure 3 and Figure 4In general, the embodiment shown is that the intelligent robot first searches for a part of sentences from the corpus as the fourth sentence based on the text overlap rate. Then, the second sentence that best matches the sentence trunk of the first sentence in semantics is determined from the fourth sentence by a similarity calculation algorithm combined with a semantic matching model. It can be seen that in the above embodiment, the intelligent robot still determines the semantics of the sentence trunk by first searching and then matching, that is, it determines the second sentence that matches the sentence trunk of the first sentence in semantics. The semantic recognition model will not be used in the process of semantic determination, so various problems caused by the use of the semantic recognition model can naturally be avoided.

[0096] At the same time, according to Figure 3 , Figure 4 As can be seen from the embodiment shown, the intelligent robot first calculates the first semantic similarity between the fourth sentence and the sentence trunk through a calculation algorithm, and screens the fourth sentence once through the first semantic similarity. Then, only the fourth sentence whose first semantic similarity is not less than the first preset threshold, i.e., the fourth sentence in the first group, is input into the semantic matching model. At this time, the semantic matching model only needs to calculate the fourth sentence in the first group, which can greatly reduce the amount of calculation of the semantic model compared to calculating all the fourth sentences, thereby ensuring that the second sentence is quickly determined.

[0097] After determining the second sentence using the methods provided in the above embodiments, the intelligent robot will respond to the first sentence according to the second sentence, thereby realizing human-computer interaction. In practical applications, common human-computer interaction types usually include single-round dialogue, i.e., question-and-answer, or multi-round dialogue. Different types of interaction often have different response processes.

[0098] Specifically, when the interaction type is question-answering, the corpus used in determining the second sentence is a question-answering corpus, which records question-answering sentence pairs. For example, "I want to download mobile banking" and "Scan the QR code on me to download" are a pair of question-answering pairs in the question-answering corpus. Since the second sentence is a question existing in the question-answering corpus, the intelligent robot can directly find and output the answer corresponding to this question based on the question-answering sentence pairs in the question-answering corpus. This answer is also the response result of the first sentence, that is, the fifth sentence.

[0099] When the interaction type is a multi-round dialogue, the corpus used in determining the second sentence is an intention corpus, which records the correspondence between sentences and their intentions. The intention of this sentence can be understood as the semantics of the sentence. For example, the sentence "I want to apply for a bank card" has a corresponding intention of "applying for a card". When the intelligent robot determines the second sentence, it also obtains the intention of the second sentence. The intelligent robot will input the intention corresponding to the second sentence and the dialogue state corresponding to the previous sentence before the second sentence into the dialogue system configured by itself, so that the dialogue system can determine the response sentence corresponding to the first sentence, that is, the fifth sentence.

[0100] It can be seen that the human-computer interaction method provided by the present invention is applicable to both single-round dialogue, i.e., question-and-answer scenarios, and multi-round dialogue scenarios. In this way, only one system needs to be deployed in the intelligent robot to enable the intelligent robot to have the interactive functions of question-and-answer or multi-round dialogue at the same time, making the deployment of the internal interactive system of the intelligent robot more concise.

[0101] The following will describe in detail one or more embodiments of the human-computer interaction device of the present invention. Those skilled in the art will appreciate that these human-computer interaction devices can be configured using commercially available hardware components through the steps taught in this solution.

[0102] Figure 5 A schematic diagram of a human-computer interaction device provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the device comprises:

[0103] The receiving module 11 is used to receive a first sentence input by a user.

[0104] The extraction module 12 is used to perform trunk extraction on the first sentence to obtain a sentence trunk.

[0105] The first determination module 13 is used to determine a second sentence in the corpus that semantically matches the sentence trunk.

[0106] The responding module 14 is configured to respond to the first statement according to the second statement.

[0107] Optionally, the human-computer interaction device further includes: a second determination module 21, configured to determine whether there is a third sentence in the corpus that semantically matches the first sentence.

[0108] The response module 14 is configured to respond to the first statement according to the third statement if the third statement exists.

[0109] The first determination module 13 is configured to determine, if the third sentence does not exist, a second sentence in the corpus that semantically matches the sentence trunk of the first sentence.

[0110] Optionally, the first determining module 13 specifically includes:

[0111] The division unit 131 is used to divide the sentence trunk and the sentences included in the corpus into words.

[0112] The first determining unit 132 is used to determine the text overlap rate between the sentence trunk and the sentences included in the corpus according to the segmentation result.

[0113] The searching unit 133 is configured to search the fourth sentence from the corpus according to the word coincidence rate.

[0114] The second determining unit 134 is configured to determine the second statement from the searched fourth statements.

[0115] Optionally, the second determination unit 134 is specifically used to: calculate a first semantic similarity between the sentence trunk and the fourth sentence; input the fourth sentence whose first semantic similarity is not less than a first preset threshold into a semantic matching model; if the second semantic similarity output by the semantic matching model is not less than a second preset threshold, determining the second sentence from the fourth sentence whose first semantic similarity is not less than the first preset threshold.

[0116] Optionally, the second determination unit 134 is also used to input a fourth sentence whose first semantic similarity is less than the first preset threshold into the semantic matching model if the second semantic similarity output by the semantic matching model is less than the second preset threshold; and determine the second sentence from the fourth sentence whose first semantic similarity is less than the first preset threshold based on the second semantic similarity output by the semantic matching model.

[0117] Optionally, the extraction module 12 in the human-computer interaction device specifically includes:

[0118] The analyzing unit 121 is used to perform grammatical analysis on the first sentence to obtain sentence components corresponding to the part of speech of each word in the first sentence.

[0119] The extraction unit 122 is used to extract the trunk of the first sentence according to the sentence components to obtain a sentence trunk.

[0120] Optionally, the response module 14 in the human-computer interaction device specifically includes:

[0121] The determining unit 141 is configured to determine, according to the second sentence, a fifth sentence in the question-answer corpus that satisfies a question-answer relationship with the second sentence.

[0122] The output unit 142 is configured to output the fifth sentence.

[0123] Optionally, the response module 14 further includes: an input unit 143 .

[0124] The determination unit 141 is used to determine the intent corresponding to the second sentence in the intent corpus.

[0125] The input unit 143 is used to input the intention into the dialogue system, so that the dialogue system determines a fifth sentence corresponding to the second sentence.

[0126] The output unit 142 is configured to output the fifth sentence.

[0127] Figure 5 The artificial interaction device shown can perform the aforementioned Figures 1 to 4 The human-computer interaction method provided in the embodiment shown in the figure, for the parts not described in detail in this embodiment, please refer to Figures 1 to 4 The relevant description of the illustrated embodiment will not be repeated here.

[0128] The above describes the internal functions and structure of the human-machine interaction device. In a possible design, the structure of the human-machine interaction device can be implemented as a part of an intelligent robot, such as Figure 6 As shown, the intelligent robot may include: a processor 32 and a memory 31. The memory 31 is used to store the information that supports the intelligent robot to execute the aforementioned Figures 1 to 4 The program of the human-computer interaction method provided in the illustrated embodiment, the processor 32 is configured to execute the program stored in the memory 31 .

[0129] The program includes one or more computer instructions, wherein the one or more computer instructions, when executed by the processor 32, can implement the following steps:

[0130] receiving a first sentence input by a user;

[0131] Performing trunk extraction on the first sentence to obtain a sentence trunk;

[0132] In the corpus, determining a second sentence that semantically matches the sentence trunk;

[0133] The first statement is responded to according to the second statement.

[0134] Optionally, the processor 32 is further configured to execute the aforementioned Figures 1 to 4 All or part of the steps in the illustrated embodiments.

[0135] The structure of the intelligent robot may further include a communication interface 33 for communicating with other devices or communication networks.

[0136] In addition, an embodiment of the present invention provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to perform at least the following actions:

[0137] receiving a first sentence input by a user;

[0138] Performing trunk extraction on the first sentence to obtain a sentence trunk;

[0139] In the corpus, determining a second sentence that semantically matches the sentence trunk;

[0140] The first statement is responded to according to the second statement.

[0141] The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separate. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0142] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product.

[0143] For ease of understanding, the specific implementation of the human-computer interaction method provided above is exemplified in combination with the following application scenarios.

[0144] Taking the public service scenario of a bank as an example, a bank may have intelligent terminal devices such as service robots. When a user enters a bank to consult about the business he wants to handle, he can ask the service robot a question, that is, the first sentence: "I want to apply for a bank card to deposit my salary." At this time, the intelligent robot can use Figure 3 In the way shown in the figure, the following sentences are searched in the corpus: "I want to apply for a bank card", "Can you help me apply for a bank card?" and "I want to apply for a loan". Then, use Figure 4 The method shown calculates the first semantic similarity of the first sentence and the above sentence as 0.67, 0.56 and 0.21 respectively. Assuming that the first preset threshold is set to 0.5 and the second preset threshold is set to 0.8, among the above three sentences, "I want to apply for a bank card" and "Can you help me apply for a bank card" will be classified into the first group, and "I want to apply for a loan" will be classified into the second group.

[0145] At this time, the intelligent robot will input the first sentence and the sentences in the first group into the semantic matching model, and the second semantic similarities output by the semantic matching model for the sentences in the first group are 0.16 and 0.12 respectively, both of which do not reach the second preset threshold. Then the intelligent robot will input the sentences in the second group into the semantic matching model again, and the second semantic similarity output by the model is 0.006, which still does not reach the second preset threshold.

[0146] The above processing results show that if the first sentence is used directly, it is possible that the second sentence that matches its semantics cannot be obtained. The reason is that the non-main part in the first sentence interferes with the semantic matching. In order to avoid this interference. The intelligent robot will extract the main stem of the first sentence to obtain the main stem of the first sentence as "I want to apply for a bank card". At this time, the intelligent robot will use this sentence main stem as a basis to determine from the corpus that the fourth sentence that matches the sentence main stem semantically is: "I want to apply for a bank card", "Can you help me apply for a bank card" and "I want to apply for a loan". Similar to the above process, the intelligent robot calculates the first semantic similarity between these three fourth sentences and the sentence main stem as 0.875, 0.7 and 0.29 respectively. If the first semantic similarity of "I want to apply for a bank card" and "Can you help me apply for a bank card" is greater than the first preset threshold, the two will be exchanged and divided into the first group, and "I want to apply for a loan" will be divided into the second group.

[0147] The intelligent robot inputs "I want to apply for a bank card", "Can you help me apply for a bank card" and the sentence trunk "I want to apply for a bank card" in the first group into the semantic matching model. The second semantic similarities output by the model for the two fourth sentences are 0.99 and 0.85 respectively, both reaching the second preset threshold. The intelligent robot can determine the fourth sentence corresponding to the highest second semantic similarity as the second sentence, and the second sentence is "I want to apply for a bank card".

[0148] The above example corresponds to Figure 2 Flow chart of the embodiment shown. In practical application, Figure 1 Corresponding to the illustrated embodiment, the intelligent robot can also directly extract the trunk of the first sentence after receiving it, and use the sentence trunk to determine the second sentence that semantically matches the first sentence. The specific process can also be referred to the above example and will not be repeated here.

[0149] After determining the second sentence, when the interaction type is question and answer, since the question and answer corpus records question and answer pairs, the intelligent robot will directly determine in the question and answer corpus that the fifth sentence that satisfies the question and answer relationship with the second sentence "I want to apply for a bank card" is "Please take a number and queue up to handle the service", thereby realizing human-computer interaction.

[0150] When the interaction type is a multi-round dialogue, since the intention corpus records the correspondence between sentences and intentions, the intelligent robot can directly determine that the intention of the second sentence "I want to apply for a bank card" is "applying for a card", and input this "applying for a card" intention into the dialogue system, so that the dialogue system can determine the corresponding fifth sentence "Please place your ID card at the document scanning area", thereby realizing human-computer interaction.

[0151] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A human-computer interaction method, characterized in that: include: receiving a first sentence input by a user; In the corpus, determining whether there is a third sentence that semantically matches the first sentence; Performing grammatical analysis on the first sentence to obtain the sentence components corresponding to each word in the first sentence Extracting the main stem of the first sentence according to the sentence components to obtain a sentence main stem; In the corpus, determining a second sentence that semantically matches the sentence trunk; If the third statement does not exist, responding to the first statement according to the second statement; If the third statement exists, responding to the first statement according to the third statement; The process of determining the second statement includes: Determining the word overlap rate between the sentence trunk and the sentences included in the corpus according to the word division results of the sentence trunk and the sentences included in the corpus; searching for a fourth sentence from the corpus according to the word overlap rate; Calculating a first semantic similarity between the sentence trunk and the searched fourth sentence; Inputting a fourth sentence whose first semantic similarity is not less than a first preset threshold into a semantic matching model; If the second semantic similarity output by the semantic matching model is not less than a second preset threshold, the second sentence is determined from fourth sentences whose first semantic similarity is not less than the first preset threshold.

2. The method according to claim 1, characterized in that The method further comprises: If the second semantic similarity output by the semantic matching model is less than the second preset threshold, inputting a fourth sentence whose first semantic similarity is less than the first preset threshold into the semantic matching model; According to the second semantic similarity output by the semantic matching model, the second sentence is determined from fourth sentences whose first semantic similarity is less than the first preset threshold.

3. The method according to claim 1 or 2, characterized in that: The corpus is a question-answer corpus, and responding to the first sentence according to the second sentence includes: According to the second sentence, determining in the question-answer corpus a fifth sentence that satisfies a question-answer relationship with the second sentence; The fifth sentence is output.

4. The method according to claim 1 or 2, characterized in that: The corpus is an intention corpus, and responding to the first sentence according to the second sentence includes: Determining the intent corresponding to the second sentence in the intent corpus; inputting the intention into a dialogue system so that the dialogue system determines a fifth sentence corresponding to the second sentence; The fifth sentence is output.

5. A human-computer interaction device, characterized in that: include: A receiving module, used for receiving a first sentence input by a user; A second determination module is used to determine whether there is a third sentence in the corpus that semantically matches the first sentence; An extraction module, configured to perform grammatical analysis on the first sentence to obtain sentence components corresponding to each word in the first sentence; Extracting the main stem of the first sentence according to the sentence components to obtain a sentence main stem; A first determination module is used to determine the word overlap rate between the sentence trunk and the sentences included in the corpus according to the word division results of the sentence trunk and the sentences included in the corpus; searching for a fourth sentence from the corpus according to the word overlap rate; Calculating a first semantic similarity between the sentence trunk and the searched fourth sentence; Inputting a fourth sentence whose first semantic similarity is not less than a first preset threshold into a semantic matching model; If the second semantic similarity output by the semantic matching model is not less than a second preset threshold, determining a second sentence that semantically matches the sentence trunk from the fourth sentence whose first semantic similarity is not less than the first preset threshold; a response module, configured to respond to the first statement according to the third statement if the third statement exists; If the third statement does not exist, respond to the first statement according to the second statement.

6. An intelligent robot comprising: A processor and a memory; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement: receiving a first sentence input by a user; In the corpus, determining whether there is a third sentence that semantically matches the first sentence; Performing grammatical analysis on the first sentence to obtain sentence components corresponding to each word in the first sentence; Extracting the main stem of the first sentence according to the sentence components to obtain a sentence main stem; In the corpus, determining a second sentence that semantically matches the sentence trunk; If the third statement does not exist, responding to the first statement according to the second statement; If the third statement exists, responding to the first statement according to the third statement; The process of determining the second statement includes: Determining the word overlap rate between the sentence trunk and the sentences included in the corpus according to the word division results of the sentence trunk and the sentences included in the corpus; searching for a fourth sentence from the corpus according to the word overlap rate; Calculating a first semantic similarity between the sentence trunk and the searched fourth sentence; Inputting a fourth sentence whose first semantic similarity is not less than a first preset threshold into a semantic matching model; If the second semantic similarity output by the semantic matching model is not less than a second preset threshold, the second sentence is determined from fourth sentences whose first semantic similarity is not less than the first preset threshold.

7. A computer-readable storage medium storing computer instructions, characterized in that: When the computer instructions are executed by one or more processors, the one or more processors are caused to perform at least the following actions: receiving a first sentence input by a user; In the corpus, determining whether there is a third sentence that semantically matches the first sentence; Performing grammatical analysis on the first sentence to obtain sentence components corresponding to each word in the first sentence; Extracting the main stem of the first sentence according to the sentence components to obtain a sentence main stem; In the corpus, determining a second sentence that semantically matches the sentence trunk; If the third statement does not exist, responding to the first statement according to the second statement; If the third statement exists, responding to the first statement according to the third statement; The process of determining the second statement includes: Determining the word overlap rate between the sentence trunk and the sentences included in the corpus according to the word division results of the sentence trunk and the sentences included in the corpus; searching for a fourth sentence from the corpus according to the word overlap rate; Calculating a first semantic similarity between the sentence trunk and the searched fourth sentence; Inputting a fourth sentence whose first semantic similarity is not less than a first preset threshold into a semantic matching model; If the second semantic similarity output by the semantic matching model is not less than a second preset threshold, the second sentence is determined from fourth sentences whose first semantic similarity is not less than the first preset threshold.