Method and device for generating reply information and electronic equipment
By generating utterance templates and filling in the user's historical entity words, we select reply templates with high sentence similarity, which solves the problem of inconsistency between the reply information and the user's language habits in the task-based dialogue system, and improves the user experience.
Patent Information
- Application Number
- CN202310325386.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-03-29
AI Technical Summary
In task-based dialogue systems, traditional reply information generation methods fail to effectively combine the user's language habits, resulting in a large difference between the generated reply information and the user's utterance, resulting in poor user experience.
By obtaining the semantic information sent by the user account, an utterance template corresponding to the semantic information is generated, and based on the sentence similarity between the utterance template and the reply template, a reply template whose similarity meets the preset conditions is selected, and the matching is selected based on the historical entity words of the user account. Entity words fill the template and generate reply information.
Ensure that the reply template is more in line with the user's language habits, reduce the difference between the generated reply information and the user's utterance, and improve the user experience.
Smart Images

Figure CN118733719A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of voice interaction technology, and in particular to a method, device and electronic device for generating reply information. Background Art
[0002] In task-based dialogue systems, natural language generation needs to generate reply information based on the current dialogue state. This process is generally divided into two steps: template decision and slot filling. After the traditional template decision determines the reply template group, it will randomly select the reply template board, and then use the normalized value to fill the slot of the reply template.
[0003] Since the user's language habits are not taken into consideration, the generated reply information is quite different from what the user says, resulting in a poor user experience. Summary of the invention
[0004] In order to solve the above technical problems, the present disclosure provides a method, device and electronic device for generating reply information.
[0005] In order to achieve the above objectives, the present invention adopts the following technical solutions:
[0006] In a first aspect, the present disclosure provides a method for generating a reply message, including: obtaining at least one reply template corresponding to semantic information sent by a user account; using the word segmentation position corresponding to the actual entity word in the semantic information as a word slot to generate a speech template corresponding to the semantic information; based on the sentence similarity between the speech template and each reply template, selecting a reply template whose sentence similarity meets a preset condition as the reply template; screening historical entity words in the historical entity words of the user account that match the actual entity words included in the semantic information; filling the matching historical entity words into the word slot of the reply template to generate a reply message.
[0007] In some feasible examples, the word segmentation positions corresponding to the actual entity words in the semantic information are used as word slots to generate speech templates 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 word slots to obtain the speech templates corresponding to the semantic information.
[0008] In some feasible examples, based on the sentence similarity between the speaking template and each reply template, before selecting a reply template whose sentence similarity meets preset conditions as the reply template, the method for generating reply information provided by the present disclosure also 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 utterance template and each reply template, a reply template whose sentence similarity meets a preset condition is selected as the reply template, including: based on the sentence similarity between the utterance template and each reply template, when it is determined that the total number of reply templates whose sentence similarity meets the preset condition is greater than or equal to 2, randomly selecting a reply template from the reply templates whose sentence similarity meets the preset condition as the reply template.
[0010] In some feasible examples, based on the sentence similarity between the utterance template and each reply template, a reply template whose sentence similarity meets a preset condition is selected as the reply template, including: based on the sentence similarity between the utterance template and each reply template, when it is determined that 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 selected as the reply template.
[0011] In some feasible examples, the preset condition includes that the sentence similarity is greater than or equal to a similarity threshold.
[0012] In some feasible examples, historical entity words in a user account are screened for historical entity words that match actual entity words included in semantic information, including: obtaining actual entity words belonging to a target title in the semantic information; wherein a target title contains one or more theoretical entity words; based on the statistical probability of historical entity words that are the same as the theoretical entity words, taking the historical entity word with the highest statistical probability as the historical entity word that matches the actual entity word included in the semantic information.
[0013] In a second aspect, the present disclosure provides a device for generating reply information, including: an acquisition unit, for acquiring at least one reply template corresponding to semantic information sent by a user account; a processing unit, for using the word segmentation position corresponding to the actual entity word in the semantic information acquired by the acquisition unit as a word slot to generate a speech template corresponding to the semantic information; the processing unit is also used to select a reply template whose sentence similarity meets a preset condition as a reply template based on the sentence similarity between the speech template and each reply template; the processing unit is also used to screen historical entity words in the historical entity words of the user account that match the actual entity words contained in the semantic information acquired by the acquisition unit; the processing unit is also used to fill the matching historical entity words into the word slot of the reply template 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 use the segmentation positions of the actual entity words belonging to the target title in the semantic information acquired by the acquisition unit as word slots to obtain a speech template corresponding to the semantic information.
[0015] In some feasible examples, the following operations are performed for each reply template: the acquisition unit is further used to acquire the text similarity between the utterance template and the reply template; the processing unit is further used to use the text similarity acquired by the acquisition unit as the sentence similarity between the utterance template and the reply template.
[0016] In some feasible examples, the processing unit is specifically used to randomly select a reply template from the reply templates whose sentence similarity meets the preset conditions as a reply template when the total number of reply templates whose sentence similarity meets the preset conditions is greater than or equal to 2 based on the sentence similarity between the speaking template and each 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 reply template, that when the total number of reply templates whose sentence similarity meets the preset conditions is greater than or equal to 2, use the reply template with the highest historical adoption rate among the reply templates whose sentence similarity meets the preset conditions as the reply template.
[0018] In some feasible examples, the preset condition includes that the sentence similarity is greater than or equal to a similarity threshold.
[0019] In some feasible examples, the acquisition unit is specifically used to acquire 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, based on the statistical probability of the historical entity words being the same as the theoretical entity words, select the historical entity words with the highest statistical probability as the historical entity words that match the actual entity words contained in the semantic information.
[0020] In a third aspect, the present disclosure provides an electronic device, comprising: a memory and a processor, the memory being used to store a computer program; the processor being used to enable the electronic device to implement the method for generating reply information provided in the first aspect when executing the computer program.
[0021] In a fourth aspect, the present disclosure provides a computer-readable storage medium, comprising: a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a computing device, the computing device implements the method for generating reply information provided in the first aspect above.
[0022] In a fourth aspect, the present disclosure provides a vehicle, comprising a device for generating any reply information provided in the second aspect above.
[0023] In the present disclosure, the name of the above-mentioned reply information generating device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of the present disclosure, they fall within the scope of the claims of the present disclosure and their equivalent technologies.
[0024] These and other aspects of the present disclosure will become more apparent from the following description.
[0025] Compared with the prior art, the technical solution provided by the present invention has the following advantages:
[0026] By rewriting the semantic information into a speech template, the sentence similarity between the speech template and at least one reply template corresponding to the semantic information can be obtained, so that based on the sentence similarity, a reply template whose sentence similarity meets the preset conditions can be selected as a reply template, which can ensure that the reply template is more in line with the user's language habits. At the same time, the actual entity words contained in the semantic information are screened in the historical entity words of the user account to obtain at least one matching historical entity word. In this way, it can be ensured that the target entity words filled in the word slot of the reply template are more in line with the user's voice and language habits, so that the generated reply information can be combined with the user's language habits, reduce the difference between the generated reply information and the user's speech, and ensure the user experience. It solves the problem in the prior art that the generated reply information is greatly different from the user's speech due to the lack of combination of the user's language habits, and the user experience is poor. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0029] Figure 1 One of the flowcharts of the method for generating reply information provided in the embodiment of the present disclosure;
[0030] Figure 2 A second flowchart of a method for generating reply information provided in an embodiment of the present disclosure;
[0031] Figure 3 A third flowchart of a method for generating reply information provided in an embodiment of the present disclosure;
[0032] Figure 4 A fourth flowchart of a method for generating reply information provided in an embodiment of the present disclosure;
[0033] Figure 5 A fifth flowchart of a method for generating reply information provided in an embodiment of the present disclosure;
[0034] Figure 6 A sixth flowchart of a method for generating reply information provided in an embodiment of the present disclosure;
[0035] Figure 7 A schematic diagram of the structure of a device for generating reply information provided in an embodiment of the present disclosure;
[0036] Figure 8 A schematic diagram of the structure of a vehicle-mounted terminal provided in an embodiment of the present disclosure;
[0037] Fig. 9 A schematic diagram of the structure of a computer program product provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0038] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0039] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0040] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0041] The semantic information, historical entity words, actual entity words and theoretical entity words involved in the present disclosure may be data authorized by the user or fully authorized by all parties.
[0042] The execution subject of the mode switching method of the embodiment of the present application is a reply information generation device, which can be set in a vehicle terminal or other equipment, and this embodiment does not limit this. When the reply information generation device is set in a vehicle terminal, the mode switching method provided by the embodiment of the present disclosure can be executed by the vehicle controller.
[0043] Exemplarily, the method for generating reply information provided by the embodiment of the present disclosure is introduced by taking the execution subject of the method for generating reply information provided by the embodiment of the present disclosure as a vehicle-mounted terminal as an example.
[0044] like Figure 1 As shown, the method for generating reply information provided by the embodiment of the present disclosure 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, when riding in a vehicle, the user can control the vehicle terminal to perform corresponding operations through voice interaction, such as controlling the vehicle terminal to play music, movies, etc. through voice interaction. Usually, when the user uses the vehicle terminal, the vehicle terminal will prompt the user to log in to the user account, such as: if the user has registered a user account on the vehicle terminal, the user can log in to the user account on the vehicle terminal, so that the user can better use the vehicle terminal. Alternatively, when the user has not registered a user account on the vehicle terminal, the user account can be the device identification code of the vehicle terminal, or the physical address that uniquely represents the vehicle terminal, etc.
[0047] In some examples, the vehicle terminal recognizes the voice information sent by the user to obtain the voice text corresponding to the voice information. Afterwards, the voice text is recognized by Natural Language Understanding (NLU) to determine the user's intention. Afterwards, based on the user's intention, the Dialog Management (DM) searches the database for a reply template that matches the user's intention, such as: based on the user's intention, querying the first data table to obtain at least one reply template; wherein the first data table includes the correspondence between the user's intention and the reply template. In this way, at least one reply template corresponding to the semantic information can be obtained.
[0048] S12. Use the word segmentation position corresponding to the actual entity word in the semantic information as a word slot to generate an utterance template corresponding to the semantic information.
[0049] In some examples, the semantic information contains one or more actual entity words. At the same time, in order to distinguish the user's intention, the method for generating reply information provided by the embodiment of the present disclosure pre-configures the first correspondence between different target titles and theoretical entity words. In this way, the first correspondence can be queried to determine the actual entity words belonging to the target title. Afterwards, the word segmentation position of the actual entity words belonging to the target title in the semantic information is used as the word slot to obtain the speech template corresponding to the semantic information, such as: the semantic information is "I want to watch ***", and then by querying the first correspondence, it is determined that "***" belongs to the target title (such as: film and television title). Afterwards, the word segmentation position of "***" is used as the word slot to obtain the speech template "I want to watch ${videoTitle}" corresponding to "I want to watch ***".
[0050] In some examples, semantic information may be input into a rewriting model to obtain an utterance template corresponding to the semantic information.
[0051] Among them, the training process of the rewritten model is as follows:
[0052] The training sample data and the marking result of the training sample data are obtained, wherein the training sample data includes at least one historical semantic information, and the marking result includes a historical utterance template 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 for the training sample data is obtained.
[0054] Based on the prediction results and the labeling results, the network parameters of the neural network model are adjusted until the neural network model converges to obtain a rewritten model.
[0055] S13. Based on the sentence similarity between the utterance template and each reply template, a reply template whose sentence similarity meets a preset condition is selected as a reply template.
[0056] In some examples, the text similarity between the utterance template and the reply template can be obtained; the text similarity is used as the sentence similarity between the utterance template and the reply template. Exemplarily, the Bert (Bidirectional EncoderRepresentation from Transformers) model can be used to determine the sentence similarity between the utterance template and each reply template. Alternatively, the utterance template and the reply template are converted into a utterance vector and a reply vector, respectively. Afterwards, the target distance between the utterance vector and the reply vector is used as the text similarity between the utterance template and the reply template. Among them, the target distance includes: any one of cosine distance and Euclidean distance.
[0057] S14. Filter historical entity words in the user account to find historical entity words that match the actual entity words included in the semantic information.
[0058] In some examples, in order to make the reply information more in line with the user's language habits, the reply information generation method provided by the embodiment of the present disclosure can obtain the user's preference information by counting the historical entity words of the user 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. Then, based on the theoretical entity word, the historical entity word that is the same as the theoretical entity word can be determined. Then, based on the statistical probability of the historical entity word that is the same as the theoretical entity word, the historical entity word with the largest statistical probability is determined to be the historical entity word that matches the actual entity word contained in the semantic information.
[0059] Exemplarily, it is assumed that the historical entity words of the user account include historical entity word 1, historical entity word 2, and historical entity word 3, and the actual entity word contained in the semantic information is actual entity word 1. Through analysis, it is determined that the target title corresponding to actual entity word 1 is target title 1, and target title 1 includes theoretical entity word 1, theoretical entity word 2, theoretical entity word 3, and theoretical entity word 4. Afterwards, 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. Afterwards, according to the statistical probability of historical entity word 2 and the statistical probability of theoretical entity word 4, when it is determined that the statistical probability of historical entity word 2 is greater than the statistical probability of theoretical entity word 4, historical entity word 2 is used as the target entity word.
[0060] Exemplarily, it is assumed that the historical entity words of the user account include historical entity word 1, historical entity word 2, and historical entity word 3, and the actual entity words contained in the semantic information are actual entity word 1 and actual entity word 2. Through analysis, it is determined that the target title corresponding to actual entity word 1 is target title 1, and the target title corresponding to actual entity word 2 is target title 2. Target title 1 includes theoretical entity word 1, theoretical entity word 2, theoretical entity word 3, and theoretical entity word 4, and target title 2 includes theoretical entity 5, theoretical entity word 6, and theoretical entity word 7. Afterwards, target title 1 and target title 2 are analyzed respectively to determine 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. Afterwards, according to the statistical probability of historical entity word 2 and the statistical probability of theoretical entity word 4, when it is determined that the statistical probability of historical entity word 2 is greater than the statistical probability of theoretical entity word 4, historical entity word 2 is used 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. Afterwards, 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 the statistical probability of theoretical entity word 1, historical entity word 3 is used as target entity word 2.
[0061] Specifically, the statistical probability is equal to the ratio of the total number of occurrences of the same historical entity word to the total number of occurrences of all historical entity words of the user account.
[0062] S15. Fill the matching historical entity words into the word slot of the reply template to generate reply information.
[0063] In some examples, the target entity word includes any matching historical entity word. When the target entity word includes only one, the target entity word can be directly filled into the word slot of the reply template to generate reply 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 target entity word into the word slot of the reply template in turn according to the word segmentation position of the actual entity word corresponding to the target entity word in the semantic information to generate the reply information.
[0065] For example: there are two target entity words, namely target entity word 1 and target entity word 2. The segmentation position of actual entity word 1 corresponding to target entity word 1 in the semantic information is segmentation position 1, and the segmentation position of actual entity word 2 corresponding to target entity word 2 in the semantic information is segmentation position 2. The order of appearance of segmentation position 1 is later than the order of appearance of segmentation position 2. In this case, it is necessary to fill target entity word 2 into word slot 1 of the reply template, and then fill target entity word 1 into word slot 2 of the reply template, so as to generate reply information.
[0066] As can be seen from the above, the method for generating reply information provided by the embodiment of the present disclosure can obtain the sentence similarity of the at least one reply template corresponding to the speech template and the semantic information by rewriting the semantic information into a speech template, so that based on the sentence similarity, a reply template whose sentence similarity meets the preset conditions can be selected as a reply template, which can ensure that the reply template is more in line with the user's language habits. At the same time, at least one target entity word is determined by the historical entity words of the user account and the actual entity words contained in the semantic information. Since the target entity word includes any historical entity word, it can be ensured that the target entity word filled in the word slot of the reply template is more in line with the user's voice language habits, so that the generated reply information can be combined with the user's language habits, reduce the difference between the generated reply information and the user's speech, and ensure the user experience. It solves the problem that the generated reply information and the user's speech are greatly different and the user experience is poor due to the lack of combination with the user's language habits in the prior art.
[0067] In some possible implementation examples, combined with Figure 1 ,like Figure 2 As shown, the above S12 can be specifically implemented through the following S120 and S121.
[0068] S120, obtaining the actual entity words belonging to the target title in the semantic information.
[0069] S121. Using the segmentation position of the actual entity word belonging to the target title in the semantic information as a word slot, obtaining an utterance template corresponding to the semantic information.
[0070] In some possible implementation examples, combined with Figure 1 ,like Figure 3 As shown, the method for generating reply information provided by the embodiment of the present disclosure further includes S16.
[0071] S16. For each reply template, perform the following operations: obtain the text similarity between the utterance template and the reply template; and use the text similarity as the sentence similarity between the utterance template and the reply template.
[0072] In some possible implementation examples, combined with Figure 1 ,like Figure 4 As shown, the above S13 can be specifically implemented through the following S130.
[0073] S130. Based on the sentence similarity between the utterance template and each reply template, when it is determined that the total number of reply templates whose sentence similarity meets the preset conditions is greater than or equal to 2, randomly select a reply template from the reply templates whose sentence similarity meets the preset conditions as the reply template.
[0074] In some examples, based on the sentence similarity between the utterance template and each reply template, when it is determined that the total number of reply templates whose sentence similarity meets a preset condition is 1, the reply template is used as the reply template.
[0075] In some possible implementation examples, combined with Figure 1 ,like Figure 5 As shown, the above S13 can be specifically implemented through the following S131.
[0076] S131. Based on the sentence similarity between the utterance template and each reply template, when it is determined that 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.
[0077] In some feasible examples, the preset condition includes that the sentence similarity is greater than or equal to a similarity threshold.
[0078] In some possible implementation examples, combined with Figure 1 ,like Figure 6 As shown, the above S14 can be specifically implemented through the following S140 and S141.
[0079] S140, obtaining actual entity words belonging to the target title in the semantic information, wherein a target title contains one or more theoretical entity words.
[0080] S141. Based on the statistical probability of the historical entity words that are the same as the theoretical entity words, the historical entity word with the highest statistical probability is used as the historical entity word that matches the actual entity word included in the semantic information.
[0081] The above mainly introduces the solution provided by the embodiment of the present disclosure from the perspective of the method. In order to achieve the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present disclosure.
[0082] The disclosed embodiment can divide the function modules of the reply information generating device according to the above method example. For example, each function module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software function modules. It should be noted that the division of modules in the disclosed embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0083] like Figure 7 FIG. 1 is a schematic diagram of a structure of a reply information generating device 10 provided in an embodiment of the present disclosure, comprising an acquiring 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 use the word segmentation position corresponding to the actual entity word in the semantic information acquired by the acquisition unit 101 as a word slot to generate a speech template corresponding to the semantic information; the processing unit 102 is also used to select a reply template whose sentence similarity meets a preset condition as a reply template based on the sentence similarity between the speech template and each reply template; the processing unit 102 is also used to screen historical entity words in the historical entity words of 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 matching historical entity words into the word slot of the reply template to 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 use the segmentation position of the actual entity words belonging to the target title in the semantic information acquired by the acquisition unit 101 as the word slot to obtain the utterance template corresponding to the semantic information.
[0086] In some feasible examples, the following operations are performed for each reply template: the acquisition unit 101 is also used to acquire the text similarity between the utterance template and the reply template; the processing unit 102 is also used to use the text similarity acquired by the acquisition unit 101 as the sentence similarity between the utterance template and the reply template.
[0087] In some feasible examples, the processing unit 102 is specifically used to randomly select a reply template from the reply templates whose sentence similarity meets the preset conditions as a reply template when it is determined that the total number of reply templates whose sentence similarity meets the preset conditions is greater than or equal to 2 based on the sentence similarity between the utterance template and each reply template.
[0088] In some feasible examples, the processing unit 102 is specifically used to determine, based on the sentence similarity between the utterance template and each reply template, that when the total number of reply templates whose sentence similarity meets a preset condition is greater than or equal to 2, use the reply template with the highest historical adoption rate among the reply templates whose sentence similarity meets the preset condition as the reply template.
[0089] In some feasible examples, the preset condition includes that the sentence similarity is greater than or equal to a similarity threshold.
[0090] 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; wherein, a target title contains one or more theoretical entity words; the processing unit 102 is specifically used to take the historical entity words with the highest statistical probability as the historical entity words that match the actual entity words 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] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and its role will not be repeated here.
[0092] Of course, the reply information generation device 10 provided in the embodiment of the present disclosure includes but is not limited to the above modules, for example, the reply information generation device 10 may also include a storage unit 103. The storage unit 103 may be used to store the program code of the reply information generation device 10, and may also be used to store data generated by the reply information generation device 10 during operation, such as data in a write request, etc.
[0093] Figure 8A schematic diagram of the structure of a vehicle-mounted terminal provided in an embodiment of the present disclosure is shown in FIG. Figure 8 As shown, the vehicle-mounted terminal may include: at least one processor 51 , a memory 52 , a communication interface 53 and a communication bus 54 .
[0094] Combine the following Figure 8 The following is a detailed introduction to the various components of the vehicle terminal:
[0095] The processor 51 is the control center of the electronic device 10, and may be a processor or a general term for multiple processing elements. For example, the processor 51 is a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present disclosure, such as one or more DSPs, or one or more field programmable gate arrays (FPGAs).
[0096] In a specific implementation, as an embodiment, the processor 51 may include one or more CPUs, such as Figure 8 Also, as an embodiment, the electronic device may include multiple processors, such as Figure 8 51 and 55 are shown in FIG. Each of these processors may be a single-core processor (Single-CPU) or a multi-core processor (Multi-CPU). The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0097] The memory 52 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or 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 disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed 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, the memory 52 is used to store the data in the present disclosure and execute the software program in the present disclosure. The processor 51 can execute various functions of the air conditioner by running or executing the software program stored in the memory 52 and calling the data stored in the memory 52.
[0099] The communication interface 53 uses any transceiver-like device to communicate with other devices or communication networks, such as Radio Access Network (RAN), Wireless Local Area Networks (WLAN), terminals, the cloud, etc. The communication interface 53 may include an acquisition unit to implement the acquisition function.
[0100] The communication bus 54 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0101] As an example, combine Figure 7The function implemented by the acquisition unit 101 in the reply information generation device 10 is the same as Figure 8 The function of the communication interface 53 in the reply information generation device 10 is the same as that of the processing unit 102 in the reply information generation device 10. Figure 8 The function of the processor 51 in the reply information generation device 10 is the same as that of the storage unit 103 in the reply information generation device 10. Figure 8 The function of the memory 52 in is the same.
[0102] Another embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a computing device, the computing device executes the mode switching method shown in the above method embodiment.
[0103] In some embodiments, the disclosed methods 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 manufacture.
[0104] Fig. 9 A conceptual partial view of a computer program product provided by an embodiment of the present disclosure is schematically shown, wherein the computer program product includes a computer program for executing a computer process on a computing device.
[0105] In one embodiment, the computer program product is provided using a signal bearing medium 410. The signal bearing medium 410 may include one or more program instructions, which when executed by one or more processors may provide the above-mentioned Figure 1 Thus, for example, reference to Figure 1 In the embodiment shown in , one or more features of S11-S15 can be undertaken by one or more instructions associated with the signal bearing medium 410. In addition, Fig. 9 The program instructions in also describe example instructions.
[0106] In some examples, signal bearing medium 410 may include computer readable medium 411, such as, but not limited to, a hard drive, a compact disk (CD), a digital video disk (DVD), a digital tape, a memory, a read-only memory (ROM), or a random access memory (RAM), and the like.
[0107] In some implementations, signal bearing medium 410 may include computer recordable medium 412 such as, but not limited to, memory, read / write (R / W) CD, R / W DVD, and the like.
[0108] In some implementations, signal bearing medium 410 may include communication medium 413 such as, but not limited to, digital and / or analog communication media (eg, fiber optic cables, waveguides, wired communication links, wireless communication links, etc.).
[0109] Signal bearing medium 410 may be communicated by a wireless form of communication medium 413 (eg, wireless communication medium complying with IEEE 802.41 standard or other transmission protocol). The one or more program instructions may be, for example, computing device executable instructions or logic implementing instructions.
[0110] In some examples, such as for Figure 7 The described reply information generation apparatus 10 may be configured to provide various operations, functions, or actions in response to one or more program instructions in the computer-readable medium 411 , the computer-recordable medium 412 , and / or the communication medium 413 .
[0111] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned 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 the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0113] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0114] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0115] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks or optical disks.
[0116] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be 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 the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating a reply message, characterized in that: include: Obtaining at least one reply template corresponding to the semantic information sent by the user account; Using the word segmentation position corresponding to the actual entity word in the semantic information as a word slot, generating an utterance template corresponding to the semantic information; Based on the sentence similarity between the utterance template and each of the reply templates, selecting a reply template whose sentence similarity meets a preset condition as a reply template; Screening historical entity words in the user account for historical entity words that match the actual entity words included in the semantic information; The matched historical entity words are filled into the word slots of the reply template to generate reply information.
2. The generation method according to claim 1, characterized in that: The step of using the word segmentation position corresponding to the actual entity word in the semantic information as a word slot to generate an utterance template corresponding to the semantic information includes: Acquire the actual entity words belonging to the target title in the semantic information; The word segmentation position of the actual entity word belonging to the target title in the semantic information is used as a word slot to obtain an utterance template corresponding to the semantic information.
3. The generation method according to claim 1, characterized in that: Before selecting the reply template whose sentence similarity meets a preset condition as the reply template based on the sentence similarity between the utterance template and each of the reply templates, the method further includes: For each reply template, do the following: The text similarity between the utterance template and the reply template is obtained; and the text similarity is used as the sentence similarity between the utterance template and the reply template.
4. The generation method according to claim 1, characterized in that: Based on the sentence similarity between the utterance template and each of the reply templates, selecting a reply template whose sentence similarity meets a preset condition as a reply template comprises: Based on the sentence similarity between the speaking template and each of the reply templates, when it is determined that the total number of reply templates whose sentence similarity meets the preset conditions is greater than or equal to 2, a reply template is randomly selected from the reply templates whose sentence similarity meets the preset conditions as the reply template.
5. The generation method according to claim 1, characterized in that: Based on the sentence similarity between the utterance template and each of the reply templates, selecting a reply template whose sentence similarity meets a preset condition as a reply template comprises: Based on the sentence similarity between the speaking template and each of the reply templates, when it is determined that 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.
6. The generation method according to claim 1, characterized in that: The preset condition includes that the sentence similarity is greater than or equal to a similarity threshold.
7. The generation method according to claim 1, characterized in that: The step of screening the historical entity words in the user account and the historical entity words matching the actual entity words included in the semantic information includes: Acquire the actual entity words belonging to the target title in the semantic information; wherein one of the target titles contains one or more theoretical entity words; Based on the statistical probability of the historical entity words that are the same as the theoretical entity word, the historical entity word with the highest statistical probability is used as the historical entity word that matches the actual entity word included in the semantic information.
8. A device for generating reply information, characterized in that: include: An acquisition unit, configured to acquire at least one reply template corresponding to the semantic information sent by the user account; a processing unit, configured to use the word segmentation position corresponding to the actual entity word in the semantic information acquired by the acquisition unit as a word slot, and generate an utterance template corresponding to the semantic information; The processing unit is further configured to select, based on the sentence similarity between the utterance template and each of the reply templates, a reply template whose sentence similarity satisfies a preset condition as a reply template; The processing unit is further configured to filter historical entity words in the user account that match the actual entity words included in the semantic information acquired by the acquisition unit; The processing unit is further used to fill the matched historical entity words into the word slots of the reply template to generate reply information.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store a computer program; and the processor is used to enable the electronic device to implement the method for generating reply information as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computing device, the computing device implements the method for generating reply information according to any one of claims 1 to 7.
11. A vehicle, comprising the device for generating reply information of training data according to claim 8.
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
Inquiry information processing method and device, storage medium and computer equipment
CN111415740A
Medical questioning and answering method, medical questioning and answering system, electronic device and computer-readable storage medium
WO2020244534A1
Cited By
Replay message generation method and device, storage medium and electronic equipment
CN119202204A
