A script text proofreading and optimization method based on semantic AI processing

By preprocessing structured text and re-encoding using a closed-loop BigBird model, combined with sparse attention encoding and anomaly confidence mapping, the problem of detecting and revising semantic anomalies across segments in script text is solved, achieving efficient optimization and consistency improvement of script content.

CN122153038APending Publication Date: 2026-06-05NEW AXIS ANIMATION TECHNOLOGY DEVELOPMENT (BEIJING) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NEW AXIS ANIMATION TECHNOLOGY DEVELOPMENT (BEIJING) CO LTD
Filing Date
2026-03-09
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies struggle to perform cyclical detection and targeted revision of semantic anomalies across segments in script text, and lack a semantic representation update feedback mechanism, resulting in poor review of script content involving cross-character dialogue and scene transitions.

Method used

By employing structured text preprocessing, closed-loop BigBird model re-encoding, semantic review feedback modulation, and text generation optimization, and through sparse attention encoding and anomaly confidence mapping, a semantic consistency detection and optimization closed loop is constructed to achieve automated review and optimization of script content.

Benefits of technology

It improved the accuracy and consistency of script text review, reduced the risk of semantic damage from secondary editing, and enhanced the semantic coherence and overall quality of the script content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122153038A_ABST
    Figure CN122153038A_ABST
Patent Text Reader

Abstract

The application discloses a script text proofreading and optimization method based on semantic AI processing, comprising the following steps: obtaining a script text to be proofread, and preprocessing the script text; inputting a structured script text sequence into an embedding layer of a closed-loop BigBird model, and performing first semantic encoding through a sparse attention encoding layer; inputting a primary semantic vector sequence into a semantic proofreading engine to obtain an abnormal segment position set; constructing a proofreading high-risk area set, and generating a re-attention weight matrix unit; performing re-encoding on the structured script text sequence under the control of a re-encoding control unit; inputting a re-encoded semantic vector sequence into the semantic proofreading engine, and performing convergence determination by a convergence determination unit; and backfilling an optimized candidate text segment into the structured script text sequence, and outputting a proofreading result report. The application adopts a closed-loop BigBird model to realize automatic script text proofreading and optimization generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of natural language processing and intelligent text review technology, and in particular to a method for script text review and optimization based on semantic AI processing. Background Technology

[0002] In the process of script creation and editing, manual review is typically required to assess character language style, plot chronology, logical connections between events, and fluency of expression. Existing technologies often employ keyword matching or classification model-based text review methods, detecting semantic anomalies and generating revision suggestions by examining local content of text entries. Within these technologies, one type of method compares text using fixed templates or preset rules, suitable for formatted text review. However, when faced with script text content spanning multiple scenes, characters, and time periods, it struggles to accurately identify semantic relationships across sentences and segments. Another type of method utilizes deep learning models to understand the semantics of text, capable of identifying grammatical anomalies and semantic deviations to some extent. However, these methods typically generate review results through a single forward inference approach, with a fixed attention allocation strategy. They cannot dynamically adjust the model's focus on key segments based on detected anomalies, potentially leading to semantic deviations remaining in anomaly segments during subsequent revisions.

[0003] The aforementioned existing technologies struggle to perform cyclical detection and targeted revision of semantic anomalies distributed across different segments of the script text. Furthermore, they lack a feedback mechanism for updating the semantic representation of anomalous regions, easily leading to situations where the results of the second review are identical to the initial review, thus failing to achieve targeted optimization of anomalous segments. For long script texts involving cross-character dialogue, scene transitions, and plot progression, existing review methods have limited capabilities in consistency detection and semantic optimization, making it difficult to meet the needs of high-precision script text review and optimization.

[0004] Therefore, how to provide a script text review and optimization method based on semantic AI processing is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] One objective of this invention is to propose a script text review and optimization method based on semantic AI processing. This invention combines structured text preprocessing, closed-loop BigBird model re-encoding, semantic review feedback modulation, and text generation optimization. Through multi-dimensional semantic consistency detection, anomaly confidence mapping construction, dynamic attention reconstruction, and targeted content replacement, it achieves automated script content review and optimization. This invention fully utilizes sparse attention encoding, key re-encoding of anomaly regions, and an iterative convergence judgment mechanism to establish a semantic update closed loop for anomaly segments. It features high anomaly localization accuracy, strong targeted optimization, and excellent cross-segment semantic consistency maintenance capabilities, effectively improving the intelligent processing level of script text review and content optimization.

[0006] A script text review and optimization method based on semantic AI processing according to an embodiment of the present invention includes the following steps: Obtain the script text to be reviewed, preprocess the script text to obtain a structured script text sequence; The structured script text sequence is input into the embedding layer of the closed-loop BigBird model to generate an initial embedding vector sequence. The first semantic encoding is performed through a sparse attention encoding layer to obtain the initial semantic vector sequence. The initial semantic vector sequence is input into the semantic review engine, which outputs the anomaly confidence matrix and generates anomaly confidence mapping to obtain the set of anomaly fragment locations. Based on the anomaly confidence mapping and the set of anomaly fragment locations, a set of high-risk areas for review is constructed, and a re-attention weight matrix is ​​formed through a re-attention weight matrix generation unit. The re-attention weight matrix is ​​input into the sparse attention coding layer, and the structured script text sequence is re-encoded under the control of the re-encoding control unit to generate a re-encoded semantic vector sequence. The recoded semantic vector sequence is input into the semantic review engine, and the convergence determination unit performs convergence determination, outputting the final recoded semantic vector sequence and the final set of abnormal fragment locations. Based on the final re-encoded semantic vector sequence and the final set of abnormal fragment locations, optimized candidate text fragments are generated, backfilled into the structured script text sequence, and a review result report is output.

[0007] Optionally, the preprocessing includes structure segmentation, sentence and word segmentation, text cleaning, structure tag insertion, and sequence shaping.

