A method, apparatus and electronic device for generating a reply message
By generating speech templates and filling word slots with user-historical entity words, the problem of significant discrepancies between response information and user language habits in task-oriented dialogue systems is solved, thus improving the user experience.
Patent Information
- Application Number
- CN202310325386.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-03-29
AI Technical Summary
In task-oriented dialogue systems, existing technologies generate responses that differ significantly from users' language habits, resulting in a poor user experience.
By acquiring semantic information from user accounts, a speech template is generated, and a reply template is selected based on sentence similarity. The reply information is generated by filling word slots with the user's historical entity words.
It improves the alignment of response messages with users' language habits, reduces the discrepancy between generated response messages and user statements, and enhances the user experience.
Smart Images

Figure CN118733719B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of voice interaction technology, and in particular to a method, apparatus and electronic device for generating response information. Background Technology
[0002] In task-oriented dialogue systems, natural language generation requires generating response information based on the current dialogue state. This process generally consists of two steps: template decision-making and slot filling. Traditional template decision-making involves randomly selecting a template after determining the response template set, and then using normalized values to fill the slots in the response template.
[0003] Because the generated response does not take into account the user's language habits, there is a significant difference between the generated response and the user's actual speech, resulting in a poor user experience. Summary of the Invention
[0004] To address the aforementioned technical problems, this disclosure provides a method, apparatus, and electronic device for generating response information.
[0005] To achieve the above objectives, the present disclosure adopts the following technical solution:
[0006] Firstly, this disclosure provides a method for generating response information, comprising: obtaining at least one response template corresponding to semantic information sent by a user account; using the word segmentation positions corresponding to actual entity words in the semantic information as slots to generate a speech template corresponding to the semantic information; selecting a response template whose sentence similarity meets preset conditions as a response template based on the sentence similarity between the speech template and each response template; filtering historical entity words that match the actual entity words contained in the semantic information from the historical entity words of the user account; and filling the slots of the response template with the matching historical entity words to generate response information.
[0007] In some feasible examples, the word segmentation positions corresponding to the actual entity words in the semantic information are used as slots to generate the speech template corresponding to the semantic information, including: obtaining the actual entity words belonging to the target title in the semantic information; using the word segmentation positions of the actual entity words belonging to the target title in the semantic information as slots to obtain the speech template corresponding to the semantic information.
[0008] In some feasible examples, before selecting a response template whose sentence similarity meets preset conditions as the reply template based on the sentence similarity between the speaking template and each response template, the method for generating reply information provided in this disclosure further includes: performing the following operations for each reply template: obtaining the text similarity between the speaking template and the reply template; and using the text similarity as the sentence similarity between the speaking template and the reply template.
[0009] In some feasible examples, based on the sentence similarity between the speaking template and each response template, a response template whose sentence similarity meets a preset condition is selected as the reply template. This includes: when the total number of response templates whose sentence similarity meets the preset condition is greater than or equal to 2, a reply template is randomly selected from the response templates whose sentence similarity meets the preset condition as the reply template.
[0010] In some feasible examples, based on the sentence similarity between the speaking template and each response template, the response template that meets the preset conditions is selected as the reply template. This includes: when the total number of response templates that meet the preset conditions is greater than or equal to 2, the response template with the highest historical adoption rate among the response templates that meet the preset conditions is selected as the reply template.
[0011] In some feasible examples, the preset conditions include sentence similarity being greater than or equal to a similarity threshold.
[0012] In some feasible examples, filtering historical entity words from the user account's historical entity words that match the actual entity words contained in the semantic information includes: obtaining the actual entity words belonging to the target title in the semantic information; wherein, a target title contains one or more theoretical entity words; and, based on the statistical probability of historical entity words that are the same as theoretical entity words, selecting the historical entity word with the highest statistical probability as the historical entity word that matches the actual entity word contained in the semantic information.
[0013] Secondly, this disclosure provides a device for generating reply information, comprising: an acquisition unit, configured to acquire at least one reply template corresponding to semantic information sent by a user account; a processing unit, configured to use the word segmentation positions corresponding to actual entity words in the semantic information acquired by the acquisition unit as slots to generate a speech template corresponding to the semantic information; the processing unit is further configured to select a reply template whose sentence similarity meets preset conditions as a reply template based on the sentence similarity between the speech template and each reply template; the processing unit is further configured to filter historical entity words in the user account that match the actual entity words contained in the semantic information acquired by the acquisition unit; and the processing unit is further configured to fill the slots of the reply template with the matching historical entity words to generate reply information.
[0014] In some feasible examples, the acquisition unit is specifically used to acquire the actual entity words belonging to the target title in the semantic information; the processing unit is specifically used to take the word segmentation position of the actual entity words belonging to the target title in the semantic information acquired by the acquisition unit as word slots to obtain the speech template corresponding to the semantic information.
[0015] In some feasible examples, for each response template, the following operations are performed: an acquisition unit is also used to acquire the text similarity between the speech template and the response template; a processing unit is also used to use the text similarity acquired by the acquisition unit as the sentence similarity between the speech template and the response template.
[0016] In some feasible examples, the processing unit is specifically used to determine, based on the sentence similarity between the speaking template and each response template, that when the total number of response templates whose sentence similarity meets the preset condition is greater than or equal to 2, randomly select one response template from the response templates whose sentence similarity meets the preset condition as the reply template.
[0017] In some feasible examples, the processing unit is specifically used to determine, based on the sentence similarity between the speaking template and each response template, that when the total number of response templates whose sentence similarity meets the preset conditions is greater than or equal to 2, use the response template with the highest historical adoption rate among the response templates whose sentence similarity meets the preset conditions as the reply template.
[0018] In some feasible examples, the preset conditions include sentence similarity being greater than or equal to a similarity threshold.
[0019] In some feasible examples, the acquisition unit is specifically used to acquire the actual entity words belonging to the target title in the semantic information; wherein, a target title contains one or more theoretical entity words; the processing unit is specifically used to select the historical entity word with the highest statistical probability as the historical entity word that matches the actual entity word contained in the semantic information, based on the statistical probability of the historical entity words that are the same as the theoretical entity words.
[0020] Thirdly, this disclosure provides an electronic device, including: a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to cause the electronic device to implement the method for generating response information as provided in the first aspect above when executing the computer program.
[0021] Fourthly, this disclosure provides a computer-readable storage medium, comprising: a computer program stored on the computer-readable storage medium, wherein when the computer program is executed by a computing device, the computing device implements the method for generating response information as provided in the first aspect above.
[0022] Fourthly, this disclosure provides a vehicle including a device for generating response information as provided in any of the second aspects above.
[0023] In this disclosure, the name of the aforementioned response information generation device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear under other names. As long as the function of each device or functional module is similar to that of this disclosure, it falls within the scope of the claims of this disclosure and its equivalents.
[0024] These or other aspects of this disclosure will become more readily apparent in the following description.
[0025] The technical solution provided in this disclosure has the following advantages compared with the prior art:
[0026] By rewriting semantic information into a speech template, the sentence structure similarity between the speech template and at least one corresponding response template can be obtained. Based on this similarity, response templates that meet preset conditions can be selected as reply templates, ensuring that the reply templates better match the user's language habits. Simultaneously, by filtering the actual entity words contained in the semantic information from the user's historical entity words, at least one matching historical entity word is obtained. This ensures that the target entity words filling the word slots in the reply template are more in line with the user's speech and language habits. Therefore, the generated reply information incorporates the user's language habits, reducing the discrepancy between the generated reply information and the user's spoken words, and improving the user experience. This solves the problem in existing technologies where the lack of integration with user language habits leads to significant discrepancies between the generated reply information and the user's spoken words, resulting in a poor user experience. Attached Figure Description
[0027] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0028] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is one of the flowcharts illustrating the method for generating response information provided in this embodiment of the disclosure;
[0030] Figure 2 A second schematic flowchart illustrating the method for generating response information provided in this embodiment of the disclosure;
[0031] Figure 3 The third flowchart illustrates the method for generating response information provided in this embodiment of the disclosure;
[0032] Figure 4 A fourth schematic flowchart illustrating the method for generating response information provided in this embodiment of the disclosure;
[0033] Figure 5 Fifth flowchart illustrating the method for generating response information provided in this embodiment of the disclosure;
[0034] Figure 6 A flowchart illustrating the method for generating response information provided in this embodiment of the present disclosure is shown in Figure 6.
[0035] Figure 7 A schematic diagram of the structure of the response information generation device provided in the embodiments of this disclosure;
[0036] Figure 8 This is a schematic diagram of the structure of the vehicle-mounted terminal provided in an embodiment of this disclosure;
[0037] Figure 9 A schematic diagram of the structure of a computer program product provided in an embodiment of this disclosure. Detailed Implementation
[0038] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0039] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0040] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0041] The semantic information, historical entities, actual entities, and theoretical entities involved in this disclosure may be data authorized by the user or fully authorized by all parties.
[0042] The execution entity of the mode switching method in this application embodiment is a response information generation device. This response information generation device can be located in an in-vehicle terminal or other devices; this embodiment does not limit its location. When the response information generation device is located in an in-vehicle terminal, the mode switching method provided in this disclosure embodiment can be executed through the vehicle's controller.
[0043] For example, taking a vehicle-mounted terminal as the executing entity for the method of generating response information provided in this embodiment of the disclosure, the method of generating response information provided in this embodiment of the disclosure will be described.
[0044] like Figure 1 As shown, the method for generating response information provided in this embodiment includes the following steps S11-S15:
[0045] S11. Obtain at least one reply template corresponding to the semantic information sent by the user account.
[0046] In some examples, users can control the in-vehicle terminal via voice interaction while riding in the vehicle, such as playing music or movies. Typically, when using the in-vehicle terminal, the user will be prompted to log in to their account. If the user has already registered an account, they can log in to the terminal for better use. Alternatively, if the user has not registered an account, the account can be the terminal's device identifier or a unique physical address.
[0047] In some examples, the in-vehicle terminal recognizes the voice information sent by the user to obtain the corresponding speech text. Then, Natural Language Understanding (NLU) is used to recognize the speech text and determine the user's intent. Next, Dialogue Management (DM) searches a database for a matching response template based on the user's intent. For example, based on the user's intent, it queries a first data table to obtain at least one response template; the first data table includes the correspondence between user intents and response templates. In this way, at least one response template corresponding to the semantic information can be obtained.
[0048] S12. Use the word segmentation positions corresponding to the actual entity words in the semantic information as word slots to generate the speech template corresponding to the semantic information.
[0049] In some examples, the semantic information contains one or more actual entity words. To differentiate user intent, the response information generation method provided in this disclosure pre-configures different first correspondences between target titles and theoretical entity words. This allows querying the first correspondence to determine the actual entity word belonging to the target title. Then, the word segmentation position of the actual entity word belonging to the target title in the semantic information is used as a slot to obtain the corresponding speech template. For example, if the semantic information is "I want to watch ***", then by querying the first correspondence, it is determined that "***" belongs to the target title (e.g., a movie title). Then, the word segmentation position of "***" is used as a slot to obtain the speech template "I want to watch ${videoTitle}" corresponding to "I want to watch ***".
[0050] In some examples, semantic information can be input into the rewriting model to obtain the speech template corresponding to the semantic information.
[0051] The training process of the rewritten model is as follows:
[0052] Obtain training sample data and the labeling results of the training sample data. The training sample data includes at least one piece of historical semantic information, and the labeling results include the historical speech templates corresponding to the historical semantic information.
[0053] The training sample data is input into the neural network model for training, and the prediction result of the neural network model on the training sample data is obtained.
[0054] Based on the prediction and labeling results, the network parameters of the neural network model are adjusted until the neural network model converges, resulting in the rewritten model.
[0055] S13. Based on the sentence similarity between the speaking template and each reply template, select the reply template whose sentence similarity meets the preset conditions as the reply template.
[0056] In some examples, the text similarity between the utterance template and the response template can be obtained; this text similarity is then used as the sentence structure similarity between the utterance template and the response template. For instance, a BERT (Bidirectional Encoder Representation from Transformers) model can be used to determine the sentence structure similarity between the utterance template and each response template. Alternatively, the utterance template and the response template can be transformed into utterance vectors and response vectors, respectively. Then, the target distance between the utterance vector and the response vector is used as the text similarity between the utterance template and the response template. The target distance includes either cosine distance or Euclidean distance.
[0057] S14. Filter historical entity words in the user account's historical entity words that match the actual entity words contained in the semantic information.
[0058] In some examples, to make the response information more in line with the user's language habits, the response information generation method provided in this disclosure provides a method for obtaining user preference information by statistically analyzing the historical entity words of the user's account. Then, by analyzing the target title to which the actual entity words contained in the semantic information belong, at least one theoretical entity word corresponding to the target title can be obtained. Next, based on the theoretical entity word, historical entity words that are identical to the theoretical entity word can be identified. Finally, based on the statistical probability of historical entity words that are identical to the theoretical entity word, the historical entity word with the highest statistical probability is determined as the historical entity word that matches the actual entity word contained in the semantic information.
[0059] For example, suppose a user account's historical entity words include historical entity word 1, historical entity word 2, and historical entity word 3. The actual entity word contained in the semantic information is actual entity word 1. Through analysis, the target title corresponding to actual entity word 1 is determined to be target title 1. Target title 1 includes theoretical entity word 1, theoretical entity word 2, theoretical entity word 3, and theoretical entity word 4. Then, it is determined that theoretical entity word 2 is the same as historical entity word 2, and historical entity word 3 is the same as theoretical entity word 4. Next, based on the statistical probabilities of historical entity word 2 and theoretical entity word 4, if the statistical probability of historical entity word 2 is greater than that of theoretical entity word 4, historical entity word 2 is selected as the target entity word.
[0060] For example, suppose a user account's historical entity words include historical entity word 1, historical entity word 2, and historical entity word 3. The semantic information contains actual entity words 1 and 2. Through analysis, the target title corresponding to actual entity word 1 is determined to be target title 1, and the target title corresponding to actual entity word 2 is determined to be target title 2. Target title 1 includes theoretical entity words 1, 2, 3, and 4, and target title 2 includes theoretical entity words 5, 6, and 7. Then, target title 1 and target title 2 are analyzed separately, determining that theoretical entity word 2 is the same as historical entity word 2, and historical entity word 3 is the same as theoretical entity word 4. Next, based on the statistical probabilities of historical entity word 2 and theoretical entity word 4, if the statistical probability of historical entity word 2 is greater than that of theoretical entity word 4, historical entity word 2 is taken as target entity word 1. Similarly, it is determined that theoretical entity word 5 is the same as historical entity word 1, and historical entity word 6 is the same as theoretical entity word 3. Subsequently, based on the statistical probability of historical entity word 1 and the statistical probability of theoretical entity word 3, when it is determined that the statistical probability of historical entity word 3 is greater than that of theoretical entity word 1, historical entity word 3 is taken as target entity word 2.
[0061] Specifically, the statistical probability is equal to the ratio of the total number of times the same historical entity term appears to the total number of times all historical entity terms of the user account appear.
[0062] S15. Fill the slots in the reply template with the matching historical entity words to generate reply information.
[0063] In some examples, the target entity word includes any matching historical entity word. When the target entity word contains only one, it can be directly populated into the word slot of the response template to generate the response information.
[0064] In some examples, the target entity word includes any matching historical entity word. When the target entity word contains only two or more, it is necessary to fill the word slots in the response template sequentially according to the word segmentation position of the actual entity word corresponding to the target entity word in the semantic information to generate the response information.
[0065] For example, if there are two target entity words, namely target entity word 1 and target entity word 2, the segmentation position of the actual entity word 1 corresponding to target entity word 1 in the semantic information is segmentation position 1, and the segmentation position of the actual entity word 2 corresponding to target entity word 2 in the semantic information is segmentation position 2. Since the order of segmentation position 1 is later than the order of segmentation position 2, it is necessary to fill target entity word 2 into slot 1 of the response template, and then fill target entity word 1 into slot 2 of the response template to generate response information.
[0066] As described above, the method for generating response information provided in this embodiment rewrites semantic information into a speech template, thereby obtaining the sentence similarity between the speech template and at least one response template corresponding to the semantic information. Based on this sentence similarity, response templates that meet preset conditions can be selected as response templates, ensuring that the response templates better match the user's language habits. Simultaneously, at least one target entity word is determined through the user's historical entity words and the actual entity words contained in the semantic information. Since the target entity word includes any historical entity word, this ensures that the target entity words filling the word slots in the response template better match the user's speech and language habits. Therefore, the generated response information can incorporate the user's language habits, reducing the difference between the generated response information and the user's speech, and ensuring a better user experience. This solves the problem in the prior art where the generated response information differs significantly from the user's speech due to a lack of consideration for the user's language habits, resulting in a poor user experience.
[0067] In some feasible examples, combining Figure 1 ,like Figure 2 As shown, the above S12 can be implemented by the following S120 and S121.
[0068] S120. Obtain the actual entity words belonging to the target title from the semantic information.
[0069] S121. Take the word segmentation position of the actual entity word belonging to the target title in the semantic information as the word slot to obtain the speech template corresponding to the semantic information.
[0070] In some feasible examples, combining Figure 1 ,like Figure 3 As shown in the embodiments of this disclosure, the method for generating response information further includes S16.
[0071] S16. For each response template, perform the following operations: obtain the text similarity between the statement template and the response template; use the text similarity as the sentence structure similarity between the statement template and the response template.
[0072] In some feasible examples, combining Figure 1 ,like Figure 4 As shown, the above S13 can be implemented by the following S130.
[0073] S130. Based on the sentence similarity between the speaking template and each reply template, when the total number of reply templates whose sentence similarity meets the preset conditions is greater than or equal to 2, randomly select one reply template from the reply templates whose sentence similarity meets the preset conditions as the reply template.
[0074] In some examples, when the total number of response templates whose sentence similarity meets the preset conditions is 1, based on the sentence similarity between the speaking template and each response template, the response template is used as the reply template.
[0075] In some feasible examples, combining Figure 1 ,like Figure 5 As shown, the above S13 can be implemented in the following S131.
[0076] S131. Based on the sentence similarity between the speaking template and each reply template, when the total number of reply templates whose sentence similarity meets the preset conditions is greater than or equal to 2, the reply template with the highest historical adoption rate among the reply templates whose sentence similarity meets the preset conditions is taken as the reply template.
[0077] In some feasible examples, the preset conditions include sentence similarity being greater than or equal to a similarity threshold.
[0078] In some feasible examples, combining Figure 1 ,like Figure 6 As shown, the above S14 can be implemented by the following S140 and S141.
[0079] S140. Obtain the actual entity words belonging to the target title from the semantic information. A target title contains one or more theoretical entity words.
[0080] S141. Based on the statistical probability of historical entity words that are the same as theoretical entity words, the historical entity word with the highest statistical probability is taken as the historical entity word that matches the actual entity word contained in the semantic information.
[0081] The foregoing primarily describes the solutions provided by the embodiments of this disclosure from a methodological perspective. To achieve the aforementioned functions, it includes corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this disclosure can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0082] This embodiment of the disclosure can divide the response information generation device into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this embodiment of the disclosure is illustrative and is only a logical functional division. In actual implementation, there may be other division methods.
[0083] like Figure 7 The diagram shown is a structural schematic of a response information generation device 10 provided in an embodiment of this disclosure. It includes an acquisition unit 101 and a processing unit 102.
[0084] The acquisition unit 101 is used to acquire at least one reply template corresponding to the semantic information sent by the user account; the processing unit 102 is used to take the word segmentation position corresponding to the actual entity word in the semantic information acquired by the acquisition unit 101 as the word slot and generate the speech template corresponding to the semantic information; the processing unit 102 is also used to select the reply template whose sentence similarity meets the preset condition as the reply template based on the sentence similarity between the speech template and each reply template; the processing unit 102 is also used to filter historical entity words in the user account that match the actual entity words contained in the semantic information acquired by the acquisition unit; the processing unit 102 is also used to fill the word slot of the reply template with the matching historical entity words and generate reply information.
[0085] In some feasible examples, the acquisition unit 101 is specifically used to acquire the actual entity words belonging to the target title in the semantic information; the processing unit 102 is specifically used to take the word segmentation position of the actual entity words belonging to the target title in the semantic information acquired by the acquisition unit 101 as word slots to obtain the speech template corresponding to the semantic information.
[0086] In some feasible examples, the following operations are performed for each response template: the acquisition unit 101 is further configured to acquire the text similarity between the speech template and the response template; the processing unit 102 is further configured to use the text similarity acquired by the acquisition unit 101 as the sentence similarity between the speech template and the response template.
[0087] In some feasible examples, the processing unit 102 is specifically used to determine, based on the sentence similarity between the speaking template and each reply template, that when the total number of reply templates whose sentence similarity meets the preset conditions is greater than or equal to 2, randomly select one reply template from the reply templates whose sentence similarity meets the preset conditions as the reply template.
[0088] In some feasible examples, the processing unit 102 is specifically used to determine, based on the sentence similarity between the speaking template and each reply template, that when the total number of reply templates whose sentence similarity meets the preset conditions is greater than or equal to 2, the reply template with the highest historical adoption rate among the reply templates whose sentence similarity meets the preset conditions is used as the reply template.
[0089] In some feasible examples, the preset conditions include sentence similarity being greater than or equal to a similarity threshold.
[0090] In some implementable examples, the acquisition unit 101 is specifically used to acquire the actual entity words belonging to the target title in the semantic information; wherein, a target title contains one or more theoretical entity words; the processing unit 102 is specifically used to select the historical entity word with the highest statistical probability as the historical entity word that matches the actual entity word contained in the semantic information based on the statistical probability of the historical entity words that are the same as the theoretical entity words.
[0091] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and their functions will not be repeated here.
[0092] Of course, the response information generation apparatus 10 provided in this embodiment includes, but is not limited to, the modules described above. For example, the response information generation apparatus 10 may also include a storage unit 103. The storage unit 103 may be used to store the program code of the response information generation apparatus 10, and may also be used to store data generated by the response information generation apparatus 10 during operation, such as data in a write request.
[0093] Figure 8This is a schematic diagram of the structure of a vehicle-mounted terminal provided in an embodiment of this disclosure, as shown below. Figure 8 As shown, the vehicle terminal may include at least one processor 51, a memory 52, a communication interface 53, and a communication bus 54.
[0094] The following is combined with Figure 8 A detailed introduction to each component of the vehicle-mounted terminal:
[0095] The processor 51 is the control center of the electronic device 10. It can be a single processor or a collective term for multiple processing elements. For example, the processor 51 can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this disclosure, such as one or more DSPs, or one or more field-programmable gate arrays (FPGAs).
[0096] In a specific implementation, as one example, processor 51 may include one or more CPUs, for example... Figure 8 CPU0 and CPU1 are shown in the diagram. Furthermore, as one embodiment, the electronic device may include multiple processors, such as... Figure 8 The processors 51 and 55 are shown. Each of these processors can be a single-core processor or a multi-core processor. A processor here can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0097] The memory 52 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or it may be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto. The memory 52 may exist independently and be connected to the processor 51 via a communication bus 54. The memory 52 may also be integrated with the processor 51.
[0098] In a specific implementation, memory 52 is used to store data disclosed herein and execute software programs disclosed herein. Processor 51 can perform various functions of the air conditioner by running or executing software programs stored in memory 52 and by calling data stored in memory 52.
[0099] Communication interface 53, using any transceiver-like device, is used to communicate with other devices or communication networks, such as Radio Access Network (RAN), Wireless Local Area Networks (WLAN), terminals, and the cloud. Communication interface 53 may include an acquisition unit to implement acquisition functions.
[0100] The communication bus 54 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0101] As an example, combined Figure 7The function implemented by the acquisition unit 101 in the response information generation device 10 is the same as... Figure 8 The communication interface 53 in the device has the same function, and the processing unit 102 in the reply information generation device 10 performs the same function. Figure 8 The processor 51 in the device has the same function as the storage unit 103 in the response information generation device 10, and the storage unit 103 in the response information generation device 10 has the same function as the processor 51 in the device 51. Figure 8 The memory 52 in it has the same function.
[0102] Another embodiment of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a computing device, causes the computing device to perform the mode switching method shown in the above-described method embodiments.
[0103] In some embodiments, the disclosed method may be implemented as computer program instructions encoded in a machine-readable format on a computer-readable storage medium or on other non-transitory media or articles of art.
[0104] Figure 9 A conceptual partial view of a computer program product provided in an embodiment of the present disclosure is shown schematically. The computer program product includes a computer program for executing computer processes on a computing device.
[0105] In one embodiment, a computer program product is provided using a signal bearer medium 410. The signal bearer medium 410 may include one or more program instructions that, when executed by one or more processors, can provide the above-mentioned... Figure 1 The described function or part of the function. Therefore, for example, refer to... Figure 1 In the embodiment shown, one or more features of S11-S15 can be provided by one or more instructions associated with the signal carrying medium 410. Furthermore, Figure 9 The program instructions in the document also describe example instructions.
[0106] In some examples, the signal carrying medium 410 may include a computer-readable medium 411, such as, but not limited to, a hard disk drive, a compact disc (CD), a digital video disc (DVD), a digital magnetic tape, a memory, a read-only memory (ROM), or a random access memory (RAM), etc.
[0107] In some implementations, the signal carrying medium 410 may include a computer recordable medium 412, such as, but not limited to, a memory, a read / write (R / W) CD, a R / W DVD, and so on.
[0108] In some implementations, the signal carrying medium 410 may include a communication medium 413, such as, but not limited to, digital and / or analog communication media (e.g., fiber optic cables, waveguides, wired communication links, wireless communication links, etc.).
[0109] The signal-bearing medium 410 can be transmitted by a wireless communication medium 413 (e.g., a wireless communication medium conforming to the IEEE 802.41 standard or other transmission protocols). One or more program instructions can be, for example, device-executable instructions or logic implementation instructions.
[0110] In some examples, such as targeting Figure 7 The described response information generation device 10 can be configured to provide various operations, functions, or actions in response to one or more program instructions in a computer-readable medium 411, a computer-recordable medium 412, and / or a communication medium 413.
[0111] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0112] In the several embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0113] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0114] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0115] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this disclosure, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0116] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating response information, characterized in that, include: Obtain at least one response template corresponding to the semantic information sent by the user account; Using the word segmentation positions corresponding to the actual entity words in the semantic information as word slots, a speech template corresponding to the semantic information is generated. Based on the sentence similarity between the speaking template and each of the reply templates, the reply template whose sentence similarity meets the preset conditions is selected as the response template; Filter historical entity words from the user account's historical entity words that match the actual entity words contained in the semantic information; The matching historical entity words are filled into the word slots of the reply template to generate reply information; The step of using the word segmentation positions corresponding to the actual entity words in the semantic information as slots to generate the speech template corresponding to the semantic information includes: Obtain the actual entity words belonging to the target title from the semantic information; The word segmentation positions of the actual entity words belonging to the target title in the semantic information are used as word slots to obtain the speech template corresponding to the semantic information; The step of filtering historical entity words from the user account's historical entity words that match the actual entity words contained in the semantic information includes: Obtain the actual entity words belonging to the target title from the semantic information; wherein, a target title contains one or more theoretical entity words; Based on the statistical probability of historical entities that are the same as the theoretical entity words, the historical entity words with the highest statistical probability are selected as the historical entity words that match the actual entity words contained in the semantic information.
2. The generation method according to claim 1, characterized in that, Before selecting a response template whose sentence similarity meets a preset condition as the reply template based on the sentence similarity between the spoken template and each of the response templates, the method further includes: For each response template, perform the following operations: Obtain the text similarity between the speech template and the response template; use the text similarity as the sentence structure similarity between the speech template and the response template.
3. The generation method according to claim 1, characterized in that, Based on the sentence structure similarity between the spoken template and each of the response templates, response templates whose sentence structure similarity meets preset conditions are selected as reply templates, including: Based on the sentence similarity between the speaking template and each of the reply templates, when the total number of reply templates whose sentence similarity meets the preset condition is greater than or equal to 2, a reply template is randomly selected from the reply templates whose sentence similarity meets the preset condition as the reply template.
4. The generation method according to claim 1, characterized in that, Based on the sentence structure similarity between the spoken template and each of the response templates, response templates whose sentence structure similarity meets preset conditions are selected as reply templates, including: Based on the sentence similarity between the speaking template and each of the reply templates, when the total number of reply templates whose sentence similarity meets the preset condition is greater than or equal to 2, the reply template with the highest historical adoption rate among the reply templates whose sentence similarity meets the preset condition is taken as the reply template.
5. The generation method according to claim 1, characterized in that, The preset conditions include a sentence similarity greater than or equal to a similarity threshold.
6. A device for generating response information, characterized in that, include: The acquisition unit is used to acquire at least one response template corresponding to the semantic information sent by the user account; The processing unit is used to take the word segmentation position corresponding to the actual entity word in the semantic information obtained by the acquisition unit as the word slot and generate the speech template corresponding to the semantic information. The processing unit is further configured to select a response template whose sentence similarity satisfies a preset condition as a reply template based on the sentence similarity between the speaking template and each of the response templates; The processing unit is further configured to filter historical entity words in the user account that match the actual entity words contained in the semantic information obtained by the acquisition unit; The processing unit is also used to fill the word slots of the reply template with the matching historical entity words to generate reply information; Specifically, when the processing unit generates a speech template corresponding to the semantic information by using the word segmentation positions corresponding to the actual entity words in the semantic information as word slots, it is further configured to: Obtain the actual entity words belonging to the target title from the semantic information; The word segmentation positions of the actual entity words belonging to the target title in the semantic information are used as word slots to obtain the speech template corresponding to the semantic information; When the processing unit performs the task of filtering historical entity words in the user account's historical entity words that match the actual entity words contained in the semantic information, it is further configured to: Obtain the actual entity words belonging to the target title from the semantic information; wherein, a target title contains one or more theoretical entity words; Based on the statistical probability of historical entities that are the same as the theoretical entity words, the historical entity words with the highest statistical probability are selected as the historical entity words that match the actual entity words contained in the semantic information.
7. An electronic device, characterized in that, include: A memory and a processor, the memory being used to store a computer program; the processor being used, when executing the computer program, to cause the electronic device to implement the method for generating response information according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, include: The computer-readable storage medium stores a computer program that, when executed by a computing device, causes the computing device to implement the method for generating response information according to any one of claims 1-5.
9. A vehicle comprising the response information generation device as described in claim 6.
Citation Information
Patent Citations
Man-machine conversation method, device and system
CN110659360A
Online equipment fault diagnosis platform of mobile terminal based on knowledge graph
CN110765277A
