Script analysis-based semantic entity stabilization method, terminal device, and product

CN122819205APending Publication Date: 2026-09-25HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611100804.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-23
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0004]本申请实施例提供了一种基于剧本解析的语义实体稳定化方法、终端设备及产品,以解决现有技术存在的考虑不够全面,难以满足实际需求的问题

Benefits of technology

本申请实施例提供的一种基于剧本解析的语义实体稳定化方法,通过对与待确定实体关联的当前剧本内容执行特征提取操作,得到待确定实体的特征向量;基于待确定实体和同现实体,生成待确定实体在当前轮次的局部同现拓扑图;同现实体指在当前剧本内容中与待确定实体同时出现并产生对白的实体;局部同现拓扑图用于表征待确定实体与同现实体之间的社交熟络度;基于特征向量和局部同现拓扑图,从已构建的全局持续语义锚点网络中筛选得到与待确定实体匹配的目标锚点实体,并将待确定实体与目标锚点实体进行关联;全局持续语义锚点网络包括多个锚点实体,每个锚点实体包括一个在完整剧本范围内具有唯一确定性的规范身份;完整剧本范围包括当前剧本内容。本申请可以通过特征向量捕捉实体文字和语义固有属性,并利用局部同现拓扑图量化实体间同场景共现频次,可以量化实体社交关联紧密程度,补充剧本场景专属关联约束,可以减少错关联、漏关联的情况出现;同时,结合全局持续语义锚点网络,每个锚点实体具备全文本唯一规范身份,不随单场文本表述、场景变化而变更;每次解析仅将待解析实体关联至固定规范锚点,可以从根源上避免实体身份碎片化、语义漂移,有效提高实体标识的全局唯一稳定。可见,本申请通过局部同现拓扑图和全局持续语义锚点网络,有效解决了剧本中实体语义不稳定、身份混淆的问题,提高了匹配精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122819205A_ABST
    Figure CN122819205A_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of computers, and provides a script analysis-based semantic entity stabilization method, a terminal device and a product, which comprise: performing a feature extraction operation on current script content associated with a to-be-determined entity to obtain a feature vector of the to-be-determined entity; generating a local co-occurrence topology graph of the to-be-determined entity in a current round based on the to-be-determined entity and a co-occurrence entity; screening a target anchor entity matching the to-be-determined entity from a global persistent semantic anchor network based on the feature vector and the local co-occurrence topology graph, and associating the to-be-determined entity with the target anchor entity; and each anchor entity in the global persistent semantic anchor network comprises a standard identity with unique certainty in a complete script range. Through the local co-occurrence topology graph and the global persistent semantic anchor network, the application effectively solves the problems of unstable script entity semantics and confused identities, and improves matching accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, and in particular relates to a semantic entity stabilization method, terminal device and product based on script parsing. Background Technology

[0002] Currently, the industrialization of cultural and entertainment industries, including short dramas, long dramas, automatic script decomposition, script knowledge graph construction, and interactive script deduction, has been fully implemented. Script parsing, as an upstream foundational module, undertakes the core tasks of extracting semantic entities such as characters, props, scenes, events, and relationships, resolving referential issues, and associating them across scenes. Taking long scripts as an example, when parsing such long scripts in multiple rounds and across sessions using a large model (LLM), the nondeterministic generation of the large model and the forgetfulness of cross-session processes can easily lead to problems such as disordered and stateless expansion of entities and fragmentation of synonyms.

[0003] Existing semantic entity stabilization methods typically address the aforementioned technical problems through entity pairing, disambiguation (Entity Resolution), or knowledge graph pairing techniques. However, existing technologies mainly rely on large-scale external general-purpose encyclopedic corpora (such as DBpedia / Wikipedia) or pre-defined static expert rule systems (Regex / Schema mapping) for offline batch processing computation, which is not comprehensive enough and fails to meet practical needs. Summary of the Invention

[0004] This application provides a semantic entity stabilization method, terminal device, and product based on script parsing to address the problem that existing technologies are not comprehensive enough and cannot meet actual needs.

[0005] In a first aspect, embodiments of this application provide a semantic entity stabilization method based on script parsing, including: Perform feature extraction on the current script content associated with the entity to be determined to obtain the feature vector of the entity to be determined; Based on the entity to be determined and its co-occurrence entities, a local co-occurrence topology graph of the entity to be determined in the current round is generated; a co-occurrence entity refers to an entity that appears simultaneously with the entity to be determined and generates dialogue in the current script content; the local co-occurrence topology graph is used to represent the social familiarity between the entity to be determined and its co-occurrence entities. Based on feature vectors and local co-occurrence topology graphs, target anchor entities matching the entity to be determined are selected from the constructed global persistent semantic anchor network, and the entity to be determined is associated with the target anchor entities. The global persistent semantic anchor network includes multiple anchor entities, each anchor entity including a canonical identity that is uniquely determined within the scope of the complete script. The scope of the complete script includes the current script content.

[0006] Optionally, the feature vector includes a character feature vector and a dialogue fingerprint vector. Feature extraction is performed on the current script content associated with the entity to be determined to obtain the feature vector of the entity, including: From the current script content, the attribute information and background information of the entities to be identified are obtained; From the current script content, select the dialogue lines that are associated with the entity to be identified; Semantic features are extracted based on attribute and background information to obtain the character feature vector; Based on the dialogue, a dialogue style fingerprint is extracted to obtain a dialogue fingerprint vector.

[0007] Optionally, a dialogue style fingerprint is extracted based on the dialogue lines to obtain a dialogue fingerprint vector, including: The average sentence length was calculated based on the total number of sentences in the dialogue and the number of words in each sentence. High-frequency characteristic words in dialogue; high-frequency characteristic words are used to characterize words that frequently appear in dialogue and have significant features; Based on the analysis of each interjection in the dialogue, the interjection usage preferences of the entity to be identified are obtained; The average sentence length, high-frequency characteristic words, and interjection usage preferences are transformed to obtain the dialogue fingerprint vector.

[0008] Optionally, based on the entity to be determined and co-occurring entities, a local co-occurrence topology graph of the entity to be determined in the current round is generated, including: The statistics include the first appearance of the unidentified entity in the current script content, the second appearance of the same entity in the current script content, and the third appearance of the unidentified entity and the same entity in the current script content. Based on the first, second, and third times of the scene, the social familiarity between the entity to be determined and the same entity in the current round is calculated; Based on the entities to be determined, co-occurring entities, and social familiarity, a local co-occurrence topology graph is generated.

[0009] Optionally, each anchor entity in the global persistent semantic anchor network also includes an alias set, an anchor feature vector, and an anchor local co-occurrence graph. Based on the feature vector and the local co-occurrence topology graph, target anchor entities matching the entity to be determined are selected from the constructed global persistent semantic anchor network, including: Based on the entity name of the entity to be determined and the alias set of each anchor entity, the name similarity between the entity to be determined and each anchor entity is calculated. Based on the feature vector and the anchor feature vector of each anchor entity, the feature semantic similarity between the entity to be determined and each anchor entity is calculated. Based on the local co-occurrence topology graph and the local co-occurrence graph of each anchor entity, the topological affinity between the entity to be determined and each anchor entity is calculated. The similarity of names, semantic similarity of features, and topological affinity are analyzed to determine the target anchor entity.