[0008] Optionally, the step of inputting the structured script text sequence into the embedding layer of the closed-loop BigBird model to generate an initial embedding vector sequence, and performing the first semantic encoding through a sparse attention encoding layer to obtain the initial semantic vector sequence specifically includes: A closed-loop BigBird model is constructed, which includes an embedding layer, a sparse attention coding layer, a semantic review engine, a re-attention weight matrix generation unit, a re-coding control unit, and a convergence determination unit. The structured script text sequence is input into the embedding layer for embedding mapping, generating word embedding vectors, paragraph domain embedding vectors, and position embedding vectors respectively. The word embedding vector, paragraph domain embedding vector, and position embedding vector are summed to form the corresponding initial embedding vector; The initial embedding vector sequence is input into the sparse attention coding layer, and the first semantic encoding is performed according to the connection relationship of the sparse attention matrix to generate the initial semantic vector sequence.

[0009] Optionally, the step of inputting the initial semantic vector sequence into the semantic review engine, outputting the anomaly confidence matrix and generating the anomaly confidence mapping to obtain the set of anomaly fragment locations specifically includes: The initial semantic vector sequence is input into the semantic review engine, which includes a detection unit, a confidence fusion unit, and an abnormal segment localization unit. The initial semantic vector sequence passes through the detection unit to obtain the confidence scores for character style anomalies, plot time sequence anomalies, event association anomalies, and language fluency anomalies. The confidence scores for character style, plot time sequence, event correlation, and language fluency are input into the confidence fusion unit to obtain a comprehensive confidence score, thus forming an anomaly confidence score mapping. The abnormality confidence mapping is used to make a determination, and an abnormality location index set is obtained. Then, the consecutive number intervals in the abnormality location index set are merged to form an abnormality segment location set.

[0010] Optionally, the initial semantic vector sequence is processed by the detection unit to obtain confidence scores for character style anomalies, plot time sequence anomalies, event association anomalies, and language fluency anomalies, specifically including: In the detection unit, the matching degree of the character language style is calculated based on the character tag corresponding to the initial semantic vector and the text unit, and the confidence degree of character style anomaly is obtained. Based on the initial semantic vector and the sequential position number of the text unit, the consistency of the plot time series constraint is calculated to obtain the confidence of time sequence anomaly. The event association consistency is calculated based on the semantic association degree between the initial semantic vector and the context text unit vector to obtain the event logic anomaly confidence. Based on the initial semantic vector and the clause boundaries, word order and semantic continuity within the sentence, the consistency of language fluency is calculated to obtain the confidence level of the expression fluency anomaly.

[0011] Optionally, the step of constructing a set of high-risk review areas based on the anomaly confidence mapping and the set of anomaly fragment locations, and forming a re-attention weight matrix through a re-attention weight matrix generation unit, specifically includes: Each text unit in the anomaly confidence mapping is retrieved sequentially to obtain the corresponding anomaly confidence value, which is then compared with a preset threshold to obtain a set of high-risk areas for review. The set of high-risk areas for review is input into the re-attention weight matrix generation unit, and the attention connections associated with the text unit index positions corresponding to the set of high-risk areas for review in the sparse attention matrix are marked. Based on the set of high-risk regions for review, the sparse attention matrix in the closed-loop BigBird model is reconstructed to form a re-attention weight matrix.

[0012] Optionally, the step of inputting the re-attention weight matrix into the sparse attention coding layer and performing re-coding on the structured script text sequence under the control of the re-coding control unit to generate a re-coded semantic vector sequence specifically includes: The re-attention weight matrix is ​​input into the sparse attention coding layer of the closed-loop BigBird model. Under the control of the re-coding control unit, the initial embedding vector and the re-attention weight matrix are combined to generate the re-coded input representation sequence. In the sparse attention coding layer, attention is calculated on the re-encoded input representation sequence based on the re-attention weight matrix to generate the re-attention fusion representation sequence. The re-attention fusion representation sequence is input into the semantic mapping module inside the sparse attention coding layer for update processing, resulting in a re-encoded semantic vector. All recoded semantic vectors are arranged in the order of text units to form a recoded semantic vector sequence.

[0013] Optionally, the step of inputting the recoded semantic vector sequence into the semantic review engine, and having the convergence determination unit perform convergence determination to output the final recoded semantic vector sequence and the final set of abnormal segment locations specifically includes: The re-encoded semantic vector sequence is input into the semantic review engine to generate an updated anomaly confidence map and anomaly fragment location set; The updated anomaly confidence mapping is checked item by item to obtain the comprehensive anomaly confidence corresponding to the text unit, and the anomaly confidence with the largest value is selected as the highest anomaly confidence in the current loop stage. The highest anomaly confidence level is compared with the preset anomaly judgment threshold, the number of recoding loops that have been executed is recorded, and the number of recoding loops is compared with the preset upper limit of loops. The convergence determination unit makes a comprehensive convergence determination based on the comparison between the highest anomaly confidence level and the preset anomaly determination threshold, and the comparison between the number of recoding loops and the preset upper limit of loops. When the state is determined to be non-converged, the process of generating the re-attention weight matrix and the re-encoding process are retried to form a new re-encoded semantic vector sequence. When the convergence state is determined, the attention weight adjustment and recoding loop process is stopped, and the final recoded semantic vector sequence and the final set of abnormal fragment locations are output.

[0014] Optionally, the step of generating optimized candidate text fragments based on the final re-encoded semantic vector sequence and the final set of abnormal fragment positions, backfilling them into the structured script text sequence, and outputting a review result report specifically includes: Based on the final set of abnormal fragment locations, the corresponding original text fragments and context fragments are extracted from the structured script text sequence to form a set of original text fragments and a set of context fragments. For each anomalous fragment in the final set of anomalous fragment locations, the final re-encoded semantic information, the original text content, and the context content corresponding to the anomalous fragment are obtained in sequence, and the text generation model forms an optimized candidate text fragment set. The optimized candidate text content in the optimized candidate text fragment set is matched and replaced with the corresponding position in the structured script text sequence to obtain the optimized script text. Based on the final set of abnormal fragment locations, the updated abnormal confidence mapping, and the optimized set of candidate text fragments, a review result report is generated.

