Text analysis method, device, storage medium, and program product
By performing character mention detection and coreference resolution on the target text, combined with pronoun cascading constraints within quotations, the accuracy issues of existing text analysis methods in character recognition and speaker separation are resolved, thereby improving the overall accuracy of text analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- IFLYTEK CO LTD
- Filing Date
- 2026-05-08
- Publication Date
- 2026-06-05
AI Technical Summary
Existing text analysis methods have low accuracy in scenarios such as books, novels, film and television scripts, and meeting minutes, and face challenges, especially in areas such as speaker separation, role recognition, and emotion tracking.
By performing character mention detection and coreference resolution on the target text, the speaker and listener of the quotation are identified, and cascading constraints are applied to the first-person and second-person pronouns in the quotation to improve the accuracy of character recognition.
It significantly improves the accuracy of text analysis, especially in identifying the roles referred to by first-person and second-person pronouns within quotations, thus enhancing the accuracy of role recognition.
Smart Images

Figure CN122154708A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a text analysis method, device, storage medium, and program product. Background Technology
[0002] With the in-depth development of intelligent reading applications, especially in scenarios that require structured analysis of books, novels, film and television scripts, meeting minutes, etc., building an automated analysis system faces multiple challenges such as speaker separation, role recognition, and emotion tracking.
[0003] Current text analysis methods have low accuracy. Summary of the Invention
[0004] In view of the above problems, this application provides a text analysis method, device, storage medium, and program product to improve the accuracy of text analysis. The specific solution is as follows:
[0005] The first aspect of this application provides a text analysis method, including:
[0006] The target text is subjected to character mention detection; the character mentions include: proper nouns referring to people, third-person pronouns, and generic phrases referring to people.
[0007] Coreference resolution is performed on detected character references to identify references that refer to the same character;
[0008] For each quotation in the target text, the speaker and listener of the quotation are identified based on the text sequence containing the quotation and its context, whether the quotation belongs to the dialogue content, and if it belongs to the dialogue content; the speaker and listener of the quotation are different people mentioned in the person mentions contained in the text sequence.
[0009] If the quoted content belongs to dialogue, identify the first-person pronouns and second-person pronouns in the quoted content;
[0010] The identified first-person pronouns are associated with the same speaker as the quoted speaker, and the identified second-person pronouns are associated with the same listener as the quoted listener.
[0011] In one possible implementation, identifying whether the quotation belongs to the dialogue content, and the speaker and listener of the quotation when it belongs to the dialogue content, is based on a text sequence containing the quotation and its context, including:
[0012] The text sequence is processed to determine whether the quote belongs to the dialogue content, and if it does, the speaker of the quote.
[0013] Obtain the associated information of each person to be evaluated mentioned in the text sequence, wherein the person to be evaluated is mentioned by a person other than the speaker of the quotation in the text sequence; the associated information includes: the active status of the person to be evaluated mentioned, the historical dialogue record of the person to be evaluated mentioned, and the second-person pronoun reference clues in the quotation.
[0014] Based on the relevant information mentioned by the person to be evaluated, those whose mentions meet the consistency criteria with the speaker of the quote are selected as the recipients of the quote.
[0015] In one possible implementation, the selection of mentions of the person to be evaluated that meet the consistency condition with the speaker of the quotation based on the relevance information mentioned by the person to be evaluated includes:
[0016] Based on the relevant information mentioned by the person to be evaluated, the listener evaluation of the mention of the person to be evaluated is carried out to obtain the score of the listener belonging to the mention of the person to be evaluated;
[0017] Individuals whose scores exceed the first threshold will be identified as potential speakers.
[0018] For each candidate listener, the consistency between the candidate listener and the speaker of the quote is evaluated, and the candidate listener with the highest consistency score with the speaker of the quote is determined as the listener of the quote.
[0019] In one possible implementation, the text sequence is processed to determine whether the quote belongs to the dialogue content, and if it does, the speaker of the quote, including:
[0020] The semantic features of the text sequence are input into the quotation attribution model to obtain the initial quotation attribution result output by the quotation attribution model; the initial quotation attribution result indicates whether the quotation belongs to the dialogue content, and the speaker when it belongs to the dialogue content.
[0021] If the initial quote attribution result indicates that the quote belongs to the dialogue content, the speaker of the quote is verified based on a multi-level attribution strategy, which includes:
[0022] If there is a text segment consisting of a person's mention and a speaking verb before the quote, then the speaker of the quote is the character referred to by the person's mention before the quote;
[0023] If a text segment consisting of a person's mention and a speaking verb exists after the quote, then the speaker of the quote is the character referred to by the person's mention after the quote;
[0024] If there are no text segments consisting of verbs or phrases before or after the quoted statement, and the quoted statement and the preceding quoted statement that is part of the dialogue constitute a continuous dialogue, then the speaker alternation pattern of at least two consecutive quoted statements that are part of the dialogue is identified, and the speaker of the i-th quoted statement is determined according to the speaker alternation pattern; the i-th quoted statement is the latest quoted statement of the above-mentioned at least two consecutive quoted statements that are part of the dialogue.
[0025] In one possible implementation, person mention detection is performed on the target text, including:
[0026] Obtain the encoding features of each word element obtained by encoding each word element in the target text based on a self-attention mechanism;
[0027] For each text segment in the target text whose length is less than a preset length, the encoding features of each word in the text segment are fused to obtain the semantic feature representation of the text segment.
[0028] Based on the semantic features of the text fragment, predict whether the text fragment belongs to a person mention, and if it does, the category of the person mention.
[0029] In one possible implementation, at least the encoded features of each word in the text segment are fused, including:
[0030] The encoded features of each word in the text segment are pooled to obtain the pooled features of the text segment; the encoded features of the starting word, the encoded features of the ending word, and the pooled features are concatenated to obtain the semantic feature representation of the text segment.
[0031] Alternatively, obtain the embedding feature of the length of the text segment; perform pooling on the encoding features of each word in the text segment to obtain the pooling feature of the text segment; concatenate the encoding features of the starting word, the encoding features of the ending word, the pooling feature, and the embedding feature of the text segment to obtain the semantic feature representation of the text segment.
[0032] In one possible implementation, the coreference resolution of detected person mentions includes:
[0033] Obtain the confidence score of the person mentions obtained by performing person mention detection on the target text;
[0034] For each pair of character mentions, a coreference compatibility assessment is performed to obtain a coreference compatibility score for each pair of character mentions; the coreference compatibility score indicates the compatibility of two character mentions when they refer to the same character.
[0035] Based on the confidence score of the mentions and the coreference compatibility score among the mentions, the mentions are clustered; mentions belonging to the same cluster refer to the same person.
[0036] In one possible implementation, mentions are clustered based on their confidence scores and coreference compatibility scores, including:
[0037] For any two mentions of a person, the confidence score of the mentions of the two people and the coreference compatibility score between the mentions of the two people are combined to obtain the coreference score of the mentions of the two people.
[0038] Two people whose core index scores are greater than the second threshold are identified as belonging to the same cluster category.
[0039] Mentions of different individuals whose core reference scores are all greater than the second threshold are identified as belonging to the same cluster category.
[0040] One possible implementation also includes:
[0041] For each speaker identified in a quote, the speaker's profile is updated based on each of the speaker's identified quotes.
[0042] The character's profile includes: information about the character's appearances, relationships with other characters, and personality traits;
[0043] The information on the appearance of the character includes at least one of the following: the frequency of appearance, chapter distribution, paragraph distribution, and dialogue proportion of the character in the analyzed text consisting of the current quote and the text preceding it;
[0044] The relationship between this character and other characters includes at least one of the following: co-occurrence relationship, dialogue relationship, degree centrality representing the character's position among all characters, and betweenness centrality representing the character's pivotal role among all characters in the analyzed text;
[0045] The character's personality traits include at least one of the following: the topics the character focuses on, language style, emotional distribution, and personality keywords in the analyzed text.
[0046] In one possible implementation, the relationships between each character and other characters are generated, including:
[0047] If two characters appear in the same paragraph or the same dialogue scene in the analyzed text, it is determined that the two characters have a co-occurrence relationship; the weight of the co-occurrence relationship is the co-occurrence frequency of the two characters; if two characters have dialogue interaction in the analyzed text, it is determined that the two characters have a dialogue relationship; the weight of the dialogue relationship is the number of dialogue turns of the two characters.
[0048] Calculate the degree centrality and betweenness centrality of each character based on its co-occurrence and dialogue relationships with other characters.
[0049] In one possible implementation, generating the personality traits for each character includes:
[0050] Topic extraction and language style analysis were performed on all statements made by the character in the analyzed text to determine the topic areas the character focuses on and the character's language style;
[0051] Emotion recognition was performed on each statement made by the character in the analyzed text to determine the emotion of the character's different statements; the distribution of the character's emotions was statistically analyzed.
[0052] Based on the character's appearances in the analyzed text, the topics they focus on, their language style, and their emotional distribution, we can identify the character's personality keywords.
[0053] In one possible implementation, emotion recognition is performed on any statement, including:
[0054] Obtain the semantic features of any of the statements;
[0055] Predict the initial probability that any given statement belongs to each possible emotion based on the semantic features of that statement;
[0056] Obtain the prior transition probability from the emotion of the speaker's previous speech to each possible emotion for any given speech;
[0057] For any possible emotion, the initial probability of any speech belonging to any possible emotion is constrained based on the prior transition probability from the emotion of the previous speech to the possible emotion, so as to obtain the target probability of any speech belonging to the possible emotion.
[0058] The emotion of any given statement is determined based on the target probability of each possible emotion.
[0059] In one possible implementation, determining the emotion of any given statement based on the target probability that any given statement belongs to each possible emotion includes:
[0060] Based on a pre-configured personality-emotion adjustment coefficient mapping table, determine the adjustment coefficients for each possible emotion corresponding to the speaker's personality updated at the previous speaking time for any speaker making the above statement.
[0061] Based on the adjustment coefficients of each possible emotion, the target probability of any statement belonging to each possible emotion is adjusted, and the possible emotion corresponding to the largest value among the adjusted target probabilities is determined as the emotion of any statement.
[0062] In one possible implementation, before constraining the initial probability of any given statement belonging to any of the possible emotions, the method further includes:
[0063] The initial emotion of any given statement is determined based on the initial probability that any given statement belongs to each possible emotion.
[0064] Obtain the prior transition probability from the emotion of the speaker's previous speech to the initial emotion, as well as the difference in emotion intensity;
[0065] If the prior transition probability from the emotion of the speaker's previous speech to the initial emotion is less than a third threshold, and the difference in emotion intensity is greater than a fourth threshold, then the initial probability of any speech belonging to each possible emotion is constrained; otherwise, constraining the initial probability of any speech belonging to each possible emotion is prohibited.
[0066] One possible implementation also includes:
[0067] The emotional intensity of each statement made by the character is identified to determine the emotional intensity of the different statements made by the character.
[0068] An emotional time series is constructed for each character along the text unit sequence; each element in the emotional time series includes: a timestamp representing the text unit number, the character's emotional category in that text unit, and the emotional intensity; each text unit is a chapter in the target text, or each text unit is a paragraph in the target text;
[0069] Based on the emotional time series, the rate of emotional change, the amplitude of emotional fluctuation, the emotional peak and the turning point of each character are statistically analyzed.
[0070] One possible implementation also includes:
[0071] For any cluster category, obtain the average value of the coreference score among the mentions of people within that cluster category, the semantic similarity among the mentions of people, and the consistency of the reference type of the mentions of people;
[0072] Based on the average coreference score, the semantic similarity between mentions of people, and the consistency of the reference type of mentions of people, a cluster consistency evaluation is performed on any cluster category to obtain a cluster consistency score for any cluster category.
[0073] If the cluster consistency score is less than the fifth threshold, a rollback operation is performed on the mentions of people within any of the cluster categories to re-detect the mentions of people in the text fragments corresponding to the mentions of people within any of the cluster categories.
[0074] One possible implementation also includes:
[0075] Obtain the confidence level of the initial quotations attribution results;
[0076] If the confidence level of the initial quotation attribution result is less than the sixth threshold, a manual review process is triggered.
[0077] A second aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the text analysis method of the first aspect or any implementation thereof.
[0078] A third aspect of this application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:
[0079] The memory is used to store computer programs;
[0080] The processor is used to execute the computer program so that the electronic device can implement the text analysis method of the first aspect or any implementation thereof.
[0081] A fourth aspect of this application provides a computer storage medium carrying one or more computer programs that, when executed by an electronic device, enable the electronic device to perform the text analysis method described in the first aspect or any implementation thereof.
[0082] Using the above technical solutions, the text analysis method, device, storage medium, and program products provided in this application perform character reference detection (proper nouns, third-person pronouns, and generic phrases) on the target text, and perform coreference resolution on the detected character references to determine character references pointing to the same role; for each quotation in the target text, based on the text sequence containing the quotation and its surrounding text, it identifies whether the quotation belongs to the dialogue content, and if it belongs to the dialogue content, the speaker and listener of the quotation; if the quotation belongs to the dialogue content, it identifies the first-person pronouns and second-person pronouns in the quotation, pointing the identified first-person pronouns to the same role as the speaker of the quotation, and pointing the identified second-person pronouns to the same role as the listener of the quotation. This application performs role recognition on the target text in two stages. The first role recognition involves detecting person references without detecting first-person and second-person pronouns, and performing coreference resolution on detected person references (proper nouns, third-person pronouns, and generic phrases). The second role recognition identifies the speaker and listener of quotations that belong to the dialogue content in the target text, as well as the first-person and second-person pronouns in the quotations. The identified first-person pronouns are assigned to the same role as the speaker of the quotation, and the identified second-person pronouns are assigned to the same role as the listener of the quotation. Since the roles represented by first-person and second-person pronouns may be different in the speech of different speakers, this cascading constraint method of first identifying the speaker and then performing coreference resolution on first-person and second-person pronouns in the quotation can accurately identify the roles pointed to by first-person and second-person pronouns in the quotation, significantly improving the accuracy of role recognition. Attached Figure Description
[0083] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0084] Figure 1 A flowchart illustrating an implementation of the text analysis method provided in this application;
[0085] Figure 2 A flowchart illustrating an implementation of this application for identifying whether the i-th quotation belongs to the dialogue content based on the i-th text sequence containing the i-th quotation and its preceding and following context, and the speaker and listener of the i-th quotation when it belongs to the dialogue content;
[0086] Figure 3 A flowchart for processing the i-th text sequence to determine whether the i-th quote belongs to the dialogue content, and the speaker of the i-th quote when it belongs to the dialogue content, provided in this application;
[0087] Figure 4 A flowchart illustrating an implementation of person mention detection in target text provided in this application;
[0088] Figure 5 A flowchart illustrating an implementation of coreference resolution for detected person mentions provided in this application;
[0089] Figure 6 A schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation
[0090] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0091] As will be known to those skilled in the art, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0092] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0093] Text analysis typically includes dimensions such as role recognition, speaker separation, and tracking of role emotions. This application is proposed to improve the accuracy of text analysis in at least one of these dimensions.
[0094] like Figure 1 The diagram shown is a flowchart of one implementation of the text analysis method provided in this application, which may include:
[0095] Step S101: Detect mentions of people in the target text.
[0096] The target text can be short or long, such as books, novels, film and television scripts, meeting minutes, interview records, customer service dialogues, etc.
[0097] Mentions of people can include the following categories: proper nouns referring to people, third-person pronouns, and general phrases referring to people.
[0098] Among them, proper nouns referring to people may include, but are not limited to: people's names, titles, abbreviations, nicknames, etc.
[0099] Third-person pronouns can include, but are not limited to: he, she, it, they, they, etc.
[0100] Phrases referring to people can include, but are not limited to: job titles, relational terms (such as "that waiter" or "his mother"), etc.
[0101] Step S101 involves detecting mentions of people throughout the target text.
[0102] Step S102: Perform coreference resolution on the detected character references to identify character references that point to the same character.
[0103] Existing coreference resolution methods can be used (e.g., using end-to-end neural networks or graph neural networks to resolve coreferences of detected person mentions based on the detected person mentions and their context), or the coreference resolution methods described below in this application can be used to resolve coreferences of detected person mentions.
[0104] The most frequently occurring proper noun among all mentions of the same character (let's call it the j-th character for ease of narration) can be used as the canonical name of the j-th character. Alternatively, the full name in the mentions of the j-th character can be used as the canonical name of the j-th character. Or, the commonly used title (a generic phrase referring to the character) in the mentions of the j-th character can be used as the canonical name of the j-th character.
[0105] Furthermore, to better distinguish between different roles, different role IDs can be assigned to different roles.
[0106] Step S103: For each quotation in the target text (denoted as the i-th quotation for ease of description; i = 1, 2, 3, ..., I; I is the total number of quotations in the target text), based on the text sequence containing the i-th quotation and its preceding and following text (denoted as the i-th text sequence), identify whether the i-th quotation belongs to the dialogue content, and if it belongs to the dialogue content, the speaker and listener of the i-th quotation. The speaker and listener of the i-th quotation are the people mentioned in the i-th text sequence (i.e., the people mentioned through step S101).
[0107] Quotations refer to quoted passages in the target text that are enclosed in quotation marks or other markers and are used to highlight a particular expression. They are not limited to dialogue between characters; that is, the content enclosed in quotation marks may be what the character says (referred to as dialogue content) or it may not be what the character says.
[0108] Quotations include the content enclosed by single quotation marks (such as: '') and the content enclosed by double quotation marks (such as: "" or "").
[0109] As an example, in the sentence ["Lao Duan is a fat man, so the blacksmith shop is called 'Duan the Fat Man's Blacksmith Shop'. "], the content enclosed by double quotation marks is not the content of a dialogue. While in the sentence ["Why did you come so late today?" Xiaoming put down the book and frowned slightly.], the content enclosed by double quotation marks is the content of a dialogue.
[0110] For each quotation in the text, this application determines whether the quotation belongs to the content of a dialogue based on the quotation and its context (i.e., the preceding and following text), and when it belongs to the content of a dialogue, it determines who (the speaker) said the quotation to whom (the recipient).
[0111] The process of determining the speaker of a quotation that belongs to the content of a dialogue is also called Dialogue Attribution, which is a process of precisely matching the "words" in the text with specific "persons" (i.e., characters).
[0112] Steps S103 can be sequentially executed for each quotation in the order from the front to the back of the target text. Every time a quotation is determined to belong to the content of a dialogue, step S104 can be executed. Alternatively, step S104 can be executed after all quotations that belong to the content of a dialogue in the target text are identified.
[0113] Step S104: If the i-th quotation belongs to the content of a dialogue, identify the first-person pronouns and second-person pronouns in the i-th quotation.
[0114] First-person pronouns can include but are not limited to: we, us, I, my generation, we, I, me, my, I, we, I, I, myself, humble person, myself, etc. These first-person pronouns can be used to construct a first-person pronoun dictionary.
[0115] Second-person pronouns can include but are not limited to: you, you all, you, you all, you, you, you, you, you, you, you, you, you, you, etc. These second-person pronouns can be used to construct a second-person pronoun dictionary.
[0116] Optionally, the i-th quotation can be segmented to obtain multiple segments. For each segment, it is determined whether the segment is any word in the preset first-person pronoun dictionary or any word in the preset second-person pronoun dictionary. If the segment is any word in the first-person pronoun dictionary, it is determined to be a first-person pronoun. If the segment is any word in the second-person pronoun dictionary, it is determined to be a second-person pronoun. If the segment is neither any word in the first-person pronoun dictionary nor any word in the second-person pronoun dictionary, it is determined to be neither a first-person pronoun nor a second-person pronoun.
[0117] Step S105: Assign the identified first-person pronoun to the same role as the speaker of the i-th quotation, and assign the identified second-person pronoun to the same role as the listener of the i-th quotation.
[0118] In literary dialogues, the meaning of pronouns may change as the speaker switches. Therefore, this application establishes a clear referential mapping:
[0119] First-person pronouns in quotes that pertain to the content of a dialogue are required to refer to the speaker of the current quote, i.e., the speaker.
[0120] Second-person pronouns in quotations that pertain to the content of a dialogue are required to refer to the listener of the current quotation, i.e., the recipient of the speech.
[0121] Typical coreference resolution (e.g., step S102) usually calculates similarity based on contextual features. However, in a dialogue, the "I" spoken by different people represents completely different roles. Without specific coreference resolution within the quotation (i.e., coreference resolution of first-person and second-person pronouns within the quotation), the system cannot accurately extract the emotions and personality traits expressed by the character in the dialogue, thus affecting the final character profile construction and other role-related analyses.
[0122] The text analysis method provided in this application performs role identification in two stages. The first role identification involves detecting person references without detecting first-person and second-person pronouns, and performing coreference resolution on detected person references (proper nouns, third-person pronouns, and generic phrases). The second role identification identifies the speaker and listener of quotations that belong to the dialogue content in the target text, as well as the first-person and second-person pronouns in the quotations. The identified first-person pronouns are assigned to the same role as the speaker of the quotation, and the identified second-person pronouns are assigned to the same role as the listener of the quotation. Since the roles represented by first-person and second-person pronouns may be different in the speech of different speakers, this cascading constraint method of first identifying the speaker and then performing coreference resolution on first-person and second-person pronouns in the quotation can accurately identify the roles pointed to by first-person and second-person pronouns in the quotation, significantly improving the accuracy of role identification.
[0123] In an optional embodiment, the flowchart for identifying whether the i-th quotation belongs to the dialogue content based on the i-th text sequence containing the i-th quotation and its preceding and following context, and the speaker and listener of the i-th quotation when it belongs to the dialogue content, is shown below. Figure 2 As shown, it may include:
[0124] Step S201: Process the i-th text sequence to determine whether the i-th quote belongs to the dialogue content, and if it does, the speaker of the i-th quote.
[0125] The i-th text sequence consists of the i-th quotation and its preceding and following context. The i-th text sequence can be added to a first prompt word template to obtain the first prompt word. The first prompt word template also includes a first task instruction, which instructs the user to identify whether the i-th quotation belongs to the dialogue content based on the i-th text sequence, and if it does, the speaker of the i-th quotation. The first prompt word is then input into a pre-trained speaker recognition model to obtain the model's recognition result. This result indicates whether the i-th quotation belongs to the dialogue content and, if it does, the speaker mentioned in the i-th text sequence. The speaker recognition model can be a large model, such as a large language model or a multimodal large model.
[0126] Step S202: Obtain the associated information of each person to be evaluated mentioned in the i-th text sequence. The person to be evaluated is mentioned by a person other than the speaker of the i-th quotation in the i-th text sequence. The associated information of the k-th person to be evaluated may include: the active status of the character to be evaluated mentioned by the k-th person to be evaluated, the historical dialogue record of the k-th person to be evaluated, and the second-person reference clues in the i-th quotation.
[0127] In the i-th text sequence, any other person mentioned besides the speaker of the i-th quotation (referred to as the person to be evaluated for ease of narration and distinction) is considered as the person to be evaluated.
[0128] The active state of the character mentioned by the kth person to be evaluated may include, but is not limited to, the frequency with which the kth person to be evaluated is mentioned in the i-th text sequence.
[0129] The historical dialogue records mentioned by the k-th person to be evaluated may include, but are not limited to, the number of interactions between the i-th speaker and the k-th person to be evaluated before the i-th quote.
[0130] The second-person reference clues in the i-th quote refer to the mentions of people adjacent to the second-person pronoun in the i-th quote. The mention of people adjacent to the second-person pronoun refers to the mention of people in the i-th quote that is closest to the second-person pronoun among the mentions of people preceding the second-person pronoun; the mention of people adjacent to the second-person pronoun refers to the mention of people in the i-th quote that is closest to the second-person pronoun among the mentions of people following the second-person pronoun.
[0131] Step S203: Based on the relevant information mentioned by the person to be evaluated, select the mentions of the person to be evaluated that meet the consistency condition with the speaker of the i-th quote as the recipients of the i-th quote.
[0132] Optionally, the listener evaluation can be performed on each mention of the person to be evaluated based on the related information mentioned by the person to be evaluated, so as to obtain a score for each person to be evaluated as a listener.
[0133] As an example, the association information mentioned by the kth person to be evaluated can be input into the listener scoring model to obtain the score of the kth person to be evaluated being mentioned by the listener. The listener scoring model can be a large model, such as a large language model or a multimodal large model; the listener scoring model and the speaker identification model can be the same large model or different large models.
[0134] Individuals whose scores exceed the first threshold will be identified as potential speakers.
[0135] For each candidate listener, the consistency between the candidate listener and the speaker of the i-th quote is evaluated, and the candidate listener with the highest consistency score with the speaker of the i-th quote is determined as the listener of the i-th quote.
[0136] The consistency score between the candidate listener and the speaker of the i-th quote represents the degree of matching between the listener and the speaker of the i-th quote.
[0137] As an example, the consistency between each candidate and the speaker of the i-th quote can be evaluated from four dimensions: quote semantics, dialogue structure features, historical interaction relationships, and role status.
[0138] Specifically, for the g-th candidate listener, in the semantic dimension of the quotation, the i-th text sequence (including the i-th quotation and its context), the speaker of the i-th quotation, and the g-th candidate listener can be input into the consistency evaluation model to obtain the consistency score of the g-th candidate listener and the speaker of the i-th quotation in the semantic dimension of the quotation. The consistency evaluation model can be a large model, such as a large language model or a multimodal large model; the consistency evaluation model, the listener scoring model, and the speaker identification model can be the same large model or different large models.
[0139] In the dialogue structure feature dimension, the consistency score between the g-th candidate listener and the speaker of the i-th quote can be calculated using the first preset rule based on whether there is a "X said to Y" segment before and after the i-th quote, the speaker of the previous quote (which belongs to the dialogue content), and the distance between the g-th candidate listener and the speaker of the i-th quote.
[0140] In the historical interaction dimension, the consistency score between the g-th candidate speaker and the speaker of the i-th quote can be calculated using the second preset rule based on the frequency of dialogue between the g-th candidate speaker and the speaker of the i-th quote before the i-th quote, as well as the most recent interaction position between the g-th candidate speaker and the speaker of the i-th quote (such as the chapter or paragraph where the most recent dialogue content between the g-th candidate speaker and the speaker of the i-th quote is located).
[0141] In the role state dimension, the profile of the role pointed to by the speaker of the i-th quote can be determined based on the various established quotes of the speaker of the i-th quote and the relationship between the role pointed to by the speaker of the i-th quote and other roles. Similarly, the profile of the role pointed to by the g-th candidate listener is obtained. A lightweight model is used to evaluate the profiles of the roles pointed to by the speaker of the i-th quote and the profiles of the roles pointed to by the g-th candidate listener, to obtain the consistency score between the g-th candidate listener and the speaker of the i-th quote in the role state dimension. The profile of each role may include, but is not limited to, information about the role's appearance, relationships with other roles, and personality traits.
[0142] After obtaining the consistency scores for the above four dimensions, the consistency scores of the four dimensions are weighted and summed to obtain the consistency score between the g-th candidate listener and the speaker of the i-th quote.
[0143] As an example, the following can be directly input into a large model: the i-th text sequence, the speaker of the i-th quote, the g-th candidate listener, whether there are "X said to Y" segments before and after the i-th quote, the speaker of the previous quote, the distance between the g-th candidate listener and the speaker of the i-th quote, the dialogue frequency between the g-th candidate listener and the speaker of the j-th quote, the most recent interaction position between the g-th candidate listener and the speaker of the j-th quote, the profile of the character pointed to by the speaker of the i-th quote, and the profile of the character pointed to by the g-th candidate listener. The large model directly outputs the consistency score between the g-th candidate listener and the speaker of the i-th quote. This large model can be a large language model or a multimodal large model. This large model can be the same large model as the aforementioned consistency assessment model, listener scoring model, and speaker identification model, or it can be a different large model.
[0144] In an optional embodiment, a flowchart illustrating the above-described processing of the i-th text sequence to determine whether the i-th quote belongs to the dialogue content, and the speaker of the i-th quote if it belongs to the dialogue content, is shown below. Figure 3 As shown, it may include:
[0145] Step S301: Input the semantic features of the i-th text sequence into the quotation attribution model to obtain the quotation attribution result output by the quotation attribution model (for ease of description and differentiation, it is denoted as the initial quotation attribution result). The initial quotation attribution result indicates whether the i-th quotation (i.e. the quotation currently being analyzed) belongs to the dialogue content, and the speaker when it belongs to the dialogue content.
[0146] Each token in the target text can be pre-encoded using a self-attention mechanism to obtain the encoding features of each word. Specifically, the target text can be preprocessed (including word segmentation and sentence segmentation) to obtain preprocessed text. Each token in the preprocessed text can then be encoded using a self-attention mechanism to obtain the encoding features (i.e., hidden state vectors) of each token.
[0147] To meet the demands of long text analysis, this application employs a pre-trained large language model with long context processing capabilities (e.g., supporting context windows of 192K tokens or more) as the basic semantic encoder. This allows for one-time encoding of complete chapters or even entire texts, avoiding the loss of cross-chapter information due to window truncation. The pre-trained large language model can be, but is not limited to, any of the following: BERT series models, GPT series models, Qwen series models, Baichuan series models, or Spark models, etc. The pre-trained large language model captures long-distance dependencies in the text through a self-attention mechanism. Compared to traditional models with short context windows (e.g., 512-token context windows), which require fragmenting the text and feeding it to the large model, causing the model to forget earlier parts as it reads later, one-time encoding allows the model to capture the semantic connections of the entire text or entire chapter within a single computational space.
[0148] For extremely long texts that exceed the model's context window, sparse attention mechanisms (such as Longformer and BigBird architectures) can be employed. By combining local and global attention, long-distance dependency modeling can be maintained while preserving computational efficiency. The specific processing involves the following two collaborative steps:
[0149] Local Sliding Window Attention: During encoding, for most tokens (except for those at key positions described below), each token only performs self-attention computation with its u neighboring tokens. This ensures that the model can capture local context (such as grammatical relationships within a sentence) while significantly reducing computational cost.
[0150] Global Attention: To avoid losing long-range dependencies, the system manually designates certain key locations (such as [CLS] nodes, specific role names, or chapter beginnings) as "global anchors." These anchors perform attention calculations with all tokens in the entire text, and all tokens also pay attention to these anchors.
[0151] Combinatorial modeling: By linearly combining local and global attention, the model can maintain both computational efficiency and semantic connections across the entire text when processing extremely long texts that exceed the native window (e.g., >192K tokens).
[0152] When it is necessary to obtain the semantic features of the i-th text sequence, the encoding features of the starting word of the i-th text sequence can be used as the semantic features of the i-th text sequence. Alternatively, the encoding features of each word in the i-th text sequence can be fused (e.g., averaged) to obtain the semantic features of the i-th text sequence.
[0153] When segmenting target text into sentences, a predefined marker (e.g., [CLS]) is typically added before each sentence to mark the beginning of a sentence. Based on this, the preceding text of the i-th quotation includes at least one sentence preceding the i-th quotation and the beginning markers of each sentence (e.g., [CLS]), and the following text of the i-th quotation includes at least one sentence following the i-th quotation and the beginning markers of each sentence. Thus, the starting term of the i-th text sequence can be the beginning marker of the first sentence preceding the i-th quotation (e.g., [CLS]).
[0154] Step S302: If the initial quote attribution result indicates that the i-th quote belongs to the dialogue content, the speaker of the i-th quote is verified based on a multi-level attribution strategy. The multi-level attribution strategy may include:
[0155] Level 1: Indicates attribution. If there is a text segment consisting of a person's mention and a speaking verb (e.g., "said", "answered") before the i-th quote (e.g., "Zhang San said"), then the speaker of the i-th quote is the character referred to by the person's mention before the i-th quote.
[0156] Level 2: Post-attribution. If there is a text segment consisting of a person's mention and a speaking verb after the i-th quote (e.g., he replied), then the speaker of the i-th quote is the person mentioned after the i-th quote.
[0157] Level 3: Context-based attribution based on dialogue patterns. If there are no text segments consisting of mentions and speaking verbs before or after the i-th quotation, and the i-th quotation forms a continuous dialogue with its preceding quotation (which is part of the dialogue content), identify the speaker alternation pattern among at least two consecutive quotations belonging to the dialogue content, and determine the speaker of the i-th quotation based on this alternation pattern. Here, the i-th quotation is the most recent statement among the aforementioned at least two consecutive quotations belonging to the dialogue content; that is, the speaker of the i-th quotation is the last character to appear, determined based on this alternation reasoning.
[0158] The spatial connection between the i-th quotation and its preceding dialogue-related quotation can be determined by factors such as line spacing, paragraph boundaries, and punctuation (e.g., consecutive quotation marks, colons). Specifically, if there are no blank lines or paragraph breaks between the i-th quotation and its preceding dialogue-related quotation, and these two quotations are marked with consecutive quotation marks (e.g., “…”, “…”) or consecutive colons followed by double quotation marks (e.g., A: “…”, B: “…”), then these two quotations are considered spatially connected and constitute a continuous dialogue.
[0159] When multiple consecutive quotations belonging to the dialogue content are spatially connected to the preceding quotations belonging to the dialogue content, these consecutive quotations constitute a continuous dialogue paragraph.
[0160] The alternation pattern of at least two quotations belonging to the dialogue content can be identified by using a large model, thus obtaining the alternation pattern of the at least two quotations belonging to the dialogue content.
[0161] As an example, if there are only two consecutive quotations, the alternation pattern can be AB (meaning the speakers of the two consecutive quotations are different) or AA (meaning the speakers of the two consecutive quotations are the same); if there are three consecutive quotations, the alternation pattern can include, but is not limited to: ABA, ABB, or AAB; if there are four consecutive quotations, the alternation pattern can include, but is not limited to: ABAB, ABBA, or AABA.
[0162] For example, based on the speaker alternation rule AAB or AB, it can be determined that the speaker of the i-th quotation is the listener B of the previous quotation; based on the speaker alternation rule ABAB, it can be determined that the speaker of the i-th quotation is the listener of the previous quotation or the (i-3)-th quotation, or the speaker of the (i-2)-th quotation; based on the speaker alternation rule ABB, it can be determined that the speaker of the i-th quotation is the speaker of the previous quotation, or the listener of the (i-2)-th quotation; based on the speaker alternation rule ABBA, it can be determined that the speaker of the i-th quotation is the listener of the previous quotation or the (i-2)-th quotation, or the speaker of the (i-3)-th quotation; based on the speaker alternation rule AABA, it can be determined that the speaker of the i-th quotation is the listener of the previous quotation, or the speaker of the (i-2)-th or (i-3)-th quotation.
[0163] Optionally, after determining the speaker alternation pattern, the confidence level of the speaker alternation pattern can also be obtained. If the confidence level is higher than the ninth threshold, the i-th speaker for quoting can be determined based on the speaker alternation pattern; otherwise, it is prohibited to determine the i-th speaker for quoting based on the speaker alternation pattern.
[0164] If the speaker of the i-th quote determined based on the multi-level attribution strategy is different from the speaker of the i-th quote determined by the aforementioned quote attribution model, the result of the multi-level attribution strategy shall prevail.
[0165] Optionally, before executing step S302, the confidence level of the initial quotation attribution result can be obtained; if the confidence level of the initial quotation attribution result is greater than or equal to the sixth threshold (e.g., 0.6), step S302 is executed; if the confidence level of the initial quotation attribution result is less than the sixth threshold, a manual review process is triggered. After the manual review is completed, step S302 is executed again.
[0166] In an optional embodiment, the flowchart for one implementation of person mention detection in target text described above is as follows: Figure 4 As shown, it may include:
[0167] Step S401: Obtain the encoding features of each token in the target text by encoding each token based on a self-attention mechanism.
[0168] The specific encoding process can be found in the aforementioned embodiments, and will not be repeated here.
[0169] Step S402: For each text segment in the target text whose length is less than the preset length, the encoding features of each word in the text segment are fused to obtain the semantic feature representation of the text segment (which can be simply referred to as semantic features).
[0170] In this application, the minimum length of the text fragment used to determine the person's mention is usually 1, and the maximum length can be set to 8-10 words based on experience or statistics to cover common names, titles, or generic phrases. That is, the preset length can be 8, 9, 10, or 11.
[0171] For the h-th text segment whose length is less than the preset length (hereinafter referred to as the h-th text segment), the semantic features of the h-th text segment can be obtained by fusing the features of each word element in the h-th text segment, or the semantic features of the h-th text segment can be obtained by fusing the features of each word element in the h-th text segment and the length feature of the h-th text segment.
[0172] Optionally, the encoding features of each word in the h-th text segment can be pooled (average pooling or max pooling) to obtain the pooled features of the h-th text segment; the encoding features of the starting word (i.e., the first word) and the ending word (i.e., the last word) of the h-th text segment can be concatenated with the above pooled features to obtain the semantic feature representation of the h-th text segment.
[0173] Alternatively, we can obtain the embedding feature of the length of the h-th text segment; perform pooling on the encoding features of each word in the h-th text segment to obtain the pooling feature of the h-th text segment; and concatenate the encoding features of the starting word, the ending word, the pooling feature, and the embedding feature of the h-th text segment to obtain the semantic feature representation of the h-th text segment.
[0174] This application incorporates the encoding features of the starting and ending words of the h-th text segment, along with the pooling features of the intermediate words, as part of the semantic features of the h-th text segment. This allows the semantic features of the h-th text segment to not only know where it begins and ends, but also to include a comprehensive summary of its content. This helps the person mention detection model compress the essential semantics of the entire text segment into boundary words, improving the accuracy of the person mention detection model.
[0175] Step S403: Based on the semantic feature representation of the text fragment, predict whether the text fragment belongs to a person mention, and if it belongs to a person mention, the category of the person mention.
[0176] The semantic features of the h-th text segment can be input into the person mention detection model to obtain the person mention detection result output by the person mention detection model. The person mention detection result represents whether the h-th text segment belongs to person mention, and the type of person mention when it belongs to person mention (i.e., proper noun, third-person pronoun or generic phrase of person).
[0177] In an optional embodiment, the flowchart for one implementation of coreference resolution of detected person mentions is as follows: Figure 5 As shown, it may include:
[0178] Step S501: Obtain the confidence score of the person mentions obtained by performing person mention detection on the target text.
[0179] The confidence score of the h-th text segment belonging to a person's mention can be the score obtained by the aforementioned person mention detection model.
[0180] Step S502: Evaluate the coreference compatibility for each pair of character mentions to obtain a coreference compatibility score for each pair of character mentions. The coreference compatibility score indicates the compatibility of two character mentions when they refer to the same character.
[0181] For any two mentions, denoted as mention A and mention B, the coreference compatibility score of mention A and mention B can be calculated based on the semantic features of mention A and mention B, as well as a pre-learned biaffine transformation matrix. This can be expressed by the formula:
[0182] (1)
[0183] in, Scoring the coreference compatibility between mentions of person A and mentions of person B; For the semantic features of mentioning A by a person, T represents the transpose operation; The semantic features of mentioning B in the character; W is the learned parameter matrix, denoted as the biaffine transformation matrix, which is the parameter of the biaffine transformation model.
[0184] The dual affine transformation model can be jointly trained with other models (including but not limited to at least one of the following models: person mention detection model, speaker recognition model, listener scoring model, consistency assessment model, etc.). During the training process, the loss corresponding to the dual affine transformation model is the loss between the coreference compatibility score between person mentions obtained by the dual affine transformation model and the standard coreference compatibility score.
[0185] The purpose of using a biaffine transformation model to perform biaffine transformation on the semantic features mentioned by two characters is to measure the "compatibility" or "similarity" of the two characters' mentions in a mathematical space. For example, based on biaffine transformation, it can be determined whether "Zhang San" and "he" appearing later in the text belong to the same character entity in terms of semantics and context.
[0186] To improve the adaptability of the biaffine transformation model to literary works, the parameters (i.e., the biaffine transformation matrix) of the biaffine transformation model can be fine-tuned using a common annotation dataset of literary works (such as LitBank), so that the biaffine transformation model can adapt to the narrative style (e.g., flashback, interlude, etc.) and character reference patterns of different genres.
[0187] Step S503: Cluster the mentions of a person based on their confidence score and the coreference compatibility score; mentions of people belonging to the same cluster category point to the same person.
[0188] Optionally, the confidence scores of mention A, the confidence scores of mention B, and the coreference compatibility scores of mentions A and B can be combined (e.g., summed) to obtain the coreference scores of mentions A and B.
[0189] If the coreference score of mentions A and B is greater than the second threshold, mentions A and B will be classified into the same cluster category.
[0190] Mentions of different individuals whose core reference scores are all greater than a second threshold are grouped into the same cluster. For example, if mentions of person A and person B have core reference scores greater than the second threshold, and mentions of person C and person B also have core reference scores greater than the second threshold, then regardless of whether the core reference scores of mentions of person A and person C are greater than the second threshold, mentions of person A, person B, and person C will be classified into the same cluster. This ensures consistency in character clustering within long texts.
[0191] Furthermore, for any cluster category, the average coreference score and semantic similarity between mentions of people within that cluster category are obtained.
[0192] Based on the average coreference score and the semantic similarity between mentions of people, the cluster consistency of any cluster category is evaluated to obtain the cluster consistency score of any cluster category.
[0193] The average coreference score and the semantic similarity between mentions can be input into a large model to obtain the cluster consistency score for any cluster category generated by the large model. Alternatively, a pre-defined scoring rule can be used to calculate the cluster consistency score for any cluster category based on the average coreference score and the semantic similarity between mentions.
[0194] If the cluster consistency score is less than the fifth threshold (e.g., 0.5), it indicates that there is obvious conflict or instability within the clustering results. The mentions of people in any cluster should be rolled back and recalculated. Therefore, the rollback is performed on the mentions of people in any cluster to the step of detecting mentions of people in the target text. That is, the rollback operation is performed on the mentions of people in any cluster to re-detect mentions of people in the text fragments corresponding to the mentions of people in any cluster. Then, the re-detected mentions of people and the mentions of people in the clusters that have not been rolled back are clustered.
[0195] In an optional embodiment, for each speaker of a quote, the speaker's persona can be updated based on the individual quotes of that speaker.
[0196] For any character R, the character R's profile may include, but is not limited to: information about the appearance of character R, the relationship between character R and other characters, and the character R's personality traits.
[0197] The information regarding the appearance of character R includes at least one of the following: the frequency of appearance, chapter distribution, paragraph distribution, and proportion of dialogue of character R in the analyzed text consisting of the current quote of character R (i.e., the quote in which the speaker is most recently identified as character R) and the text preceding it.
[0198] The chapter and paragraph distribution of character R measures the coverage of character R in the spatial dimension, while the dialogue proportion of character R measures the contribution of character R in the interaction dimension.
[0199] The chapter distribution of character R refers to the proportion of the number of chapters in the analyzed text in which character R appears to the total number of chapters in the analyzed text.
[0200] The paragraph distribution of character R refers to the proportion of paragraphs in the analyzed text in which character R appears to the total number of paragraphs in the analyzed text.
[0201] The dialogue percentage of character R refers to the proportion of the number of quotes (i.e., the number of times or the number of times character R speaks) in the analyzed text to the total number of quotes in the analyzed text that belong to dialogue content.
[0202] The relationship between character R and other characters may include, but is not limited to, at least one of the following: co-occurrence relationship, dialogue relationship, degree centrality representing the position of character R among all characters (all characters appearing in the analyzed text), and betweenness centrality representing the pivotal role of character R among all characters (all characters appearing in the analyzed text) in the analyzed text.
[0203] Optionally, the relationships between each character and other characters can be generated in the following way:
[0204] If two characters appear in the same paragraph or the same dialogue scene in the analyzed text, a co-occurrence relationship is determined between the two characters; the weight of the co-occurrence relationship is the co-occurrence frequency of the two characters. The appearance of two characters in the same dialogue scene can include: the two characters appearing simultaneously in the same dialogue content or appearing in the descriptive profile of the dialogue (e.g., Zhang San looking at Li Si and saying).
[0205] If two characters have dialogue interactions in the analyzed text, it is determined that the two characters have a dialogue relationship, and the weight of the dialogue relationship is the number of dialogue turns between the two characters.
[0206] A character relationship network can be constructed based on the co-occurrence and dialogue relationships between characters in the analyzed text. Edges exist between characters that have co-occurrence and / or dialogue relationships. The weight of the edge is determined according to the relationship between the characters. If two characters only have a co-occurrence relationship, the weight of the edge between the two characters is the co-occurrence frequency of the two characters in the analyzed text. If two characters only have a dialogue relationship, the weight of the edge between the two characters is the dialogue rounds of the two characters. If two characters have both a dialogue relationship and a co-occurrence relationship, the weight of the edge between the two characters can be the weighted sum of the co-occurrence frequency and the dialogue rounds of the two characters.
[0207] Based on each character's co-occurrence and dialogue relationships with other characters, the degree centrality and betweenness centrality of each character are calculated. Furthermore, community segmentation can be performed on the characters.
[0208] The calculation methods for the degree centrality and betweenness centrality of character R, as well as the methods for dividing characters into communities, can adopt existing schemes, which will not be elaborated here.
[0209] The degree centrality of role R is used to measure the activity level of role R, and based on this, it can be determined whether role R is a "social butterfly". For example, if the degree centrality of role R is greater than the seventh threshold, role R is determined to be a "social butterfly".
[0210] The betweenness centrality of role R is used to measure the bridging role of role R, and based on this, it can be determined whether role R is a "key pivot figure". For example, if the betweenness centrality of role R is greater than the eighth threshold, role R is determined to be a "key pivot figure".
[0211] The purpose of community segmentation is to identify “factions” or “family camps” within a target text (such as a script or novel).
[0212] The personality traits of character R include, but are not limited to, at least one of the following: the topics that character R focuses on, language style, emotional distribution (such as the ratio of emotional polarity), and personality keywords in the analyzed text.
[0213] By updating character profiles, vague figures can be transformed into describable, understandable, and usable structured information, which can be used to help readers understand text, interpret behavior, and support creation and application.
[0214] The character profile obtained from each update can be stored in association with the latest character quotes determined when the character profile is updated. When a user requests to view the character profile for each quote, the character profile associated with that quote can be output, thus clearly showing the changes of each character in the target text.
[0215] Optionally, the personality traits of character R can be generated in the following way:
[0216] Topic extraction and language style analysis were performed on all statements (i.e. quotations) made by character R in the analyzed text to determine the topic areas that character R focuses on and the character's language style (e.g., verbal tics and speaking habits).
[0217] Traditional topic models (such as Latent Dirichlet Allocation, LDA) can be used to extract the topic domain of character R from all statements made by character R in the analyzed text. Alternatively, a large topic extraction model can be used to extract the topic domain of character R from all statements made by character R in the analyzed text.
[0218] Language style analysis models can be used to identify character R's verbal tics and speaking habits from all statements made by character R in the analyzed text, which can be used as character R's language style.
[0219] Emotion identification is performed on each statement made by character R in the analyzed text to determine the emotion of different statements made by the character; the distribution of emotions of character R is statistically analyzed (e.g., the proportion of each emotion).
[0220] For each statement made by character R in the analyzed text, the encoded feature of the marker [CLS] preceding the statement (see the aforementioned embodiment for the specific encoding process, which will not be repeated here) can be used as the semantic feature of the statement. The semantic feature is then input into the emotion recognition model to obtain the emotion of the statement output by the emotion model.
[0221] The emotion recognition model and the aforementioned quote attribution model can be the same large model or different large models.
[0222] When the emotion recognition model and the quote attribution model are the same large model, the general large model can be fine-tuned by using the dual tasks of quote attribution and emotion recognition.
[0223] The sample data for the quotation attribution task consists of a text sequence containing character statements (i.e., quotations belonging to the dialogue content) and their context. The context of a character's statement includes references to other characters representing that character. The sample labels are the references to other characters representing that character or the characters those references refer to, contained in the context of the character's statement. For example, the original text is:
“Why are you so late today?” Xiaoming put down his book and frowned slightly. Xiaohua quickly smiled apologetically, “I was delayed on the way.”
“Why are you so late today?” Xiaoming put down his book and frowned slightly.
Xiaohua quickly smiled apologetically, “I was delayed on the way.”
[0224] The sample data for the emotion recognition task consists of quotations belonging to the dialogue content and the narrative text related to the character in the context of those quotations (e.g., Xiaoming puts down his book and frowns slightly), with the sample labels representing the character's emotion. When training the large model's emotion recognition capability, the samples are input into the large model to obtain the emotion recognition result output by the large model. The corresponding loss (denoted as the second loss) is the loss between the emotion recognition result and the sample labels. The second loss can be a multi-label binary cross-entropy loss.
[0225] When updating the parameters of the large model, the first loss and the second loss are weighted and summed to obtain the total loss. The parameters of the large model are updated with the goal of reducing the total loss.
[0226] In this embodiment, a labeling system containing 10-12 fine-grained emotions is constructed, such as: joy, sadness, anger, fear, disgust, surprise, trust, expectation, love, shame, guilt, contempt, etc. The emotion expressed by character R in each statement in the analyzed text can be any one of the above 12 emotions.
[0227] Based on the information about R's appearances in the analyzed text, the topics he / she focuses on, his / her language style, and the distribution of his / her emotions, we can determine the personality keywords of R.
[0228] Information about character R's appearances in the analyzed text, their areas of interest, language style, and emotional distribution can be input into the personality analysis model to obtain the personality keywords for character R. Character R can have one, two, or more personality keywords.
[0229] The personality analysis model and the aforementioned major models can be the same major model or different major models.
[0230] In an optional embodiment, one way to perform emotion recognition on any speech is as follows:
[0231] Obtain the semantic features (hidden state vector) of any given statement.
[0232] Based on the semantic features of any given statement, predict the probability that the statement belongs to each possible emotion (for ease of description and distinction, denoted as the initial probability). Possible emotions refer to the aforementioned fine-grained emotion labels.
[0233] Obtain the prior transition probability from the emotion of the speaker's previous speech to each possible emotion for any given speech.
[0234] By performing frequency statistics on training corpora with emotion labels, we can calculate the frequency of specific emotion pairs (e) in consecutive dialogue sequences of the same character. t-1 ,e tThe number of times the emotion appears is divided by the initial emotion e. t-1 The total number of occurrences yields the conditional probability P(e). t |e t−1 ), where e t-1 Let e be the emotion at time t-1. t Let be the emotion at time t. Assuming the number of emotion categories is E, we can construct an E×E matrix T, where each row of matrix T represents the emotional state e of the preceding statement in two consecutive statements by the same character. t-1 Different rows correspond to different possible emotions, and the columns of matrix T represent the emotional state e of the second speech in two adjacent speeches by the same character. t Different columns correspond to different possible emotions; each coordinate point T in matrix T m,n Store the conditional probability of transitioning from emotion m to emotion n.
[0235] For any possible emotion, the initial probability that any speech belongs to any possible emotion is constrained based on the prior transition probability from the emotion of the previous speech to that possible emotion, thus obtaining the target probability that any speech belongs to that possible emotion.
[0236] The target probability of any statement belonging to any possible emotion can be obtained by multiplying the initial probability of that statement belonging to that possible emotion by the prior transition probability from the emotion of the previous statement to that possible emotion. This can be expressed by the formula:
[0237] (2)
[0238] Formula (2) describes how to determine the optimal emotional state of the current dialogue sequence at time t in the Viterbi Algorithm.
[0239] in, This is the probability output by the emotion classification head of the emotion recognition model. It represents the probability based on the current text x. t The emotion recognition model considers it to belong to emotion e. t The original possibility. These are prior values extracted from the "emotional state transition matrix". argmaxet[⋅] (objective function): This is achieved by using the "original probabilities predicted by the model" as the objective function. "and "logic probability of state transition" "Multiply by each other to find the emotion category e that maximizes the overall probability." t .
[0240] The emotion of any given statement is determined based on the target probability of that statement belonging to each possible emotion.
[0241] Optionally, the possible emotion corresponding to the highest target probability among all possible emotions can be determined as the emotion of any given statement.
[0242] By constraining the prior transition probability of emotions, the emotional sequence can be smoothed, preventing unreasonable abrupt changes in the emotional prediction of adjacent dialogues of the same character.
[0243] Optionally, another implementation of determining the emotion of any given statement based on the target probability of that statement belonging to each possible emotion can be:
[0244] Based on a pre-configured personality-emotion adjustment coefficient mapping table, determine the adjustment coefficients for each possible emotion corresponding to the speaker's personality updated at the time of the previous speech of any speaker.
[0245] The personality-emotion adjustment coefficient mapping table stores the adjustment coefficients for the probabilities of various possible emotions corresponding to each personality type. For example, the prior probability of a "joyful" emotion for a character with a "gloomy" personality should be appropriately reduced. Based on this, an adjustment coefficient of less than 1 can be set for the "gloomy" character to affect the probability of its "joyful" emotion.
[0246] The target probability of any given statement belonging to any given statement is adjusted based on the adjustment coefficients of each possible emotion. The possible emotion corresponding to the largest value among the adjusted target probabilities is determined as the emotion of any given statement.
[0247] The adjusted target probability can be obtained by multiplying the target probability of any statement belonging to each possible emotion by the adjustment coefficient of that possible emotion.
[0248] By adjusting the target probability, consistency verification between the role and the emotion was achieved, making the identified emotions more consistent with the character's persona.
[0249] In an optional embodiment, before constraining the initial probability that any statement belongs to each possible emotion, the method may further include:
[0250] The initial emotion of any given statement is determined based on the initial probability that it belongs to each possible emotion. For example, the possible emotion corresponding to the highest initial probability can be determined as the initial emotion of any given statement.
[0251] Obtain the prior transition probability from the emotion of the speaker's previous speech to the aforementioned initial emotion, and the difference in emotion intensity between the speaker's previous speech and the aforementioned initial emotion.
[0252] In this application, the emotion recognition model can predict not only the speaker's emotion, but also the intensity of the emotion.
[0253] When training an emotion recognition model, sample labels include both emotion labels and emotion intensity labels. Therefore, when calculating the loss, in addition to calculating the loss between the emotion recognition result and the emotion label (i.e., the aforementioned second loss), the loss between the emotion intensity recognition result output by the emotion recognition model and the emotion intensity label can also be calculated (denoted as the third loss). The third loss can be the average error loss. The second loss (with a weight of 1) and the third loss (with a weight less than 1) are weighted and summed to obtain the total loss of the emotion recognition model. The total loss of the emotion recognition model is then weighted and summed with the first loss to obtain the total loss of both the emotion recognition model and the quotation attribution model. The parameters of the emotion recognition model and the quotation attribution model are updated based on this total loss.
[0254] If the prior probability of the speaker's previous emotion to the initial emotion mentioned above is less than the third threshold (e.g., 0.2), and the intensity difference is greater than the fourth threshold (e.g., 0.5), then the initial probability of the speaker's previous emotion to any possible emotion is constrained; otherwise, the initial probability of the speaker's previous emotion to any possible emotion is not constrained, and the initial emotion mentioned above is used as the emotion of the speaker's previous emotion.
[0255] In an optional embodiment, the text analysis method provided in this application may further include:
[0256] Construct an emotion time series for character R according to the text unit order. Each element in the emotion time series includes: a timestamp representing the text unit number, character R's emotion in that text unit, and the intensity of the emotion. Each text unit is either a chapter or a paragraph in the target text. The timestamp for a chapter can be a chapter number, and the timestamp for a paragraph can be a exercise number.
[0257] Furthermore, based on the emotional time series of character R, we can statistically analyze the emotional change rate, emotional fluctuation amplitude, emotional peaks and turning points of character R.
[0258] The Emotion Change Rate for Character R measures the rate at which the intensity of emotion changes per unit length of text (e.g., per chapter or per paragraph). It is typically calculated using first-order differences or gradients. The formula can be expressed as:
[0259] (3)
[0260] Among them, v t Indicates the rate of change in mood; i t and i t-1Δt represents the emotional intensity of character R at two adjacent times t and t-1 in the emotional time series, respectively; Δt represents the time difference between the two adjacent times, that is, the duration from time t-1 to time t.
[0261] The volatility amplitude of a character (R) refers to the dispersion or range of emotional intensity within a specific window (such as a story unit, which can be specified by the user). It is often measured by variance or standard deviation. It can be expressed by the formula:
[0262] (4)
[0263] Where A represents the fluctuation range of character R; k represents the number of text units in the emotional time series belonging to character R contained within the window.
[0264] Emotion peaks for character R are local maxima of emotional intensity in the emotional time series of character R, and these values typically need to exceed the global average intensity plus a certain multiple of the standard deviation. Emotion peaks can be identified using the following conditions:
[0265] (5)
[0266] Among them, i t and i t-1 μ represents the emotional intensity of character R at two adjacent times t and t-1 in the emotional time series; i σ is the mean of the emotional intensity across all elements in the emotional time series of character R; i Let be the variance of the emotional intensity among all elements in the emotional time series of character R; k is a preset scaling factor, which can be 1, 2, or 3. For example, when k is 2, it means that the text unit corresponding to the emotional intensity exceeding the mean by 2 standard deviations is the emotional high point. k takes a uniform value for all characters, or is adaptively adjusted according to the length of the character's emotional time series; for example, when the length of the character's emotional time series is less than the preset length threshold, a smaller k value is used to improve sensitivity. If condition (5) is met, determine the inclusion of emotional intensity i. t The text unit in the element represents the emotional high point of character R.
[0267] Turning points for character R are the points in the emotional time series where the polarity of emotion fundamentally changes (e.g., from "joy" to "anger") or the slope of emotional intensity reverses. Turning points can be identified using the following conditions:
[0268] (6)
[0269] Comparative analysis revealed that the coreference resolution F1 score of this application is 10%-15% higher than that of the baseline method; the citation attribution accuracy reaches over 85%, solving the problem of consistent role reference in long texts.
[0270] This application supports more than 10 categories of fine-grained emotion recognition, which is 3 times more granular than the traditional 4-class classification. The F1 score of emotion classification in this application is improved by 8%-12%, realizing quantitative assessment of emotion intensity and supporting emotion evolution tracking.
[0271] In addition, this application has a high degree of automation, with the entire process being over 90% automated, reducing manual annotation costs by more than 70%.
[0272] Corresponding to the method embodiments, this application also provides an electronic device. (See reference...) Figure 6 The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of this application. The electronic device in these embodiments can be a terminal device (e.g., an in-vehicle infotainment system, a large-screen device, a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc.) or a server (which can be a single server, a server cluster, or a cloud server, etc.). Figure 6 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0273] like Figure 6 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, the RAM 603 also stores various programs and data required for the operation of the electronic device. The processing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0274] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, memory cards, hard drives, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0275] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the text analysis methods provided in this application.
[0276] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the text analysis methods provided in this application.
[0277] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0278] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0279] In the above embodiments, the functionality can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented entirely or partially as a computer program product. Those skilled in the art can use different methods to implement the described functions for each specific solution, but such implementation should not be considered beyond the scope of this application.
[0280] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0281] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0282] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A text analysis method, characterized in that, include: The target text is subjected to character mention detection; the character mentions include: proper nouns referring to people, third-person pronouns, and generic phrases referring to people. Coreference resolution is performed on detected character references to identify references that refer to the same character; For each quotation in the target text, the speaker and listener of the quotation are identified based on the text sequence containing the quotation and its context, whether the quotation belongs to the dialogue content, and if it belongs to the dialogue content; the speaker and listener of the quotation are different people mentioned in the person mentions contained in the text sequence. If the quoted content belongs to dialogue, identify the first-person pronouns and second-person pronouns in the quoted content; The identified first-person pronouns are associated with the same speaker as the quoted speaker, and the identified second-person pronouns are associated with the same listener as the quoted listener.
2. The method according to claim 1, characterized in that, Identifying whether a quote belongs to dialogue content based on a text sequence containing the quote and its preceding and following context, and identifying the speaker and listener of the quote when it belongs to dialogue content, includes: The text sequence is processed to determine whether the quote belongs to the dialogue content, and if it does, the speaker of the quote. Obtain the associated information of each person to be evaluated mentioned in the text sequence, wherein the person to be evaluated is mentioned by a person other than the speaker of the quotation in the text sequence; the associated information includes: the active status of the person to be evaluated mentioned, the historical dialogue record of the person to be evaluated mentioned, and the second-person pronoun reference clues in the quotation. Based on the relevant information mentioned by the person to be evaluated, those whose mentions meet the consistency criteria with the speaker of the quote are selected as the recipients of the quote.
3. The method according to claim 2, characterized in that, Based on the relevant information mentioned by the person to be evaluated, those whose mentions meet the condition of consistency with the speaker of the quotation are selected as the recipients of the quotation, including: Based on the relevant information mentioned by the person to be evaluated, the listener evaluation of the mention of the person to be evaluated is carried out to obtain the score of the listener belonging to the mention of the person to be evaluated; Individuals whose scores exceed the first threshold will be identified as potential speakers. For each candidate listener, the consistency between the candidate listener and the speaker of the quote is evaluated, and the candidate listener with the highest consistency score with the speaker of the quote is determined as the listener of the quote.
4. The method according to claim 2, characterized in that, The text sequence is processed to determine whether the quote belongs to the dialogue content, and if it does, the speaker of the quote, including: The semantic features of the text sequence are input into the quotation attribution model to obtain the initial quotation attribution result output by the quotation attribution model; the initial quotation attribution result indicates whether the quotation belongs to the dialogue content, and the speaker when it belongs to the dialogue content. If the initial quote attribution result indicates that the quote belongs to the dialogue content, the speaker of the quote is verified based on a multi-level attribution strategy, which includes: If there is a text segment consisting of a person's mention and a speaking verb before the quote, then the speaker of the quote is the character referred to by the person's mention before the quote; If a text segment consisting of a person's mention and a speaking verb exists after the quote, then the speaker of the quote is the character referred to by the person's mention after the quote; If there are no text segments consisting of verbs or phrases of speech before or after the quoted statement, and the quoted statement and the preceding quoted statement that is part of the dialogue form a continuous dialogue, then the speaker alternation pattern of at least two consecutive quoted statements that are part of the dialogue is identified, and the speaker of the quoted statement is determined based on the speaker alternation pattern; the quoted statement is the latest quoted statement of the aforementioned at least two consecutive quoted statements that are part of the dialogue.
5. The method according to claim 1, characterized in that, Person mention detection is performed on the target text, including: Obtain the encoding features of each word element obtained by encoding each word element in the target text based on a self-attention mechanism; For each text segment in the target text whose length is less than a preset length, the encoding features of each word in the text segment are fused to obtain the semantic feature representation of the text segment. Based on the semantic features of the text fragment, predict whether the text fragment belongs to a person mention, and if it does, the category of the person mention.
6. The method according to claim 5, characterized in that, At least the encoded features of each word in the text segment should be fused, including: The encoded features of each word in the text segment are pooled to obtain the pooled features of the text segment; the encoded features of the starting word, the encoded features of the ending word, and the pooled features are concatenated to obtain the semantic feature representation of the text segment. Alternatively, obtain the embedding feature of the length of the text segment; perform pooling on the encoding features of each word in the text segment to obtain the pooling feature of the text segment; concatenate the encoding features of the starting word, the encoding features of the ending word, the pooling feature, and the embedding feature of the text segment to obtain the semantic feature representation of the text segment.
7. The method according to claim 1, characterized in that, The coreference resolution of detected person mentions includes: Obtain the confidence score of the person mentions obtained by performing person mention detection on the target text; For each pair of character mentions, a coreference compatibility assessment is performed to obtain a coreference compatibility score for each pair of character mentions; the coreference compatibility score indicates the compatibility of two character mentions when they refer to the same character. Based on the confidence score of the mentions and the coreference compatibility score among the mentions, the mentions are clustered; mentions belonging to the same cluster refer to the same character.
8. The method according to claim 7, characterized in that, Based on the confidence score of the mentions and the coreference compatibility score among the mentions, the mentions are clustered, including: For any two mentions of a person, the confidence score of the mentions of the two people and the coreference compatibility score between the mentions of the two people are combined to obtain the coreference score of the mentions of the two people. Two people whose core index scores are greater than the second threshold are identified as belonging to the same cluster category. Mentions of different individuals whose core reference scores are all greater than the second threshold are identified as belonging to the same cluster category.
9. The method according to claim 1, characterized in that, Also includes: For each speaker identified in a quote, update the speaker's profile based on each of the speaker's identified quotes. The character's profile includes: information about the character's appearances, relationships with other characters, and personality traits; The information on the appearance of the character includes at least one of the following: the frequency of appearance, chapter distribution, paragraph distribution, and dialogue proportion of the character in the analyzed text consisting of the current quote and the text preceding it; The relationship between this character and other characters includes at least one of the following: co-occurrence relationship, dialogue relationship, degree centrality representing the character's position among all characters, and betweenness centrality representing the character's pivotal role among all characters in the analyzed text; The character's personality traits include at least one of the following: the topics the character focuses on, language style, emotional distribution, and personality keywords in the analyzed text.
10. The method according to claim 9, characterized in that, Generate the relationships between each character and other characters, including: If two characters appear in the same paragraph or the same dialogue scene in the analyzed text, it is determined that the two characters have a co-occurrence relationship; the weight of the co-occurrence relationship is the co-occurrence frequency of the two characters; if two characters have dialogue interaction in the analyzed text, it is determined that the two characters have a dialogue relationship; the weight of the dialogue relationship is the number of dialogue turns of the two characters. Calculate the degree centrality and betweenness centrality of each character based on its co-occurrence and dialogue relationships with other characters.
11. The method according to claim 9, characterized in that, The personality traits generated for each character include: Topic extraction and language style analysis were performed on all statements made by the character in the analyzed text to determine the topic areas the character focuses on and the character's language style; Emotion recognition was performed on each statement made by the character in the analyzed text to determine the emotion of the character's different statements; the distribution of the character's emotions was statistically analyzed. Based on the character's appearances in the analyzed text, the topics they focus on, their language style, and their emotional distribution, we can determine the character's personality keywords.
12. The method according to claim 11, characterized in that, Emotion recognition for any statement, including: Obtain the semantic features of any of the statements; Predict the initial probability that any given statement belongs to each possible emotion based on the semantic features of that statement; Obtain the prior transition probability from the emotion of the speaker's previous speech to each possible emotion for any given speech; For any possible emotion, the initial probability of any speech belonging to any possible emotion is constrained based on the prior transition probability from the emotion of the previous speech to the possible emotion, so as to obtain the target probability of any speech belonging to the possible emotion. The emotion of any given statement is determined based on the target probability of each possible emotion.
13. The method according to claim 12, characterized in that, Determining the emotion of any given statement based on the target probability of each possible emotion, including: Based on a pre-configured personality-emotion adjustment coefficient mapping table, determine the adjustment coefficients for each possible emotion corresponding to the speaker's personality updated at the previous speaking time for any of the speakers. Based on the adjustment coefficients of each possible emotion, the target probability of any statement belonging to each possible emotion is adjusted, and the possible emotion corresponding to the largest value among the adjusted target probabilities is determined as the emotion of any statement.
14. The method according to claim 12, characterized in that, Before constraining the initial probability of any given statement belonging to any of the possible emotions, the method further includes: The initial emotion of any given statement is determined based on the initial probability that any given statement belongs to each possible emotion. Obtain the prior transition probability from the emotion of the speaker's previous speech to the initial emotion, as well as the difference in emotion intensity; If the prior transition probability from the emotion of the speaker's previous speech to the initial emotion is less than a third threshold, and the difference in emotion intensity is greater than a fourth threshold, then the initial probability of any speech belonging to each possible emotion is constrained; otherwise, constraining the initial probability of any speech belonging to each possible emotion is prohibited.
15. The method according to claim 11, characterized in that, Also includes: The emotional intensity of each statement made by the character is identified to determine the emotional intensity of the different statements made by the character. Construct an emotional time series for each character along the text unit sequence; Each element in the emotional time series includes: a timestamp representing the text unit number, the character's emotional category in that text unit, and the emotional intensity; Each text unit is a chapter in the target text, or each text unit is a paragraph in the target text; Based on the emotional time series, the rate of emotional change, the amplitude of emotional fluctuation, the emotional peak and the turning point of each character are statistically analyzed.
16. The method according to claim 8, characterized in that, Also includes: For any cluster category, obtain the average coreference score and semantic similarity between mentions of people within that cluster category; Based on the average coreference score and the semantic similarity between mentions of people, the cluster consistency of any cluster category is evaluated to obtain the cluster consistency score of any cluster category; If the cluster consistency score is less than the fifth threshold, a rollback operation is performed on the mentions of people within any of the cluster categories to re-detect the mentions of people in the text fragments corresponding to the mentions of people within any of the cluster categories.
17. The method according to claim 4, characterized in that, Also includes: Obtain the confidence level of the initial quotations attribution results; If the confidence level of the initial quotation attribution result is less than the sixth threshold, a manual review process is triggered.
18. An electronic device, characterized in that, The electronic device includes at least one processor and a memory connected to the processor; wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the text analysis method as described in any one of claims 1 to 17.
19. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the text analysis method as described in any one of claims 1 to 17.
20. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the text analysis method as described in any one of claims 1 to 17.