[0010] Optionally, based on the local co-occurrence topology graph and the local co-occurrence graph of each anchor entity, the topological affinity between the entity to be determined and each anchor entity is calculated, including: For any anchor entity, based on the local co-occurrence topology graph, the set of neighboring entities that appear simultaneously with the entity to be determined is obtained by filtering from the local co-occurrence graph of any anchor entity. From the global persistent semantic anchor network, neighbor anchor entities that are the same entity as the neighbor entity set are selected; Based on the social familiarity between the entity to be determined and its neighboring anchor entities, and the topological affinity between any anchor entity and its neighboring anchor entities, the topological affinity between the entity to be determined and any anchor entity is calculated.

[0011] Optionally, analyze the similarity of each name, the semantic similarity of each feature, and the topological affinity to determine the target anchor entity, including: For any anchor entity, the name similarity, feature semantic similarity, and topological affinity between the entity to be determined and any anchor entity are weighted and summed to obtain the deterministic confidence between the entity to be determined and any anchor entity. Among all the deterministic confidence levels, the anchor entity corresponding to the deterministic confidence level that is greater than the set confidence level and is the maximum confidence level is determined as the target anchor entity.

[0012] Optionally, each anchor entity in the global persistent semantic anchor network also includes an alias set, an anchor feature vector, and an anchor local co-occurrence graph, which associates the entity to be determined with the target anchor entity, including: Add the entity name of the entity to be determined to the alias set of the target anchor entity; Update the anchor feature vector of the target anchor entity based on the feature vector; The local co-occurrence graph of the target anchor entity is updated based on the local co-occurrence topology graph to realize the association between the entity to be determined and the target anchor entity, and to complete the update of the global persistent semantic anchor network.

[0013] Secondly, embodiments of this application provide a semantic entity stabilization device based on script parsing, comprising: The feature extraction unit is used to perform feature extraction operations on the current script content associated with the entity to be determined, and obtain the feature vector of the entity to be determined; The topology graph generation unit is used to generate a local co-occurrence topology graph of the entity to be determined in the current round, based on the entity to be determined and its co-occurrence entities. Co-occurrence entities refer to entities that appear simultaneously with the entity to be determined and generate dialogue in the current script content. The local co-occurrence topology graph is used to represent the social familiarity between the entity to be determined and its co-occurrence entities. The entity association unit is used to filter target anchor entities that match the entity to be determined from the constructed global persistent semantic anchor network based on feature vectors and local co-occurrence topology graphs, and associate the entity to be determined with the target anchor entities. The global persistent semantic anchor network includes multiple anchor entities, each anchor entity including a canonical identity that is uniquely determined within the scope of the complete script. The scope of the complete script includes the current script content.

[0014] Thirdly, embodiments of this application provide a terminal device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the semantic entity stabilization method based on script parsing as described in any of the first aspects above.

[0015] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the semantic entity stabilization method based on script parsing as described in any one of the first aspects above.

[0016] Fifthly, embodiments of this application provide a computer program product that, when run on a terminal device, enables the terminal device to execute the semantic entity stabilization method based on script parsing as described in any of the first aspects.

[0017] The beneficial effects of the embodiments of this application compared with the prior art are: This application provides a semantic entity stabilization method based on script parsing. The method involves performing feature extraction on the current script content associated with the entity to be determined, obtaining a feature vector for the entity; generating a local co-occurrence topology graph of the entity in the current round based on the entity and its co-occurring entities; co-occurring entities refer to entities that appear simultaneously with the entity in the current script content and generate dialogue; the local co-occurrence topology graph represents the social familiarity between the entity and its co-occurring entities; and based on the feature vector and the local co-occurrence topology graph, selecting target anchor entities matching the entity from the constructed global persistent semantic anchor network, and associating the entity with the target anchor entities; the global persistent semantic anchor network includes multiple anchor entities, each anchor entity having a unique and definitive canonical identity within the entire script; the entire script includes the current script content. This application captures the inherent textual and semantic attributes of entities through feature vectors and quantifies the frequency of co-occurrence between entities in the same scene using a local co-occurrence topology graph. This quantifies the strength of social connections between entities, supplements scene-specific association constraints in the script, and reduces the occurrence of incorrect or missed associations. Simultaneously, by combining a global persistent semantic anchor network, each anchor entity possesses a unique and standardized identity across the entire text, which remains unchanged regardless of the individual text description or scene variations. Each parsing session only associates the entity to be parsed with a fixed standardized anchor, fundamentally preventing entity identity fragmentation and semantic drift, effectively improving the global uniqueness and stability of entity identifiers. Therefore, this application effectively solves the problems of unstable entity semantics and identity confusion in scripts through a local co-occurrence topology graph and a global persistent semantic anchor network, thereby improving matching accuracy. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the implementation of a semantic entity stabilization method based on script parsing provided in an embodiment of this application. Figure 2 This is a flowchart illustrating the implementation of a semantic entity stabilization method based on script parsing, provided in another embodiment of this application. Figure 3 This is a partial co-occurrence topology diagram provided in an embodiment of this application; Figure 4 This is a flowchart illustrating the implementation of a semantic entity stabilization method based on script parsing, provided in another embodiment of this application. Figure 5This is a flowchart illustrating the overall implementation of a semantic entity stabilization method based on script parsing provided in one embodiment of this application. Figure 6 This is a schematic diagram of the structure of a semantic entity stabilization device based on script parsing provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0020] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0021] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0022] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0023] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0024] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0025] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0026] Currently, the automatic decomposition of scripts for short dramas and long dramas, the construction of script knowledge graphs, and interactive script deduction are all being implemented in the cultural and entertainment industry. Script parsing, as an upstream basic module, undertakes the core tasks of extracting semantic entities such as characters, props, scenes, events, and relationships, resolving referential issues, and associating them across scenes. Taking long scripts as an example, when parsing such long scripts in multiple rounds and across sessions using a Large Language Model (LLM), the nondeterministic generation of the large model and the forgetfulness of cross-session processes can easily lead to problems such as disordered and stateless expansion of entities and fragmentation of synonyms.

[0027] Existing semantic entity stabilization methods typically address the aforementioned technical problems through entity pairing, disambiguation (Entity Resolution), or knowledge graph pairing techniques. However, existing technologies primarily rely on large-scale external general-purpose encyclopedic corpora (such as DBpedia / Wikipedia) or pre-defined static expert rule systems (Regex / Schema mapping) for offline batch processing computation, which presents the following issues: 1. Inability to handle the cold start of fiction: Screenplays are typical closed-door cold start fiction texts, with no publicly available encyclopedic corpora on the public internet to provide semantic connections, causing traditional offline alignment systems to completely fail; 2. Low tolerance for extreme naming variants: Existing technologies rely excessively on literal overlap (such as edit distance); however, large models have a wide range of aliases, abbreviations, misspellings, and even identity titles (such as "Director Wang" becoming "Old Wang") for the same role during parsing, and the literal features are almost completely non-overlapping. Due to the low tolerance, existing technologies frequently misjudge or miss the case.