[0015] The beneficial effects of this invention are: This invention constructs a closed-loop BigBird model and introduces a dynamic attention weight adjustment mechanism driven by anomaly confidence. This allows the model to change its attention allocation strategy in real time based on semantically abnormal regions detected during the review process, focusing on re-encoding abnormal segments. Through multiple rounds of semantic feedback, the model can gradually reduce the semantic bias of abnormal regions and improve their semantic representation quality, thereby achieving targeted revision and continuous optimization. Compared with single-inference models with fixed attention structures, this invention achieves higher review accuracy in cross-segment semantic association and cross-scene structural continuity.

[0016] This invention constructs four detection indicators: consistency of character language style, consistency of plot chronology, logical coherence of events, and fluency of language expression. It then integrates the corresponding anomaly confidence results into an iteratively updatable anomaly confidence map. This enables the differentiated identification and localization of different types of anomalies in the script text, avoiding problems such as anomaly type confusion or inaccurate anomaly localization. This mapping mechanism allows the model to generate targeted revisions based on anomaly types in subsequent optimization stages, improving the fit between the optimized content and the original plot structure.

[0017] This invention achieves optimized content generation for anomalous segments by inputting the final re-encoded semantic vector sequence along with the original text content and context of the corresponding anomalous segment into a text generation model. This method generates candidate revised text to replace the original anomalous segment while maintaining the existing narrative logic, character settings, and language style of the script, reducing the risk of semantic corruption or structural contradictions during secondary editing. This invention enables fine-grained replacement of local content during the text revision stage, contributing to improved consistency and semantic coherence of the overall script text. Attached Figure Description

[0018] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a script text review and optimization method based on semantic AI processing proposed in this invention; Figure 2 This is a schematic diagram of the closed-loop BigBird model structure in the script text review and optimization method based on semantic AI processing proposed in this invention; Figure 3 This is a schematic diagram of the sparse attention weight reconstruction process in a script text review and optimization method based on semantic AI processing proposed in this invention. Detailed Implementation

[0019] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0020] refer to Figures 1-3 A script text review and optimization method based on semantic AI processing includes the following steps: Obtain the script text to be reviewed, preprocess the script text to obtain a structured script text sequence; The structured script text sequence is input into the embedding layer of the closed-loop BigBird model to generate an initial embedding vector sequence. The first semantic encoding is performed through a sparse attention encoding layer to obtain the initial semantic vector sequence. The initial semantic vector sequence is input into the semantic review engine, which outputs the anomaly confidence matrix and generates anomaly confidence mapping to obtain the set of anomaly fragment locations. Based on the anomaly confidence mapping and the set of anomaly fragment locations, a set of high-risk areas for review is constructed, and a re-attention weight matrix is ​​formed through a re-attention weight matrix generation unit. The re-attention weight matrix is ​​input into the sparse attention coding layer, and the structured script text sequence is re-encoded under the control of the re-encoding control unit to generate a re-encoded semantic vector sequence. The recoded semantic vector sequence is input into the semantic review engine, and the convergence determination unit performs convergence determination, outputting the final recoded semantic vector sequence and the final set of abnormal fragment locations. Based on the final re-encoded semantic vector sequence and the final set of abnormal fragment locations, optimized candidate text fragments are generated, backfilled into the structured script text sequence, and a review result report is output.

[0021] In this embodiment, the step of obtaining the script text to be reviewed and preprocessing the script text to obtain a structured script text sequence specifically includes: The original script text is divided into scene segments, dialogue segments, and narrative segments based on scene title recognition rules, character dialogue recognition rules, and stage instruction positioning rules, forming an initial segmented text sequence. Sentence segmentation and word segmentation are performed on the initially segmented text sequence, and text cleaning is performed on the text after sentence and word segmentation. The text cleaning process includes removing redundant spaces, duplicate punctuation and illegal control characters, and using sentence boundary judgment symbols to divide the sentence-level text boundaries to obtain the cleaned sentence-level text sequence. In the cleaned sentence-level text sequence, a corresponding scene marker is inserted at the beginning of each scene segment to indicate which scene the position belongs to. For each instance of dialogue, insert a corresponding character marker at the character's name position to indicate which character delivered the dialogue; For each stage instruction, a corresponding instruction marker is inserted to indicate that the location is a stage action or scene arrangement description, so that various structural information in the text is clearly marked in the sequence; The aforementioned inserted scene tags, character tags, and instruction tags are combined with their corresponding sentence-level text fragments, so that each text fragment is closely associated with its respective scene information, character information, or stage instruction information, thereby forming a set of structured text units that integrate tags and content. All structured text units are arranged sequentially according to the order corresponding to the scene markers, and then spliced ​​together according to the development order of the original plot to form a serialized text input that can represent the overall structure of the script. The serialized text is then used as a structured script text sequence.

