Agent-based voice interaction method and related device

Through speech recognition and keyword recognition technology, initial text information is identified and corrected, which solves the problem of inaccurate voice interaction caused by users' lack of understanding of a certain field, improves the accuracy and efficiency of voice interaction, and enhances user experience.

CN118506783BActive Publication Date: 2024-09-27CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410967885.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-09-27
Estimated Expiration
2044-07-18

AI Technical Summary

Technical Problem

When the user does not know enough about a certain field, interacting with the Agent through voice may lead to inaccurate input voice expressions, reducing the effect of voice interaction.

Method used

Through voice input, speech recognition, keyword recognition, sentence anomaly identification and correction are performed, target text information is obtained, query retrieval and speech conversion are performed to ensure the accuracy and completeness of the output information.

Benefits of technology

It improves user experience and operational convenience, enhances the efficiency and accuracy of the interaction process, can more accurately understand user intentions, reduces misunderstandings and errors, and achieves efficient information exchange and feedback loops.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118506783B
    Figure CN118506783B
Patent Text Reader

Abstract

The embodiment of the present invention provides an Agent-based voice interaction method and related devices, belonging to the field of human-computer interaction technology. The method includes: obtaining initial voice information corresponding to a target user, and performing voice recognition on the initial voice information to obtain initial text information; performing keyword recognition on the initial text information to obtain a target keyword, and determining the initial relationship corresponding to the target keyword according to the initial text information; performing sentence anomaly recognition on the initial text information according to the initial relationship to obtain a recognition result; when the recognition result meets a preset condition, obtaining a target relationship corresponding to the target keyword, and correcting the initial text information according to the target relationship to obtain the target text information; performing query retrieval according to the target text information to obtain a target query result, and performing voice conversion on the target query result to obtain the target voice information, so that the target voice information is fed back to the target user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of human-computer interaction, and in particular to an Agent-based voice interaction method and related devices. Background Art

[0002] Agent-based voice interaction has many advantages, including providing convenient, efficient and personalized services, improving the operating environment and enhancing the user experience. These advantages can bring important benefits in many fields such as industry, medical care, and home intelligence. However, in actual use, when users do not have enough knowledge of a certain field, interacting with the agent through voice may result in inaccurate input voice expression, thereby reducing the effect of voice interaction. Summary of the invention

[0003] The main purpose of the embodiments of the present invention is to provide an agent-based voice interaction method and related devices, aiming to solve the problem in the related art that when a user does not have sufficient knowledge of a certain field, interacting with the agent through voice may result in inaccurate input voice expression, thereby reducing the effect of voice interaction.

[0004] In a first aspect, an embodiment of the present invention provides an agent-based voice interaction method, comprising:

[0005] Obtaining initial voice information corresponding to the target user, and performing voice recognition on the initial voice information to obtain initial text information;

[0006] Performing keyword recognition on the initial text information to obtain a target keyword, and determining an initial relationship corresponding to the target keyword according to the initial text information;

[0007] Perform sentence anomaly recognition on the initial text information according to the initial relationship to obtain a recognition result;

[0008] When the recognition result meets the preset condition, the target relationship corresponding to the target keyword is obtained, and the initial text information is modified according to the target relationship to obtain the target text information;

[0009] A query is performed based on the target text information to obtain a target query result, and the target query result is converted into voice to obtain target voice information, so that the target voice information is fed back to the target user.

[0010] In a second aspect, an embodiment of the present invention provides an Agent-based voice interaction device, comprising:

[0011] A data acquisition module is used to obtain the initial voice information corresponding to the target user, and perform voice recognition on the initial voice information to obtain initial text information;

[0012] A relationship recognition module, configured to perform keyword recognition on the initial text information to obtain a target keyword, and determine an initial relationship corresponding to the target keyword according to the initial text information;

[0013] An anomaly recognition module, used for performing sentence anomaly recognition on the initial text information according to the initial relationship to obtain a recognition result;

[0014] A correction processing module, used for obtaining a target relationship corresponding to the target keyword when the recognition result meets a preset condition, and correcting the initial text information according to the target relationship to obtain target text information;

[0015] The information query module is used to perform query retrieval according to the target text information to obtain a target query result, and perform voice conversion on the target query result to obtain target voice information, so that the target voice information is fed back to the target user.

[0016] In a third aspect, an embodiment of the present invention further provides a terminal device, comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of any one of the agent-based voice interaction methods provided in the specification of the present invention are implemented.

[0017] In a fourth aspect, an embodiment of the present invention further provides a storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any agent-based voice interaction method provided in the specification of the present invention.

[0018] The embodiment of the present invention provides an agent-based voice interaction method and a related device. The method includes providing a natural and convenient interaction mode through voice input, enhancing the user's operation comfort and convenience, thereby the user does not need to manually input information, reducing the complexity and time cost of the operation, and then through keyword recognition, the user's intention and focus can be understood more accurately, and the accuracy and efficiency of subsequent processing can be improved. Then, by analyzing the initial text information, the initial relationship between target keywords is determined, which helps to better understand the user's query or demand background, and then the initial relationship is used to perform sentence abnormality recognition on the initial text information to obtain a recognition result, so that the user's possible misunderstanding or error can be captured in time, thereby avoiding a negative impact on subsequent processing, and then correcting the initial text information according to the recognition result to obtain the target text information, and by correcting the initial text information, ensuring the accuracy and completeness of the output information, and then performing query retrieval according to the target text information to obtain the target query result, and performing voice conversion, so that the user's needs can be quickly and accurately obtained and the accurate target query result can be obtained, and the target query result is further converted into voice for information feedback, so as to achieve efficient information exchange and feedback cycle. This method not only improves user experience and operational convenience, but also improves the efficiency and accuracy of the interaction process through precise semantic understanding and fault-tolerant processing, thereby better meeting user needs and expectations. It also solves the problem in related technologies that when users do not have enough knowledge of a certain field, interacting with the Agent through voice may result in inaccurate input voice expressions, thereby reducing the effect of voice interaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 A flow chart of an agent-based voice interaction method provided by an embodiment of the present invention;