[0028] Therefore, this application provides a semantic entity stabilization method based on script parsing, which can effectively solve the problems of unstable entity semantics and identity confusion in scripts.

[0029] Please see Figure 1 , Figure 1This is a flowchart illustrating the implementation of a script-based semantic entity stabilization method according to an embodiment of this application. In this embodiment, the execution subject of the script-based semantic entity stabilization method is a terminal device. The terminal device includes, but is not limited to, laptops, desktop computers, and other computers.

[0030] like Figure 1 As shown, a semantic entity stabilization method based on script parsing provided in one embodiment of this application may include S101~S103, which are detailed below: In S101, a feature extraction operation is performed on the current script content associated with the entity to be determined, and the feature vector of the entity to be determined is obtained.

[0031] In this embodiment of the application, after receiving the original script, the terminal device can divide the original script into multiple sub-scripts since the original script usually has a lot of content, and execute steps S101 to S103 on each sub-script in turn.

[0032] The original scripts include, but are not limited to: user-written short drama scripts and long drama scripts, as well as AI-generated short drama scripts and long drama scripts, i.e., AI scripts.

[0033] In some possible embodiments, since the complete script scope, that is, the complete script content, is usually composed of the script content of each episode, the terminal device can divide the original script based on the number of episodes to obtain the sub-scripts corresponding to each episode, so that the terminal device can parse the script content of one episode in each round and execute steps S101~S103.

[0034] In this embodiment of the application, the terminal device can input the current script content corresponding to the current round into the trained large language model for parsing and output uncertain entities, that is, entities to be determined.

[0035] Among them, the entities to be determined can be biological entities, such as people.

[0036] It should be noted that the above-mentioned trained large language model can be obtained by training existing large language models based on the training dataset.

[0037] The training dataset consists of a large number of labeled scripts, each of which has been labeled with all fuzzy references, abbreviations, nicknames, personal pronouns, temporary pronouns, full standard names, and unique character labels.

[0038] In this embodiment of the application, after obtaining the entity to be determined, the terminal device can perform a feature extraction operation based on the current script content to obtain the feature vector of the entity to be determined.

[0039] In some possible embodiments, the terminal device can intercept the dialogue and / or scene description of N sentences before and after the entity to be determined in the current script content, and extract semantic features from the dialogue and / or scene description of the N sentences before and after to obtain the textual semantic features of the entity to be determined, i.e., the feature vector.

[0040] In one implementation of this embodiment, the terminal device can extract features from the preceding and following N sentences of dialogue and / or scene descriptions through multi-layer nonlinear transformations based on existing convolutional neural networks (CNN), recurrent neural networks (RNN), or Transformer models, capturing the contextual information of the words, thereby obtaining the final feature vector.

[0041] In one embodiment of this application, the feature vector may include a character feature vector and a dialogue fingerprint vector.

[0042] Among them, the role feature vector is a digital representation of the role identity attributes of the entity to be determined, that is, the static identity, appearance behavior and relationship attributes of the entity to be determined are converted into a fixed-length numerical vector to represent the role itself.

[0043] Dialogue fingerprint vectors are digital representations of the speaking habits of a character in an entity to be identified. They can include vectors of dimensions such as speaking style, word usage habits, and semantic tendencies, which are equivalent to the character's language fingerprint.

[0044] Therefore, in this embodiment, the terminal device can specifically be implemented through, as follows: Figure 2 Steps S201-204 shown implement step S101, as detailed below: In S201, attribute information and background information of the entity to be determined are obtained from the current script content.

[0045] In S202, dialogue lines associated with the entity to be identified are selected from the current script content.

[0046] In this embodiment, the terminal device can filter out the text descriptions and dialogues associated with the entity to be determined from the current script content.

[0047] It should be noted that the dialogue associated with the entity to be determined specifically refers to the dialogue spoken by the entity to be determined.

[0048] After receiving the text description, the terminal device can extract the attribute information and background information of the entity to be determined from the text description.

[0049] Wherein, the attribute information includes, but is not limited to: the age, identity and the like of the entity to be determined.

[0050] The background information refers to scene descriptions and background descriptions associated with the entity to be determined in the current script content, such as scene location, list of present characters, environment description, pre-introduction of appearing characters, etc.

[0051] In step S203, semantic feature extraction is performed based on the attribute information and the background information to obtain a role feature vector.

[0052] In this embodiment, after obtaining the above attribute information and background information, the terminal device may perform semantic feature extraction on the attribute information and the background information to obtain the role feature vector of the entity to be determined.

[0053] Specifically, the terminal device may input the above attribute information and background information into a text embedding (Embedding) model for processing to obtain the role feature vector.

[0054] In practical applications, the Embedding model is a semantic space conversion engine based on deep learning (such as BGE-M3 based on Transformer architecture, text-embedding-3 model, etc.). The core function of the Embedding model is to map discrete, variable-length skit text descriptions into a continuous dense real vector space with fixed dimensions.

[0055] In step S204, dialogue style fingerprint extraction is performed based on the line dialogue to obtain a line fingerprint vector.

[0056] In this embodiment, the terminal device may filter common stop words such as "de (of), le (past tense marker), ne (interrogative particle)" in the line dialogue based on the existing Term Frequency-Inverse Document Frequency (TF-IDF) technology, and extract the top K core word vectors obtained through the TF-IDF technology. Meanwhile, the terminal device may count the frequency of each modal interjection in the line dialogue spoken by the entity to be determined based on a modal interjection set, and perform normalization processing based on the frequency of each modal interjection and the total number of occurrences of all modal interjections to obtain the occurrence probability of each modal interjection, that is, the interjection probability distribution fingerprint. Then, the terminal device may splice the above core word vector and the interjection probability distribution fingerprint to obtain the final line fingerprint vector.

[0057] Wherein, the modal interjection set can be set according to actual needs, and is not limited herein.

[0058] Combining steps S201 to S204, this embodiment combines character feature vectors and dialogue fingerprint vectors, which can simultaneously take into account the character's underlying settings and personalized language habits, forming a highly recognizable composite feature vector, which can significantly reduce matching confusion between similar entities.

[0059] In one embodiment of this application, the terminal device may implement step S204 through the following steps, detailed below: The average sentence length was calculated based on the total number of sentences in the dialogue and the number of words in each sentence. High-frequency characteristic words in dialogue; high-frequency characteristic words are used to characterize words that frequently appear in dialogue and have significant features; Based on the analysis of each interjection in the dialogue, the interjection usage preferences of the entity to be identified are obtained; The average sentence length, high-frequency characteristic words, and interjection usage preferences are transformed to obtain the dialogue fingerprint vector.

[0060] In this embodiment, after the terminal device obtains the dialogue associated with the entity to be determined, it can use periods, question marks, exclamation marks, semicolons and ellipses as sentence separators to obtain multiple independent sentences, and count the total number of independent sentences, that is, the total number of sentences.

[0061] At the same time, the terminal device can count the number of words in each independent sentence and obtain the word count of each sentence.