[0022] In this embodiment, the step of inputting the structured script text sequence into the embedding layer of the closed-loop BigBird model to generate an initial embedding vector sequence, and performing the first semantic encoding through a sparse attention encoding layer to obtain the initial semantic vector sequence specifically includes: A closed-loop BigBird model is constructed, which includes an embedding layer, a sparse attention coding layer, a semantic review engine, a re-attention weight matrix generation unit, a re-coding control unit, and a convergence determination unit. The units are connected through data flow. The structured script text sequence is input into the embedding layer, and each text unit is processed by embedding mapping in turn to generate word embedding vectors to represent the meaning of the text, paragraph field embedding vectors to represent the paragraph type of the text, and position embedding vectors to represent the positional relationship of the text in the sequence. The embedding mapping process includes three sub-processes: word embedding mapping, paragraph domain embedding mapping, and position embedding mapping. The word embedding mapping targets any text unit in the structured script text sequence. Based on the vocabulary mapping table or sub-word segmentation strategy, the corresponding semantic representation unit is determined. Word semantic level embedding mapping is performed on the semantic representation unit to obtain a word embedding vector that reflects the semantic features of the text content. The word embedding vector is used to characterize the semantic meaning of the text unit and belongs to the vectorized representation of the text content level. The paragraph field embedding mapping generates corresponding paragraph field embedding vectors according to the text structure type to which the text unit belongs. The text structure types in the structured script text sequence include three types: scene segment, dialogue segment, and narrative segment, which are used to represent scene information, character dialogue information, and plot narrative information, respectively. For text units belonging to the scene segment, assign a scene domain embedding vector; for text units belonging to the dialogue segment, assign a dialogue domain embedding vector; for text units belonging to the narrative segment, assign a narrative domain embedding vector. The position embedding mapping determines the corresponding sequence number based on the sequential position of the text unit in the structured script text sequence, and generates a position information embedding vector based on the sequence number to reflect the temporal relationship and contextual dependence of the text unit. The position embedding vector can be generated using a learnable parameter-based method or a deterministic position function-based method, and is used to provide the model with the preceding and following relationships of the text unit and its positioning reference in the plot timeline. The word embedding vector, paragraph domain embedding vector, and position embedding vector are summed to form the corresponding initial embedding vector; The initial embedding vector generated for any text unit is obtained by adding the word embedding vector, paragraph domain embedding vector and position embedding vector of the text unit. The initial embedding vectors corresponding to all text units are arranged in the input order to form the initial embedding vector sequence. The initial embedding vector sequence is input into the sparse attention coding layer, and the first semantic encoding is performed according to the connection relationship of the sparse attention matrix to generate the initial semantic vector sequence. The sparse attention matrix is ​​composed of three attention connections: a global attention connection for establishing associations between global key markers in the structured script text sequence, a window attention connection for establishing associations between adjacent text units within a preset window, and a random attention connection for establishing associations between several randomly selected text units outside the window. These three types of attention connections together limit the attention propagation range of the sparse attention coding layer, thereby completing the first semantic encoding of the initial embedded vector sequence under the premise of controlling the number of attention connections and computational complexity, so as to output the initial semantic vector sequence.

[0023] In this embodiment, the step of inputting the initial semantic vector sequence into the semantic review engine, outputting the anomaly confidence matrix and generating the anomaly confidence mapping to obtain the set of anomaly fragment locations specifically includes: The initial semantic vector sequence is input into the semantic review engine, which includes a detection unit, a confidence fusion unit, and an abnormal segment localization unit. The initial semantic vector sequence passes through the detection unit to obtain the confidence scores for character style anomalies, plot time sequence anomalies, event association anomalies, and language fluency anomalies. The confidence scores for character style, plot time sequence, event association, and language fluency are all input into the confidence fusion unit. Each text unit is then processed individually. By weighting and summing the four confidence scores according to a preset weight ratio, a comprehensive confidence score is obtained to represent the overall degree of abnormality of the text unit. The weights are used to reflect the participation ratio of the four types of review indicators in the comprehensive judgment process. All weights are summed to one and each weight is greater than zero to ensure that the comprehensive anomaly confidence level is stable and comparable. After completing the weighted aggregation, the obtained comprehensive anomaly confidence score is registered as the anomaly confidence score mapping result of the corresponding text unit, which is used to reflect the anomaly possibility of the text unit at the comprehensive review level. The higher the comprehensive anomaly confidence score, the more the text unit deviates from the normal text features in multiple dimensions. The lower the comprehensive anomaly confidence score, the more the text unit conforms to the normal expression rules under the overall review indicators. Finally, the comprehensive anomaly confidence scores corresponding to all text units are arranged in the order of the text units to form a complete anomaly confidence score mapping; The comprehensive anomaly confidence level corresponding to each text unit in the anomaly confidence level mapping is determined according to a preset threshold. The index positions of text units with a comprehensive anomaly confidence level not lower than the preset threshold are registered as an anomaly position index set. The consecutive numbered intervals in the anomaly position index set are merged, and each consecutive interval is regarded as a whole anomaly segment, thereby forming an anomaly segment position set, which is used to characterize the range of consecutive texts in the structured script text sequence that have the possibility of anomalies.