[0021] Figure 2 A schematic diagram of the module structure of an Agent-based voice interaction device provided in an embodiment of the present invention;

[0022] Figure 3 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0025] It should be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0026] The embodiment of the present invention provides an agent-based voice interaction method and related devices. The agent-based voice interaction method can be applied to a terminal device, which can be an electronic device such as a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device. The terminal device can be a server or a server cluster.

[0027] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0028] Please refer to Figure 1 , Figure 1 A flow chart of an Agent-based voice interaction method provided in an embodiment of the present invention.

[0029] like Figure 1 As shown, the Agent-based voice interaction method includes steps S101 to S105.

[0030] Step S101: obtaining initial voice information corresponding to a target user, and performing voice recognition on the initial voice information to obtain initial text information.

[0031] For example, in the field of voice interaction, Agent usually refers to an intelligent system or program that can understand voice input and perform relevant processing and feedback, and then use appropriate equipment or applications to capture the target user's voice input to obtain initial voice information. Then use Agent to perform relevant processing and feedback on the initial voice information.

[0032] Exemplarily, the collected initial voice information is preprocessed, including denoising, voice enhancement, etc., to improve the accuracy and stability of subsequent voice recognition, and then the preprocessed initial voice information is converted into initial text information using voice recognition technology. Voice recognition technology involves acoustic models and language models, and then the initial voice information is converted into corresponding initial text information.

[0033] Step S102: Perform keyword recognition on the initial text information to obtain a target keyword, and determine an initial relationship corresponding to the target keyword based on the initial text information.

[0034] Exemplarily, the initial text information is preprocessed, which includes removing meaningless characters, punctuation marks, stop words, etc. in the text to reduce noise and improve the accuracy of subsequent keyword recognition, and then using algorithms such as word frequency, TF-IDF (word frequency-inverse document frequency), TextRank, etc., to extract important target keywords from the preprocessed text. These target keywords reflect the core content and focus of the initial text information.

[0035] Exemplarily, semantic analysis and relationship extraction techniques are used to determine the relationship between these target keywords based on the context and logical relationship in the initial text information to understand the initial relationship (such as subject-predicate-object relationship) or semantic relationship (such as cause-effect relationship, parallel relationship, etc.) between the target keywords.

[0036] In some embodiments, the keyword recognition of the initial text information to obtain the target keyword includes: using a text representation module of an entity recognition model to represent the initial text information with word information to obtain a text vector corresponding to the initial text information; using an information annotation module of the entity recognition model to perform feature extraction and context constraints on the text vector to obtain a text annotation result corresponding to the initial text information; and using a text cutting module of the entity recognition model to mark boundaries on the text annotation result to obtain the target keyword.

[0037] Exemplarily, the entity recognition model includes a text representation module, an information annotation module, and a text segmentation module, and then uses the text representation module of the entity recognition model to convert the initial text information into a text vector representation. These vectors can capture the semantic and contextual features of the initial text information and provide a basis for subsequent processing.

[0038] Exemplarily, the information annotation module of the entity recognition model is used to extract features from the text vector, taking into account contextual constraints. This step aims to identify and annotate entities, keywords or important fragments in the text, as well as the relationships between them. The text segmentation module of the entity recognition model is then used to mark the boundaries of the annotation results, thereby extracting the target keywords.

[0039] For example, the text representation module uses a pre-trained language model (such as BERT, GPT) to perform text representation and feature extraction, and then uses an information annotation module (such as BiLSTM) to extract features and consider context constraints. Finally, the text segmentation module is used to perform boundary recognition or edge recognition on the text annotation results to obtain the target keywords.

[0040] Specifically, using entity recognition models for text processing can improve the system's ability to understand and process text information, and can quickly and accurately extract key information from complex initial text information, thereby providing support for subsequent improvements in user experience and system performance.

[0041] In some embodiments, the text cutting module includes a feature splicing layer, a non-entity encoding layer, a position encoding layer, and an entity recognition layer. The text cutting module using the entity recognition model marks the boundaries of the text annotation results to obtain the target keywords, including: using the non-entity encoding layer to encode the non-entity information identified in the previous layer in the initial text information to obtain a non-entity representation; using the position encoding layer to represent the position of the entity information identified in the previous layer in the text vector to obtain an entity representation; using the feature splicing layer to splice the non-entity representation and the entity representation to obtain a splicing vector; using the entity recognition layer to mark the boundaries of the splicing vector to obtain the target keyword.

[0042] Exemplarily, the text cutting module includes a feature splicing layer, a non-entity encoding layer, a position encoding layer, and an entity recognition layer.

[0043] Exemplarily, a non-entity encoding layer is used to encode the non-entity information identified in the initial text information. This step can use various encoding techniques, such as word embeddings or other forms of vectorized representation, to convert the non-entity information into a corresponding representation form. The position encoding layer is then used to represent the position of the entity information identified in the previous layer in the text vector. Position encoding is usually used to indicate the relative position relationship of various parts in the text, which helps to improve the representation accuracy of entity information and the ability to understand the context.