[0062] Afterwards, the terminal device can sum the number of words in each sentence to obtain the sum of word counts, and then divide the sum of word counts by the total number of sentences to obtain the average sentence length.

[0063] In this embodiment, the terminal device can filter out distinctive content words such as nouns, verbs, proper nouns, industry terms, and catchphrases from the dialogue. Then, the terminal device can count the first occurrence frequency of each distinctive content word in the dialogue and identify distinctive content words whose first occurrence frequency is greater than a set number as high-frequency characteristic words. The set number of occurrences can be determined according to actual needs and is not limited here.

[0064] It should be noted that high-frequency characteristic words are used to characterize words that appear frequently in dialogue and have significant features.

[0065] In this embodiment, the terminal device can count the second occurrence count of each interjection in the dialogue based on the set of interjections; then, the terminal device can calculate the occurrence ratio of each interjection based on the second occurrence count of each interjection and the total occurrence count of all interjections in the dialogue, and determine the occurrence ratio of each interjection as the interjection usage preference of the entity to be determined.

[0066] After obtaining the average sentence length, high-frequency characteristic words, and interjection usage preferences, the terminal device can normalize the average sentence length to obtain a one-dimensional numerical feature corresponding to the average sentence length. Simultaneously, the terminal device can process the high-frequency characteristic words based on the existing Bag-of-Words Model (BoW) to obtain word vectors corresponding to the high-frequency characteristic words. Then, the terminal device can concatenate the one-dimensional numerical feature corresponding to the average sentence length, the word vectors corresponding to the high-frequency characteristic words, and the interjection usage preferences to obtain the final dialogue fingerprint vector.

[0067] In conjunction with the above embodiments, the character's speech patterns, idiomatic vocabulary, and interjections do not change drastically with the theme of a single scene or the dialogue partner. The extracted dialogue fingerprints exhibit long-term stability and high consistency when comparing entity features across acts and scenes, thus ensuring the continuous stability of entity matching. Furthermore, when two entity characters have extremely high feature similarity and it is difficult to determine the target anchor point, the dialogue fingerprint vector can be used as a differential discrimination weight to assist the local co-occurrence topology graph in jointly filtering matching anchor points, reducing entity misassociations, and effectively ensuring the consistency and stability of entity identities throughout the script, supporting the stabilization of entity semantics from the underlying feature level.

[0068] In S102, based on the entity to be determined and the co-occurring entities, a local co-occurrence topology graph of the entity to be determined in the current round is generated.

[0069] In this embodiment of the application, the terminal device can filter out multiple entities in the same scene as the entity to be determined from the current script content. Then, the terminal device can further filter out the dialogue entity that actually has a dialogue with the entity to be determined from the multiple entities in the same scene as the entity to be determined, and determine the dialogue entity as the same entity.

[0070] In other words, a real entity can be an entity that appears simultaneously with the entity to be determined in the current script and generates dialogue.

[0071] It should be noted that the aforementioned entity can be one or multiple.

[0072] In this embodiment, after identifying a co-occurring entity, the terminal device can generate a local co-occurrence topology graph of the entity to be identified in the current round based on the dialogue between the entity to be identified and the co-occurring entity in the current script content. The local co-occurrence topology graph is used to characterize the social familiarity between the entity to be identified and the co-occurring entity.

[0073] Specifically, the terminal device can count the number of dialogues and the total number of words between the entity to be identified and the real-world entity in the current script content; then, the terminal device can perform a weighted sum of the number of dialogues and the total number of words to calculate the social familiarity between the entity to be identified and the real-world entity.

[0074] It should be noted that the higher the social familiarity score, the more familiar the entity to be identified is with its corresponding real-world counterpart.

[0075] In this embodiment of the application, after obtaining the social familiarity between the entity to be determined and the co-occurring entity, the terminal device can generate the aforementioned local co-occurrence topology map based on the entity to be determined, the co-occurring entity, and the aforementioned social familiarity.

[0076] In some possible embodiments, the local co-occurrence topology graph can be a weighted undirected graph, and the weighted undirected graph G = (V, E, W). Here, the vertex set V represents the entity to be determined, the edge set E represents the spatiotemporal intersection of the entity to be determined and each co-occurring entity, and the edge weight W∈[0,1] represents the social familiarity between the entity to be determined and the corresponding co-occurring entity.

[0077] In practical applications, a weighted undirected graph is a graph structure based on an undirected graph, where each edge is assigned a weight. This weight can represent quantities with practical significance such as distance, cost, and time.

[0078] For example, please refer to Figure 3 , Figure 3 This is a partial co-occurrence topology diagram provided in an embodiment of this application. For example... Figure 3 As shown, Director Wang is an entity to be determined, Secretary Xiao Li and Driver Lao Zhang are the same entity. The weight of the edge connecting Director Wang and Driver Lao Zhang is 0.85, which is used to represent the social familiarity between Director Wang and Driver Lao Zhang. The weight of the edge connecting Director Wang and Secretary Xiao Li is 0.95, which is used to represent the social familiarity between Director Wang and Secretary Xiao Li.

[0079] In one embodiment of this application, the terminal device may implement step S102 according to the following steps, as detailed below: The statistics include the first appearance of the unidentified entity in the current script content, the second appearance of the same entity in the current script content, and the third appearance of the unidentified entity and the same entity in the current script content. Based on the first, second, and third times of the scene, the social familiarity between the entity to be determined and the same entity in the current round is calculated; Based on the entities to be determined, co-occurring entities, and social familiarity, a local co-occurrence topology graph is generated.

[0080] In this embodiment, the terminal device can deduplicate the first and second occurrences based on the third occurrence to obtain the total number of times the entity to be determined and the same entity appear. Then, the terminal device can normalize the third occurrence based on the total number of times the entity to be determined and the same entity appear in the current round.

[0081] In one embodiment of this application, the terminal device can specifically calculate the aforementioned social familiarity level according to the following formula: ; in, This indicates the level of social familiarity between the entity to be determined and the corresponding real-world entity in the current round. Indicates the first time at the scene. This indicates the second time the scene was observed. This indicates the third time someone has appeared at the scene. Indicates an entity to be determined. It refers to the same entity as the real thing.

[0082] In this embodiment, after obtaining the social familiarity between the entity to be determined and the co-occurring entity, the terminal device can generate the aforementioned local co-occurrence topology map based on the entity to be determined, the co-occurring entity, and the aforementioned social familiarity.

[0083] In S103, based on feature vectors and local co-occurrence topology graphs, target anchor entities that match the entity to be determined are selected from the constructed global persistent semantic anchor network, and the entity to be determined is associated with the target anchor entities.

[0084] In this embodiment of the application, after obtaining the feature vector and local co-occurrence topology of the entity to be determined, the terminal device can filter out the target anchor entity that matches the entity to be determined from the constructed global persistent semantic anchor network based on the feature vector and local co-occurrence topology.

[0085] It should be noted that the Persistent Semantic Anchors (PSA) network includes multiple anchor entities, each of which includes, but is not limited to: a canonical identity that is uniquely determined within the entire script, a set of aliases, an anchor feature vector, and an anchor local co-occurrence graph.