[0024] In this embodiment, the initial semantic vector sequence is processed by the detection unit to obtain confidence levels for character style anomalies, plot time sequence anomalies, event association anomalies, and language fluency anomalies. Specifically, these include: In the detection unit, the matching degree of the character language style is calculated based on the character tag corresponding to the initial semantic vector and the text unit, and the confidence degree of character style anomaly is obtained. The character language style matching degree calculation includes filtering out the historical dialogue text corresponding to the character based on the character tags in the structured script text sequence, and constructing a character reference style sample set from the initial semantic vectors of these historical dialogue fragments to characterize the character's language style features in the existing script. Then, for the current text unit to be reviewed, the corresponding initial semantic vector is obtained, and the similarity is calculated with each vector in the character reference style sample set to obtain a set of similarity values ​​that reflect the degree of conformity between the current text unit and the character's existing language style. After obtaining the above similarity values, the highest similarity is selected as the character language style matching degree of the current text unit, and the character language style matching degree is converted into the character style anomalous confidence degree according to the consistency deviation conversion rule. The consistency deviation transformation rule is to linearly transform the matching degree value by subtracting the matching degree from the deviation degree, that is, the character style abnormality confidence is equal to one minus the maximum similarity. Based on the initial semantic vector and the sequential position number of the text unit, the consistency of the plot time series constraint is calculated to obtain the confidence of time sequence anomaly. The consistency calculation of the plot time sequence constraint includes assigning a corresponding sequential position number to each text unit in the structured script text sequence according to its order of appearance in the sequence, so as to indicate the baseline occurrence order of the text unit in the plot event timeline; The initial semantic vector corresponding to the current text unit to be reviewed is obtained and compared with the initial semantic vectors corresponding to the previous and next text units. By analyzing the distance change trend, direction change trend or other metrics that reflect the continuity of time, it is determined whether there is a time drift of reverse order, skip order or no context support between the current text unit and the adjacent text units, thereby calculating the plot time sequence matching degree of the current text unit. After obtaining the plot time sequence matching degree, based on the numerical mapping relationship that the time sequence deviation is equal to one minus the matching degree, the plot time sequence matching degree is converted into a time sequence anomaly confidence degree with a value range between 0 and 1. The closer the time sequence anomaly confidence degree is to 1, the more likely the position of the text unit in the plot timeline is to be misplaced or inconsistent, and the closer it is to 0, the more likely it is to conform to the normal narrative order. The event association consistency is calculated based on the semantic association degree between the initial semantic vector and the context text unit vector to obtain the event logic anomaly confidence. The calculation of event association consistency includes extracting semantic information that can characterize the event content from the currently pending text unit as the semantic focus of the event; Centered on the current text unit, select several adjacent text units before and after it as the event association range, obtain the semantic vectors corresponding to each text unit within the event association range, and use them to construct the semantic relationship chain between the current text and the context event; By comparing the connection between the current text unit and other text units within the scope of the event in terms of causal relationship, premise relationship, condition relationship, parallel relationship or transition relationship, it can be determined whether the current text unit has event breakpoints, event repetitions, missing event results, insufficient event conditions or no causal support in the event occurrence sequence and event logical structure. After completing the comparison and analysis, the consistency level of event association is determined based on the rationality of the logical connection of events, and the deviation of event association consistency is converted into the corresponding event association anomaly confidence. The higher the event association anomaly confidence, the greater the possibility of anomalies in the logical consistency of the current text unit. The lower the event association anomaly confidence, the more reasonable the semantic connection in the event progression process. Based on the initial semantic vector and the clause boundaries, word order and semantic continuity within the sentence, the consistency of language fluency is calculated to obtain the confidence level of the expression fluency anomaly; The language fluency consistency calculation includes extracting the semantic representation information of the current text unit and identifying its basic grammatical structure by combining the sentence segmentation results and word order structure. The semantic content of the current text unit is compared with that of the adjacent text units. By searching the word order, phrase collocation, and modification structure, it is determined whether the current text unit has word order disorder, improper modification relationship, or missing expression components in its grammatical structure. By analyzing the semantic connection and linguistic reference between the current text unit and the texts before and after it, we can detect whether there are problems such as semantic interruption, semantic jump or unclear reference. At the same time, the punctuation marks, pause positions and language rhythm in the current text unit are compared and analyzed to determine whether there are inappropriate pauses or abnormal expression rhythms. After completing the above comparison, the language fluency consistency level of the current text unit is determined based on the degree of matching in terms of grammatical structure coherence, semantic coherence, and language rhythm rationality. The degree of deviation from the normal language expression rules is converted into the corresponding language fluency anomaly confidence level, which is used to characterize the consistency deviation of its language expression fluency. The higher the language fluency anomaly confidence level, the more likely there is a lack of fluency or unnaturalness in the language expression, while the lower the language fluency anomaly confidence level, the more the expression conforms to the normal language use rules.

[0025] In this embodiment, the step of constructing a set of high-risk review areas based on the anomaly confidence mapping and the set of anomaly fragment locations, and forming a re-attention weight matrix through the re-attention weight matrix generation unit, specifically includes: Each text unit in the anomaly confidence mapping is retrieved sequentially to obtain the corresponding anomaly confidence value, which is then compared with a preset threshold. When the anomaly confidence value of a text unit is not lower than the preset threshold, the position of the text unit is registered as an anomaly position index, and all anomaly position indices that meet the conditions are arranged in the order of their appearance in the structured script text sequence. After completing the location registration, adjacent and continuous abnormal location indices are merged. Each continuous abnormal location index is regarded as a high-risk segment for review, and all high-risk segments for review together constitute a set of high-risk regions for review, which is used to characterize the key review scope where there may be abnormal expressions, logical breaks or semantic inconsistencies in the structured script text sequence. The set of high-risk areas for review is input into the attention weight matrix generation unit, and the attention connections associated with the text unit index positions corresponding to the set of high-risk areas for review in the sparse attention matrix of the closed-loop BigBird model are marked. After identifying the set of high-risk areas for review, the corresponding text positions are used as the basis for adjusting the attention weights, and the sparse attention matrix used for semantic encoding in the closed-loop BigBird model is restructured. Specifically, there are three types of attention connection methods in the sparse attention matrix: global attention connection used to associate key prompts of the whole text, window attention connection used to continuously model adjacent text content, and random attention connection used to expand the scope of semantic association. When refactoring the weights, the weights of the global attention connection and window attention connection corresponding to the high-risk area set are increased, so that the text information of the key attention area is highlighted more during the model encoding process. At the same time, the weights of random attention connections corresponding to the high-risk areas of the review are reduced to weaken the interference of random associations on the encoding results. For text locations not included in the set of high-risk review areas, the weight configuration of the original sparse attention matrix remains unchanged. Through the above weight adjustment process, the attention configuration after the attention weight reconstruction is more focused on the abnormal text areas, thus forming a re-attention weight matrix.

[0026] In this embodiment, the step of inputting the re-attention weight matrix into the sparse attention coding layer and performing re-coding on the structured script text sequence under the control of the re-coding control unit to generate a re-coded semantic vector sequence specifically includes: The re-attention weight matrix is ​​input into the sparse attention encoding layer of the closed-loop BigBird model. Under the control of the re-encoding control unit, the initial embedding vector corresponding to each text unit in the structured script text sequence is combined with the re-attention weight matrix position by position to generate the re-encoded input representation sequence. In the sparse attention coding layer, attention is calculated on the re-encoded input representation sequence based on the re-attention weight matrix. The re-encoded input representation corresponding to the text unit belonging to the high-risk region set of review is weighted and aggregated with the global attention connection and window attention connection associated with it. The attention contribution related to random attention connection is reduced according to the weight adjustment coefficient to generate the re-attention fusion representation sequence. The re-attention fusion representation sequence is input into the semantic mapping module inside the sparse attention coding layer one by one according to the natural order of the text units. The semantic content corresponding to each re-attention fusion representation is updated. By recalculating, redistributing and restructuring the semantic information, a re-encoded semantic vector corresponding to the updated semantic content is generated. The generated re-encoded semantic vector is then integrated according to the order of the text units as the output sequence of the re-encoding step. The recoded semantic vectors are arranged in the order of text units to form a recoded semantic vector sequence.