[0044] For example, in the feature concatenation layer, the representations processed by non-entity encoding and position encoding are concatenated to form a concatenation vector. This step aims to organically combine the non-entity information and entity information in the text, providing a richer information basis for subsequent entity recognition. Finally, the entity recognition layer is used to mark the boundaries of the concatenation vector, thereby realizing the cutting of entities in the initial text information, and then obtaining the target keywords, thereby ensuring that important information entities in the text can be accurately identified.

[0045] Specifically, the use of non-entity encoding layer and position encoding layer to encode and positionally represent text information can more accurately capture the semantic and contextual features of non-entity information and entity information in the text. This improvement in representation capabilities helps subsequent tasks to deeply understand and accurately analyze the text. The feature splicing layer effectively splices non-entity representations and entity representations, combining the two to form a more comprehensive splicing vector. This fusion can comprehensively utilize various information in the text and provide a more comprehensive feature expression, thereby enhancing the system's ability to fully understand text information. By marking the boundaries of the splicing vector through the entity recognition layer, the system can accurately identify the target keywords in the text, and can thus be more intelligent and efficient in processing and understanding the initial text information.

[0046] In some embodiments, the determining the initial relationship corresponding to the target keyword according to the initial text information includes: obtaining the position information of the target keyword in the initial text information, and determining the direction information between any two of the target keywords according to the position information; classifying the target keywords using a keyword recognition model to obtain the keyword type corresponding to the target keyword, wherein the keyword type is any one of a subject and an object; determining the initial relationship corresponding to any two of the target keywords according to the keyword type and the direction information; wherein the direction information is obtained according to the following formula:

[0047] ;

[0048] represents the direction information between the target keyword p and the target keyword q, represents the position information corresponding to the target keyword p, represents the position information corresponding to the target keyword q, represents the average position of all the target keywords p. represents the average position of all the target keywords q. represents the position variance corresponding to all the target keywords p, represents the position variance corresponding to all the target keywords q, To prevent division by zero, represents the weight information between the target keyword p and the target keyword q, represents the bias parameter, represents the amplitude adjustment parameter, which is used to adjust the influence of the additional sine function. Represents the angle information of the target keyword p and the target keyword q in the same coordinate system.

[0049] Exemplarily, the position information of the target keyword is obtained from the initial text information. The position information can be the starting position and the ending position of the target keyword in the initial text information or other forms of position marks, and then the direction information between any two target keywords is determined based on the position information. The direction information can be simply defined as the position relationship of one keyword relative to another, such as before and after, context, etc. The direction information can also be obtained according to the following formula:

[0050] ;

[0051] Represents the direction information between the target keyword p and the target keyword q, Indicates the position information corresponding to the target keyword p, Indicates the position information corresponding to the target keyword q, represents the average position of all target keywords p. represents the average position of all target keywords q. represents the position variance corresponding to all target keywords p, represents the position variance corresponding to all target keywords q, To prevent division by zero, Represents the weight information between target keyword p and target keyword q, represents the bias parameter, represents the amplitude adjustment parameter, which is used to adjust the influence of the additional sine function. Indicates the angle information of target keyword p and target keyword q in the same coordinate system.

[0052] For example, the above formula fuses the position information between target keywords. Once the position information corresponding to the target keywords is exchanged, different outputs will be generated. Therefore, the above formula can not only fuse features, but also effectively reflect the directional features between the input target keywords. This provides support for the subsequent accurate identification of the initial relationship.

[0053] Exemplarily, a keyword recognition model is used to classify each target keyword to determine its keyword type. The keyword type can be either subject or object. Subject and object usually represent the actor and object in an action or event. The subject is the party that exerts force in an action or event, and the object is the party that receives force in an action or event.

[0054] For example, prepare a training data set, including text samples and their corresponding target keywords and their type annotations. Make sure that each keyword in the data set has a clear type label, such as subject or object. Then select a suitable keyword classification model according to the task requirements. Common models include classifiers based on statistical methods (such as naive Bayes), machine learning models (such as support vector machines, random forests), and models based on deep learning (such as convolutional neural networks, Transformer models). Then use the prepared training data set and the selected model for training to obtain a keyword recognition model.

[0055] Exemplarily, the initial relationship corresponding to any two keywords is determined according to the keyword type of the target keyword and the direction information between them. The initial relationship may be an action relationship, a descriptive relationship, and the like.

[0056] For example, each target keyword can be classified as either a subject or an object. A subject is usually the performer of an action or event, while an object is the object of an action or event. Direction information describes the positional relationship between any two target keywords, such as before and after, context, etc. Once the type (subject or object) of each target keyword and their direction information in the initial text information are determined, the relationship between them can be inferred. If one target keyword is marked as a subject and the other target keyword is marked as an object, and the direction information indicates that the subject appears before the object, then it can be inferred that the subject performed a certain action or operation. If both target keywords are marked as a subject or an object, and their position information indicates that they are in a context or parallel relationship with each other in the text, then it can be inferred that there is some kind of interaction or influence relationship between them.

[0057] Step S103: performing sentence anomaly recognition on the initial text information according to the initial relationship to obtain a recognition result.

[0058] Exemplarily, the target relationship between target keywords is obtained based on historical data, and then the target relationship is compared with the initial relationship. When the target relationship is the same as the initial relationship, the recognition result is determined to be a normal sentence. When the target relationship is different from the initial relationship, the recognition result is determined to be an abnormal sentence.

[0059] In some embodiments, the performing sentence anomaly recognition on the initial text information according to the initial relationship to obtain a recognition result includes: obtaining the technical field corresponding to the target keyword, and obtaining the target associated sentence corresponding to the target keyword in the technical field; determining the target relationship corresponding to any two target keywords according to the target associated sentence; comparing the initial relationship and the target relationship to determine a comparison result, and determining the recognition result corresponding to the initial text information according to the comparison result.

