Human-computer interaction method and device, terminal and storage medium
By using syllable matching to determine the next machine phrase in a word chain game, the problem of low efficiency in existing technologies is solved, and more efficient human-computer interaction is achieved.
Patent Information
- Application Number
- CN202111387363.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-22
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2041-11-22
AI Technical Summary
Existing methods for human-computer interaction in idiom chain games are inefficient.
By obtaining syllable information from user responses and using syllable mapping relationships in a pre-defined phrase library, the next machine phrase is determined, thereby achieving syllable matching and improving efficiency.
The efficiency of human-computer interaction methods has been improved, the index size has been optimized, and the performance of idiom chain games has been enhanced.
Smart Images

Figure CN116150325B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and particularly to a human-computer interaction method, device, terminal, and storage medium. Background Art
[0002] Word chain is a traditional word game with diverse and constantly evolving rules. The commonly known method is to connect the first and last characters of idioms continuously. In some rules, in addition to four-character idioms, poems, proverbs, sayings, etc. can also be used for word chain; in some rules, homophonic words can also be used for word chain, for example: happy and satisfied - going forward without hesitation.
[0003] However, the current human-computer interaction method applied in the word chain scenario has low efficiency. Summary of the Invention
[0004] Embodiments of the present invention provide a human-computer interaction method, device, terminal, and storage medium, which can improve the efficiency of the human-computer interaction method.
[0005] Embodiments of the present invention provide a human-computer interaction method, including:
[0006] Obtain the current user's reply, where the current user's reply is the reply made by the user to the current machine phrase, and the current user's reply contains the current user phrase;
[0007] If the last character of the current machine phrase has the same syllable as the first character of the current user's reply, determine the next machine phrase corresponding to the current user phrase, where the last character of the current user phrase has the same syllable as the first character of the next machine phrase;
[0008] Display the next machine phrase to the user.
[0009] Embodiments of the present invention further provide a human-computer interaction device, including:
[0010] An acquisition unit for obtaining the current user's reply, where the current user's reply is the reply made by the user to the current machine phrase, and the current user phrase included in the current user's reply;
[0011] A machine phrase unit for determining the next machine phrase corresponding to the current user phrase if the last character of the current machine phrase has the same syllable as the first character of the current user's reply, where the last character of the current user phrase has the same syllable as the first character of the next machine phrase;
[0012] A display unit for displaying the next machine phrase to the user.
[0013] In some embodiments, the machine phrase unit includes:
[0014] The final syllable subunit is used to determine the final syllable of the current user phrase, wherein the final syllable is the syllable of the last character in the current user phrase;
[0015] The retrieval subunit is used to retrieve a target phrase from a preset phrase library based on the last syllable of the current user phrase, wherein the last syllable of the current user phrase and the first syllable of the target phrase have the same syllable.
[0016] The next machine subunit is used to determine the next machine phrase corresponding to the current user phrase from the target phrases when at least one target phrase exists in the preset phrase library.
[0017] The first prompt subunit is used to display a first prompt to the user when the target phrase does not exist in the preset phrase library.
[0018] In some embodiments, the preset phrase library includes a mapping relationship between phrases and their first syllables, and a mapping relationship between phrases and their frequency proportions. The retrieval subunit is used for:
[0019] Retrieve the target syllable from the preset phrase library, wherein the target syllable is the same as the last syllable of the current user phrase;
[0020] Based on the mapping relationship between phrases and their first syllables in the preset phrase library, at least one candidate phrase corresponding to the target syllable is determined;
[0021] Based on the mapping relationship between the phrase and its frequency proportion, the frequency proportion of the first syllable of each candidate phrase is determined;
[0022] The target phrase is determined from the at least one candidate phrase based on the frequency ratio of the first syllable of the candidate phrase.
[0023] In some embodiments, the target phrase is the candidate phrase with the highest frequency of the first syllable.
[0024] In some embodiments, the acquisition unit further includes:
[0025] A fragment subunit is used to determine phrase fragments in the current user's reply;
[0026] The user phrase subunit is used to use the phrase fragment as the current user phrase when the phrase fragment exists in a preset phrase library.
[0027] The second prompt subunit is used to display a second prompt to the user when the phrase fragment does not exist in the preset phrase library.
[0028] In some embodiments, the fragment subunit is used for:
[0029] Determine the number of characters in the current user's reply;
[0030] If the number of characters exceeds the preset limit, then a phrase fragment is extracted from the current user's reply;
[0031] If the number of characters equals the preset quantity, then the current user's reply is treated as a phrase fragment.
[0032] In some embodiments, the interactive device further includes a second prompting unit, the second prompting unit being configured to:
[0033] If the last character of the current machine phrase does not have the same syllable as the first character of the current user reply, then a second prompt is displayed to the user.
[0034] In some embodiments, the acquisition unit is configured to:
[0035] Get random numbers;
[0036] The phrase corresponding to the random number in the preset phrase library is determined as the current machine phrase;
[0037] Get the current user's response to the current machine phrase.
[0038] In some embodiments, the preset phrase library includes a mapping relationship between phrases and their first syllables, and a mapping relationship between phrases and their frequency proportions. The interactive device further includes a construction unit, which is used for:
[0039] Obtain a phrase set, which includes multiple phrases;
[0040] Identify all the first-syllable words in the phrase set, where the first-syllable word is the syllable of the first character in the phrase;
[0041] Determine the frequency percentage of each phrase, where the frequency percentage is the percentage of each phrase among all phrases in the phrase set;
[0042] Construct a mapping relationship between the phrase and its frequency percentage;
[0043] Construct a mapping relationship between each phrase and its first syllable.
[0044] In some embodiments, the acquisition unit is configured to:
[0045] Obtain user voice;
[0046] The user's voice is processed into audio-to-text to obtain the current user's reply.
[0047] In some embodiments, the display unit is configured to:
[0048] The next machine phrase is subjected to text-to-audio conversion processing to obtain the next machine speech;
[0049] Play the next machine voice message.
[0050] This invention also provides a terminal, including a memory storing multiple instructions; the processor loads instructions from the memory to execute steps in any of the human-computer interaction methods provided in this invention.
[0051] This invention also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the human-computer interaction methods provided in this invention.
[0052] This invention can obtain the current user reply, which is the user's reply to the current machine phrase, and the current user reply contains the current user phrase; if the last character of the current machine phrase has the same syllable as the first character of the current user reply, then determine the next machine phrase corresponding to the current user phrase, and the last character of the current user phrase has the same syllable as the first character of the next machine phrase; and display the next machine phrase to the user.
[0053] In this invention, determining whether the first and last characters conform to the rules of idiom chaining by using syllables can effectively improve the determination efficiency. This, in turn, enhances the efficiency of human-computer interaction methods. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1a This is a schematic diagram of a scenario for the human-computer interaction method provided in an embodiment of the present invention;
[0056] Figure 1b This is a flowchart illustrating the human-computer interaction method provided in an embodiment of the present invention;
[0057] Figure 1c This is a schematic diagram illustrating the random generation of the human-computer interaction method provided in this embodiment of the invention;
[0058] Figure 1d This is a schematic diagram of the mapping relationship of the human-computer interaction method provided in the embodiments of the present invention;
[0059] Figure 1e This is a schematic diagram of the preset phrase library of the human-computer interaction method provided in the embodiments of the present invention;
[0060] Figure 1f This is a schematic diagram of the phrase judgment process of the human-computer interaction method provided in the embodiments of the present invention;
[0061] Figure 1g This is a schematic diagram of the connection judgment process of the human-computer interaction method provided in the embodiment of the present invention;
[0062] Figure 1h This is a schematic diagram of the machine response process of the human-computer interaction method provided in the embodiments of the present invention;
[0063] Figure 2a This is a schematic diagram illustrating the application of the human-computer interaction method provided in this embodiment of the invention in a Chinese idiom chain game scenario;
[0064] Figure 2b This is a schematic diagram of the functional modules of the human-computer interaction method provided in the embodiments of the present invention;
[0065] Figure 2c This is a schematic diagram of the judgment module of the human-computer interaction method provided in an embodiment of the present invention;
[0066] Figure 3 This is a schematic diagram of the human-computer interaction device provided in an embodiment of the present invention;
[0067] Figure 4 This is a schematic diagram of the terminal provided in an embodiment of the present invention. Detailed Implementation
[0068] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0069] This invention provides a human-computer interaction method, device, terminal, and storage medium.
[0070] Specifically, this human-computer interaction device can be integrated into an electronic device, such as a terminal or server. The terminal can be a mobile phone, tablet, smart Bluetooth device, laptop, or personal computer (PC); the server can be a single server or a server cluster consisting of multiple servers.
[0071] For example, the terminal can be a smartphone, a personal computer, a Bluetooth speaker, etc.
[0072] In some embodiments, the human-computer interaction device can also be integrated into multiple electronic devices. For example, the human-computer interaction device can be integrated into multiple servers, and the human-computer interaction method of the present invention can be implemented by multiple servers.
[0073] In some embodiments, the server may also be implemented as a terminal.
[0074] For example, refer to Figure 1a The electronic device can be a laptop computer. The laptop computer first announces the current machine phrase to the user, then obtains the current user reply to the current machine phrase, and determines the current user phrase contained in the current user reply. If the last character of the current machine phrase has the same syllable as the first character of the current user reply, then the next machine phrase corresponding to the current user phrase is determined. If the last character of the current user phrase has the same syllable as the first character of the next machine phrase, then the next machine phrase is announced to the user in order to obtain the next user reply to the next machine phrase. This process is repeated multiple times until the user stops replying or the word chain ends.
[0075] The following sections provide detailed descriptions of each example. It should be noted that the sequence numbers of the following embodiments are not intended to limit the preferred order of the embodiments.
[0076] In this embodiment, a human-computer interaction method is provided, such as... Figure 1b As shown, the specific process of this human-computer interaction method can be as follows:
[0077] 101. Obtain the current user's reply, wherein the current user's reply is the user's reply to the current machine phrase, and the current user's reply contains the current user phrase.
[0078] In some embodiments, step 101 may include the following steps:
[0079] Obtain user voice;
[0080] The user's voice is processed into audio-to-text to obtain the current user's reply.
[0081] like Figure 1c As shown, in some embodiments, step 101 may include the following steps:
[0082] Get random numbers;
[0083] The phrase corresponding to the random number in the preset phrase library is determined as the current machine phrase;
[0084] Get the current user's response to the current machine phrase.
[0085] For example, the phrase corresponding to the number 1521 is "enlightening", and the phrase corresponding to the number 1522 is "whole-hearted". Therefore, when the random number is 1522, "whole-hearted" can be determined as the current machine phrase, and then the voice "whole-hearted" is broadcast to the user, and then the current user response to "whole-hearted" is obtained.
[0086] The following will introduce the construction method of the preset phrase library:
[0087] As Figure 1d shown, in some embodiments, the preset phrase library may include the mapping relationship between the phrase and its first syllable, and the mapping relationship between the phrase and its frequency ratio, and may also include:
[0088] Obtain a phrase set, and the phrase set may include multiple phrases;
[0089] Determine all the first syllables in the phrase set, and the first syllable is the syllable of the first character in the phrase;
[0090] Determine the frequency ratio of each phrase, and the frequency ratio is the proportion of each phrase in all phrases in the phrase set;
[0091] Construct the mapping relationship between the phrase and its frequency ratio;
[0092] Construct the mapping relationship between each phrase and its first syllable.
[0093] Among them, phrases can include idioms, proverbs, poems, etc. Among them, a syllable is a speech unit formed by the combination of phonemes. The syllable of a phonetic language is formed by the combination of consonants and vowels, and the syllable of Chinese is formed by the combination of initials and finals. A vowel that can be pronounced alone is also a syllable. The syllable can be represented in the form of pinyin, phoneme, etc. For example, the syllable of the character [tóu] is [tóu].
[0094] The purpose of constructing the preset phrase library is to improve the retrieval speed. An index is established with the first syllable as the primary key, and at the same time, the frequency ratio of each idiom under the same primary key is statistically calculated based on the phrase set, and this is used as the weight value of each idiom. Among them, the phrase set can be external corpora collected, such as the original idiom dictionary, etc.
[0095] As Figure 1e shown, in this solution, the frequency ratio of each idiom appearing in the original idiom dictionary is statistically calculated. For example, the frequency ratio of "clear and logical" appearing is 0.08, and the frequency ratio of "substitute the beams with rotten timbers" appearing is 0.06... In this solution, it is necessary to judge whether the current user response conforms to the idiom solitaire rule, such as judging whether the current user response is an idiom. Therefore, in some embodiments, step 101 may further include the following steps:
[0096] Identify phrase fragments in the current user's reply;
[0097] If the phrase fragment exists in the preset phrase library, then the phrase fragment is used as the current user phrase;
[0098] If the phrase fragment does not exist in the preset phrase library, a second prompt is displayed to the user.
[0099] The second prompt is used to notify the user that their reply is incorrect, such as indicating that their reply is not an idiom or that their reply does not conform to the rules of the word chain.
[0100] refer to Figure 1f In some embodiments, to allow users to participate in the idiom chain game based on natural language, it can be determined whether the current user's reply contains the current user's phrase by extracting idiom fragments from the sentence. Therefore, determining the phrase fragments in the current user's reply may include:
[0101] Determine the number of characters in the current user's reply;
[0102] If the number of characters exceeds the preset limit, then a phrase fragment is extracted from the current user's reply;
[0103] If the number of characters equals the preset quantity, then the current user's reply is treated as a phrase fragment.
[0104] In some embodiments, if the number of characters is less than a preset number, a second prompt is displayed to the user.
[0105] For example, if the current user's reply is 4 characters, then the current user's reply is treated as a phrase fragment; if the current user's reply is more than 4 characters, then a phrase fragment is extracted from the current user's reply; if the current user's reply is less than 4 characters, then the user is prompted that their reply does not conform to the chain-reaction rules.
[0106] In some embodiments, syntactic analysis tools can be used to analyze natural language responses and extract phrase fragments from the current user's response.
[0107] 102. If the last character of the current machine phrase has the same syllable as the first character of the current user reply, then determine the next machine phrase corresponding to the current user phrase, wherein the last character of the current user phrase has the same syllable as the first character of the next machine phrase.
[0108] In some embodiments, this solution may further include the following steps:
[0109] If the last character of the current machine phrase does not have the same syllable as the first character of the current user reply, then a second prompt is displayed to the user.
[0110] refer to Figure 1g In some embodiments, determining the next machine phrase corresponding to the current user phrase may include:
[0111] Determine the last syllable of the current user phrase, where the last syllable is the syllable of the last character in the current user phrase;
[0112] Based on the last syllable of the current user phrase, a target phrase is retrieved from a preset phrase library, wherein the last syllable of the current user phrase and the first syllable of the target phrase have the same syllable.
[0113] When at least one target phrase exists in the preset phrase library, the next machine phrase corresponding to the current user phrase is determined from the target phrases.
[0114] If the target phrase does not exist in the preset phrase library, a first prompt will be displayed to the user.
[0115] The first prompt is used to inform the user that their answer is correct and they have won the idiom chain game.
[0116] refer to Figure 1h In some embodiments, the preset phrase library may include a mapping relationship between phrases and their first syllables, and a mapping relationship between phrases and their frequency proportions. The step of retrieving a target phrase from the preset phrase library based on the last syllable of the current user's phrase may include:
[0117] Retrieve the target syllable from the preset phrase library, wherein the target syllable is the same as the last syllable of the current user phrase;
[0118] Based on the mapping relationship between phrases and their first syllables in the preset phrase library, at least one candidate phrase corresponding to the target syllable is determined;
[0119] Based on the mapping relationship between the phrase and its frequency proportion, the frequency proportion of the first syllable of each candidate phrase is determined;
[0120] The target phrase is determined from the at least one candidate phrase based on the frequency ratio of the first syllable of the candidate phrase.
[0121] In some embodiments, the target phrase is the candidate phrase with the highest frequency of the first syllable.
[0122] 103. Show the user the next machine phrase.
[0123] In some embodiments, step 103 may include the following steps:
[0124] The next machine phrase is subjected to text-to-audio conversion processing to obtain the next machine speech;
[0125] Play the next machine voice message.
[0126] As can be seen from the above, the embodiments of the present invention can obtain the current user reply, which is the user's reply to the current machine phrase, and the current user reply contains the current user phrase; if the last character of the current machine phrase has the same syllable as the first character of the current user reply, then the next machine phrase corresponding to the current user phrase is determined, and the last character of the current user phrase has the same syllable as the first character of the next machine phrase; the next machine phrase is then displayed to the user. Therefore, this solution uses syllables as the primary key to build an index, which greatly optimizes the index size and improves performance compared to character-based indexing, thereby improving the efficiency of the human-computer interaction method.
[0127] The method described in the above embodiments will be further described in detail below.
[0128] This invention can be applied to intelligent dialogue products that use dialogue as a medium, such as smart speakers, WeChat chatbots, online voice interaction systems, and intelligent voice assistant devices, enabling chatbots to have the intelligent ability to play word chain games, such as... Figure 2a As shown, the chatbot reads idioms to the user. After the user replies, the chatbot reads the next idiom based on the user's reply, until the idiom chain ends or the user stops replying.
[0129] In this embodiment, a dialogue robot using homophone idiom chain will be used as an example to describe the method of the present invention in detail.
[0130] like Figure 2b As shown, this solution breaks down the idiom chain game function into a search database construction module, an idiom initiation module, a judgment module, and a response module:
[0131] 201. Search database construction module.
[0132] The idiom retrieval database constructed using this method is indexed with the first character's pinyin as the primary key. Compared to character-based indexing, this significantly optimizes the index size and improves performance. The following is an introduction to the database construction module:
[0133] This solution proposes to count the frequency of idioms based on external corpora, and generate responses for idiom solitaire based on the frequency as the probability distribution of the response idioms. The purpose of constructing the idiom dictionary retrieval library is to improve the retrieval speed. Taking the first-character pinyin as the primary key, an index is established. At the same time, the frequency of each idiom under the same primary key is counted based on external corpora, and this is used as the weight value of each idiom.
[0134] 202. Initiate the idiom module.
[0135] This solution can randomly select an idiom from the idiom retrieval library as the initiating idiom.
[0136] 203. Judgment module.
[0137] There are two criteria for judging correctness. One is to judge whether the response is an idiom, and the other is to judge whether the response can connect to the previous idiom. Therefore, as Figure 2c shown, in some embodiments, the judgment module can be divided into an idiom judgment sub-module 2031 and a connection judgment sub-module 2032.
[0138] (1) Idiom judgment sub-module 2031. <00003
[0145] As shown above, this solution enables the chatbot to play idiom chain games. By establishing an index based on syllables, the index size is greatly optimized compared to the character-based indexing method, thus improving performance and efficiency of human-computer interaction methods.
[0146] To better implement the above methods, embodiments of the present invention also provide a human-computer interaction device, which can be integrated into an electronic device, such as a terminal or server. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, personal computer, etc.; the server can be a single server or a server cluster composed of multiple servers.
[0147] For example, in this embodiment, the method of the present invention will be described in detail by taking the integration of the human-computer interaction device into XX as an example.
[0148] For example, such as Figure 3 As shown, the human-computer interaction device may include an acquisition unit 301, a machine phrase unit 302, and a display unit 303, as follows:
[0149] (a) Acquisition Unit 301.
[0150] The acquisition unit 301 can be used to acquire the current user reply, which is the reply made by the user to the current machine phrase, and the current user reply contains the current user phrase.
[0151] In some embodiments, the acquisition unit 301 may be used for:
[0152] Get random numbers;
[0153] The phrase corresponding to the random number in the preset phrase library is determined as the current machine phrase;
[0154] Get the current user's response to the current machine phrase.
[0155] In some embodiments, the preset phrase library may include a mapping relationship between phrases and their first syllables, and a mapping relationship between phrases and their frequency proportions. The interactive device may also include a construction unit, which may be used for:
[0156] Obtain a phrase set, which may include multiple phrases;
[0157] Identify all the first-syllable words in the phrase set, where the first-syllable word is the syllable of the first character in the phrase;
[0158] Determine the frequency percentage of each phrase, where the frequency percentage is the percentage of each phrase among all phrases in the phrase set;
[0159] Construct a mapping relationship between the phrase and its frequency percentage;
[0160] Construct a mapping relationship between each phrase and its first syllable.
[0161] In some embodiments, the acquisition unit 301 may be used for:
[0162] Obtain user voice;
[0163] The user's voice is processed into audio-to-text to obtain the current user's reply.
[0164] In some embodiments, the acquisition unit 301 may further include:
[0165] The fragment subunit can be used to determine phrase fragments in the current user's reply;
[0166] The user phrase subunit can be used to use the phrase fragment as the current user phrase when the phrase fragment exists in a preset phrase library;
[0167] The second prompt subunit can be used to display a second prompt to the user when the phrase fragment does not exist in the preset phrase library.
[0168] In some embodiments, the fragment subunit may be used for:
[0169] Determine the number of characters in the current user's reply;
[0170] If the number of characters exceeds the preset limit, then a phrase fragment is extracted from the current user's reply;
[0171] If the number of characters equals the preset quantity, then the current user's reply is treated as a phrase fragment.
[0172] In some embodiments, the interactive device may further include a second prompting unit, which may be used to:
[0173] If the last character of the current machine phrase does not have the same syllable as the first character of the current user reply, then a second prompt is displayed to the user.
[0174] (iii) Machine phrase unit 302.
[0175] The machine phrase unit 302 can be used to determine the next machine phrase corresponding to the current user phrase if the last character of the current machine phrase has the same syllable as the first character of the current user reply, wherein the last character of the current user phrase has the same syllable as the first character of the next machine phrase.
[0176] In some embodiments, the machine phrase unit 302 may include:
[0177] The final syllable subunit can be used to determine the final syllable of the current user phrase, where the final syllable is the syllable of the last character in the current user phrase;
[0178] The retrieval subunit can be used to retrieve a target phrase from a preset phrase library based on the last syllable of the current user phrase, wherein the last syllable of the current user phrase and the first syllable of the target phrase have the same syllable.
[0179] The next machine subunit can be used to determine the next machine phrase corresponding to the current user phrase in the target phrase when there is at least one target phrase in the preset phrase library;
[0180] The first prompt subunit can be used to display a first prompt to the user when the target phrase does not exist in the preset phrase library.
[0181] In some embodiments, the preset phrase library may include a mapping relationship between phrases and their first syllables, and a mapping relationship between phrases and their frequency proportions. The retrieval subunit may be used for:
[0182] Retrieve the target syllable from the preset phrase library, wherein the target syllable is the same as the last syllable of the current user phrase;
[0183] Based on the mapping relationship between phrases and their first syllables in the preset phrase library, at least one candidate phrase corresponding to the target syllable is determined;
[0184] Based on the mapping relationship between the phrase and its frequency proportion, the frequency proportion of the first syllable of each candidate phrase is determined;
[0185] The target phrase is determined from the at least one candidate phrase based on the frequency ratio of the first syllable of the candidate phrase.
[0186] In some embodiments, the target phrase is the candidate phrase with the highest frequency of the first syllable.
[0187] (iv) Display Unit 303.
[0188] The display unit 303 can be used to display the next machine phrase to the user.
[0189] In some embodiments, the display unit 303 may be used for:
[0190] The next machine phrase is subjected to text-to-audio conversion processing to obtain the next machine speech;
[0191] Play the next machine voice message.
[0192] In practice, each of the above units can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units, please refer to the previous method embodiments, which will not be repeated here.
[0193] As can be seen from the above, the human-computer interaction device of this embodiment obtains the current user reply by the acquisition unit. The current user reply is the user's reply to the current machine phrase, and the current user reply contains the current user phrase. If the last character of the current machine phrase has the same syllable as the first character of the current user reply, the machine phrase unit determines the next machine phrase corresponding to the current user phrase, and the last character of the current user phrase has the same syllable as the first character of the next machine phrase. The display unit displays the next machine phrase to the user. Therefore, this embodiment of the invention can improve the efficiency of the human-computer interaction method.
[0194] This invention also provides an electronic device, which can be a terminal, a server, or other similar devices. The terminal can be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, personal computer, etc.; the server can be a single server or a server cluster composed of multiple servers, etc.
[0195] In some embodiments, the human-computer interaction device can also be integrated into multiple electronic devices. For example, the human-computer interaction device can be integrated into multiple servers, and the human-computer interaction method of the present invention can be implemented by multiple servers. In some embodiments, the xx server and the xx server can also be implemented by a single server.
[0196] In this embodiment, the electronic device will be described in detail as a terminal, for example, such as... Figure 4 As shown, it illustrates a structural schematic diagram of the terminal involved in an embodiment of the present invention, specifically:
[0197] The terminal may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, an input module 404, and a communication module 405. Those skilled in the art will understand that... Figure 4The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0198] The processor 401 is the control center of the terminal, connecting various parts of the terminal through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 402, and by calling data stored in the memory 402, thereby providing overall monitoring of the terminal. In some embodiments, the processor 401 may include one or more processing cores; in some embodiments, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 401.
[0199] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0200] The terminal also includes a power supply 403 that supplies power to the various components. In some embodiments, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0201] The terminal may also include an input module 404, which can be used to receive input numeric or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0202] The terminal may also include a communication module 405. In some embodiments, the communication module 405 may include a wireless module, through which the terminal can perform short-range wireless transmission, thereby providing users with wireless broadband internet access. For example, the communication module 405 can be used to help users send and receive emails, browse web pages, and access streaming media.
[0203] Although not shown, the terminal may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the terminal loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402 to realize various functions, as follows:
[0204] Get the current user's reply, which is the user's reply to the current machine phrase, and the current user's reply contains the current user phrase;
[0205] If the last character of the current machine phrase has the same syllable as the first character of the current user's reply, then determine the next machine phrase corresponding to the current user phrase, where the last character of the current user phrase has the same syllable as the first character of the next machine phrase.
[0206] The next machine phrase is then displayed to the user. Specific implementation details for each of the above operations can be found in the preceding embodiments and will not be repeated here.
[0207] As can be seen from the above, this solution can improve the efficiency of human-computer interaction methods.
[0208] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0209] To this end, embodiments of the present invention provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the human-computer interaction methods provided in the embodiments of the present invention. For example, the instructions can execute the following steps:
[0210] Get the current user reply, which is the user's reply to the current machine phrase, and the current user phrase contained in the current user reply;
[0211] If the last character of the current machine phrase has the same syllable as the first character of the current user's reply, then determine the next machine phrase corresponding to the current user phrase, where the last character of the current user phrase has the same syllable as the first character of the next machine phrase.
[0212] The next machine phrase is displayed to the user. This storage medium may include: read-only memory (ROM), random access memory (RAM), a disk, or an optical disk, etc.
[0213] Since the instructions stored in the storage medium can execute the steps of any of the human-computer interaction methods provided in the embodiments of the present invention, the beneficial effects that any of the human-computer interaction methods provided in the embodiments of the present invention can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.
[0214] The foregoing has provided a detailed description of a human-computer interaction method, apparatus, terminal, and computer-readable storage medium provided by embodiments of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A human-computer interaction method, characterized in that, include: Get the current user's reply, which is the user's reply to the current machine phrase, and the current user's reply contains the current user phrase; Determine the last syllable of the current user phrase, where the last syllable is the syllable of the last character in the current user phrase; The target syllable is retrieved from the preset phrase library. The target syllable is the same as the last syllable of the current user's phrase. The preset phrase library includes the mapping relationship between the phrase and its first syllable, and the mapping relationship between the phrase and its frequency ratio. The frequency ratio of the phrase refers to the word frequency of each idiom with the same first syllable, which is obtained based on the statistics of the phrase set. Based on the mapping relationship between phrases and their first syllables in the preset phrase library, at least one candidate phrase corresponding to the target syllable is determined; Based on the mapping relationship between the phrase and its frequency proportion, the frequency proportion of the first syllable of each candidate phrase is determined; Based on the frequency proportion of the first syllable of the candidate phrases, a target phrase is determined among the at least one candidate phrases, and the target phrase is the candidate phrase with the highest frequency proportion of the first syllable. When at least one target phrase exists in the preset phrase library, the next machine phrase corresponding to the current user phrase is determined from the target phrases. Show the user the next machine phrase; When the target phrase is not found in the preset phrase library, a first prompt is displayed to the user.
2. The human-computer interaction method as described in claim 1, characterized in that, The step of obtaining the current user's reply also includes: Identify phrase fragments in the current user's reply; If the phrase fragment exists in the preset phrase library, then the phrase fragment is used as the current user phrase; If the phrase fragment does not exist in the preset phrase library, a second prompt is displayed to the user.
3. The human-computer interaction method as described in claim 2, characterized in that, The step of determining the phrase fragment in the current user's reply includes: Determine the number of characters in the current user's reply; If the number of characters exceeds the preset limit, then a phrase fragment is extracted from the current user's reply; If the number of characters equals the preset quantity, then the current user's reply is treated as a phrase fragment.
4. The human-computer interaction method as described in claim 1, characterized in that, Also includes: If the last character of the current machine phrase does not have the same syllable as the first character of the current user reply, then a second prompt is displayed to the user.
5. The human-computer interaction method as described in claim 1, characterized in that, The step of obtaining the current user's reply includes: Get random numbers; The phrase corresponding to the random number in the preset phrase library is determined as the current machine phrase; Get the current user's response to the current machine phrase.
6. The human-computer interaction method as described in any one of claims 2 to 3 or 5, characterized in that, The preset phrase library includes the mapping relationship between phrases and their first syllables, and the mapping relationship between phrases and their frequency proportions, and also includes: Obtain a phrase set, which includes multiple phrases; Identify all the first-syllable words in the phrase set, where the first-syllable word is the syllable of the first character in the phrase; Determine the frequency percentage of each phrase, where the frequency percentage is the percentage of each phrase among all phrases in the phrase set; Construct a mapping relationship between the phrase and its frequency percentage; Construct a mapping relationship between each phrase and its first syllable.
7. The human-computer interaction method as described in claim 1, characterized in that, The step of obtaining the current user's reply includes: Obtain user voice; The user's voice is processed into audio-to-text to obtain the current user's reply.
8. The human-computer interaction method as described in claim 1, characterized in that, The process of showing the user the next machine phrase includes: The next machine phrase is subjected to text-to-audio conversion processing to obtain the next machine speech; Play the next machine voice message.
9. A human-computer interaction device, characterized in that, include: The acquisition unit is used to acquire the current user reply, which is the user's reply to the current machine phrase, and the current user reply contains the current user phrase; The final syllable subunit can be used to determine the final syllable of the current user phrase, where the final syllable is the syllable of the last character in the current user phrase; The retrieval subunit can be used to retrieve target syllables in a preset phrase library, wherein the target syllable is the same as the last syllable of the current user's phrase; the preset phrase library includes the mapping relationship between phrases and their first syllables, and the mapping relationship between phrases and their frequency proportions, wherein the frequency proportion of phrases refers to the word frequency of each idiom with the same first syllable obtained based on the statistics of the phrase set; Based on the mapping relationship between phrases and their first syllables in the preset phrase library, at least one candidate phrase corresponding to the target syllable is determined; Based on the mapping relationship between the phrase and its frequency proportion, the frequency proportion of the first syllable of each candidate phrase is determined; Based on the frequency proportion of the first syllable of the candidate phrases, a target phrase is determined among the at least one candidate phrases, and the target phrase is the candidate phrase with the highest frequency proportion of the first syllable. The next machine subunit can be used to determine the next machine phrase corresponding to the current user phrase from the target phrases when there is at least one target phrase in the preset phrase library; The display unit is used to show the user the next machine phrase; The first prompt subunit can be used to display a first prompt to the user when the target phrase does not exist in the preset phrase library.
10. A terminal, characterized in that, The method includes a processor and a memory, the memory storing multiple instructions; the processor loads instructions from the memory to perform the steps in the human-computer interaction method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the human-computer interaction method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by the processor, they implement the steps of the human-computer interaction method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Processing method and device
CN106951091A