User question and answer data processing method and system based on vector calculation
By adopting a vector-based calculation method in the user question and answer system, the shortcomings of complex language structures and user emotions processing in the prior art are solved, and more efficient and accurate user interaction is achieved.
Patent Information
- Application Number
- CN202410549489.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-06
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-05-06
AI Technical Summary
The prior art is difficult to effectively handle complex language structures and user emotions in user question and answer scenarios, resulting in insufficient accuracy and efficiency of answers.
Using a vector-based calculation method, the target user's voice information is obtained, the vector transformation algorithm is used to convert it into word vector combinations, and the most matching reply operation is calculated based on the data sample model library and the similarity algorithm to generate real-time and accurate reply.
Improves the interaction efficiency and accuracy in user Q&A scenarios and improves the user experience.
Smart Images

Figure CN118377845B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a user question and answer data processing method and system based on vector calculation. Background Art
[0002] Speech recognition algorithms and intelligent customer service technologies have been widely used in existing customer service systems and have played a very important role. However, when using data processing technology to solve user question-and-answer scenarios, existing technologies still have defects in solving complex language structures and user emotions, and have not fully combined vector conversion algorithms and sample model libraries to improve the accuracy of answers. It can be seen that existing technologies have defects that need to be solved urgently. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a user question and answer data processing method and system based on vector calculation, which can realize real-time and accurate reply to the voice information of the target user, improve the efficiency and accuracy of the interaction, and improve the user experience.
[0004] In order to solve the above technical problems, the first aspect of the present invention discloses a method for processing user question and answer data based on vector calculation, the method comprising:
[0005] Get the current voice information of the target user;
[0006] According to a preset vector conversion algorithm, the current speech information is converted into a word vector combination;
[0007] Calculate the reply operation corresponding to the word vector combination according to the preset data sample model library and similarity algorithm;
[0008] According to the reply operation, reply information to the current voice information is generated; the reply information is used to reply to the target user.
[0009] As an optional implementation, in the first aspect of the present invention, the data sample model library includes a plurality of data sample models; each of the data sample models includes a plurality of historical word vector samples and a corresponding reply operation set.
[0010] As an optional implementation manner, in the first aspect of the present invention, the obtaining of current voice information of the target user includes:
[0011] Get the user parameters corresponding to the target user;
[0012] Determine a user tag of the target user according to the user parameter; the user tag includes at least one of a lactation tag, a pregnancy tag, a cold tag, a drinking tag, a smoking tag, and a sports tag;
[0013] According to the user tag of the target user and the preset corresponding rules between the tag and the model, the data sample model corresponding to the target user is determined.
[0014] As an optional implementation, in the first aspect of the present invention, the calculation of the reply operation corresponding to the word vector combination according to the preset data sample model library and the similarity algorithm includes:
[0015] Based on the cosine similarity algorithm, the similarity between each of the historical word vector samples and the word vector combination in the data sample model corresponding to the target user is calculated;
[0016] According to the similarity, a target word vector sample whose similarity is greater than a preset similarity threshold is selected from all the historical word vector samples;
[0017] According to the reply operation set corresponding to the target word vector sample, the reply operation corresponding to the word vector combination is determined.
[0018] As an optional implementation, in the first aspect of the present invention, determining the reply operation corresponding to the word vector combination according to the reply operation set corresponding to the target word vector sample includes:
[0019] Calculate the intersection of the reply operation sets corresponding to all the target word vector samples to obtain a first reply operation set;
[0020] Based on a preset operation contradiction rule, determine the operation quantity of all other operations that are contradictory and correspond to each operation in the first reply operation set;
[0021] Deleting all operations in the first reply operation set where the number of conflicting operations is greater than a preset threshold, to obtain a second reply operation set;
[0022] Obtaining historical user personality parameters of the target user;
[0023] Calculating the adaptability parameter corresponding to each operation in the second reply operation set and the historical user personality parameter according to the preset adaptation relationship between the personality and the operation;
[0024] The operation with the highest adaptability parameter in the second reply operation set is determined as the reply operation corresponding to the word vector combination.
[0025] As an optional implementation, in the first aspect of the present invention, the converting the current speech information into a word vector combination according to a preset vector conversion algorithm includes:
[0026] Determine the speech text corresponding to the current speech information according to the speech text recognition algorithm;
[0027] Determining the tone information corresponding to the current voice information according to the voice tone prediction algorithm;
[0028] Based on a word segmentation algorithm, determining a plurality of text words corresponding to the speech text;
[0029] Randomly deleting the plurality of text words to obtain enhanced text word data;
[0030] Based on the word frequency algorithm and the word distance algorithm, a word relationship topology is generated according to the plurality of text words and the enhanced text word data; the word relationship topology includes the word frequency information of any of the text words and the average word distance information between the word and all other text words;
[0031] Generate a word vector corresponding to each of the text words according to the word relationship topology;
[0032] The word vectors corresponding to all the text words are subjected to length control processing and PCA dimensionality reduction processing to obtain a word vector combination corresponding to the current voice information.
[0033] As an optional embodiment, in the first aspect of the present invention, the method further comprises:
[0034] When the data sample model corresponding to the target user cannot be determined according to the corresponding rule between the label and the model, sending the word vector combination to a preset large language model;
[0035] Obtaining model response information of the large language model for the word vector combination;
[0036] The model reply information is sent to the target user.
[0037] As an optional implementation, in the first aspect of the present invention, the data sample model library is established by the following steps:
[0038] Obtain user voice information of multiple historical users;
[0039] Determine the speech word vector corresponding to each of the user speech information;
[0040] According to the keyword matching rule, determining the matching tags appearing in the text of each of the speech word vectors; the matching tags include at least one of childbearing, drinking, smoking, dissatisfaction, complaint, refund, exercise, weight loss and illness;
[0041] Determine a set of reply operations corresponding to each of the speech word vectors;
[0042] All the speech word vectors and corresponding reply operation sets with the same matching labels are determined as one of the data sample models to obtain the data sample model library.
[0043] A second aspect of an embodiment of the present invention discloses a user question and answer data processing system based on vector calculation, the system comprising:
[0044] An acquisition module is used to acquire the current voice information of the target user;
[0045] A conversion module, used to convert the current voice information into a word vector combination according to a preset vector conversion algorithm;
[0046] A calculation module, used to calculate the reply operation corresponding to the word vector combination according to a preset data sample model library and a similarity algorithm;
[0047] The reply module is used to generate reply information to the current voice information according to the reply operation; the reply information is used to reply to the target user.
[0048] As an optional implementation, in the second aspect of the present invention, the data sample model library includes a plurality of data sample models; each of the data sample models includes a plurality of historical word vector samples and a corresponding reply operation set.
[0049] As an optional implementation, in the second aspect of the present invention, the specific manner in which the acquisition module acquires the current voice information of the target user includes:
[0050] Get the user parameters corresponding to the target user;
[0051] Determine a user tag of the target user according to the user parameter; the user tag includes at least one of a lactation tag, a pregnancy tag, a cold tag, a drinking tag, a smoking tag, and a sports tag;
[0052] According to the user tag of the target user and the preset corresponding rules between the tag and the model, the data sample model corresponding to the target user is determined.
[0053] As an optional implementation, in the second aspect of the present invention, the calculation module calculates the specific manner of the reply operation corresponding to the word vector combination according to the preset data sample model library and the similarity algorithm, including:
[0054] Based on the cosine similarity algorithm, the similarity between each of the historical word vector samples and the word vector combination in the data sample model corresponding to the target user is calculated;
[0055] According to the similarity, a target word vector sample whose similarity is greater than a preset similarity threshold is selected from all the historical word vector samples;
[0056] According to the reply operation set corresponding to the target word vector sample, the reply operation corresponding to the word vector combination is determined.
[0057] As an optional implementation, in the second aspect of the present invention, the calculation module determines the specific manner of the reply operation corresponding to the word vector combination according to the reply operation set corresponding to the target word vector sample, including:
[0058] Calculate the intersection of the reply operation sets corresponding to all the target word vector samples to obtain a first reply operation set;
[0059] Based on a preset operation contradiction rule, determine the operation quantity of all other operations that are contradictory and correspond to each operation in the first reply operation set;
[0060] Deleting all operations in the first reply operation set where the number of conflicting operations is greater than a preset threshold, to obtain a second reply operation set;
[0061] Obtaining historical user personality parameters of the target user;
[0062] Calculating the adaptability parameter corresponding to each operation in the second reply operation set and the historical user personality parameter according to the preset adaptation relationship between the personality and the operation;
[0063] The operation with the highest adaptability parameter in the second reply operation set is determined as the reply operation corresponding to the word vector combination.
[0064] As an optional implementation, in the second aspect of the present invention, the specific manner in which the conversion module converts the current voice information into a word vector combination according to a preset vector conversion algorithm includes:
[0065] Determine the speech text corresponding to the current speech information according to the speech text recognition algorithm;
[0066] Determining the tone information corresponding to the current voice information according to the voice tone prediction algorithm;
[0067] Based on a word segmentation algorithm, determining a plurality of text words corresponding to the speech text;
[0068] Randomly deleting the plurality of text words to obtain enhanced text word data;
[0069] Based on the word frequency algorithm and the word distance algorithm, a word relationship topology is generated according to the plurality of text words and the enhanced text word data; the word relationship topology includes the word frequency information of any of the text words and the average word distance information between the word and all other text words;
[0070] Generate a word vector corresponding to each of the text words according to the word relationship topology;
[0071] The word vectors corresponding to all the text words are subjected to length control processing and PCA dimensionality reduction processing to obtain a word vector combination corresponding to the current voice information.
[0072] As an optional embodiment, in the second aspect of the present invention, the method further comprises:
[0073] When the data sample model corresponding to the target user cannot be determined according to the corresponding rule between the label and the model, sending the word vector combination to a preset large language model;
[0074] Obtaining model response information of the large language model for the word vector combination;
[0075] The model reply information is sent to the target user.
[0076] As an optional implementation, in the second aspect of the present invention, the data sample model library is established by the following steps:
[0077] Obtain user voice information of multiple historical users;
[0078] Determine the speech word vector corresponding to each of the user speech information;
[0079] According to the keyword matching rule, determining the matching tags appearing in the text of each of the speech word vectors; the matching tags include at least one of childbearing, drinking, smoking, dissatisfaction, complaint, refund, exercise, weight loss and illness;
[0080] Determine a set of reply operations corresponding to each of the speech word vectors;
[0081] All the speech word vectors and corresponding reply operation sets with the same matching labels are determined as one of the data sample models to obtain the data sample model library.
[0082] The third aspect of the present invention discloses another user question and answer data processing system based on vector calculation, the system comprising:
[0083] A memory storing executable program code;
[0084] a processor coupled to the memory;
[0085] The processor calls the executable program code stored in the memory to execute part or all of the steps in the user question and answer data processing method based on vector calculation disclosed in the first aspect of the present invention.
[0086] The fourth aspect of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute part or all of the steps in the user question and answer data processing method based on vector calculation disclosed in the first aspect of the present invention.
[0087] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0088] The present invention obtains the current voice information of the target user and converts it into a word vector combination using a vector conversion algorithm, thereby realizing the understanding and processing of the voice content, and then calculates the most matching reply operation through a data sample model library and a similarity algorithm, thereby being able to realize real-time and accurate reply to the voice information of the target user, thereby improving the efficiency and accuracy of the interaction and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0090] Figure 1 It is a flow chart of a method for processing user question and answer data based on vector calculation disclosed in an embodiment of the present invention.
[0091] Figure 2 It is a structural diagram of a user question and answer data processing system based on vector computing disclosed in an embodiment of the present invention.
[0092] Figure 3 It is a structural diagram of another user question and answer data processing system based on vector calculation disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0093] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0094] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or equipment that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or equipment.
[0095] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0096] The present invention discloses a user question and answer data processing method and system based on vector calculation, which realizes the understanding and processing of the voice content by obtaining the current voice information of the target user and converting it into a word vector combination by using a vector conversion algorithm, and then calculates the most matching reply operation through a data sample model library and a similarity algorithm, so as to realize real-time and accurate reply to the voice information of the target user, improve the efficiency and accuracy of the interaction, and improve the user experience. The following are detailed descriptions respectively.
[0097] Embodiment 1
[0098] See also Figure 1 , Figure 1 : is a flow chart of a method for processing user question and answer data based on vector calculation disclosed in an embodiment of the present invention. Figure 1 The user question and answer data processing method based on vector calculation described above can be applied to a data processing system / data processing device / data processing server (wherein the server includes a local processing server or a cloud processing server). Figure 1 As shown, the user question and answer data processing method based on vector calculation may include the following operations:
[0099] 101. Obtain current voice information of the target user.
[0100] 102. According to a preset vector conversion algorithm, the current voice information is converted into a word vector combination.
[0101] 103. According to the preset data sample model library and similarity algorithm, the reply operation corresponding to the word vector combination is calculated.
[0102] 104. Generate reply information to the current voice message according to the reply operation
[0103] Optionally, the reply message is used to reply to the target user.
[0104] It can be seen that the above-mentioned embodiment of the invention realizes the understanding and processing of the voice content by acquiring the current voice information of the target user and converting it into a word vector combination using a vector conversion algorithm, and then calculates the most matching reply operation through a data sample model library and a similarity algorithm, thereby being able to realize real-time and accurate reply to the voice information of the target user, thereby improving the efficiency and accuracy of the interaction and improving the user experience.
[0105] As an optional embodiment, in the above steps, the data sample model library includes multiple data sample models; each data sample model includes multiple historical word vector samples and a corresponding reply operation set.
[0106] It can be seen that through the above optional embodiments, by constructing a data sample model library containing multiple historical word vector samples and their corresponding reply operation sets, fast and accurate processing and reply of voice information are achieved, thereby improving interaction efficiency and user experience.
[0107] As an optional embodiment, in the above step, obtaining the current voice information of the target user includes:
[0108] Get the user parameters corresponding to the target user;
[0109] Determine a user tag of the target user according to the user parameters; the user tag includes at least one of a lactation tag, a pregnancy tag, a cold tag, a drinking tag, a smoking tag, and a sports tag;
[0110] According to the user tag of the target user and the corresponding rules between the preset tags and models, the data sample model corresponding to the target user is determined.
[0111] It can be seen that through the above optional embodiments, by obtaining the current voice information of the target user and determining the corresponding data sample model according to its user tag, personalized processing and response of the voice information is achieved, thereby improving the accuracy of the interaction and the user experience.
[0112] As an optional embodiment, in the above steps, the reply operation corresponding to the word vector combination is calculated according to the preset data sample model library and the similarity algorithm, including:
[0113] Based on the cosine similarity algorithm, the similarity between each historical word vector sample and the word vector combination in the data sample model corresponding to the target user is calculated;
[0114] According to the similarity, from all historical word vector samples, select the target word vector samples whose similarity is greater than the preset similarity threshold;
[0115] According to the reply operation set corresponding to the target word vector sample, determine the reply operation corresponding to the word vector combination.
[0116] It can be seen that through the above optional embodiments, by using the preset data sample model library and similarity algorithm, the reply operation corresponding to the word vector combination is calculated, thereby achieving accurate processing and reply of voice information, and improving the accuracy and efficiency of the interaction.
[0117] As an optional embodiment, in the above step, determining the reply operation corresponding to the word vector combination according to the reply operation set corresponding to the target word vector sample includes:
[0118] Calculate the intersection of the reply operation sets corresponding to all target word vector samples to obtain the first reply operation set;
[0119] Based on a preset operation contradiction rule, determine the number of all other operations that are contradictory to each operation in the first reply operation set;
[0120] Delete all operations in the first reply operation set where the number of conflicting operations is greater than a preset threshold, to obtain a second reply operation set;
[0121] Obtain historical user personality parameters of the target user;
[0122] According to the preset adaptation relationship between personality and operation, the adaptability parameter corresponding to each operation in the second reply operation set and the personality parameter of the historical user is calculated;
[0123] The operation with the highest adaptability parameter in the second reply operation set is determined as the reply operation corresponding to the word vector combination.
[0124] It can be seen that through the above optional embodiments, by calculating the intersection of the reply operation sets corresponding to the target word vector samples, and determining the reply operation corresponding to the word vector combination based on the preset operation contradiction rules and character adaptation relationship, personalized and high-precision reply to voice information is achieved, thereby improving the accuracy of interaction and user experience.
[0125] As an optional embodiment, in the above steps, according to a preset vector conversion algorithm, the current speech information is converted into a word vector combination, including:
[0126] Determine the speech text corresponding to the current speech information according to the speech text recognition algorithm;
[0127] Determine the tone information corresponding to the current voice information according to the voice tone prediction algorithm;
[0128] Based on the word segmentation algorithm, determine multiple text words corresponding to the speech text;
[0129] Randomly delete multiple text words to obtain enhanced text word data;
[0130] Based on the word frequency algorithm and the word distance algorithm, a word relationship topology is generated according to multiple text words and enhanced text word data; the word relationship topology includes the word frequency information of any text word and the average word distance information between it and all other text words;
[0131] Generate word vectors for each text word based on word relationship topology;
[0132] The word vectors corresponding to all text words are length-controlled and PCA-dimensionality-reduced to obtain the word vector combination corresponding to the current speech information.
[0133] It can be seen that through the above optional embodiments, the current voice information is converted into a word vector combination through a preset vector conversion algorithm, which achieves a deep understanding and processing of the voice information and improves the accuracy and efficiency of the reply.
[0134] As an optional embodiment, in the above steps, the method further includes:
[0135] When the data sample model corresponding to the target user cannot be determined according to the corresponding rules between the label and the model, the word vector combination is sent to the preset large language model;
[0136] Get the model response information of the large language model for the word vector combination;
[0137] Send the model response information to the target user.
[0138] It can be seen that through the above optional embodiments, when the data sample model corresponding to the target user cannot be determined, the word vector combination is sent to the large language model, the model reply information is obtained and sent to the target user, thereby realizing universal processing and reply of voice information and ensuring the continuity of the interaction.
[0139] As an optional embodiment, in the above steps, the data sample model library is established by the following steps:
[0140] Obtain user voice information of multiple historical users;
[0141] Determine the speech word vector corresponding to each user's speech information;
[0142] According to the keyword matching rules, the matching tags appearing in the text of each speech word vector are determined; the matching tags include at least one of childbearing, drinking, smoking, dissatisfaction, complaint, refund, exercise, weight loss and illness;
[0143] Determine a set of reply operations corresponding to each speech word vector;
[0144] All speech word vectors with the same matching label and the corresponding reply operation set are determined as a data sample model to obtain a data sample model library.
[0145] It can be seen that through the above optional embodiments, by establishing a data sample model library containing user voice information of multiple historical users, corresponding voice word vectors, matching labels and reply operation sets, comprehensive processing of voice information and personalized replies are achieved, the accuracy and efficiency of the interaction are improved, and the user experience is also enhanced.
[0146] Embodiment 2
[0147] See also Figure 2 , Figure 2 : is a schematic diagram of a user question and answer data processing system based on vector calculation disclosed in an embodiment of the present invention. Figure 2 The user question and answer data processing system based on vector calculation described above can be applied to a data processing system / data processing device / data processing server (wherein the server includes a local processing server or a cloud processing server). Figure 2 As shown, the user question and answer data processing system based on vector calculation may include:
[0148] The acquisition module 201 is used to acquire the current voice information of the target user.
[0149] The conversion module 202 is used to convert the current speech information into a word vector combination according to a preset vector conversion algorithm.
[0150] The calculation module 203 is used to calculate the reply operation corresponding to the word vector combination according to the preset data sample model library and the similarity algorithm.
[0151] The reply module 204 is used to generate reply information to the current voice information according to the reply operation.
[0152] Optionally, the reply message is used to reply to the target user.
[0153] It can be seen that the above-mentioned embodiment of the invention realizes the understanding and processing of the voice content by acquiring the current voice information of the target user and converting it into a word vector combination using a vector conversion algorithm, and then calculates the most matching reply operation through a data sample model library and a similarity algorithm, thereby being able to realize real-time and accurate reply to the voice information of the target user, thereby improving the efficiency and accuracy of the interaction and improving the user experience.
[0154] As an optional embodiment, the data sample model library includes multiple data sample models; each data sample model includes multiple historical word vector samples and a corresponding reply operation set.
[0155] It can be seen that through the above optional embodiments, by constructing a data sample model library containing multiple historical word vector samples and their corresponding reply operation sets, fast and accurate processing and reply of voice information are achieved, thereby improving interaction efficiency and user experience.
[0156] As an optional embodiment, the specific manner in which the acquisition module acquires the current voice information of the target user includes:
[0157] Get the user parameters corresponding to the target user;
[0158] Determine a user tag of the target user according to the user parameters; the user tag includes at least one of a lactation tag, a pregnancy tag, a cold tag, a drinking tag, a smoking tag, and a sports tag;
[0159] According to the user tag of the target user and the corresponding rules between the preset tags and models, the data sample model corresponding to the target user is determined.
[0160] It can be seen that through the above optional embodiments, by obtaining the current voice information of the target user and determining the corresponding data sample model according to its user tag, personalized processing and response of the voice information is achieved, thereby improving the accuracy of the interaction and the user experience.
[0161] As an optional embodiment, the calculation module calculates the specific manner of the reply operation corresponding to the word vector combination according to the preset data sample model library and the similarity algorithm, including:
[0162] Based on the cosine similarity algorithm, the similarity between each historical word vector sample and the word vector combination in the data sample model corresponding to the target user is calculated;
[0163] According to the similarity, from all historical word vector samples, select the target word vector samples whose similarity is greater than the preset similarity threshold;
[0164] According to the reply operation set corresponding to the target word vector sample, determine the reply operation corresponding to the word vector combination.
[0165] It can be seen that through the above optional embodiments, by using the preset data sample model library and similarity algorithm, the reply operation corresponding to the word vector combination is calculated, thereby achieving accurate processing and reply of voice information, and improving the accuracy and efficiency of the interaction.
[0166] As an optional embodiment, the calculation module determines the specific manner of the reply operation corresponding to the word vector combination according to the reply operation set corresponding to the target word vector sample, including:
[0167] Calculate the intersection of the reply operation sets corresponding to all target word vector samples to obtain the first reply operation set;
[0168] Based on a preset operation contradiction rule, determine the number of all other operations that are contradictory to each operation in the first reply operation set;
[0169] Delete all operations in the first reply operation set where the number of conflicting operations is greater than a preset threshold, to obtain a second reply operation set;
[0170] Obtain historical user personality parameters of the target user;
[0171] According to the preset adaptation relationship between personality and operation, the adaptability parameter corresponding to each operation in the second reply operation set and the personality parameter of the historical user is calculated;
[0172] The operation with the highest adaptability parameter in the second reply operation set is determined as the reply operation corresponding to the word vector combination.
[0173] It can be seen that through the above optional embodiments, by calculating the intersection of the reply operation sets corresponding to the target word vector samples, and determining the reply operation corresponding to the word vector combination based on the preset operation contradiction rules and character adaptation relationship, personalized and high-precision reply to voice information is achieved, thereby improving the accuracy of interaction and user experience.
[0174] As an optional embodiment, the conversion module converts the current voice information into a specific way of word vector combination according to a preset vector conversion algorithm, including:
[0175] Determine the speech text corresponding to the current speech information according to the speech text recognition algorithm;
[0176] Determine the tone information corresponding to the current voice information according to the voice tone prediction algorithm;
[0177] Based on the word segmentation algorithm, determine multiple text words corresponding to the speech text;
[0178] Randomly delete multiple text words to obtain enhanced text word data;
[0179] Based on the word frequency algorithm and the word distance algorithm, a word relationship topology is generated according to multiple text words and enhanced text word data; the word relationship topology includes the word frequency information of any text word and the average word distance information between it and all other text words;
[0180] Generate word vectors for each text word based on word relationship topology;
[0181] The word vectors corresponding to all text words are length-controlled and PCA-dimensionality-reduced to obtain the word vector combination corresponding to the current speech information.
[0182] It can be seen that through the above optional embodiments, the current voice information is converted into a word vector combination through a preset vector conversion algorithm, which achieves a deep understanding and processing of the voice information and improves the accuracy and efficiency of the reply.
[0183] As an optional embodiment, the method further includes:
[0184] When the data sample model corresponding to the target user cannot be determined according to the corresponding rules between the label and the model, the word vector combination is sent to the preset large language model;
[0185] Get the model response information of the large language model for the word vector combination;
[0186] Send the model response information to the target user.
[0187] It can be seen that through the above optional embodiments, when the data sample model corresponding to the target user cannot be determined, the word vector combination is sent to the large language model, the model reply information is obtained and sent to the target user, thereby realizing universal processing and reply of voice information and ensuring the continuity of the interaction.
[0188] As an optional embodiment, the data sample model library is established through the following steps:
[0189] Obtain user voice information of multiple historical users;
[0190] Determine the speech word vector corresponding to each user's speech information;
[0191] According to the keyword matching rules, the matching tags appearing in the text of each speech word vector are determined; the matching tags include at least one of childbearing, drinking, smoking, dissatisfaction, complaint, refund, exercise, weight loss and illness;
[0192] Determine a set of reply operations corresponding to each speech word vector;
[0193] All speech word vectors with the same matching label and the corresponding reply operation set are determined as a data sample model to obtain a data sample model library.
[0194] It can be seen that through the above optional embodiments, by establishing a data sample model library containing user voice information of multiple historical users, corresponding voice word vectors, matching labels and reply operation sets, comprehensive processing of voice information and personalized replies are achieved, the accuracy and efficiency of the interaction are improved, and the user experience is also enhanced.
[0195] Embodiment 3
[0196] See also Figure 3 , Figure 3 It is another user question and answer data processing system based on vector calculation disclosed in an embodiment of the present invention. Figure 3 The user question and answer data processing system based on vector calculation is applied to a data processing system / data processing device / data processing server (wherein the server includes a local processing server or a cloud processing server). Figure 3 As shown, the user question and answer data processing system based on vector calculation may include:
[0197] A memory 301 storing executable program codes;
[0198] a processor 302 coupled to the memory 301;
[0199] The processor 302 calls the executable program code stored in the memory 301 to execute the steps of the user question and answer data processing method based on vector calculation described in the first embodiment.
[0200] Embodiment 4
[0201] An embodiment of the present invention discloses a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute the steps of the user question and answer data processing method based on vector calculation described in the first embodiment.
[0202] Embodiment 5
[0203] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps of the user question and answer data processing method based on vector calculation described in Embodiment 1.
[0204] The above describes specific embodiments of the present specification, and other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily have to be performed in the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0205] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0206] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0207] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may be in the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the embodiments of this specification may be in the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0208] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0209] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0210] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0211] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0212] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0213] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0214] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0215] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0216] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0217] Finally, it should be noted that the user question and answer data processing method and system based on vector calculation disclosed in the embodiment of the present invention discloses only the preferred embodiment of the present invention, which is only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A user question and answer data processing method based on vector calculation, characterized in that: The method comprises: Get the current voice information of the target user, including: Get the user parameters corresponding to the target user; Determine a user tag of the target user according to the user parameter; the user tag includes at least one of a lactation tag, a pregnancy tag, a cold tag, a drinking tag, a smoking tag, and a sports tag; Determine a data sample model corresponding to the target user according to the user tag of the target user and the preset tag and model correspondence rule; the data sample model includes a plurality of historical word vector samples and a corresponding reply operation set; According to a preset vector conversion algorithm, the current speech information is converted into a word vector combination; According to the preset data sample model library and similarity algorithm, the reply operation corresponding to the word vector combination is calculated, including: Based on the cosine similarity algorithm, the similarity between each of the historical word vector samples and the word vector combination in the data sample model corresponding to the target user is calculated; According to the similarity, a target word vector sample whose similarity is greater than a preset similarity threshold is selected from all the historical word vector samples; Calculate the intersection of the reply operation sets corresponding to all the target word vector samples to obtain a first reply operation set; Based on a preset operation contradiction rule, determining the number of all other operations that are contradictory to each operation in the first reply operation set; Deleting all operations in the first reply operation set where the number of conflicting operations is greater than a preset threshold, to obtain a second reply operation set; Obtaining historical user personality parameters of the target user; Calculating the adaptability parameter corresponding to each operation in the second reply operation set and the historical user personality parameter according to the preset adaptation relationship between the personality and the operation; Determine the operation with the highest adaptability parameter in the second reply operation set as the reply operation corresponding to the word vector combination; According to the reply operation, reply information to the current voice information is generated; the reply information is used to reply to the target user.
2. The user question and answer data processing method based on vector calculation according to claim 1 is characterized in that: The data sample model library includes a plurality of data sample models.
3. The user question and answer data processing method based on vector calculation according to claim 1 is characterized in that: The step of converting the current speech information into a word vector combination according to a preset vector conversion algorithm includes: Determine the speech text corresponding to the current speech information according to the speech text recognition algorithm; Determining the tone information corresponding to the current voice information according to the voice tone prediction algorithm; Based on a word segmentation algorithm, determining a plurality of text words corresponding to the speech text; Randomly deleting the plurality of text words to obtain enhanced text word data; Based on the word frequency algorithm and the word distance algorithm, a word relationship topology is generated according to the plurality of text words and the enhanced text word data; the word relationship topology includes the word frequency information of any of the text words and the average word distance information between the word and all other text words; Generate a word vector corresponding to each of the text words according to the word relationship topology; The word vectors corresponding to all the text words are subjected to length control processing and PCA dimensionality reduction processing to obtain a word vector combination corresponding to the current voice information.
4. The user question and answer data processing method based on vector calculation according to claim 2 is characterized in that: The method further comprises: When the data sample model corresponding to the target user cannot be determined according to the corresponding rule between the label and the model, sending the word vector combination to a preset large language model; Obtaining model response information of the large language model for the word vector combination; The model reply information is sent to the target user.
5. The user question and answer data processing method based on vector calculation according to claim 2 is characterized in that: The data sample model library is established by the following steps: Get user voice information of multiple historical users; Determine the speech word vector corresponding to each of the user speech information; According to the keyword matching rule, determining the matching tags appearing in the text of each of the speech word vectors; the matching tags include at least one of childbearing, drinking, smoking, dissatisfaction, complaint, refund, exercise, weight loss and illness; Determine a set of reply operations corresponding to each of the speech word vectors; All the speech word vectors and corresponding reply operation sets with the same matching labels are determined as one of the data sample models to obtain the data sample model library.
6. A user question and answer data processing system based on vector computing, characterized in that: The system comprises: The acquisition module is used to obtain the current voice information of the target user, including: Get the user parameters corresponding to the target user; Determine a user tag of the target user according to the user parameter; the user tag includes at least one of a lactation tag, a pregnancy tag, a cold tag, a drinking tag, a smoking tag, and a sports tag; Determine a data sample model corresponding to the target user according to the user tag of the target user and the preset tag and model correspondence rule; the data sample model includes a plurality of historical word vector samples and a corresponding reply operation set; A conversion module, used to convert the current voice information into a word vector combination according to a preset vector conversion algorithm; The calculation module is used to calculate the reply operation corresponding to the word vector combination according to the preset data sample model library and the similarity algorithm, including: Based on the cosine similarity algorithm, the similarity between each of the historical word vector samples and the word vector combination in the data sample model corresponding to the target user is calculated; According to the similarity, a target word vector sample whose similarity is greater than a preset similarity threshold is selected from all the historical word vector samples; Calculate the intersection of the reply operation sets corresponding to all the target word vector samples to obtain a first reply operation set; Based on a preset operation contradiction rule, determining the number of all other operations that are contradictory to each operation in the first reply operation set; Deleting all operations in the first reply operation set where the number of conflicting operations is greater than a preset threshold, to obtain a second reply operation set; Obtaining historical user personality parameters of the target user; Calculating the adaptability parameter corresponding to each operation in the second reply operation set and the historical user personality parameter according to the preset adaptation relationship between the personality and the operation; Determine the operation with the highest adaptability parameter in the second reply operation set as the reply operation corresponding to the word vector combination; The reply module is used to generate reply information to the current voice information according to the reply operation; the reply information is used to reply to the target user.
7. A user question and answer data processing system based on vector computing, characterized in that: The system comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the user question and answer data processing method based on vector calculation as described in any one of claims 1-5.
Citation Information
Patent Citations
Information processing method, device and equipment and computer storage medium
CN114239606A
Method and device for generating dialogue information, readable storage medium and equipment
CN115934902A