[0060] Exemplarily, a domain dictionary, a domain classification model or a keyword-based technical field matching algorithm is used to map the extracted target keywords to the corresponding technical fields. For each target keyword, the corresponding target associated sentence is extracted from the text corpus or knowledge base of the technical field through information retrieval technology.

[0061] Exemplarily, the extracted target-related sentences are analyzed and processed, and the target relationship between any two target keywords is determined using semantic analysis, association analysis, or knowledge graph-based relationship extraction technology.

[0062] Exemplarily, the initial relationship extracted from the initial text information is compared with the target relationship determined from the target associated sentence. The recognition result corresponding to the initial text information is determined according to the comparison result. If the initial relationship is consistent or similar to the target relationship, the recognition result can be confirmed as a normal sentence; otherwise, an abnormal sentence or a sentence inconsistency may be identified.

[0063] Step S104: When the recognition result meets the preset condition, the target relationship corresponding to the target keyword is obtained, and the initial text information is modified according to the target relationship to obtain the target text information.

[0064] Exemplarily, when the preset condition is that the sentence is abnormal or inconsistent, then when the recognition result is that the sentence is abnormal or inconsistent, the recognition result meets the preset condition, and then the initial text information is corrected according to the corresponding target relationship between the target keywords to obtain the target text information.

[0065] For example, the correct relationship between these target keywords, i.e., the target relationship, is determined by querying an external knowledge base or database or using natural language processing techniques (such as relationship extraction, entity linking, etc.). Then, based on the obtained target relationship, the incorrect relationship in the initial text information is corrected. If some key relationships are missing in the initial text information, these relationships are added to the initial text information. If there are redundant or incorrect relationship descriptions in the initial text information, they are deleted or corrected. Thus, the target text information can be obtained after completing all necessary corrections. The target text information can more accurately reflect the actual relationship between the target keywords.

[0066] In some embodiments, the initial text information is modified according to the target relationship to obtain the target text information, including: using preset rules to identify the sentence frame of the initial text information to obtain the target sentence frame corresponding to the initial text information; generating a text relationship description corresponding to any two target keywords according to the target relationship; and filling the text relationship description into the target sentence frame to obtain the target text information.

[0067] For example, according to specific needs and application scenarios, a set of rules for identifying sentence frames is designed. These rules may involve specific sentence patterns, keyword positions, grammatical structures, etc., and then these preset rules are applied to the initial text information using natural language processing tools or regular expressions. Thus, through matching and recognition, the target sentence frame that meets the preset rules is extracted from the initial text information. The target sentence frame is an abstract representation of the text structure, which defines the position and relationship of different components in the sentence.

[0068] Exemplarily, relevant target keywords are described in natural language based on the target relationships, so that the target keywords are converted into readable sentences or phrases based on the target relationships, that is, a textual relationship description is obtained.

[0069] Exemplarily, the generated text relationship description is matched with the target sentence frame, that is, which text relationship description is suitable for filling into which part of the frame. The text relationship description is filled in according to the structure of the sentence frame to ensure that the filled text remains grammatically correct and semantically clear. Thus, a target text information with a complete structure and rich information is obtained. The target text information combines the structure of the initial text information and the relationship description between the target keywords.

[0070] Specifically, by identifying the sentence framework through preset rules, the initial text information can be converted into a structured target sentence framework. This helps to clearly express the key information points in the text and the logical relationship between them. Generating a text relationship description based on the target relationship can more intuitively show the connection between keywords and help users understand the relevance and importance of the text content. Finally, the generated text relationship description is filled into the sentence framework, which can make the target text information more detailed and rich. Such an increase in information richness helps to accurately convey the meaning and intention of the text. It provides good support for the accuracy of subsequent result queries.

[0071] Step S105: performing a search and retrieval according to the target text information to obtain a target search result, and performing voice conversion on the target search result to obtain target voice information, so that the target voice information is fed back to the target user.

[0072] Exemplarily, a suitable query tool or API is used to perform query retrieval based on the target text information to ensure that the query covers relevant data sources or knowledge bases to obtain accurate and detailed target query results.

[0073] Exemplarily, a suitable speech synthesis tool or service is selected to convert text information into natural and fluent speech. For example, based on text-to-speech (TTS) technology, a natural speech effect can be generated. Thus, the target query result obtained by the query is input into the speech synthesis tool to obtain the target speech information.

[0074] Exemplarily, the generated target voice information is fed back to the target user through a voice player, a telephone system, a voice assistant, etc., thereby ensuring that the content of the target voice information is relevant to the user's query and can clearly and accurately convey the required information.

[0075] In some embodiments, the querying and retrieving according to the target text information to obtain the target query result includes: obtaining an initial question statement and answer information corresponding to the initial question statement from a database; calculating the text similarity between the initial question statement and the target text information; calculating a first similarity value corresponding to the target keyword and the target text information, and calculating a second similarity value corresponding to the target keyword and the initial question statement; fusing the text similarity, the first similarity value, and the second similarity value to obtain a target similarity between the initial question statement and the target text information; filtering out a target question statement from the initial question statement according to the target similarity, and then determining the answer information corresponding to the target question statement as the target query result; wherein the target similarity is obtained according to the following formula:

[0076] ;

[0077] represents the target similarity between the initial question sentence i and the target text information j, represents the text similarity between the initial question sentence i and the target text information j, m represents the number of corresponding target keywords, represents the second similarity value between the initial question statement i and the kth target keyword, Represents the first similarity value between the target text information j and the kth target keyword.

