Multi-round dialogue analysis method and system based on large model
By adopting a large model-based method in multi-turn dialogue analysis, identifying character and object pronouns and behavioral directions, and analyzing behavioral relationships by combining verbs and passive verbs, the problem of poor dialogue analysis results in the existing technology is solved, and multi-turn dialogue analysis is realized. Accurate analysis of actions in sub-conversation text and effective combination of contextual content.
Patent Information
- Application Number
- CN202411321930.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-21
AI Technical Summary
The existing dialogue analysis technology lacks an effective combination of text continuity and contextual content when dealing with multiple rounds of dialogue, resulting in poor analysis results and is difficult to apply to strict requirements in legal scenarios.
Using a multi-round dialogue analysis method based on large models, the communication information of characters and objects is extracted through definition windows, and the deep learning model is used to identify the pronouns and behavioral directions of characters and objects, and the behavioral relationships are analyzed based on verbs and passive verbs to classify dialogue texts and behaviors. match.
It improves the accurate analysis of the behavior of characters and objects in multi-turn dialogue texts, and enhances the accuracy of analysis by combining contextual content, which is suitable for the strict requirements of legal scenarios.
Smart Images

Figure CN119337891A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of semantic analysis and relates to a multi-round conversation analysis method and system based on a large model. Background Art
[0002] As users' demands for information types and topics become more and more extensive, retrieval platforms need to provide text data that is as diverse and comprehensive as possible, which in turn generates massive amounts of text data. Efficiently retrieving the information users need from such massive amounts of text data has become a core challenge currently faced by retrieval platforms, especially in the political and legal fields, which require even more accurate matching of texts.
[0003] The existing process of matching the language information expressed by the parties with the legal provisions has no specific requirements on the continuity of the text, and the behavioral analysis is easily disturbed, resulting in poor analysis results, and it is impossible to combine the content in the context. It is not suitable for the strict requirements in the legal scenario. Summary of the invention
[0004] In order to solve the problems existing in the background technology, the present invention proposes a multi-round conversation analysis method and system based on a large model.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0006] Define a window and extract the communication information of characters from multiple rounds of dialogue texts according to the size of the window;
[0007] Extracting character objects from multi-round conversation texts and identifying character object pronouns using the first deep learning model;
[0008] Identify the behaviors of multiple characters in the multi-round dialogue text, use the second deep learning model to analyze the behavior of the first character in the multi-round dialogue text pointing to the second character, and classify the dialogue text according to the behavior of a single character pointing to other characters;
[0009] Merge the same behavior of a single character object on another person;
[0010] According to the behavior of the character object, the behavior of the character object is matched with an existing behavior library.
[0011] Furthermore, the method of using the first deep learning model to identify person object pronouns is:
[0012] Using labeled training data, the model parameters are learned by maximizing the likelihood estimate.
[0013] Calculate the probability of each state sequence given the current model parameters. The specific formula is:
[0014]
[0015] where γ t (s i ,s j ) is at time t from state s i Transfer to state s j probability;
[0016] Update the model parameters to maximize the likelihood of the observation sequence. The specific formula is:
[0017]
[0018] where δ t (j) is in state s at time t j The maximum probability of
[0019] After calculating the δ values for all time steps, backtrack from the final state to find the optimal path.
[0020] Furthermore, the method for identifying the behaviors of communication characters in multi-round dialogue texts is as follows:
[0021] Extract verbs from multi-round conversation texts, as well as character object pronouns associated with the verbs, and bind behavioral attributes to character objects;
[0022] At the same time, the second deep learning model is used to extract the action direction and passive verbs of the character object, analyze the relationship between the character object and the behavior, and determine whether the behavior bound to the current character object is the first character object or the second character object;
[0023] Extract the actions of the current character object as the implementer, and mark the receiver of each action to complete the behavior analysis of the character object.
[0024] Furthermore, the training method of the second deep learning model is:
[0025] Create character class N, action class P, pointing class F, and passive verb class K;
[0026] Analyze the spatial distance between person N and action P through labeled multi-round dialogue text data;
[0027] Add the parameters of pointing class F and passive class K to analyze the influence of pointing class F and passive class K on the spatial distance between person class N and action class P.
[0028] Obtain the influence parameters of the pointing class F and the passive word class K on the pointing of the action class P and the character class N.
[0029] Furthermore, the rules for classifying the conversation text are:
[0030] The first person object and the second person object are in a pointing relationship and are a unique combination;
[0031] The first character object points to the second character object, and in this class, only the first character object performs an action on the second character object or the group to which the second character object belongs.
[0032] Furthermore, the method for judging the same behavior of a single character object on the same person is:
[0033] Use Word2Vec to train the model and get a vocabulary, each word has a corresponding vector V w ∈R d , where d is the embedding dimension;
[0034] For every word w in any action i , whose word vector is The vector representation V of any behavior x , calculated by taking the average of all word vectors:
[0035]
[0036] Where n is the total number of words in the multi-round dialogue text;
[0037] Calculate the similarity of two behaviors, and the vectors of the two behaviors are V 1 and V 2 , the specific formula is:
[0038]
[0039] V 1 and V 2 The similarity cosine_similarity(V 1 , V 2 ) is greater than a certain threshold, then V 1 and V 2 Same behavior.
[0040] Furthermore, the method for matching the behavior of the character object with the existing behavior library is:
[0041] The vector of the character object's behavior is V x Indicates that the behavior vector in the existing behavior library uses U x Indicates that the distance between the behavior vector of the character object and the behavior vector in the existing behavior library is calculated using the Euclidean distance. The specific formula is:
[0042]
[0043] where v x Vx The weight, u x For U x The component, d(V x , U x ) is V x and U x If the similarity is greater than a fixed threshold, it means the match is successful.
[0044] On the other hand, the present invention provides a multi-turn conversation analysis system based on a large model, comprising:
[0045] Data processing module, extracting character object information from multi-round dialogue texts;
[0046] The data classification module classifies the multi-round dialogue texts according to the behavior of a single character object towards other different characters, and merges the same behavior of a single character object towards another person;
[0047] The data matching module matches the behavior of the character object with the existing behavior library based on the behavior of the character object.
[0048] Compared with the prior art, the present invention has the following beneficial effects:
[0049] The present invention analyzes multiple rounds of dialogue texts, and the analyzed character object behaviors are combined with contextual content to accurately analyze character behaviors. The present invention matches keywords based on character objects, verbs, passive words, and directional words, combines passive scenes with behavior analysis, analyzes behaviors in the overall dialogue content, and has high accuracy in behavior analysis. The present invention classifies according to the similarity of character object behavior vectors, categorizes and divides the same behaviors, and improves the accuracy of behavior analysis in dialogue content. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 is a flow chart of the method of the present invention;
[0051] Figure 2 It is a system architecture diagram of the present invention. DETAILED DESCRIPTION
[0052] 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 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.
[0053] like Figure 1-Figure 2 As shown, the technical solution adopted by the present invention is as follows:
[0054] like Figure 1 As shown, the present invention provides a multi-turn conversation analysis method based on a large model, comprising:
[0055] Define a window and extract the communication information of the characters from the multi-round dialogue text according to the size of the window. The scope of the window can be determined by the user. The larger the window scope, the more context content can be combined, the more accurate the semantic analysis is, and it is easier to confirm the corresponding legal terms.
[0056] The character objects in the multi-round conversation texts within the window are extracted, and the character object pronouns are identified using the first deep learning model.
[0057] The method of identifying person object pronouns using the first deep learning model is:
[0058] Using labeled training data, the model parameters are learned by maximizing the likelihood estimate.
[0059] Calculate the probability of each state sequence given the current model parameters. The specific formula is:
[0060]
[0061] where γ t (s i ,s j ) is at time t from state s i Transfer to state s j That is, the change information of the perspective of the parties involved. When the parties are telling the story, they tend to switch perspectives to state related content. Through the historical dialogue text, the probability of the parties' perspective changes during the storytelling process is calculated.
[0062] The model parameters are updated using the current multi-round dialogue text to maximize the likelihood of the observation sequence. The specific formula is:
[0063]
[0064] where δ t (j) is in state s at time t j The maximum probability. Use the maximum likelihood to estimate the number of parties, which is the initial number and the probability that has not been confirmed.
[0065] After calculating the δ values of all time steps, backtrack from the final state to find the optimal path. Get the number of parties involved and determine the number of people involved in the parties' stories. Match them as group cases or individual cases.
[0066] Identify the behaviors of multiple characters in the multi-round conversation text, and use the second deep learning model to analyze whether the behavior of the first character in the multi-round conversation text points to the second character.
[0067] The method for identifying the behaviors of communication characters in multi-round dialogue texts is as follows:
[0068] Extract verbs from multi-round dialogue texts and character object pronouns associated with the verbs, and bind behavior attributes to character objects. When a character object has verbs before and after the text, bind the verb to the current character object. At this time, the relationship between the object and the behavior is a connection relationship, but it cannot be determined whether the current character object is the implementer or recipient of the behavior.
[0069] Determine whether the current character object is the implementer or recipient of the behavior. Use the second deep learning model to extract the action direction of the character object and passive words, such as "be", "let", "call", etc. Analyze the relationship between the character object and the behavior, and determine whether the behavior bound to the current character object is the first character object or the second character object. The first character object is the implementer of the behavior and is the active party, and the second character object is the recipient of the behavior and is the passive party.
[0070] The current character object is analyzed in the global multi-round communication text, and the actions of the current character object as the implementer are extracted. At the same time, each action is marked with the recipient to complete the behavior analysis of the character object.
[0071] The training method of the second deep learning model is:
[0072] Create character class N, action class P, pointing class F, and passive word class K. Divide the words in the multi-round communication text into four categories: character class N, action class P, pointing class F, and passive word class K. Clean irrelevant data and only retain words related to character object behavior judgment.
[0073] The spatial distance between character class N and action class P is analyzed through the labeled multi-round dialogue text data. The relevant behavior content of the current character object is determined by the spatial distance, and the character object is associated with the behavior content.
[0074] In the relationship between the character object and the behavior content, add the corresponding pointing class F and passive word class K parameters of the relationship, and analyze the influence of pointing class F and passive word class K on the spatial distance between the character class N and the action class P. Prevent the relationship between the character object and the behavior content from being misjudged or mis-pointed.
[0075] The influence parameters of the pointing class F and the passive verb class K on the pointing of the action class P and the character class N are obtained. At the same time, the specific relationship between the character object and the behavior content is also obtained. The specific relationship here is not just an association, but indicates that the character object is the implementer or recipient of the behavior, and the character object and the behavior have a directional relationship.
[0076] Classify the dialogue text according to the behavior of a single character object on other different character objects. Classify the dialogue text according to the behavior of a single character object on other different character objects. A single character can exert multiple behaviors and also exert behaviors on other different character objects. The behaviors exerted by a certain character object are classified according to the target character object to form a one-to-one or one-to-many relationship chain.
[0077] Things to note:
[0078] The first character object and the second character object are in a pointing relationship and are a unique combination.
[0079] The first person object points to the second person object. In this class, only the first person object performs actions on the second person object or the group to which the second person object belongs. The group to which the person object belongs includes the person object. Therefore, the actions performed on the group to which the person object belongs also include the actions on the person object. The person object and the person in the group to which the person object belongs are collectively referred to as the same person.
[0080] Merge the same behavior of a single character object to other characters of the same person.
[0081] The method for judging the same behavior of a single character object on the same person is as follows:
[0082] Use Word2Vec to train the model and get a vocabulary, each word has a corresponding vector V w ∈R d , where d is the embedding dimension. Word2Vec is a language model that learns semantic knowledge from a large amount of text in an unsupervised manner and is widely used in natural language processing.
[0083] Word2Vec is a tool used to generate word vectors, which are closely related to language models. i , whose word vector The vector representation V of any behavior x , calculated by taking the average of all word vectors:
[0084]
[0085] Where n is the total number of words in the multi-round dialogue text. The average vector of all word vectors of the current behavior is obtained, and the average vector of all word vectors of the current behavior reflects the specific value of the current behavior.
[0086] Calculate the similarity of two behaviors, the two behavior vectors are V 1 and V 2 , the specific formula is:
[0087]
[0088] V 1 and V 2 The similarity cosine_similarity(V 1 , V 2 ) is greater than a certain threshold, then V 1 and V 2 The behaviors are the same. The cosine similarity of the average vectors of all word vectors of different behaviors is used to determine the similarity of two behaviors. Behaviors with too high similarity or exceeding a certain threshold are judged as the same behavior and merged.
[0089] After obtaining the specific behavior of a character object towards other character objects, the behavior of the character object is matched with the existing behavior library according to the behavior of the character object. The existing behavior library corresponds to the behavior corresponding to the existing legal content, and the legal text interpretation content corresponding to the behavior is obtained.
[0090] The method for matching the behavior of the character object with the existing behavior library is:
[0091] First, the corresponding behavior of the legal clause is converted into a vector. The vector of the behavior of the character object is represented by V x Indicates that the legal clause corresponds to the behavior text vector using U x Indicates that the distance between the vector of the character object behavior and the text vector of the content to be matched is calculated using the Euclidean distance. The specific formula is:
[0092]
[0093] where v x V x The weight, u x For U x The component, d(V x , U x ) is V x and U x If the similarity is greater than a fixed threshold, it means the match is successful.
[0094] Euclidean distance is a commonly used distance definition, which refers to the real distance between two points in m-dimensional space, or the natural length of a vector (i.e. the distance from the point to the origin). The Euclidean distance can be used to determine the similarity of two behavior vectors, fit two behaviors with a high degree of fit, and accurately match the legal content corresponding to the behavior of the person object.
[0095] like Figure 2 As shown, the present invention also provides a multi-turn conversation analysis system based on a large model, comprising:
[0096] Data processing module, extracting character object information from multi-round dialogue texts;
[0097] The data classification module classifies the multi-round dialogue texts according to the behavior of a single character object towards other different characters, and merges the same behavior of a single character object towards another person;
[0098] The data matching module matches the behavior of the character object with the existing behavior library based on the behavior of the character object.
[0099] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A multi-turn conversation analysis method based on a large model, characterized in that: Included are: Define a window and extract the communication information of characters from multiple rounds of dialogue texts according to the size of the window; Extracting character objects from multi-round conversation texts and identifying character object pronouns using the first deep learning model; Identify the behaviors of multiple characters in the multi-round dialogue text, use the second deep learning model to analyze the behavior of the first character in the multi-round dialogue text pointing to the second character, and classify the dialogue text according to the behavior of a single character pointing to other characters; Merge the same behavior of a single character object on another person; According to the behavior of the character object, the behavior of the character object is matched with an existing behavior library.
2. According to claim 1, a multi-turn conversation analysis method based on a large model is characterized in that ,The method of identifying the person object pronoun using the first deep learning model is: Using labeled training data, the model parameters are learned by maximizing the likelihood estimate. Calculate the probability of each state sequence given the current model parameters. The specific formula is: where γ t (s i ,s j ) is at time t from state s i Transfer to state s j probability; Update the model parameters to maximize the likelihood of the observation sequence. The specific formula is: where δ t (j) is in state s at time t j The maximum probability of After calculating the δ values for all time steps, backtrack from the final state to find the optimal path.
3. The method for analyzing multi-turn conversations based on a large model according to claim 1 is characterized in that ,The method for identifying the communication character object behavior in the multi-round dialogue text is: Extract verbs from multi-round conversation texts, as well as character object pronouns associated with the verbs, and bind behavioral attributes to character objects; At the same time, the second deep learning model is used to extract the action direction and passive verbs of the character object, analyze the relationship between the character object and the behavior, and determine whether the behavior bound to the current character object is the first character object or the second character object; Extract the actions of the current character object as the implementer, and mark the receiver of each action to complete the behavior analysis of the character object.
4. The method for analyzing multi-turn conversations based on a large model according to claim 3 is characterized in that ,The training method of the second deep learning model is: Create character class N, action class P, pointing class F, and passive verb class K; Analyze the spatial distance between person N and action P through labeled multi-round dialogue text data; Add the parameters of pointing class F and passive class K to analyze the influence of pointing class F and passive class K on the spatial distance between person class N and action class P. Obtain the influence parameters of the pointing class F and the passive word class K on the pointing of the action class P and the character class N.
5. The method for analyzing multi-turn conversations based on a large model according to claim 1 is characterized in that ,The rules for classifying conversation texts are: The first person object and the second person object are in a pointing relationship and are a unique combination; The first character object points to the second character object, and in this class, only the first character object performs an action on the second character object or the group to which the second character object belongs.
6. The method for analyzing multi-turn conversations based on a large model according to claim 1, characterized in that ,The method for judging the same behavior of a single character object on the same person is: Use Word2Vec to train the model and get a vocabulary, each word has a corresponding vector V w ∈R d , where d is the embedding dimension; For every word w in any action i , whose word vector is The vector representation V of any behavior x , calculated by taking the average of all word vectors: Where n is the total number of words in the multi-round dialogue text; Calculate the similarity of two behaviors, whose vectors are V1 and V2 respectively. The specific formula is: If the similarity cosine_similarity(V1,V2) between V1 and V2 is greater than a certain threshold, then V1 and V2 are judged to have the same behavior.
7. The method for analyzing multi-turn conversations based on a large model according to claim 6 is characterized in that ,The method of matching the behavior of the character object with the existing behavior library is: The vector of the character object's behavior is V x Indicates that the behavior vector in the existing behavior library uses U x Indicates that the distance between the behavior vector of the character object and the behavior vector in the existing behavior library is calculated using the Euclidean distance. The specific formula is: where v x V x The weight, u x For U x The component, d(V x ,U x ) is V x and U x If the similarity is greater than the preset threshold, it means the match is successful.
8. A multi-turn conversation analysis system based on a large model, characterized in that: Included are: Data processing module, extracting character object information from multi-round dialogue texts; The data classification module classifies the multi-round dialogue texts according to the behavior of a single character object towards other different characters, and merges the same behavior of a single character object towards another person; The data matching module matches the behavior of the character object with the existing behavior library based on the behavior of the character object.