[0027] In this embodiment, the step of inputting the recoded semantic vector sequence into the semantic review engine, and having the convergence determination unit perform convergence determination to output the final recoded semantic vector sequence and the final set of abnormal segment locations specifically includes: The re-encoded semantic vector sequence is input into the semantic review engine to generate an updated anomaly confidence map and anomaly fragment location set; The updated anomaly confidence mapping is checked item by item to obtain the comprehensive anomaly confidence corresponding to each text unit, and the anomaly confidence with the largest value among all comprehensive anomaly confidence is selected as the highest anomaly confidence in the current loop stage. The highest anomaly confidence level is compared with the preset anomaly judgment threshold to determine whether the current recoding process has reached the anomaly convergence condition. At the same time, the number of recoding loops that have been executed is recorded and compared with the preset loop limit to determine whether the recoding process needs to be terminated due to the loop limit being reached. The convergence determination unit makes a convergence determination based on the comparison between the highest anomaly confidence level and the preset anomaly determination threshold, and the comparison between the current number of recoding loops and the preset upper limit of loops. When the highest anomaly confidence is less than or equal to the preset anomaly judgment threshold, or when the current recoding loop count has reached the preset loop limit, the current recoding process is determined to be in a convergent state, and no new attention weight adjustment and recoding processing will be triggered. When the highest anomaly confidence level is still higher than the preset anomaly judgment threshold, and the current recoding loop count has not yet reached the preset loop limit, the current recoding process is determined to be in a non-convergent state, and the next round of attention weight adjustment and recoding processing needs to be performed. When the state is determined to be non-converged, the updated abnormal confidence mapping and abnormal fragment location set are used as input to re-trigger the generation process of the re-attention weight matrix and the re-encoding process, forming a new re-encoded semantic vector sequence, and the current iteration number is accumulated by one. When the convergence state is determined, the attention weight adjustment and recoding loop process is stopped, and the final recoded semantic vector sequence and the final set of abnormal fragment locations are output.

[0028] In this embodiment, the step of generating optimized candidate text fragments based on the final re-encoded semantic vector sequence and the final set of abnormal fragment positions, backfilling them into the structured script text sequence, and outputting a review result report specifically includes: The final re-encoded semantic vector sequence is arranged according to the natural order of the text units in the structured script text sequence, which is used to represent the semantic state of each text unit after closed-loop processing. The final set of abnormal fragment locations is considered as a set of multiple consecutive text unit index intervals, with each index interval corresponding to an abnormal fragment that needs to be optimized. Based on the final set of abnormal fragment locations, the original text content corresponding to each abnormal fragment is extracted from the structured script text sequence, and a preset number of adjacent text units before and after each abnormal fragment are selected as context content, together forming the original text fragment set and the context fragment set. For each abnormal segment in the final abnormal segment location set, the final re-encoded semantic information, the original text content, and the context content composed of several text units before and after the abnormal segment are obtained in sequence. The semantic information, the original text content, and the context content are combined to form the input data used to drive the text generation model. The input data is submitted to the text generation model for processing. The text generation model generates several optimized text contents for each abnormal fragment, which can be used to replace the original abnormal fragment, while keeping the original plot context, character settings and narrative direction unchanged. This forms a corresponding set of optimized candidate text fragments. Each set contains at least one revision suggestion text output by the text generation model, which is used as a candidate basis for replacing and revising the abnormal fragment content. For each anomalous fragment, the optimized candidate text content is matched with its corresponding position in the structured script text sequence. For each anomalous fragment, the target replacement text is selected from the optimized candidate text content and filled into the corresponding anomalous fragment position to replace the original anomalous text content. After the target replacement text is filled in at all abnormal fragment locations, the replaced text fragments are reassembled according to the original order of the structured script text sequence to form the optimized script text. Based on the final set of abnormal fragment locations, the updated abnormal confidence mapping, and the optimized candidate text fragment set, the abnormal type, abnormal location index, and corresponding optimized replacement content of each abnormal fragment are organized to generate a review result report. The review result report includes abnormal classification information, abnormal location index information, and revision suggestion information determined based on the optimized candidate text fragments. The review result report is output together with the optimized script text.

[0029] Example 1: To verify the feasibility of this invention in practice, it was applied to the script revision review process of a film and television production company. This company was responsible for multiple script projects simultaneously, and during the scriptwriting process, issues arose such as discrepancies in character dialogue styles, uneven pacing of the plot, unclear event connections, and redundant or disjointed language. Conventional review methods, primarily relying on manual proofreading and single-step reasoning using language models, frequently resulted in missed or incorrect checks, and struggled to identify semantic conflicts across scenes and characters. This led to multiple reworks in subsequent production stages, significantly increasing the script review cycle and reducing production efficiency.

[0030] In the implementation of this invention, the script text is first imported into the system. A preprocessing module completes structured modeling, including dividing the script into scene segments, dialogue segments, and narrative segments, followed by labeling, cleaning, and context numbering to form a structured script text sequence. This structured script text sequence is then input into a closed-loop BigBird model. After obtaining initial embedding vectors at the embedding layer, it enters a sparse attention encoding layer to complete the first semantic encoding, outputting an initial semantic vector sequence. The system then inputs this initial semantic vector sequence into a semantic review engine, generating anomaly confidence maps from four dimensions: consistency of character language style, consistency of plot chronological order, logical correlation of events, and fluency of language expression, and locating anomalous segments.

