Text generation system and method based on visual topology and color orthogonal modulation
By using a text generation system based on visual topology and orthogonal color modulation, the problems of logical coherence and style control in digital media content generation have been solved, achieving the generation of digital media content with high logical rigor and rich style.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEBEI GEOLOGICAL STAFF UNIV
- Filing Date
- 2026-05-18
- Publication Date
- 2026-07-03
Smart Images

Figure CN122334293A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language generation technology, and in particular to a text generation system and method based on visual topology and color orthogonal modulation. Background Technology
[0002] Natural Language Generation (NLP) technology, a core branch of artificial intelligence and computational linguistics, aims to construct algorithmic models capable of transforming non-linguistic data, semantic representations, logical representations, and structured contexts from knowledge graphs into natural language text that conforms to human language logic and grammatical norms. The technology extends beyond basic text output to include scriptwriting, description generation, and cross-modal instruction translation within the context of digital media. Its core logic lies in achieving automated transformation from raw input to structured media narrative text through the construction of semantic understanding models, sequence generation algorithms, knowledge graph topological mapping, and probability distribution matching, providing core logical support and semantic guidance for subsequent digital media entity construction.
[0003] The visual topology and color orthogonal modulation-based text generation system is specifically an integrated deep learning architecture, knowledge graph logical reasoning engine, and automated decision-making logic digital data processing platform. The solution aims to address the technical bottlenecks of low content production efficiency, poor logical consistency, and excessive reliance on intervention in digital media creation. By deploying the system, it achieves precise matching of digital media materials, knowledge graph entity nodes, and semantic logic, significantly improving the automation and response speed of content generation. This ensures the maintenance of narrative logic rigor and content diversity in large-scale generation tasks, thereby reducing digital production costs and constructing an efficient output process that can autonomously complete the process from conception to digital entity mapping based on user needs.
[0004] Existing technologies for generating digital media content primarily rely on deep neural networks to fit the probability distribution of large-scale corpora, focusing on capturing statistical patterns between word sequences rather than deep semantic logic structures. When faced with generating long scripts and complex storyboards, the lack of explicit modeling of the topological relationships between key entities such as characters, locations, and props makes it difficult for the models to maintain logical coherence over long distances. This often results in unclear entity references, attribute conflicts, and omissions of key plot points. Traditional sequence generation algorithms often employ implicit memory mechanisms based on hidden states during the decoding process, failing to accurately capture the dynamic evolution of entity relationships as the narrative progresses, leading to inconsistencies in the generated content. Stagnation in the development of relationships between objects and abrupt shifts that contradict the initial setup severely impact narrative credibility. In existing technologies, content semantic features and style-emotional features typically exist in the same high-dimensional vector space in a highly coupled form. The lack of effective feature decoupling and orthogonal control means makes it easy to interfere with the original core semantic expression when attempting to adjust the language style and emotional tone of the generated text. This results in a dual dilemma of content distortion and insignificant style transfer effects. The lack of a comprehensive assessment of the global energy and logical rationality of the generation path leads to inherent defects in the produced text, such as repetitive and verbose logical deadlocks and a lack of diversity. This makes it difficult to meet the stringent requirements of professional-grade digital media creation for content accuracy and innovation. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and to propose a text generation system and method based on visual topology and color orthogonal modulation.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a text generation system based on visual topology and color orthogonal modulation includes:
[0007] Entity graph modeling module: Based on the script text storage file and script index table, it reads paragraph number, scene number and line number and concatenates them in sequence. After locating the character name, location name and prop name in the concatenated text, it completes the mapping. Based on the sentence segment window, it counts the number of times entities co-occurs to obtain the entity topology graph.
[0008] Relationship Evolution Driven Module: Based on the entity topology graph, read the weight matrix corresponding to the generation time step and prune the entity index rows and columns, perform weight fusion on the pruning results and update the connection strength, determine the connection retention and removal according to the fusion value and form a relationship that changes over time, and generate a dynamic graph relationship matrix;
[0009] State consistency constraint module: Based on the dynamic graph relationship matrix, the node state vector is generated by calculating the node association weight through the graph neural network. The node relevance is matched in the generated hidden state and participating nodes are selected. The selection results are written into the generation context and the proportion is adjusted according to the difference value. The entity consistency context vector is output.
[0010] Style Orthogonal Modulation Module: Based on the entity consistency context vector, the correlation between the content vector and the style vector is calculated by the support vector machine and compared with a threshold. When the correlation exceeds the limit, the update direction is adjusted. Modulation parameters are generated from the style vector and context merging is completed to construct the style control context vector.
[0011] Energy-oriented generation module: Based on the style control context vector and the entity consistency context vector, the module expands the path of the candidate lexical sequence and accumulates the evaluation value. In the multi-path, the module selects and retains branches according to the energy value, writes the selected lexical into the output sequence, and obtains digital media generated content.
[0012] As a further aspect of the present invention, the entity topology map includes located character name data items, location name data items, item name data items, and statistical entity co-occurrence frequency values; the dynamic graph relationship matrix includes updated connection strength values, connection retention flags determined based on fusion values, and connection removal flags; the entity consistency context vector includes generated node state vector data items, selected participating node data items, written generation context data, and node proportion values adjusted based on difference values; the style control context vector includes generated modulation parameter sets, content vector data items, and style vector data items; and the digital media generated content includes selected lexical items corresponding to the filtered and retained branches, accumulated evaluation values, and written output sequence text.
[0013] As a further aspect of the present invention, the entity graph modeling module includes:
[0014] The script structure organization submodule reads paragraph numbers, scene numbers, and dialogue numbers from the script text storage file and script index table and concatenates them in order. It scans the concatenated text to locate character names, location names, and prop names, merges pointers with the same name and writes them to the entity mark position to form a unified annotation structure and obtain the entity-annotated script text.
[0015] Entity association construction submodule: Based on the entity annotation script text, count the number of times entities appear simultaneously in the sentence segment window, record the order interval of entity appearance and write it into the counting matrix, filter non-zero counts to establish entity connection items, summarize the connection items to generate the overall association structure, and generate an entity topology map.
[0016] As a further aspect of the present invention, the relation evolution driving module includes:
[0017] The weight fusion submodule, based on the entity topology map, reads the weight matrix corresponding to the generated time step, locates the entity index order, trims the corresponding rows and columns and extracts the effective weight units, maps the connection record of the previous time step, corrects the current weight value range, overwrites the original connection values and writes the update result, and generates a connection strength distribution matrix.
[0018] Relationship determination submodule: Based on the connection strength distribution matrix, scan matrix cells and read connection values, match threshold entries and write connection retention and removal flags, reorganize the entity connection record order, summarize the time step relationship status and write it into the relationship storage structure, and establish a dynamic graph relationship matrix.
[0019] As a further aspect of the present invention, the state consistency constraint module includes:
[0020] Weight mapping submodule: Based on the dynamic graph relation matrix, combined with the propagation mechanism of the graph neural network on the node association structure, it reads the node association weight values and locates the node index order, collects the valid association items and rearranges the weight storage position, passes the correct weight mapping relationship through the connection relationship between nodes, writes it into the node record structure, and generates the node state vector.
[0021] Node filtering submodule: Based on the node state vector, read and generate hidden state data and match node identifier positions, extract relevance values and sort and truncate them, retain node items that meet the participation conditions, write them into the generated cache structure, and obtain the set of participating nodes;
[0022] Context Allocation Submodule: Based on the set of participating nodes, it maps node identifiers to context positions and assigns node proportion values. After correcting the impact of difference values, it updates the context representation content, writes it into the context storage structure, and outputs an entity-consistent context vector.
[0023] As a further embodiment of the present invention, the graph neural network constructs a node connection structure through a dynamic graph relation matrix, reads the node index and the corresponding associated weight value, writes the node state into the node record structure, transmits numerical information between nodes according to the connection relationship, performs aggregation processing on the adjacent node states and updates the node state values, and writes the updated node states back into the node record structure in the order of the node index.
[0024] As a further aspect of the present invention, the style orthogonal modulation module includes:
[0025] Related evaluation submodule: Based on the entity consistency context vector, a support vector machine is introduced to perform interval judgment processing on the vector pairs composed of content vector and style vector, extract the data items of content vector and style vector and locate the vector index position, complete the numerical correspondence by taking the value bit by bit, collect the matching values and write them into the comparison record, and then perform threshold table item comparison and labeling to obtain the relevance judgment mark.
[0026] Parameter generation submodule: Based on the correlation determination marker, read style vector data items, use marker state to distinguish update paths, divide the data items required for modulation by numerical splitting and write them into the modulation record structure to complete parameter organization and obtain the modulation parameter set;
[0027] Context merging submodule: Based on the modulation parameter set, generate feature distribution data items, perform scaling and translation processing by writing bit by bit, merge feature distribution and entity consistency context vector positions, and construct style control context vector.
[0028] As a further aspect of the present invention, the support vector machine reads the vector pairs formed by the content vector and the style vector, constructs a joint representation according to the vector index order, maps the vector pairs to the decision space, calculates the interval value between the vector pairs and the interface in the space, writes the interval value into the comparison record structure, performs interval labeling on the interval value according to a preset threshold, outputs the corresponding decision label and writes it into the label storage structure.
[0029] As a further aspect of the present invention, the energy-directed generation module includes:
[0030] Path expansion submodule: Based on the style control context vector and the entity consistency context vector, read the candidate lexical sequence, expand the lexical item at the current generation position and construct a continuous generation path structure, record the corresponding evaluation value by accumulating along the path, write it into the path record structure, and generate a path energy evaluation table;
[0031] Lexical writing submodule: Based on the path energy evaluation table, read the numerical items corresponding to multiple paths and compare the numerical order between paths, select the lexical positions corresponding to the retained paths, and write them into the output sequence cache in the generation order to form continuous text content, thereby obtaining digital media generated content.
[0032] The text generation method based on visual topology and color orthogonal modulation, which is executed based on the aforementioned text generation system based on visual topology and color orthogonal modulation, includes the following steps:
[0033] S1: Based on the script text storage file and script index table, read and concatenate paragraph, scene and dialogue numbers, locate characters, locations and prop names in the text and complete the mapping, count the number of times entities co-occur through the sentence segment window, and establish an entity topology map containing nodes and connection relationships.
[0034] S2: Based on the entity topology graph, read the generated time step weight matrix and trim the entity index rows and columns. Perform weight fusion on the trimming result and update the connection strength. Determine the connection retention and removal status based on the fusion value to form a relationship that changes over time and generate a dynamic graph relationship matrix.
[0035] S3: Based on the dynamic graph relationship matrix, the node state vector is generated by calculating the node association weight through the graph neural network, the hidden state node relevance is matched and the participating nodes are selected, the results are written into the generation context and the proportion is adjusted according to the difference value, and the entity consistency context vector is output.
[0036] S4: Based on the entity consistency context vector, the correlation between the content vector and the style vector is calculated by the support vector machine and compared with the threshold. When the correlation exceeds the limit, the update direction is adjusted. Modulation parameters are generated from the style vector and context merging is completed to construct the style control context vector.
[0037] S5: Based on the style control context vector and the entity consistency context vector, the candidate lexical sequence path is expanded and the evaluation value is accumulated. In the multi-path, the branch is selected and retained according to the energy value. The selected lexical is written into the output sequence to obtain digital media generated content.
[0038] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0039] In this invention, node state vectors are generated by calculating node association weights through graph neural networks, which can transform discrete narrative elements into dynamic graph structures with temporal evolution characteristics. This effectively overcomes the problems of logical discontinuity and forgetting entity relationships faced by traditional linear sequence models when processing long digital media content, ensuring that character interactions and plot progression in the generated text always follow strict topological constraints, and significantly improving narrative coherence and structural integrity.
[0040] In this invention, by introducing a support vector machine to calculate the correlation between content vectors and style vectors and adjusting the update direction when the limit is exceeded, an orthogonal feature decoupling mechanism is used to generate independent modulation parameters to merge and control the context. Combined with an energy-oriented path expansion strategy, candidate word sequences are evaluated and screened through multi-path accumulation. This enables precise control of the emotional color and language style of the generated content without interfering with the core semantic expression, and avoids the risks of repeated deadlock and semantic drift in the generation process.
[0041] In this invention, the candidate lexical sequence is extended by style control context vector and entity consistency context vector and the evaluation value is accumulated. In the multi-path, the branch is selected and retained according to the energy value and the selected lexical is written into the output sequence. This effectively avoids the phenomenon of repeated loops and logical deadlock in the generation process, thereby producing digital media content with both high logical rigor and rich style expression. Attached Figure Description
[0042] Figure 1 This is a system flowchart of the present invention;
[0043] Figure 2 This is a schematic diagram of the method steps of the present invention. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0045] Example 1
[0046] Please see Figure 1 The present invention provides a technical solution: a text generation system based on visual topology and color orthogonal modulation includes.
[0047] Entity graph modeling module: Based on the script text storage file and script index table, it reads paragraph number, scene number and line number and concatenates them in sequence. After locating the character name, location name and prop name in the concatenated text, it completes the mapping. Based on the sentence segment window, it counts the number of times entities co-occurs to obtain the entity topology graph.
[0048] Relationship Evolution Driven Module: Based on the entity topology graph, it reads the weight matrix corresponding to the generation time step and prunes the entity index rows and columns. It performs weight fusion on the pruning results and updates the connection strength. Based on the fusion value, it determines whether to retain or remove connections and forms a relationship that changes over time, generating a dynamic graph relationship matrix.
[0049] State consistency constraint module: Based on the dynamic graph relation matrix, the node state vector is generated by calculating the node association weight through the graph neural network. The node relevance is matched in the generated hidden state and participating nodes are selected. The selection results are written into the generation context and the proportion is adjusted according to the difference value. The entity consistency context vector is output.
[0050] Style Orthogonal Modulation Module: Based on entity consistency context vector, the correlation between content vector and style vector is calculated by support vector machine and compared with a threshold. When the correlation exceeds the threshold, the update direction is adjusted. Modulation parameters are generated from style vector and context merging is completed to construct style control context vector.
[0051] Energy-oriented generation module: Based on style control context vector and entity consistency context vector, it expands the path of candidate word sequence and accumulates evaluation values. In the multi-path, it selects and retains branches according to energy values, writes the selected words into the output sequence, and obtains digital media generated content.
[0052] The entity topology map includes the location name data items, location name data items, item name data items, and the statistical entity co-occurrence frequency value. The dynamic graph relationship matrix includes the updated connection strength value, the connection retention flag determined based on the fusion value, and the connection removal flag. The entity consistency context vector includes the generated node state vector data items, the selected participating node data items, the written generation context data, and the node proportion value adjusted based on the difference value. The style control context vector includes the generated modulation parameter set, content vector data items, and style vector data items. The digital media generated content includes the selected lexical items corresponding to the filtered and retained branches, the accumulated evaluation value, and the written output sequence text.
[0053] The entity graph modeling module includes:
[0054] The script structure organization submodule reads paragraph numbers, scene numbers, and dialogue numbers from the script text storage file and script index table and concatenates them in order. It scans the concatenated text to locate character names, location names, and prop names, merges pointers with the same name and writes them to the entity mark position to form a unified annotation structure and obtain the entity-annotated script text.
[0055] Entity association construction submodule: Based on entity annotation script text, count the number of times entities appear simultaneously in the sentence segment window, record the order interval of entity appearance and write it into the counting matrix, filter non-zero counts to establish entity connection items, summarize connection items to generate the overall association structure, and generate entity topology map.
[0056] The script structure organization submodule, based on the script text storage file and script index table, uses a data serialization processing algorithm to read the paragraph number data column, the scene number data column, and the dialogue number data column. It converts the numerical numbers to string data, sets the connector to a space character, and performs horizontal linear concatenation of the three columns of data according to row index order, generating a concatenated text sequence containing structured numbering information. Using a pre-trained transformer model with a batch processing pipeline size parameter of 32, it scans the concatenated text sequence in batch processing mode. It calls the model's built-in named entity recognition algorithm to identify character name tags, location name tags, and prop name tags in the text stream, locating the start and end character index positions of character names, location names, and prop names in the text stream. Applying a pronoun reference resolution algorithm with a greedy search threshold parameter of 0.55, it scans the pronoun reference chain in the text, mapping personal pronouns back to subject entities in the named entity list. It performs a text replacement operation from pronouns to normalized entity names, iterates through the replaced text to record the character index offset of each entity's occurrence position, constructs a dictionary object list containing entity categories, entity names, and index positions, and generates entity-annotated script text.
[0057] The entity association construction submodule, based on entity-annotated script text, uses a sliding window statistical algorithm to define the window size parameter as 5 sentence units. It initializes a two-dimensional counting array of all-zero values as the counting matrix, setting the number of rows and columns of the array to equal the total number of unique entities. The sliding step size is set to 1. The window moves along the text sequence, traversing all entity pairs within each window view. It detects cases where the first and second entities simultaneously exist within the current window's sentence segment range, incrementing the corresponding row and column index values in the counting matrix by 1. It records the relative position difference between the two entities within the window and appends this difference to the interval list. After traversing all windows, it applies a minimum-maximum scaling algorithm, setting the feature range parameter to 0 to 1. It performs normalization calculations on the frequency values in the counting matrix, sets a filtering threshold of 0.1, and filters non-zero elements in the counting matrix whose normalized values are greater than the threshold. It extracts the corresponding row and column indices as graph connection edges, uses the normalized values as edge weight attributes, calls a graph structure construction algorithm to instantiate graph objects, batch adds node connection relationships and weight attributes, and generates an entity topology graph.
[0058] The relation evolution driving module includes:
[0059] The weight fusion submodule, based on the entity topology map, reads the weight matrix corresponding to the generated time step, locates the entity index order, trims the corresponding rows and columns and extracts the effective weight units, maps the connection records of the previous time step, corrects the current weight value range, overwrites the original connection values and writes the update results, and generates a connection strength distribution matrix.
[0060] Relationship determination submodule: Based on the connection strength distribution matrix, scan matrix cells and read connection values, match threshold entries and write connection retention and removal flags, reorganize the entity connection record order, summarize the relationship status of time steps and write it into the relationship storage structure, and establish a dynamic graph relationship matrix;
[0061] The weight fusion submodule, based on the entity topology graph, uses a tensor slicing algorithm to read the numerical matrix output by the multi-head self-attention layer of the current generation time step transformer model. It constructs an index list based on the index positions of entity nodes in the vocabulary, and uses this list to perform row and column dimension index extraction operations on the full attention matrix. It then prunes and retains a submatrix containing only the interaction values between entities, extracting the floating-point value of each unit in the submatrix as an effective weight unit. An exponential moving average algorithm is applied with a smoothing factor of 0.7. The graph connection weight values stored in the previous time step are read as historical terms, and the current effective weight unit values are used as observation terms. Weighted linear interpolation is performed, multiplying the historical terms by 0.7 and adding the observation terms multiplied by 0.3 to obtain the fused weight value. A numerical truncation algorithm is used to set a lower threshold of 0.0 and an upper threshold of 1.0, performing range constraints on the fused weight value to ensure it falls within the effective probability interval. The corrected values are then overwritten to the corresponding coordinate positions in the original adjacency matrix to generate a connection strength distribution matrix.
[0062] The relationship determination submodule, based on the connection strength distribution matrix, employs a dual-threshold determination algorithm with a preset retention threshold of 0.6 and a preset removal threshold of 0.2. It iterates through the floating-point values of each cell in the scan matrix in row-major order, reads the connection strength value at the current coordinate, and executes conditional branch judgment logic. When the connection strength value is greater than or equal to 0.6, it writes a binary value of 1 to the connection status register as a connection retention flag; when the connection strength value is less than or equal to 0.2, it writes a binary value of 0 to the connection status register as a connection removal flag. For values between 0.2 and 0.6, the previous state remains unchanged. A sparse matrix compression algorithm is used to read the row and column indices of all non-zero connection states, reorganizes the entity connection record order according to the starting node index size, appends the complete connection list of the current time step to the time dimension slice of the three-dimensional tensor storage object, summarizes the network topology state data at each time step, and establishes a dynamic graph relationship matrix.
[0063] The state consistency constraint module includes:
[0064] The weight mapping submodule is based on a dynamic graph relation matrix and combines the propagation mechanism of the node association structure of the graph neural network. It reads the node association weight values and locates the node index order. After collecting the valid association items, it rearranges the weight storage position, passes the correct weight mapping relationship through the connection relationship between nodes, writes it into the node record structure, and generates the node state vector.
[0065] The node filtering submodule reads and generates hidden state data based on the node state vector, matches the node identifier position, extracts the relevance value, sorts and truncates it, retains the node items that meet the participation conditions, writes them into the generated cache structure, and obtains the set of participating nodes.
[0066] Context Allocation Submodule: Based on the set of participating nodes, it maps node identifiers to context positions and assigns node proportion values. After correcting the impact of difference values, it updates the context representation content, writes it into the context storage structure, and outputs an entity-consistent context vector.
[0067] The weight mapping submodule, based on the dynamic graph relation matrix, uses a graph convolutional network propagation algorithm with a network layer count of 2 and a hidden unit dimension of 256. It reads the floating-point values of non-zero elements in the dynamic graph relation matrix as edge weights, locates the source node by row index and the target node by column index, applies sparse matrix multiplication to perform a dot product operation between the adjacency matrix and the node feature matrix, gathers the feature vectors of all adjacent nodes to the target node, calls a non-linear activation function to perform an element-wise transformation on the aggregated feature vector using the hyperbolic tangent function, rearranges the memory addresses of the transformed feature vectors according to the corresponding node index order, passes and accumulates the corrected feature values through inter-node connections, and finally writes the calculated feature tensor row-wise into the node record structure to generate the node state vector.
[0068] Node filtering submodule: Based on the node state vector, the cosine similarity matching algorithm is used to read the generated hidden state data of the current decoding time step as the query vector. The node state vector is used as the key vector set. The dot product operation is performed on each key vector and divided by the product of its respective modulus. The calculation result is extracted as the relevance value. The quick sorting algorithm is applied to sort the relevance values in descending order. The truncation parameter K is set to 5. The top 5 node indices with the largest values are truncated from the sorting results. The node feature data corresponding to the index is retained as the node items that meet the participation conditions. The filtered feature data is written to the high-speed cache area to obtain the set of participating nodes.
[0069] The context allocation submodule, based on the set of participating nodes, employs a multi-head attention mechanism with a parameter of 4 attention heads. It maps the feature vectors in the set of participating nodes to key and value matrices, maps the current decoded hidden state to a query matrix, calculates the dot product of the query matrix and key matrix and divides it by a scaling factor of 8, performs a normalization function on the calculation result, assigns a probability percentage value for each node in the current context, performs a weighted summation operation on the value matrix using the probability percentage value, calculates the difference vector between the weighted sum and the original hidden state, updates the context representation content using the difference vector, writes the updated high-dimensional vector into the context storage structure, and outputs an entity-consistent context vector.
[0070] Graph neural networks construct node connection structures through dynamic graph relation matrices, read node indices and corresponding associated weight values, write node states into node record structures, transmit numerical information between nodes according to connection relationships, perform aggregation processing on adjacent node states and update node state values, and write the updated node states back into node record structures in node index order.
[0071] Graph neural networks, according to the formula:
[0072]
[0073] in: For the target node at the th The updated state vector of the layer This is the index identifier for the target node. This is the layer index of the neural network. It is a non-linear activation function. For adaptive residual connection parameters, For the target node In the The original state vector of the layer, For the target node The set of neighboring nodes, This serves as the index identifier for neighboring nodes. This represents the mutual trust weight for entity types, where `type` is the index identifier of the entity's category. This is the dynamic time decay factor, where time is the index of the time step. Here, represents the semantic consistency gating coefficient, and 'gate' is the index identifier for the gating mechanism. The target node read from the dynamic graph relation matrix with neighboring nodes Normalized correlation weights between them For the first The learnable weight transformation matrix of the layer, For neighboring nodes In the The layer's input state vector;
[0074] Execution process: First, read the target node. On the upper floor The original state vector The variance of the node feature vectors is calculated and compared with a preset smoothing threshold to determine the adaptive residual connection parameters. The specific value is then determined by traversing the target node. The set of neighboring nodes For each neighbor node Read the input state vector And using the weight transformation matrix Perform linear feature transformation and introduce a dynamic time decay factor. ,factor This is obtained by calculating the exponential decay function of the difference between the current generation time step and the entity's last co-occurrence time step, used to reduce the weight of outdated historical information, while also introducing entity type mutual trust weights. Weight By querying the nodes in the preset entity category co-occurrence probability matrix Category and Node The mutual trust value of the category is determined to strengthen logically reasonable entity interactions, and a semantic consistency gating coefficient is further introduced. ,coefficient By calculating the state vectors of neighboring nodes The cosine similarity to the hidden state vector generated by the current decoder is used to filter noise irrelevant to the current context. The system incorporates these three innovative parameters. Normalized association weights read from the dynamic graph relation matrix Multiplying the reciprocals of the terms together yields a comprehensive adjustment coefficient. This coefficient is then used to perform a weighted summation and aggregation of the transformed neighbor node features. Finally, the aggregated neighbor information is combined with the parameters... Weighted original information is used to perform residual fusion, and a nonlinear activation function is applied. The process is performed to ultimately generate the target node. In the Update the state vector of the layer .
[0075] The style orthogonal modulation module includes:
[0076] The relevant evaluation submodule: Based on the entity consistency context vector, the support vector machine is introduced to perform interval judgment processing on the vector pairs composed of content vector and style vector, extract the data items of content vector and style vector and locate the vector index position, complete the numerical correspondence by taking the value bit by bit, collect the matching values and write them into the comparison record, and then perform threshold table item comparison and labeling to obtain the relevance judgment mark.
[0077] The parameter generation submodule reads style vector data items based on relevance determination labels, distinguishes update paths using label states, divides the data items required for modulation through numerical splitting, and writes them into the modulation record structure to complete parameter organization and obtain the modulation parameter set.
[0078] Context merging submodule: Based on the modulation parameter set, the generated feature distribution data items are obtained. The scaling and translation processing is completed by writing bit by bit. The feature distribution and entity consistency context vector positions are merged to construct the style control context vector.
[0079] The relevant evaluation submodule: Based on the entity consistency context vector, the kernel function is set to Gaussian radial basis function using the support vector machine kernel function mapping algorithm, and the penalty factor parameter is set to 1.0. The current entity consistency context vector is read as the content vector sample, and the preset style target vector is read as the style vector sample. The two are mapped to the infinite-dimensional Hilbert feature space, and the Euclidean distance between two points in the space is calculated. The geometric margin judgment algorithm is applied to calculate the vertical projection distance from the mapped point to the optimal classification hyperplane. The distance value is extracted as the judgment basis. The threshold constant of the preset orthogonal threshold table is read using numerical comparison logic. The calculated distance value is compared bit by bit with 0.5. If the distance value is less than 0.5, it is marked as a relevant state. If it is greater than or equal to 0.5, it is marked as an orthogonal state. The binary judgment result is written to the status register to obtain the relevance judgment mark.
[0080] The parameter generation submodule, based on the relevance determination label, uses a multilayer perceptron mapping network with two fully connected layers, each containing 512 neurons. It reads style vector data as the input tensor, selects the forward propagation path based on the relevance determination label state value, and activates a gradient inversion layer to invert the gradient of the input tensor when the label is in a relevant state. When the label is orthogonal, the gradient direction remains unchanged. Matrix multiplication and bias addition are performed, and the neuron output is processed using a modified linear unit function with an activation function. The final 512-dimensional feature vector is sliced according to the channel dimension, with the first 256 dimensions used as a scaling factor and the last 256 dimensions as a translation factor. These two sets of factors are written into different memory address blocks of the modulation record structure to obtain the modulation parameter set.
[0081] The context merging submodule, based on the modulation parameter set, uses an adaptive instance normalization algorithm to read the current entity consistency context vector, calculates the mean and variance statistics of the vector in the channel dimension, performs standardization to transform the vector into a zero-mean unit variance distribution, reads the scaling factor and translation factor from the modulation parameter set, performs an affine transformation operation on the standardized vector, multiplies each element value of the vector by the scaling factor of the corresponding channel and adds the translation factor of the corresponding channel, performs a bit-by-bit write operation to overwrite the transformation result to the original vector storage location, completes the feature distribution reconstruction, and constructs the style control context vector.
[0082] Support Vector Machine (SVM) reads vector pairs formed by content vectors and style vectors, constructs a joint representation according to the vector index order, maps the vector pairs to the decision space, calculates the interval value between the vector pair and the boundary in the space, writes the interval value into the comparison record structure, performs interval labeling on the interval value according to the preset threshold, outputs the corresponding decision label and writes it into the label storage structure.
[0083] The energy-directed generation module includes:
[0084] The path expansion submodule reads candidate lexical sequences based on style control context vectors and entity consistency context vectors, expands the lexical items at the current generation position and constructs a continuous generation path structure, records the corresponding evaluation values by accumulating them along each path, writes them into the path record structure, and generates a path energy evaluation table.
[0085] Lexical writing submodule: Based on the path energy evaluation table, read the numerical items corresponding to multiple paths and compare the numerical order between paths, select the lexical positions corresponding to the retained paths, and write them into the output sequence cache in the generation order to form continuous text content, thus obtaining digital media generated content;
[0086] The path expansion submodule, based on style control context vectors and entity consistency context vectors, initializes the root node state of the search tree using the Monte Carlo tree search algorithm, sets the simulation loop count to 50, calls the transformer neural network decoder to calculate the probability distribution of the full vocabulary at the current time step, applies the top K-item sampling strategy with a sampling quantity of 10, selects the top 10 words with the highest probability values as leaf node candidates, expands the word items at the current generation position and constructs a tree-like continuous generation path structure, calls the energy function to evaluate the model for each expanded leaf node, sets the look-ahead prediction step count to 5, uses a lightweight recurrent neural network to quickly generate a simulated sequence of the next 5 words, calculates the negative log-likelihood probability of the simulated sequence as the fluency energy item, calculates the cosine distance between the simulated sequence and the entity consistency context vector as the logical constraint energy item, sets the weighted balance coefficient to 0.8, performs a weighted summation operation on the two values to obtain the total path energy value, records the corresponding evaluation values by accumulating them along the path and stores the results in the node attribute table, generating a path energy evaluation table;
[0087] The lexical writing submodule, based on the path energy evaluation table, uses the upper confidence bound selection algorithm with the exploration constant parameter set to 1.414. It traverses all child nodes at the first level of the search tree, reads the numerical items corresponding to multiple paths, including the average energy value and the access count value of the node, substitutes them into the upper confidence bound calculation formula to calculate the comprehensive score of each node, executes the numerical sorting logic to compare the numerical order between paths, selects the node with the best comprehensive score value as the lexical position corresponding to the reserved path, extracts the lexical encoding index corresponding to the node, writes it into the output sequence cache area in the generation order to form continuous text content, calls the tree state update function to move the root node pointer of the search tree to the selected node position and releases the remaining branch memory space to obtain the digital media generated content.
[0088] Please see Figure 2 The text generation method based on visual topology and color orthogonal modulation includes the following steps:
[0089] S1: Based on the script text storage file and script index table, read and concatenate paragraph, scene and dialogue numbers, locate characters, locations and prop names in the text and complete the mapping, count the number of times entities co-occur through the sentence segment window, and establish an entity topology map containing nodes and connection relationships.
[0090] S2: Based on the entity topology graph, read the generated time step weight matrix and trim the entity index rows and columns. Perform weight fusion on the trimming result and update the connection strength. Determine the connection retention and removal status based on the fusion value to form a relationship that changes over time and generate a dynamic graph relationship matrix.
[0091] S3: Based on the dynamic graph relation matrix, the node state vector is generated by calculating the node association weight through the graph neural network, the hidden state node relevance is matched and the participating nodes are selected. The results are written into the generation context and the proportion is adjusted according to the difference value. The entity consistency context vector is output.
[0092] S4: Based on the entity consistency context vector, the correlation between the content vector and the style vector is calculated by the support vector machine and compared with the threshold. When the correlation exceeds the limit, the update direction is adjusted. Modulation parameters are generated from the style vector and the context is merged to construct the style control context vector.
[0093] S5: Based on style control context vector and entity consistency context vector, the candidate word sequence path is expanded and the evaluation value is accumulated. In the multi-path, the branch is selected and retained according to the energy value. The selected word is written into the output sequence to obtain digital media generated content.
[0094] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A text generation system based on visual topology and color orthogonal modulation, characterized in that, The system includes: Entity graph modeling module: Based on the script text storage file and script index table, it reads paragraph number, scene number and line number and concatenates them in sequence. After locating the character name, location name and prop name in the concatenated text, it completes the mapping. Based on the sentence segment window, it counts the number of times entities co-occurs to obtain the entity topology graph. Relationship Evolution Driven Module: Based on the entity topology graph, read the weight matrix corresponding to the generation time step and prune the entity index rows and columns, perform weight fusion on the pruning results and update the connection strength, determine the connection retention and removal according to the fusion value and form a relationship that changes over time, and generate a dynamic graph relationship matrix; State consistency constraint module: Based on the dynamic graph relationship matrix, the node state vector is generated by calculating the node association weight through the graph neural network. The node relevance is matched in the generated hidden state and participating nodes are selected. The selection results are written into the generation context and the proportion is adjusted according to the difference value. The entity consistency context vector is output. Style Orthogonal Modulation Module: Based on the entity consistency context vector, the correlation between the content vector and the style vector is calculated by the support vector machine and compared with a threshold. When the correlation exceeds the limit, the update direction is adjusted. Modulation parameters are generated from the style vector and context merging is completed to construct the style control context vector. Energy-oriented generation module: Based on the style control context vector and the entity consistency context vector, the module expands the path of the candidate lexical sequence and accumulates the evaluation value. In the multi-path, the module selects and retains branches according to the energy value, writes the selected lexical into the output sequence, and obtains digital media generated content.
2. The text generation system based on visual topology and color orthogonal modulation according to claim 1, characterized in that, The entity topology map includes location name data items, place name data items, item name data items, and statistical entity co-occurrence frequency values. The dynamic graph relationship matrix includes updated connection strength values, connection retention flags determined based on fusion values, and connection removal flags. The entity consistency context vector includes generated node state vector data items, selected participating node data items, written generation context data, and node proportion values adjusted based on difference values. The style control context vector includes generated modulation parameter sets, content vector data items, and style vector data items. The digital media generated content includes selected lexical items corresponding to the filtered and retained branches, accumulated evaluation values, and written output sequence text.
3. The text generation system based on visual topology and color orthogonal modulation according to claim 1, characterized in that, The entity graph modeling module includes: The script structure organization submodule reads paragraph numbers, scene numbers, and dialogue numbers from the script text storage file and script index table and concatenates them in order. It scans the concatenated text to locate character names, location names, and prop names, merges pointers with the same name and writes them to the entity mark position to form a unified annotation structure and obtain the entity-annotated script text. Entity association construction submodule: Based on the entity annotation script text, count the number of times entities appear simultaneously in the sentence segment window, record the order interval of entity appearance and write it into the counting matrix, filter non-zero counts to establish entity connection items, summarize the connection items to generate the overall association structure, and generate an entity topology map.
4. The text generation system based on visual topology and color orthogonal modulation according to claim 1, characterized in that, The relationship evolution driving module includes: The weight fusion submodule, based on the entity topology map, reads the weight matrix corresponding to the generated time step, locates the entity index order, trims the corresponding rows and columns and extracts the effective weight units, maps the connection record of the previous time step, corrects the current weight value range, overwrites the original connection values and writes the update result, and generates a connection strength distribution matrix. Relationship determination submodule: Based on the connection strength distribution matrix, scan matrix cells and read connection values, match threshold entries and write connection retention and removal flags, reorganize the entity connection record order, summarize the time step relationship status and write it into the relationship storage structure, and establish a dynamic graph relationship matrix.
5. The text generation system based on visual topology and color orthogonal modulation according to claim 1, characterized in that, The state consistency constraint module includes: Weight mapping submodule: Based on the dynamic graph relation matrix, combined with the propagation mechanism of the graph neural network on the node association structure, it reads the node association weight values and locates the node index order, collects the valid association items and rearranges the weight storage position, passes the correct weight mapping relationship through the connection relationship between nodes, writes it into the node record structure, and generates the node state vector. Node filtering submodule: Based on the node state vector, read and generate hidden state data and match node identifier positions, extract relevance values and sort and truncate them, retain node items that meet the participation conditions, write them into the generated cache structure, and obtain the set of participating nodes; Context Allocation Submodule: Based on the set of participating nodes, it maps node identifiers to context positions and assigns node proportion values. After correcting the impact of difference values, it updates the context representation content, writes it into the context storage structure, and outputs an entity-consistent context vector.
6. The text generation system based on visual topology and color orthogonal modulation according to claim 1, characterized in that, The graph neural network constructs a node connection structure through a dynamic graph relation matrix, reads the node index and corresponding associated weight values, writes the node state into the node record structure, transmits numerical information between nodes according to the connection relationship, performs aggregation processing on the states of adjacent nodes and updates the node state values, and writes the updated node states back into the node record structure in the order of the node index.
7. The text generation system based on visual topology and color orthogonal modulation according to claim 1, characterized in that, The style orthogonal modulation module includes: Related evaluation submodule: Based on the entity consistency context vector, a support vector machine is introduced to perform interval judgment processing on the vector pairs composed of content vector and style vector, extract the data items of content vector and style vector and locate the vector index position, complete the numerical correspondence by taking the value bit by bit, collect the matching values and write them into the comparison record, and then perform threshold table item comparison and labeling to obtain the relevance judgment mark. Parameter generation submodule: Based on the correlation determination marker, read style vector data items, use marker state to distinguish update paths, divide the data items required for modulation by numerical splitting and write them into the modulation record structure to complete parameter organization and obtain the modulation parameter set; Context merging submodule: Based on the modulation parameter set, it generates feature distribution data items, performs scaling and translation processing by writing bit by bit, and performs feature distribution and entity consistency context vector position merging operation to construct style control context vector.
8. The text generation system based on visual topology and color orthogonal modulation according to claim 1, characterized in that, The support vector machine reads the vector pairs formed by the content vector and the style vector, constructs a joint representation according to the vector index order, maps the vector pairs to the decision space, calculates the interval value between the vector pairs and the interface in the space, writes the interval value into the comparison record structure, performs interval labeling on the interval value according to the preset threshold, outputs the corresponding decision label and writes it into the label storage structure.
9. The text generation system based on visual topology and color orthogonal modulation according to claim 1, characterized in that, The energy-directed generation module includes: Path expansion submodule: Based on the style control context vector and the entity consistency context vector, read the candidate lexical sequence, expand the lexical item at the current generation position and construct a continuous generation path structure, record the corresponding evaluation value by accumulating along the path, write it into the path record structure, and generate a path energy evaluation table; Lexical writing submodule: Based on the path energy evaluation table, read the numerical items corresponding to multiple paths and compare the numerical order between paths, select the lexical positions corresponding to the retained paths, and write them into the output sequence cache in the generation order to form continuous text content, thereby obtaining digital media generated content.
10. A text generation method based on visual topology and color orthogonal modulation, characterized in that, The text generation system based on visual topology and color orthogonal modulation according to any one of claims 1-9 includes the following steps: S1: Based on the script text storage file and script index table, read and concatenate paragraph, scene and dialogue numbers, locate characters, locations and prop names in the text and complete the mapping, count the number of times entities co-occur through the sentence segment window, and establish an entity topology map containing nodes and connection relationships. S2: Based on the entity topology graph, read the generated time step weight matrix and trim the entity index rows and columns. Perform weight fusion on the trimming result and update the connection strength. Determine the connection retention and removal status based on the fusion value to form a relationship that changes over time and generate a dynamic graph relationship matrix. S3: Based on the dynamic graph relationship matrix, the node state vector is generated by calculating the node association weight through the graph neural network, the hidden state node relevance is matched and the participating nodes are selected, the results are written into the generation context and the proportion is adjusted according to the difference value, and the entity consistency context vector is output. S4: Based on the entity consistency context vector, the correlation between the content vector and the style vector is calculated by the support vector machine and compared with the threshold. When the correlation exceeds the limit, the update direction is adjusted. Modulation parameters are generated from the style vector and context merging is completed to construct the style control context vector. S5: Based on the style control context vector and the entity consistency context vector, the candidate lexical sequence path is expanded and the evaluation value is accumulated. In the multi-path, the branch is selected and retained according to the energy value. The selected lexical is written into the output sequence to obtain digital media generated content.