[0086] The complete script includes the current script content.

[0087] An anchor entity is a real and unique identity entity within the entire script, possessing a globally unique canonical identity (i.e., a standard name).

[0088] The alias set is a collection of all referential texts belonging to the same anchor entity. It is a container for all local titles, aliases, abbreviations, nicknames, personal pronouns, and temporary names corresponding to the global normative identity, and is used to unify the diverse names of the same character in the script.

[0089] For example, if the canonical identity of the anchor entity is Wang Jianguo, then the aliases in the corresponding alias set can include: Lao Wang, Jianguo, Boss Wang, Male protagonist, Master, Butler, Guest, He or that gentleman, etc.

[0090] Anchor point feature vector refers to the feature vector corresponding to the anchor point entity.

[0091] An anchor point local co-occurrence graph can be constructed by taking the anchor point entity as the central node, taking all other anchor point entities that have long-term interactions with the anchor point entity as neighbor nodes, and combining the global neighborhood co-occurrence topology graph formed by the cumulative social familiarity weights over multiple rounds, which can reflect the long-term stable social circle of the anchor point.

[0092] In some possible embodiments, the global persistent semantic anchor network can be abstracted as a globally dynamically evolving weighted undirected graph topology. This undirected weighted graph topology includes a vertex set, an edge set, and an edge weight matrix.

[0093] In this embodiment, the vertex set includes persistent asset nodes (i.e., persistent semantic anchors) corresponding to multiple anchor entities within the scope of the complete script.

[0094] Edge sets are used to describe the historical spatiotemporal intersection relationships between various persistent asset nodes.

[0095] The edge weight matrix is ​​used to quantify the topological affinity between any two persistent asset nodes. Affinity).

[0096] It should be noted that each independently constructed persistent asset node is encapsulated as a dense feature composite object in non-volatile memory, which may specifically contain the following five-dimensional data slots: 1. Identity Slot: Stores a canonical identity that is unique and definitive within the entire playbook, i.e., a globally unique and definitive identifier (Canonical ID). 2. Name Cluster Slot: Stores a collection of known text aliases, abbreviations, and titles accumulated over multiple historical resolutions for the anchor entity corresponding to this persistent asset node; 3. Role Context Slot: Stores role feature vectors; 4. Dialogue Style Slot: Stores the fingerprint vector of dialogue lines; 5. Topology Affinity Slot: Stores the topology affinity of the persistent asset node in the global edge weight matrix.

[0097] Among them, topological affinity is used to characterize the probability and the degree of topological connection between the anchor entities corresponding to any two persistent asset nodes in the discrete spatiotemporal scenes of the complete script.

[0098] In this embodiment, the terminal device can first compare the feature vector of the entity to be determined with the anchor feature vector of each anchor entity in the global persistent semantic anchor network to filter out multiple candidate anchor entities with vector similarity greater than the first similarity; then, the terminal device can compare the local co-occurrence topology graph of the entity to be determined with the local co-occurrence graph of each candidate anchor entity to filter out the target anchor entity with topology graph similarity greater than the second similarity.

[0099] The first and second similarity scores can be determined according to actual needs, and no restrictions are imposed here.

[0100] It should be noted that, within the scope of a complete script, a character's identity cannot match one canonical identity and then another canonical identity. In other words, an entity to be determined cannot match one anchor entity and then another anchor entity. Therefore, there is only one target anchor entity.

[0101] In one embodiment of this application, when each anchor entity in the global persistent semantic anchor network also includes an alias set, an anchor feature vector, and an anchor local co-occurrence graph, the terminal device can specifically achieve this through methods such as... Figure 4 Steps S301 to S304, which are shown, determine the target anchor point entity, and are described in detail below: In S301, the name similarity between the entity to be determined and each anchor entity is calculated based on the entity name of the entity to be determined and the alias set of each anchor entity.

[0102] In this embodiment, for any anchor entity, the terminal device can use the Levenshtein algorithm to calculate the edit distance between the entity name of the entity to be determined and each alias in the alias set of the arbitrary anchor entity, and determine the minimum edit distance among the edit distances as the name similarity between the entity to be determined and the arbitrary anchor entity.

[0103] In S302, based on the feature vector and the anchor feature vector of each anchor entity, the feature semantic similarity between the entity to be determined and each anchor entity is calculated.

[0104] In this embodiment, for any anchor entity, the terminal device can calculate the cosine similarity between the feature vector of the entity to be determined and the anchor feature vector of the arbitrary anchor entity, thereby obtaining the feature semantic similarity between the entity to be determined and the arbitrary anchor entity.

[0105] In practical applications, cosine similarity, also known as cosine similarity, is used to evaluate the similarity between two vectors by calculating the cosine of the angle between them.

[0106] In one embodiment of this application, when the feature vector includes a character feature vector and a dialogue fingerprint vector, the terminal device can perform a weighted summation of the cosine similarity of the character feature vector and the cosine similarity of the dialogue fingerprint vector to obtain the final semantic similarity between the entity to be determined and any of the above anchor entities.

[0107] In S303, the topological affinity between the entity to be determined and each anchor entity is calculated based on the local co-occurrence topology graph and the local co-occurrence graph of each anchor entity.

[0108] In this embodiment, for any anchor entity, the terminal device can filter the local co-occurrence topology of the entity to be determined based on the local co-occurrence topology of that anchor entity to obtain a set of neighbor entities that appear simultaneously with the entity to be determined. Then, the terminal device can perform a weighted summation of the topological affinity between each neighbor entity in the neighbor entity set and any anchor entity, and the social familiarity between the entity to be determined and each neighbor entity in the neighbor entity set, to calculate the topological affinity between the entity to be determined and that arbitrary anchor entity.

[0109] In one embodiment of this application, the terminal device may implement step S303 according to the following steps, as detailed below: For any anchor entity, based on the local co-occurrence topology graph, the set of neighboring entities that appear simultaneously with the entity to be determined is obtained by filtering from the local co-occurrence graph of any anchor entity. From the global persistent semantic anchor network, neighbor anchor entities that are the same entity as the neighbor entity set are selected; Based on the social familiarity between the entity to be determined and its neighboring anchor entities, and the topological affinity between any anchor entity and its neighboring anchor entities, the topological affinity between the entity to be determined and any anchor entity is calculated.

[0110] In this embodiment, for any anchor entity, the terminal device can filter the local co-occurrence graph of the anchor entity based on the local co-occurrence topology graph of the entity to be determined, to obtain a set of neighbor entities that appear simultaneously with the entity to be determined. Then, the terminal device can traverse the global persistent semantic anchor network based on this set of neighbor entities to filter out neighbor anchor entities that are the same as the neighbor entities in the neighbor entity set.

[0111] It should be noted that there can be one or more neighbor anchor entities.

[0112] In this embodiment, the terminal device determines the social familiarity between the entity to be determined and its neighboring anchor entities based on the local co-occurrence topology graph of the entity to be determined; then, the terminal device can calculate the topological affinity between the entity to be determined and any of the anchor entities based on the social familiarity between the entity to be determined and its neighboring anchor entities and the topological affinity between any of the anchor entities and its neighboring anchor entities.