[0031] The script text sample for this scenario contains approximately 134,000 words, 74 characters, 168 scene transitions, and several plot segments. Traditional manual review typically requires 4 to 6 reviewers working continuously for several days to complete the initial review, and subsequent revisions still require repeated work based on feedback. The system of this invention, after inputting the complete script text, completes the first semantic encoding in less than 7 minutes, and the closed-loop re-encoding and convergence determination takes approximately 28 minutes, with the total processing time controlled within 40 minutes, shortening the review cycle. During anomaly detection, the system identified 312 semantic anomalies of varying degrees, including 114 character style deviations, 52 plot time sequence misalignments, 89 weak event logic connections, and 57 language fluency anomalies. The system automatically triggers re-attention matrix reconstruction and re-encoding for each anomaly region, achieving convergence after approximately 3 to 6 iterations. In the final output of abnormal segment revision suggestions, about 81% of the candidate texts were directly accepted and filled in by the creative team, while the remaining parts were still used as reference content for adjusting the script text after manual revision.

[0032] In this embodiment, the solution of the present invention can shorten the average first-time proofreading time for every 100,000 words of script from approximately 38 hours using traditional methods to less than 40 minutes, reducing the proofreading cycle by more than 94%. Regarding revision accuracy, by comparing the anomaly recurrence rate (i.e., the probability of the same semantic anomaly recurring in subsequent proofreading stages) in the script after proofreading, the anomaly recurrence rate of traditional methods is approximately 27% to 33%, while the closed-loop proofreading mode of the present invention reduces this recurrence rate to approximately 8% to 11%, reducing the probability of semantic omissions and secondary rework, and improving the overall consistency of the script's language quality.

[0033] Table 1 Performance Comparison Statistics of the Invention in Script Text Review Scenarios

[0034] As can be seen from the table above, this invention improves upon traditional manual methods and single-pass language model inference in several core performance indicators of script text review. Firstly, in terms of review efficiency, this invention reduces the average first-use review cycle of approximately 38 hours in traditional methods to approximately 40 minutes, a reduction of over 94%, achieving an order-of-magnitude efficiency improvement for the same text size. This result demonstrates that the recoding mechanism and anomaly feedback loop structure based on the closed-loop BigBird model reduce the need for manual intervention, enabling automated processing of the review process and thus increasing review speed.

[0035] Secondly, regarding anomaly detection accuracy, the four classification indicators of this invention—character language style consistency anomaly detection, plot time sequence consistency anomaly detection, event logic association anomaly detection, and language fluency anomaly detection—achieve recognition accuracy of approximately 92%, 90%, 88%, and 91%, respectively. These figures are all higher than the accuracy range of approximately 61% to 72% in traditional methods, representing an average improvement of over 20 percentage points. This improvement in consistency detection demonstrates that the semantic recoding strategy based on the re-attention weight reconstruction mechanism enhances the model's ability to focus on anomalous semantic regions, avoiding missed detections caused by the fixed attention structure of traditional models, and improving the accuracy and interpretability of text anomaly localization.

[0036] Furthermore, regarding the acceptance rate of revised content, approximately 81% of the revised content generated by this invention can be directly backfilled into the original text structure, which is higher than the approximately 45% revision acceptance rate in traditional methods. This indicates that during the implementation of this invention, the text generation model, after accepting the input of the re-encoded semantic vector sequence, can maintain a high degree of consistency in semantic logic, character settings, language style, and narrative direction. This helps to improve the adaptability of the revised content to the original script text and reduce the burden of secondary revisions by humans.

[0037] Finally, regarding the probability of anomalous content recurring, this invention reduces the probability of anomalous content reappearing in subsequent reviews to approximately 8% to 11%, while the recurrence probability of traditional methods is approximately 27% to 33%. This result reflects that by constructing a semantic feedback and recoding closed-loop mechanism, this invention enables the model to continuously reduce semantic deviation and approach a logically consistent state in multiple iterations, thereby effectively reducing the probability of anomalous content reappearing and improving the overall quality stability during the review stage.

[0038] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for script text review and optimization based on semantic AI processing, characterized in that, Includes the following steps: Obtain the script text to be reviewed, preprocess the script text to obtain a structured script text sequence; The structured script text sequence is input into the embedding layer of the closed-loop BigBird model to generate an initial embedding vector sequence. The first semantic encoding is performed through a sparse attention encoding layer to obtain the initial semantic vector sequence. The initial semantic vector sequence is input into the semantic review engine, which outputs the anomaly confidence matrix and generates anomaly confidence mapping to obtain the set of anomaly fragment locations. Based on the anomaly confidence mapping and the set of anomaly fragment locations, a set of high-risk areas for review is constructed, and a re-attention weight matrix is ​​formed through a re-attention weight matrix generation unit. The re-attention weight matrix is ​​input into the sparse attention coding layer, and the structured script text sequence is re-encoded under the control of the re-encoding control unit to generate a re-encoded semantic vector sequence. The recoded semantic vector sequence is input into the semantic review engine, and the convergence determination unit performs convergence determination, outputting the final recoded semantic vector sequence and the final set of abnormal fragment locations. Based on the final re-encoded semantic vector sequence and the final set of abnormal fragment locations, optimized candidate text fragments are generated, backfilled into the structured script text sequence, and a review result report is output.

2. The script text review and optimization method based on semantic AI processing according to claim 1, characterized in that, The preprocessing includes structure segmentation, sentence and word segmentation, text cleaning, structure tag insertion, and sequence shaping.

3. The script text review and optimization method based on semantic AI processing according to claim 1, characterized in that, The process of inputting the structured script text sequence into the embedding layer of the closed-loop BigBird model to generate an initial embedding vector sequence, and then performing the first semantic encoding through a sparse attention encoding layer to obtain the initial semantic vector sequence specifically includes: A closed-loop BigBird model is constructed, which includes an embedding layer, a sparse attention coding layer, a semantic review engine, a re-attention weight matrix generation unit, a re-coding control unit, and a convergence determination unit. The structured script text sequence is input into the embedding layer for embedding mapping, generating word embedding vectors, paragraph domain embedding vectors, and position embedding vectors respectively. The word embedding vector, paragraph domain embedding vector, and position embedding vector are summed to form the corresponding initial embedding vector; The initial embedding vector sequence is input into the sparse attention coding layer, and the first semantic encoding is performed according to the connection relationship of the sparse attention matrix to generate the initial semantic vector sequence.