[0078] Exemplarily, the initial question statement and the answer information corresponding to the initial question statement are retrieved from the database. The text similarity between the initial question statement and the target text information is calculated using an NLP toolkit such as SpaCy, NLTK or a dedicated similarity calculation library.

[0079] Exemplarily, to calculate the first similarity value between the target keyword and the target text information, TF-IDF may be used to calculate the importance of the target keyword in the target text information, and then the importance is determined as the first similarity value between the target keyword and the target text information.

[0080] Exemplarily, the first similarity value between the target keyword and the initial text information is calculated, and the importance of the target keyword in the initial text information can be calculated using TF-IDF, and then the importance is determined as the second similarity value between the target keyword and the initial text information.

[0081] Exemplarily, the text similarity, the first similarity value and the second similarity value are combined to calculate the comprehensive target similarity using the following formula:

[0082] ;

[0083] represents the target similarity between the initial question sentence i and the target text information j, represents the text similarity between the initial question sentence i and the target text information j, m represents the number of target keywords, represents the second similarity value between the initial question sentence i and the kth target keyword, Represents the first similarity value between the target text information j and the kth target keyword.

[0084] For example, the above formula can capture the different levels of similarity between the initial question statement and the target text information. Text similarity usually focuses on the closeness of overall semantics and content, while keyword similarity can more accurately evaluate the matching of important words, so that taking these factors into consideration can more comprehensively evaluate the target similarity between the initial question statement and the target text information.

[0085] Exemplarily, the initial question sentence when the target similarity corresponds to the maximum value is determined as the target question sentence, and then the answer information corresponding to the target question sentence is used as the target query result.

[0086] Specifically, the target similarity is calculated by combining the text similarity, the first similarity value and the second similarity value, which can comprehensively consider the similarities between the initial question statement and the target text information at different levels, and improve the accuracy and reliability of the overall matching. Then, based on the calculated target similarity, the most relevant target question statement is screened out from the initial question statement, and the corresponding answer information is determined as the target query result, which helps to accurately meet the user's information needs, thereby providing the user with more accurate and relevant query results, thereby improving the system performance and user satisfaction.

[0087] The embodiment of the present invention provides an agent-based voice interaction method and a related device. The method includes providing a natural and convenient interaction mode through voice input, enhancing the user's operation comfort and convenience, thereby the user does not need to manually input information, reducing the complexity and time cost of the operation, and then through keyword recognition, the user's intention and focus can be understood more accurately, and the accuracy and efficiency of subsequent processing can be improved. Then, by analyzing the initial text information, the initial relationship between target keywords is determined, which helps to better understand the user's query or demand background, and then the initial relationship is used to perform sentence abnormality recognition on the initial text information to obtain a recognition result, so that the user's possible misunderstanding or error can be captured in time, thereby avoiding a negative impact on subsequent processing, and then correcting the initial text information according to the recognition result to obtain the target text information. By correcting the initial text information, the accuracy and completeness of the output information are ensured, and then querying and retrieving according to the target text information to obtain the target query result, and performing voice conversion, so that the user's needs can be quickly and accurately obtained and the accurate target query result can be obtained, and the target query result is converted into voice for information feedback, so as to achieve efficient information exchange and feedback cycle. This method not only improves user experience and operational convenience, but also improves the efficiency and accuracy of the interaction process through precise semantic understanding and fault-tolerant processing, thereby better meeting user needs and expectations. It also solves the problem in related technologies that when users do not have enough knowledge of a certain field, interacting with the Agent through voice may result in inaccurate input voice expressions, thereby reducing the effect of voice interaction.

[0088] See also Figure 2 , Figure 2An agent-based voice interaction device 200 is provided in an embodiment of the present application. The agent-based voice interaction device 200 includes a data acquisition module 201, a relationship recognition module 202, an exception recognition module 203, a correction processing module 204, and an information query module 205, wherein the data acquisition module 201 is used to obtain initial voice information corresponding to a target user, and perform voice recognition on the initial voice information to obtain initial text information; the relationship recognition module 202 is used to perform keyword recognition on the initial text information to obtain a target keyword, and determine the initial relationship corresponding to the target keyword according to the initial text information; the exception recognition module 203 is used to perform sentence exception recognition on the initial text information according to the initial relationship to obtain a recognition result; the correction processing module 204 is used to obtain a target relationship corresponding to the target keyword when the recognition result meets a preset condition, and correct the initial text information according to the target relationship to obtain the target text information; the information query module 205 is used to perform query retrieval according to the target text information to obtain a target query result, and perform voice conversion on the target query result to obtain the target voice information, so that the target voice information is fed back to the target user.

[0089] In some implementations, the relationship identification module 202 performs, during the process of performing keyword identification on the initial text information to obtain a target keyword:

[0090] Using a text representation module of an entity recognition model to represent the initial text information with words to obtain a text vector corresponding to the initial text information;

[0091] Using the information annotation module of the entity recognition model to perform feature extraction and context constraints on the text vector to obtain a text annotation result corresponding to the initial text information;

[0092] The text segmentation module of the entity recognition model is used to mark the boundaries of the text annotation results to obtain the target keywords.

[0093] In some implementations, the text segmentation module includes a feature concatenation layer, a non-entity encoding layer, a position encoding layer, and an entity recognition layer. The relationship recognition module 202 performs the following steps in the process of obtaining the target keyword by marking the boundaries of the text annotation result using the text segmentation module using the entity recognition model:

[0094] Using the non-entity encoding layer to encode the non-entity information identified by the previous layer in the initial text information to obtain a non-entity representation;

[0095] Using the position encoding layer to perform position representation on the entity information identified by the previous layer in the text vector to obtain entity representation;

[0096] Using the feature splicing layer to splice the non-entity representation and the entity representation to obtain a splicing vector;