[0113] Specifically, the terminal device can calculate the topological affinity between the entity to be determined and any anchor point entity according to the following formula: ; in, This represents the topological affinity between the entity to be determined and any anchor entity. This indicates the degree of social familiarity between the entity to be determined and its neighboring anchor entities. This represents the topological affinity between any anchor entity and its neighboring anchor entities. Indicates an entity to be determined. Represents the neighbor anchor point entity. Represents any anchor point entity. Represents the set of neighboring entities.

[0114] In S304, the similarity of each name, the semantic similarity of each feature, and the topological affinity are analyzed to determine the target anchor entity.

[0115] In this embodiment, after obtaining the name similarity, feature semantic similarity, and topological affinity, the terminal device can filter out an anchor entity with a name similarity greater than the third similarity, a feature semantic similarity greater than the fourth similarity, and a topological affinity greater than the set affinity from the name similarity, feature semantic similarity, and topological affinity, and determine the anchor entity as the target anchor entity.

[0116] The third similarity, fourth similarity, and set affinity can all be determined according to actual needs, and no restrictions are imposed here.

[0117] Combining steps S301 to S304, even when the entity names are completely different from each other, the terminal device can still make a correct judgment on the target anchor entity through feature vectors and the social circle topology relationship of high-frequency co-occurrence, that is, the local co-occurrence topology graph.

[0118] In one embodiment of this application, the terminal device may specifically implement step S304 according to the following steps, as detailed below: For any anchor entity, the name similarity, feature semantic similarity, and topological affinity between the entity to be determined and any anchor entity are weighted and summed to obtain the deterministic confidence between the entity to be determined and any anchor entity. Among all the deterministic confidence levels, the anchor entity corresponding to the deterministic confidence level that is greater than the set confidence level and is the maximum confidence level is determined as the target anchor entity.

[0119] In this embodiment, after obtaining the name similarity, feature semantic similarity, and topological affinity of each name, feature semantic similarity, and topological affinity, the terminal device can normalize the name similarity, feature semantic similarity, and topological affinity to obtain normalized name similarity, feature semantic similarity, and topological affinity.

[0120] Subsequently, for any anchor entity, the terminal device can perform a weighted sum of the normalized name similarity, feature semantic similarity, and topological affinity of that anchor entity to obtain the deterministic confidence between the entity to be determined and any anchor entity.

[0121] In this embodiment, after obtaining the deterministic confidence level between the entity to be determined and each anchor point entity, the terminal device can compare each deterministic confidence level with a set confidence level, and determine the anchor point entity corresponding to the deterministic confidence level that is greater than the set confidence level and is the maximum confidence level as the target anchor point entity.

[0122] The confidence level can be set according to actual needs, and there are no restrictions here.

[0123] In one embodiment of this application, when each anchor entity in the global persistent semantic anchor network also includes an alias set, an anchor feature vector, and an anchor local co-occurrence graph, the terminal device can specifically associate the entity to be determined with the target anchor entity according to the following steps, detailed below: Add the entity name of the entity to be determined to the alias set of the target anchor entity; Update the anchor feature vector of the target anchor entity based on the feature vector; The local co-occurrence graph of the target anchor entity is updated based on the local co-occurrence topology graph to realize the association between the entity to be determined and the target anchor entity, and to complete the update of the global persistent semantic anchor network.

[0124] In this embodiment, after determining the target anchor entity, the terminal device can add the entity name of the entity to be determined as an incremental alias to the alias set of the target anchor entity. At the same time, the terminal device can also update the anchor feature vector of the target anchor entity based on the feature vector, and update the anchor local co-occurrence graph of the target anchor entity based on the local co-occurrence topology graph, so as to realize the association between the entity to be determined and the target anchor entity, thereby completing the update of the global persistent semantic anchor network.

[0125] In some possible embodiments, the terminal device can update the anchor feature vector of the target anchor entity based on the exponential rolling average algorithm and the feature vector of the entity to be determined, so as to obtain the updated anchor feature vector of the target anchor entity.

[0126] In practical applications, the Exponential Moving Average (EMA) algorithm is a weighted averaging method used to calculate the smoothed average of a set of time series data. When calculating the average, the EMA algorithm assigns higher weights to more recent data and lower weights to earlier data.

[0127] In this embodiment, the process of updating the anchor feature vector of the target anchor entity based on the EMA algorithm by the terminal device is as follows: ; in, This represents the updated character feature vector. This represents the updated dialogue fingerprint vector. This represents the character feature vector before the update. This represents the fingerprint vector of the dialogue before the update. This represents the role feature vector of the entity to be determined. The dialogue fingerprint vector representing the entity to be identified. This represents the time decay memory weight (the value can be [0.8, 0.95]).

[0128] In other possible embodiments, the terminal device may update the topological affinity of the target anchor entity with the same neighboring anchor entities in the local co-occurrence topology graph of the target anchor entity based on the exponential rolling average algorithm and the social familiarity of each entity in the local co-occurrence topology graph of the entity to be determined, so as to obtain the updated local co-occurrence graph of the target anchor entity.

[0129] In this embodiment, the process of updating the anchor feature vector of the target anchor entity based on the EMA algorithm by the terminal device is as follows: ; in, This represents the topological affinity between an anchor point and its neighboring anchor points in the local co-occurrence graph after the graph is updated. This represents the topological affinity between the anchor point and its neighboring anchor point entities in the local co-occurrence graph before the update. This represents the social familiarity between the entity to be determined and its neighboring anchor entities in the local co-occurrence topology graph. This represents the time decay memory weight (the value can be [0.8, 0.95]).

[0130] In conjunction with the above embodiments, entities to be determined generated in different rounds of parsing can all be uniformly associated with the same target anchor entity, and their corresponding names, feature vectors, and local co-occurrence topology graphs can be uniformly collected into the corresponding target anchor entity. This effectively reduces the occurrence of multiple independent objects being identified for the same role in multiple scenes and the repeated splitting of entity nodes. This ensures that all anchor entities in the entire script have only the same canonical identity, suppresses semantic drift from the underlying data storage level, and also realizes the automatic update of the global continuous semantic anchor network.

[0131] In one embodiment of this application, when all the certainty confidence levels are less than the set confidence level, it indicates that there is no anchor entity matching the entity to be determined in the global persistent semantic anchor network. In other words, the entity to be determined is a brand new entity. Therefore, the terminal device can determine the entity to be determined as a new anchor entity and create a new persistent asset node in the global persistent semantic anchor network based on the entity name, feature vector, and local co-occurrence topology of the entity to be determined.