4. The script text review and optimization method based on semantic AI processing according to claim 1, characterized in that, The process of inputting the initial semantic vector sequence into the semantic review engine, outputting the anomaly confidence matrix, generating the anomaly confidence mapping, and obtaining the set of anomaly fragment locations specifically includes: The initial semantic vector sequence is input into the semantic review engine, which includes a detection unit, a confidence fusion unit, and an abnormal segment localization unit. The initial semantic vector sequence passes through the detection unit to obtain the confidence scores for character style anomalies, plot time sequence anomalies, event association anomalies, and language fluency anomalies. The confidence scores for character style, plot time sequence, event correlation, and language fluency are input into the confidence fusion unit to obtain a comprehensive confidence score, thus forming an anomaly confidence score mapping. The abnormality confidence mapping is used to make a determination, and an abnormality location index set is obtained. Then, the consecutive number intervals in the abnormality location index set are merged to form an abnormality segment location set.

5. A script text review and optimization method based on semantic AI processing according to claim 4, characterized in that, The initial semantic vector sequence is passed through the detection unit to obtain confidence scores for character style anomalies, plot time sequence anomalies, event association anomalies, and language fluency anomalies, specifically including: In the detection unit, the matching degree of the character language style is calculated based on the character tag corresponding to the initial semantic vector and the text unit, and the confidence degree of character style anomaly is obtained. Based on the initial semantic vector and the sequential position number of the text unit, the consistency of the plot time series constraint is calculated to obtain the confidence of time sequence anomaly. The event association consistency is calculated based on the semantic association degree between the initial semantic vector and the context text unit vector to obtain the event logic anomaly confidence. Based on the initial semantic vector and the clause boundaries, word order and semantic continuity within the sentence, the consistency of language fluency is calculated to obtain the confidence level of the expression fluency anomaly.

6. The script text review and optimization method based on semantic AI processing according to claim 1, characterized in that, The process of constructing a set of high-risk review areas based on anomaly confidence mapping and anomaly fragment location set, and forming a re-attention weight matrix through a re-attention weight matrix generation unit, specifically includes: Each text unit in the anomaly confidence mapping is retrieved sequentially to obtain the corresponding anomaly confidence value, which is then compared with a preset threshold to obtain a set of high-risk areas for review. The set of high-risk areas for review is input into the re-attention weight matrix generation unit, and the attention connections associated with the text unit index positions corresponding to the set of high-risk areas for review in the sparse attention matrix are marked. Based on the set of high-risk regions for review, the sparse attention matrix in the closed-loop BigBird model is reconstructed to form a re-attention weight matrix.

7. The script text review and optimization method based on semantic AI processing according to claim 1, characterized in that, The step of inputting the re-attention weight matrix into the sparse attention encoding layer and performing re-encoding on the structured script text sequence under the control of the re-encoding control unit to generate a re-encoded semantic vector sequence specifically includes: The re-attention weight matrix is ​​input into the sparse attention coding layer of the closed-loop BigBird model. Under the control of the re-coding control unit, the initial embedding vector and the re-attention weight matrix are combined to generate the re-coded input representation sequence. In the sparse attention coding layer, attention is calculated on the re-encoded input representation sequence based on the re-attention weight matrix to generate the re-attention fusion representation sequence. The re-attention fusion representation sequence is input into the semantic mapping module inside the sparse attention coding layer for update processing, resulting in a re-encoded semantic vector. All recoded semantic vectors are arranged in the order of text units to form a recoded semantic vector sequence.

8. The script text review and optimization method based on semantic AI processing according to claim 1, characterized in that, The process of inputting the re-encoded semantic vector sequence into the semantic review engine, and having the convergence determination unit perform convergence determination to output the final re-encoded semantic vector sequence and the final set of abnormal fragment locations specifically includes: The re-encoded semantic vector sequence is input into the semantic review engine to generate an updated anomaly confidence map and anomaly fragment location set; The updated anomaly confidence mapping is checked item by item to obtain the comprehensive anomaly confidence corresponding to the text unit, and the anomaly confidence with the largest value is selected as the highest anomaly confidence in the current loop stage. The highest anomaly confidence level is compared with the preset anomaly judgment threshold, the number of recoding loops that have been executed is recorded, and the number of recoding loops is compared with the preset upper limit of loops. The convergence determination unit makes a comprehensive convergence determination based on the comparison between the highest anomaly confidence level and the preset anomaly determination threshold, and the comparison between the number of recoding loops and the preset upper limit of loops. When the state is determined to be non-converged, the process of generating the re-attention weight matrix and the re-encoding process are retried to form a new re-encoded semantic vector sequence. When the convergence state is determined, the attention weight adjustment and recoding loop process is stopped, and the final recoded semantic vector sequence and the final set of abnormal fragment locations are output.

9. A script text review and optimization method based on semantic AI processing according to claim 1, characterized in that, The process of generating optimized candidate text fragments based on the final re-encoded semantic vector sequence and the final set of abnormal fragment positions, backfilling them into the structured script text sequence, and outputting a review result report specifically includes: Based on the final set of abnormal fragment locations, the corresponding original text fragments and context fragments are extracted from the structured script text sequence to form a set of original text fragments and a set of context fragments. For each anomalous fragment in the final set of anomalous fragment locations, the final re-encoded semantic information, the original text content, and the context content corresponding to the anomalous fragment are obtained in sequence, and the text generation model forms an optimized candidate text fragment set. The optimized candidate text content in the optimized candidate text fragment set is matched and replaced with the corresponding position in the structured script text sequence to obtain the optimized script text. Based on the final set of abnormal fragment locations, the updated abnormal confidence mapping, and the optimized set of candidate text fragments, a review result report is generated.