[0097] The entity recognition layer is used to mark the boundaries of the concatenated vector to obtain the target keyword.

[0098] In some implementations, during the process of determining the initial relationship corresponding to the target keyword according to the initial text information, the relationship identification module 202 performs:

[0099] Obtaining position information of the target keyword in the initial text information, and determining direction information between any two of the target keywords according to the position information;

[0100] Using a keyword recognition model to classify the target keyword to obtain a keyword type corresponding to the target keyword, where the keyword type is any one of a subject and an object;

[0101] Determine the initial relationship corresponding to any two target keywords according to the keyword type and the direction information;

[0102] The direction information is obtained according to the following formula:

[0103] ;

[0104] represents the direction information between the target keyword p and the target keyword q, represents the position information corresponding to the target keyword p, represents the position information corresponding to the target keyword q, represents the average position of all the target keywords p. represents the average position of all the target keywords q. represents the position variance corresponding to all the target keywords p, represents the position variance corresponding to all the target keywords q, To prevent division by zero, represents the weight information between the target keyword p and the target keyword q, represents the bias parameter, represents the amplitude adjustment parameter, which is used to adjust the influence of the additional sine function. Represents the angle information of the target keyword p and the target keyword q in the same coordinate system.

[0105] In some implementations, the exception recognition module 203, in the process of obtaining a recognition result by performing sentence exception recognition on the initial text information according to the initial relationship, executes:

[0106] Obtaining the technical field corresponding to the target keyword, and obtaining the target associated sentence corresponding to the target keyword in the technical field;

[0107] Determine the target relationship corresponding to any two target keywords according to the target association sentence;

[0108] The initial relationship and the target relationship are compared to determine a comparison result, and the recognition result corresponding to the initial text information is determined according to the comparison result.

[0109] In some implementations, the correction processing module 204 performs, during the process of correcting the initial text information according to the target relationship to obtain the target text information:

[0110] Using preset rules to identify the sentence frame of the initial text information, and obtaining the target sentence frame corresponding to the initial text information;

[0111] Generate a text relationship description corresponding to any two target keywords according to the target relationship;

[0112] The text relationship description is filled into the target sentence framework to obtain the target text information.

[0113] In some implementations, the information query module 205 performs, during the process of performing a query and retrieval according to the target text information to obtain a target query result:

[0114] Obtaining an initial question statement and answer information corresponding to the initial question statement from a database;

[0115] Calculating the text similarity between the initial question statement and the target text information;

[0116] Calculating a first similarity value corresponding to the target keyword and the target text information, and calculating a second similarity value corresponding to the target keyword and the initial question statement;

[0117] fusing the text similarity, the first similarity value, and the second similarity value to obtain a target similarity between the initial question statement and the target text information;

[0118] Filtering a target question sentence from the initial question sentence according to the target similarity, and then determining the answer information corresponding to the target question sentence as the target query result;

[0119] The target similarity is obtained according to the following formula:

[0120] ;

[0121] represents the target similarity between the initial question sentence i and the target text information j, represents the text similarity between the initial question sentence i and the target text information j, m represents the number of corresponding target keywords, represents the second similarity value between the initial question statement i and the kth target keyword, Represents the first similarity value between the target text information j and the kth target keyword.

[0122] In some implementations, the Agent-based voice interaction apparatus 200 may be applied to a terminal device.

[0123] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the Agent-based voice interaction device 200 described above can refer to the corresponding process in the aforementioned Agent-based voice interaction method embodiment, and will not be repeated here.

[0124] See also Figure 3 , Figure 3 A schematic block diagram of the structure of a terminal device provided in an embodiment of the present invention.

[0125] like Figure 3 As shown, the terminal device 300 includes a processor 301 and a memory 302 , and the processor 301 and the memory 302 are connected via a bus 303 , such as an I2C (Inter-integrated Circuit) bus.

[0126] Specifically, the processor 301 is used to provide computing and control capabilities to support the operation of the entire terminal device. The processor 301 can be a central processing unit (CPU), and the processor 301 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0127] Specifically, the memory 302 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.

[0128] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a partial structure related to the embodiment of the present invention, and does not constitute a limitation on the terminal device to which the embodiment of the present invention is applied. The specific server may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0129] The processor is used to run the computer program stored in the memory, and implement any one of the agent-based voice interaction methods provided by the embodiments of the present invention when executing the computer program.

[0130] In one embodiment, the processor is used to run a computer program stored in the memory, and implements the following steps when executing the computer program:

[0131] Obtaining initial voice information corresponding to the target user, and performing voice recognition on the initial voice information to obtain initial text information;

[0132] Performing keyword recognition on the initial text information to obtain a target keyword, and determining an initial relationship corresponding to the target keyword according to the initial text information;

[0133] Perform sentence anomaly recognition on the initial text information according to the initial relationship to obtain a recognition result;

[0134] When the recognition result meets the preset condition, the target relationship corresponding to the target keyword is obtained, and the initial text information is modified according to the target relationship to obtain the target text information;

[0135] A query is performed based on the target text information to obtain a target query result, and the target query result is converted into voice to obtain target voice information, so that the target voice information is fed back to the target user.

[0136] In some implementations, during the process of performing keyword recognition on the initial text information to obtain a target keyword, the processor 301 executes:

[0137] Using a text representation module of an entity recognition model to represent the initial text information with words to obtain a text vector corresponding to the initial text information;

[0138] Using the information annotation module of the entity recognition model to perform feature extraction and context constraints on the text vector to obtain a text annotation result corresponding to the initial text information;

[0139] The text segmentation module of the entity recognition model is used to mark the boundaries of the text annotation results to obtain the target keywords.