[0132] As can be seen from the above, the semantic entity stabilization method based on script parsing provided in this application provides a feature vector for the entity to be determined by performing feature extraction on the current script content associated with the entity to be determined. Based on the entity to be determined and its co-occurring entities, a local co-occurrence topology graph of the entity to be determined in the current round is generated. A co-occurring entity refers to an entity that appears simultaneously with the entity to be determined in the current script content and generates dialogue. The local co-occurrence topology graph is used to represent the social familiarity between the entity to be determined and its co-occurring entities. Based on the feature vector and the local co-occurrence topology graph, target anchor entities matching the entity to be determined are selected from the constructed global persistent semantic anchor network, and the entity to be determined is associated with the target anchor entities. The global persistent semantic anchor network includes multiple anchor entities, each anchor entity including a canonical identity with unique determinacy within the entire script. The entire script includes the current script content. This application effectively solves the problems of semantic instability and identity confusion of script entities through the local co-occurrence topology graph and the global persistent semantic anchor network, thereby improving matching accuracy. This application captures the inherent attributes of entity text and semantics through feature vectors and quantifies the frequency of co-occurrence between entities in the same scene using a local co-occurrence topology graph. This quantifies the strength of social connections between entities, supplements the scene-specific association constraints of the script, and reduces the occurrence of incorrect or missed associations. Simultaneously, by combining a global persistent semantic anchor network, each anchor entity possesses a unique and standardized identity across the entire text, which remains unchanged regardless of the individual text description or scene variations. Each parsing session only associates the entity to be parsed with a fixed standardized anchor, fundamentally preventing entity identity fragmentation and semantic drift, effectively improving the global uniqueness and stability of entity identifiers. Therefore, this application effectively solves the problems of unstable semantics and identity confusion of script entities through a local co-occurrence topology graph and a global persistent semantic anchor network, thereby improving matching accuracy.

[0133] In one embodiment of this application, the terminal device may specifically construct and dynamically update the global persistent semantic anchor network according to the following steps, detailed below: Network cold start and initialization; Multi-round perception of new entity script features; A local co-occurrence topology graph is constructed using a sliding window for local scenes. Global topology graph overlap and multidimensional probability fusion disambiguation; Global continuous semantic anchor network update.

[0134] In this embodiment, when the terminal device receives the script parsing task for the first round, it has not yet accumulated any historical assets; that is, the Global Persistent Semantic Anchor Network (PSA) is in an initial state with zero assets. At this time, the terminal device can perform script parsing on the script content corresponding to the first round using a large language model, and output an initial set of temporary semantic entities. The terminal device can assign a globally unique deterministic identifier to each temporary semantic entity in the set, and inject each temporary semantic entity as the first batch of vertices into the vertex set of the PSA network. Simultaneously, the terminal device can write the current entity name of each temporary semantic entity as an initial element into its corresponding alias cluster slot, and convert its identity description in the script content corresponding to the first round into an initial vector and write it into the identity vector slot, thereby completing the network cold start and network initialization.

[0135] When a terminal device detects that it has entered the script parsing process for subsequent rounds (e.g., parsing the script content of the second episode), for any subsequent round, the terminal device can use a large language model to parse the script content of that round and output a new temporary entity. Then, without relying on the entity name of the new temporary entity, the terminal device performs local feature perception on the new temporary entity, including character feature vector extraction and dialogue fingerprint vector extraction (see steps S201~S204 for details), thereby completing the script feature perception of the new entity for any round.

[0136] Subsequently, the terminal device can use "Scene" as a discrete sliding window control unit to traverse and scan the script content of the current round. When the terminal device detects that a new temporary entity and an existing entity appear simultaneously and engage in dialogue interaction in any scene, it accumulates a co-occurrence frequency on the edge connecting the new temporary entity and the existing entity. After the scan is completed, the terminal device can generate a local co-occurrence topology graph of the new temporary entity in the current round based on the new temporary entity and the co-occurring entities (see step S102 for details), thereby completing the construction of the local co-occurrence topology graph using the local scene sliding window.

[0137] Subsequently, in order to correctly converge the new temporary entity to a certain existing anchor entity in the PSA network, the terminal device can select the target anchor entity that matches the new temporary entity from the constructed global persistent semantic anchor network based on the feature vector and local co-occurrence topology graph of the new temporary entity, and associate the new temporary entity with the target anchor entity (see steps S104, S301~S304 for details), thereby completing the global topology graph overlap and multidimensional probability fusion disambiguation.

[0138] After determining that a new temporary entity has been successfully associated with the target anchor entity, the terminal device can add the entity name of the new temporary entity to the alias set of the target anchor entity; update the anchor feature vector of the target anchor entity based on the feature vector; and update the anchor local co-occurrence graph of the target anchor entity based on the local co-occurrence topology graph, so as to complete the update of the global persistent semantic anchor network.

[0139] Please see Figure 5 , Figure 5 This is a flowchart illustrating the overall implementation of a semantic entity stabilization method based on script parsing, provided in one embodiment of this application. Figure 5 As shown, the terminal device can use the large semantic model to perform large model parsing flow on the current script content of the current round, i.e. script parsing, to output uncertain entities, i.e. entities to be determined.

[0140] Afterwards, the terminal device can input the current script content into the feature extraction engine for analysis and description, and analyze the dialogue to obtain character feature vectors and dialogue fingerprint vectors (see steps S201~S204 for details); at the same time, the terminal device can also generate a local co-occurrence topology map of the current round based on the entity to be determined and the co-occurrence entity (see step S102 for details).

[0141] Subsequently, the terminal device can input the character feature vector, the dialogue fingerprint vector, the topological affinity determined by the local co-occurrence topology graph, and the constructed global persistent semantic anchor network into the spatial multidimensional probabilistic affinity fusion algorithm to calculate the deterministic confidence score between the entity to be determined and each anchor entity. (See steps S103, S301~S304 for details) When a terminal device detects that a certain score is greater than a set confidence level, it can determine that the anchor entity with the score greater than the set confidence level is the target anchor entity, associate the entity to be determined with the target anchor entity, and update the global persistent semantic anchor network (see step S103 for details). Updating the global persistent semantic anchor network includes updating the alias set of the target anchor entity, updating the anchor feature vector of the target anchor entity, and updating the anchor local co-occurrence graph of the target anchor entity.

[0142] When a terminal device detects that all scores are less than or equal to a set confidence level, it can create a new persistent semantic anchor, i.e., a persistent asset node, based on the entity to be determined in the global persistent semantic anchor network.

[0143] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0144] Corresponding to the semantic entity stabilization method based on script parsing described in the above embodiments, Figure 6 This diagram illustrates a semantic entity stabilization device based on script parsing according to an embodiment of this application. For ease of explanation, only the parts relevant to the embodiment of this application are shown. (Refer to...) Figure 6 The semantic entity stabilization device 400 based on script parsing includes: a feature extraction unit 41, a topology graph generation unit 42, and an entity association unit 43. Wherein: The feature extraction unit 41 is used to perform feature extraction operations on the current script content associated with the entity to be determined, and obtain the feature vector of the entity to be determined.

[0145] The topology generation unit 42 is used to generate a local co-occurrence topology of the entity to be determined in the current round based on the entity to be determined and its co-occurrence entities; co-occurrence entities refer to entities that appear at the same time as the entity to be determined and generate dialogue in the current script content; the local co-occurrence topology is used to represent the social familiarity between the entity to be determined and its co-occurrence entities.