[0140] In some implementations, the text segmentation module includes a feature concatenation layer, a non-entity encoding layer, a position encoding layer, and an entity recognition layer. In the process of the text segmentation module using the entity recognition model to mark the boundaries of the text annotation results and obtain the target keyword, the processor 301 executes:

[0141] Using the non-entity encoding layer to encode the non-entity information identified by the previous layer in the initial text information to obtain a non-entity representation;

[0142] Using the position encoding layer to perform position representation on the entity information identified by the previous layer in the text vector to obtain entity representation;

[0143] Using the feature splicing layer to splice the non-entity representation and the entity representation to obtain a splicing vector;

[0144] The entity recognition layer is used to mark the boundaries of the concatenated vector to obtain the target keyword.

[0145] In some implementations, during the process of determining the initial relationship corresponding to the target keyword according to the initial text information, the processor 301 executes:

[0146] Obtaining position information of the target keyword in the initial text information, and determining direction information between any two of the target keywords according to the position information;

[0147] Using a keyword recognition model to classify the target keyword to obtain a keyword type corresponding to the target keyword, where the keyword type is any one of a subject and an object;

[0148] Determine the initial relationship corresponding to any two target keywords according to the keyword type and the direction information;

[0149] The direction information is obtained according to the following formula:

[0150] ;

[0151] represents the direction information between the target keyword p and the target keyword q, represents the position information corresponding to the target keyword p, represents the position information corresponding to the target keyword q, represents the average position of all the target keywords p. represents the average position of all the target keywords q. represents the position variance corresponding to all the target keywords p, represents the position variance corresponding to all the target keywords q, To prevent division by zero, represents the weight information between the target keyword p and the target keyword q, represents the bias parameter, represents the amplitude adjustment parameter, which is used to adjust the influence of the additional sine function. Represents the angle information of the target keyword p and the target keyword q in the same coordinate system.

[0152] In some implementations, the processor 301, in the process of performing sentence anomaly recognition on the initial text information according to the initial relationship to obtain a recognition result, executes:

[0153] Obtaining the technical field corresponding to the target keyword, and obtaining the target associated sentence corresponding to the target keyword in the technical field;

[0154] Determine the target relationship corresponding to any two target keywords according to the target association sentence;

[0155] The initial relationship and the target relationship are compared to determine a comparison result, and the recognition result corresponding to the initial text information is determined according to the comparison result.

[0156] In some implementations, the processor 301, in the process of modifying the initial text information according to the target relationship to obtain the target text information, executes:

[0157] Using preset rules to identify the sentence frame of the initial text information, and obtaining the target sentence frame corresponding to the initial text information;

[0158] Generate a text relationship description corresponding to any two target keywords according to the target relationship;

[0159] The text relationship description is filled into the target sentence framework to obtain the target text information.

[0160] In some implementations, the processor 301, in the process of performing a query and retrieval according to the target text information to obtain a target query result, executes:

[0161] Obtaining an initial question statement and answer information corresponding to the initial question statement from a database;

[0162] Calculating the text similarity between the initial question statement and the target text information;

[0163] Calculating a first similarity value corresponding to the target keyword and the target text information, and calculating a second similarity value corresponding to the target keyword and the initial question statement;

[0164] fusing the text similarity, the first similarity value, and the second similarity value to obtain a target similarity between the initial question statement and the target text information;

[0165] Filtering a target question sentence from the initial question sentence according to the target similarity, and then determining the answer information corresponding to the target question sentence as the target query result;

[0166] The target similarity is obtained according to the following formula:

[0167] ;

[0168] represents the target similarity between the initial question sentence i and the target text information j, represents the text similarity between the initial question sentence i and the target text information j, m represents the number of corresponding target keywords, represents the second similarity value between the initial question statement i and the kth target keyword, Represents the first similarity value between the target text information j and the kth target keyword.

[0169] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the terminal device described above can refer to the corresponding process in the aforementioned Agent-based voice interaction method embodiment, and will not be repeated here.

[0170] An embodiment of the present invention further provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any agent-based voice interaction method provided in the description of the embodiment of the present invention.

[0171] The storage medium may be an internal storage unit of the terminal device in the aforementioned embodiment, such as a hard disk or memory of the terminal device. The storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device.

[0172] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware embodiment, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0173] It should be understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "including a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0174] The serial numbers of the embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. An Agent-based voice interaction method, characterized in that: The method comprises: Obtaining initial voice information corresponding to the target user, and performing voice recognition on the initial voice information to obtain initial text information; Performing keyword recognition on the initial text information to obtain a target keyword, and determining an initial relationship corresponding to the target keyword according to the initial text information; Perform sentence anomaly recognition on the initial text information according to the initial relationship to obtain a recognition result; When the recognition result meets the preset condition, the target relationship corresponding to the target keyword is obtained, and the initial text information is modified according to the target relationship to obtain the target text information; Performing a search and retrieval according to the target text information to obtain a target search result, and performing voice conversion on the target search result to obtain target voice information, so that the target voice information is fed back to the target user; Wherein, determining the initial relationship corresponding to the target keyword according to the initial text information includes: Obtaining position information of the target keyword in the initial text information, and determining direction information between any two of the target keywords according to the position information; Using a keyword recognition model to classify the target keyword to obtain a keyword type corresponding to the target keyword, where the keyword type is any one of a subject and an object; Determine the initial relationship corresponding to any two target keywords according to the keyword type and the direction information; The direction information is obtained according to the following formula: f (p,q) represents the direction information between the target keyword p and the target keyword q, v p represents the position information corresponding to the target keyword p, v q represents the position information corresponding to the target keyword q, μ p represents the average position of all the target keywords p, μ q represents the average position of all the target keywords q. represents the position variance corresponding to all the target keywords p, represents the position variance corresponding to all the target keywords q, ∈ is a minimum constant to prevent division by zero, and w α represents the weight information between the target keyword p and the target keyword q, b β represents a bias parameter, γ represents an amplitude adjustment parameter for adjusting the influence of the additional sine function, and θ represents the angle information of the target keyword p and the target keyword q in the same coordinate system.