[0146] The entity association unit 43 is used to filter out target anchor entities that match the entity to be determined from the constructed global persistent semantic anchor network based on feature vectors and local co-occurrence topology graphs, and associate the entity to be determined with the target anchor entities; the global persistent semantic anchor network includes multiple anchor entities, each anchor entity includes a canonical identity that is uniquely determined within the scope of the complete script; the scope of the complete script includes the current script content.

[0147] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0148] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0149] Figure 7 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Figure 7 As shown, the terminal device 5 in this embodiment includes: at least one processor 50 ( Figure 7 (Only one is shown in the diagram), memory 51, and computer program 52 stored in said memory 51 and executable on said at least one processor 50, wherein said processor 50 executes said computer program 52 to implement the steps in any of the above embodiments of the semantic entity stabilization method based on script parsing.

[0150] The terminal device 5 may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art will understand that... Figure 7 This is merely an example of terminal device 5 and does not constitute a limitation on terminal device 5. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.

[0151] The processor 50 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0152] In some embodiments, the memory 51 may be an internal storage unit of the terminal device 5, such as the RAM of the terminal device 5. In other embodiments, the memory 51 may be an external storage device of the terminal device 5, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the terminal device 5. Furthermore, the memory 51 may include both internal and external storage units of the terminal device 5. The memory 51 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 51 can also be used to temporarily store data that has been output or will be output.

[0153] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0154] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments above.

[0155] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0156] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0157] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A semantic entity stabilization method based on script parsing, characterized in that, include: Perform feature extraction on the current script content associated with the entity to be determined to obtain the feature vector of the entity to be determined; Based on the entity to be determined and the co-occurring entities, a local co-occurrence topology graph of the entity to be determined in the current round is generated; The co-occurring entity refers to an entity that appears simultaneously with the entity to be determined and engages in dialogue in the current script content; the local co-occurrence topology is used to characterize the social familiarity between the entity to be determined and the co-occurring entity. Based on the feature vector and the local co-occurrence topology graph, target anchor entities matching the entity to be determined are selected from the constructed global persistent semantic anchor network, and the entity to be determined is associated with the target anchor entities; the global persistent semantic anchor network includes multiple anchor entities, each anchor entity including a canonical identity that is uniquely determined within the scope of the complete script; the scope of the complete script includes the current script content.

2. The semantic entity stabilization method based on script parsing as described in claim 1, characterized in that, The feature vector includes a character feature vector and a dialogue fingerprint vector. The feature extraction operation based on the current script content associated with the entity to be determined, to obtain the feature vector of the entity to be determined, includes: From the current script content, the attribute information and background information of the entity to be determined are obtained by filtering. From the current script content, select the dialogue lines associated with the entity to be determined; Semantic features are extracted based on the attribute information and the background information to obtain the character feature vector; Based on the dialogue, a dialogue style fingerprint is extracted to obtain the dialogue fingerprint vector.

3. The semantic entity stabilization method based on script parsing as described in claim 2, characterized in that, The step of extracting the dialogue style fingerprint based on the dialogue to obtain the dialogue fingerprint vector includes: The average sentence length was calculated based on the total number of sentences and the number of characters in each sentence in the dialogue. The high-frequency characteristic words in the dialogue are statistically analyzed; these high-frequency characteristic words are used to characterize words that frequently appear in the dialogue and have significant features. Based on the analysis of each interjection in the dialogue, the interjection usage preference of the entity to be determined is obtained; The average sentence length, the high-frequency characteristic words, and the interjection usage preference are transformed to obtain the dialogue fingerprint vector.

4. The semantic entity stabilization method based on script parsing as described in claim 1, characterized in that, The step of generating a local co-occurrence topology graph of the entity to be determined in the current round based on the entity to be determined and co-occurrence entities includes: The number of times the entity to be determined appears in the current script content is counted; the number of times the same entity appears in the current script content is counted; and the number of times the entity to be determined and the same entity appear simultaneously in the current script content is counted. Based on the first, second, and third times of the scene, the social familiarity between the entity to be determined and the same entity in the current round is calculated. Based on the entity to be determined, the co-occurring entity, and the social familiarity, the local co-occurrence topology graph is generated.

5. The semantic entity stabilization method based on script parsing as described in any one of claims 1-4, characterized in that, Each anchor entity in the global persistent semantic anchor network further includes an alias set, an anchor feature vector, and an anchor local co-occurrence graph. The step of filtering target anchor entities matching the entity to be determined from the constructed global persistent semantic anchor network based on the feature vector and the local co-occurrence topology graph includes: Based on the entity name of the entity to be determined and the alias set of each anchor entity, the name similarity between the entity to be determined and each anchor entity is calculated. Based on the feature vector and the anchor feature vector of each anchor entity, the feature semantic similarity between the entity to be determined and each anchor entity is calculated. Based on the local co-occurrence topology graph and the local co-occurrence graph of each anchor point entity, the topological affinity between the entity to be determined and each anchor point entity is calculated. The target anchor entity is determined by analyzing the name similarity, feature semantic similarity, and topological affinity of each entity.

6. The semantic entity stabilization method based on script parsing as described in claim 5, characterized in that, The calculation of the topological affinity between the entity to be determined and each anchor entity, based on the local co-occurrence topology graph and the local co-occurrence graph of each anchor entity, includes: For any anchor entity, based on the local co-occurrence topology graph, a set of neighboring entities that appear simultaneously with the entity to be determined are obtained by filtering from the local co-occurrence graph of the anchor entity of the arbitrary anchor entity; From the global persistent semantic anchor network, neighbor anchor entities that are the same entity as the neighbor entity set are selected; Based on the social familiarity between the entity to be determined and the neighboring anchor entities, and the social familiarity between any anchor entity and the neighboring anchor entities, the topological affinity between the entity to be determined and any anchor entity is calculated.

7. The semantic entity stabilization method based on script parsing as described in claim 5, characterized in that, The step of analyzing the name similarity, semantic similarity, and topological affinity of each entity to determine the target anchor entity includes: For any anchor entity, the name similarity, feature semantic similarity, and topological affinity between the entity to be determined and any anchor entity are weighted and summed to obtain the deterministic confidence between the entity to be determined and any anchor entity. Among the various deterministic confidence levels, the anchor entity corresponding to the deterministic confidence level that is greater than the set confidence level and is the maximum confidence level is determined as the target anchor entity.

8. The semantic entity stabilization method based on script parsing as described in any one of claims 1-4, characterized in that, Each anchor entity in the global persistent semantic anchor network further includes an alias set, an anchor feature vector, and an anchor local co-occurrence graph. Associating the entity to be determined with the target anchor entity includes: Add the entity name of the entity to be determined to the alias set of the target anchor entity; The anchor feature vector of the target anchor entity is updated based on the feature vector; The local co-occurrence topology graph of the target anchor entity is updated to realize the association between the entity to be determined and the target anchor entity, and to complete the update of the global persistent semantic anchor network.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the semantic entity stabilization method based on script parsing as described in any one of claims 1 to 8.

10. A computer program product, characterized in that, It includes a computer program that, when run, implements the semantic entity stabilization method based on script parsing as described in any one of claims 1 to 8.