2. The method according to claim 1, characterized in that The performing keyword recognition on the initial text information to obtain target keywords includes: Using a text representation module of an entity recognition model to represent the initial text information with words to obtain a text vector corresponding to the initial text information; Using the information annotation module of the entity recognition model to perform feature extraction and context constraints on the text vector to obtain a text annotation result corresponding to the initial text information; The text segmentation module of the entity recognition model is used to mark the boundaries of the text annotation results to obtain the target keywords.

3. The method according to claim 2, characterized in that The text cutting module includes a feature splicing layer, a non-entity encoding layer, a position encoding layer, and an entity recognition layer. The text cutting module using the entity recognition model performs boundary marking on the text annotation result to obtain the target keyword, including: Using the non-entity encoding layer to encode the non-entity information identified by the previous layer in the initial text information to obtain a non-entity representation; Using the position encoding layer to perform position representation on the entity information identified by the previous layer in the text vector to obtain entity representation; Using the feature splicing layer to splice the non-entity representation and the entity representation to obtain a splicing vector; The entity recognition layer is used to mark the boundaries of the concatenated vector to obtain the target keyword.

4. The method according to claim 1, characterized in that: The performing sentence anomaly recognition on the initial text information according to the initial relationship to obtain a recognition result includes: Obtaining the technical field corresponding to the target keyword, and obtaining the target associated sentence corresponding to the target keyword in the technical field; Determine the target relationship corresponding to any two target keywords according to the target association sentence; The initial relationship and the target relationship are compared to determine a comparison result, and the recognition result corresponding to the initial text information is determined according to the comparison result.

5. The method according to claim 1, characterized in that: The step of modifying the initial text information according to the target relationship to obtain target text information includes: Using preset rules to identify the sentence frame of the initial text information, and obtaining the target sentence frame corresponding to the initial text information; Generate a text relationship description corresponding to any two target keywords according to the target relationship; The text relationship description is filled into the target sentence framework to obtain the target text information.

6. The method according to claim 2, characterized in that The step of performing a query and retrieval according to the target text information to obtain a target query result includes: Obtaining an initial question statement and answer information corresponding to the initial question statement from a database; Calculating the text similarity between the initial question statement and the target text information; Calculating a first similarity value corresponding to the target keyword and the target text information, and calculating a second similarity value corresponding to the target keyword and the initial question statement; fusing the text similarity, the first similarity value, and the second similarity value to obtain a target similarity between the initial question statement and the target text information; Filtering a target question sentence from the initial question sentence according to the target similarity, and then determining the answer information corresponding to the target question sentence as the target query result; The target similarity is obtained according to the following formula: Sim ij represents the target similarity between the initial question sentence i and the target text information j, C ij represents the text similarity between the initial question sentence i and the target text information j, m represents the number of target keywords, x ki represents the second similarity value between the initial question statement i and the kth target keyword, y kj Represents the first similarity value between the target text information j and the kth target keyword.

7. An Agent-based voice interaction device, characterized in that: include: A data acquisition module is used to obtain the initial voice information corresponding to the target user, and perform voice recognition on the initial voice information to obtain initial text information; A relationship recognition module is used to perform keyword recognition on the initial text information to obtain a target keyword, and determine the initial relationship corresponding to the target keyword according to the initial text information, wherein the determination of the initial relationship corresponding to the target keyword according to the initial text information includes: obtaining the position information of the target keyword in the initial text information, and determining the direction information between any two of the target keywords according to the position information; classifying the target keywords using a keyword recognition model to obtain the keyword type corresponding to the target keyword, wherein the keyword type is any one of a subject and an object; determining the initial relationship corresponding to any two of the target keywords according to the keyword type and the direction information; wherein the direction information is obtained according to the following formula: f (p,q) represents the direction information between the target keyword p and the target keyword q, v p represents the position information corresponding to the target keyword p, v q represents the position information corresponding to the target keyword q, μ p represents the average position of all the target keywords p, μ q represents the average position of all the target keywords q. represents the position variance corresponding to all the target keywords p, represents the position variance corresponding to all the target keywords q, ∈ is a minimum constant to prevent division by zero, and w α represents the weight information between the target keyword p and the target keyword q, b β represents a bias parameter, γ represents an amplitude adjustment parameter for adjusting the influence of the additional sine function, and θ represents the angle information of the target keyword p and the target keyword q in the same coordinate system; An anomaly recognition module, used for performing sentence anomaly recognition on the initial text information according to the initial relationship to obtain a recognition result; A correction processing module, used for obtaining a target relationship corresponding to the target keyword when the recognition result meets a preset condition, and correcting the initial text information according to the target relationship to obtain target text information; The information query module is used to perform query retrieval according to the target text information to obtain a target query result, and perform voice conversion on the target query result to obtain target voice information, so that the target voice information is fed back to the target user.

8. A terminal device, characterized in that: The terminal device includes a processor and a memory; The memory is used to store computer programs; The processor is used to execute the computer program and implement the agent-based voice interaction method according to any one of claims 1 to 6 when executing the computer program.

9. A computer storage medium for computer storage, characterized in that: The computer storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the agent-based voice interaction method described in any one of claims 1 to 6.