Document intelligent writing and analysis system based on knowledge graph
By dynamically updating the knowledge graph and entity recognition, the document structure is optimized, and the problem of insufficient processing capabilities of the static knowledge base is solved, the synchronization of document content and efficient information extraction is achieved, and the user experience and analysis efficiency is improved.
Patent Information
- Application Number
- CN202510522348.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-08-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology is limited by the static knowledge base and is difficult to deal with emerging topics and rapidly changing data environments, resulting in insufficient timeliness of document processing, limitations on new entity recognition and processing, affecting the breadth and depth of information extraction, poor document context connection, chaotic structure, low user experience and low efficiency.
The dynamic update module based on the knowledge graph is adopted to collect topic hot words and tag words through external data sources, expand the knowledge graph, the entity recognition and mapping module analyzes the distribution of noun phrases, the context connection module inserts synonymous entities, the semantic structure rearrangement module optimizes paragraph content, and the semantic coherence verification module ensures document consistency.
It realizes synchronization of document content and information trends, improves the accuracy of information extraction and the quality of context connection, optimizes the logical presentation of document structure, enhances reading experience and analysis efficiency, and reduces interpretation ambiguity.
Smart Images

Figure BDA0005374346330000031 
Figure BDA0005374346330000041 
Figure BDA0005374346330000042
Abstract
Description
Technical Field
[0001] The present invention relates to the field of document processing technology, and in particular to a document intelligent writing and analysis system based on knowledge graphs. Background Art
[0002] Document processing technology mainly involves various functions such as text generation, editing, storage and retrieval. It enhances the usability and accessibility of documents by utilizing methods such as natural language processing (NLP), machine learning, and artificial intelligence, making documents easier to create, modify, share and analyze. Document processing also includes functions such as converting document formats, extracting key information, automatic classification and indexing, and semantic analysis of content.
[0003] Among them, the knowledge graph document intelligent writing and analysis system is a system that combines knowledge graph and artificial intelligence technology to optimize document writing and content analysis. The system can automatically generate document content based on input data and existing knowledge base, and perform intelligent analysis on documents to extract key information and discover connections between texts. It has a wide range of uses, including automatic report generation, academic research, business intelligence analysis, etc.
[0004] Existing technologies are limited by processing frameworks that rely on static knowledge bases, making them difficult to cope with emerging topics and rapidly changing data environments, resulting in insufficient timeliness when processing new information and professional terminology. In addition, there are obvious limitations in the recognition and processing of new entities, which affects the breadth and depth of information extraction. Many systems lack effective dynamic adjustment mechanisms when processing the contextual connection of documents, resulting in poor fluency and coherence of automatically generated documents. Inaccurate structural rearrangement and semantic analysis also cause chaotic document structure and illogical information presentation, which reduces user experience and processing efficiency, and limits the performance of traditional systems in highly automated and intelligent application scenarios. Summary of the Invention
[0005] The purpose of this invention is to solve the shortcomings of the existing technology and propose a document intelligent writing and analysis system based on knowledge graph.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a document intelligent writing and analysis system based on knowledge graph, the system comprising:
[0007] The graph dynamic update module collects hot words and tags from social media and scientific articles based on external data sources, analyzes the relevance of these words to existing entities in the knowledge graph, updates and expands the existing knowledge graph, and obtains statistics for newly added entities.
[0008] The entity recognition and mapping module analyzes the occurrence frequency and field parameters of noun phrases in the text based on the newly added entity statistics, determines the distribution of the entity's first and last sentences in the text, and obtains the entity mapping weight;
[0009] The context cohesion analysis module calculates the overlap of keywords in adjacent paragraphs based on the entity mapping weights. If the overlap is less than the context cohesion threshold, the corresponding synonymous entity segment is inserted into the original paragraph, and the cohesion of the paragraph content is optimized through continuity analysis to obtain a paragraph connection index.
[0010] The semantic structure rearrangement module extracts gerund-noun pairings based on the paragraph connection index and the dependency relationship between the subject and the verb in the paragraph, calculates the length of the dependency path within the sentence and the co-occurrence frequency of nouns, scores the symmetry of the paragraph content according to the keyword, and rearranges the content based on the context dependency structure to obtain a structural shift index.
[0011] The improvements of the present invention are that the newly added entity statistics include entity recognition rate, new entity type, and entity integration; the entity mapping weights include weight classification, mapping accuracy, and entity relevance; the paragraph connection indicators include connection strength, cohesion improvement rate, and synonymous entity insertion effect; the structural deviation index includes content adjustment frequency, content symmetry improvement results, and dependency structure optimization degree.
[0012] The present invention is improved in that the graph dynamic update module includes:
[0013] The vocabulary collection submodule collects frequently appearing words, tags, and keyword phrases from social media texts and scientific articles in external data sources. It then monitors and extracts data on word frequency trends, source distribution, and time span. It then uses word frequency fluctuation benchmarks to determine which vocabulary samples meet the requirements and generate a hot word tag set.
[0014] The association calculation submodule calls the hot word tag set and analyzes the semantic association between the vocabulary and the existing knowledge graph entity nodes using the formula:
[0015]
[0016] Calculate the correlation score RG between vocabulary and entities, screen the entities and vocabulary requirements to be added, and generate a new entity mapping table, where SG ij represents the semantic similarity between vocabulary i and entity j, CG ij Indicates the frequency of co-occurrence of word i and entity j in the corpus, PG ij represents the depth of the structured path between vocabulary i and entity j, αr and βr are the adjustment weights corresponding to the parameters, γr is a constant to avoid the denominator being zero, and n rgis the total number of words, m rg is the total number of entities;
[0017] The entity expansion submodule constructs connections between the new entities and existing nodes of the knowledge graph based on the new entity mapping table, calculates connection weights and structural influences, updates and expands the existing knowledge graph, and obtains statistics of the new entities.
[0018] The present invention is improved in that the entity recognition and mapping module includes:
[0019] The frequency extraction submodule extracts noun phrases from the text based on the newly added entity statistics, the field parameters in the structured input data, and the paragraph text, analyzes the frequency of occurrence of each noun phrase in the entire text, and classifies them according to the field parameters to generate a text noun frequency quantity;
[0020] The distribution positioning submodule evaluates the sentence position distribution of each noun phrase based on the frequency of nouns in the text and the index positions of the first and last sentences of the noun phrase in the paragraph text, compares the results with the entity recognition threshold of the field parameter, selects qualified named entities, and generates a named entity positioning interval;
[0021] The weight calculation submodule analyzes the distribution frequency and the difference in the first and last positions of each qualified named entity in the text based on the named entity positioning interval, using the formula:
[0022]
[0023] Get the entity mapping weight value WS e , where n ws Represents the total number of named entities that meet the field parameter matching conditions, fs z Indicates the frequency of the zth named entity in the text, ps z is the sentence index where the zth named entity first appears in the text, qs z is the sentence index of the last occurrence of the z-th named entity in the text, es z represents the environmental variation coefficient of the z-th named entity.
[0024] The present invention is improved in that the context cohesion analysis module includes:
[0025] The overlap calculation submodule extracts keyword combinations from the paragraphs based on the entity mapping weight values, analyzes the frequency of occurrence of keywords in adjacent paragraphs, calculates the keyword overlap between each pair of paragraphs, and generates a paragraph keyword overlap;
[0026] The synonymous segment insertion submodule calls the paragraph keyword overlap degree to detect whether it is lower than the context cohesion threshold. If it is lower than the threshold, it extracts synonymous entity phrases corresponding to the low-overlap keywords from the text, and selects and inserts sentences that are close to the original text in terms of semantics and structure to obtain the number of synonymous entity supplementary paragraphs;
[0027] The paragraph connection optimization submodule supplements the paragraph quantity according to the synonymous entities, analyzes the coherence feature vectors of the inserted paragraph set, compares the coherence of the original and modified paragraphs, evaluates and optimizes the content connection between paragraphs, and obtains the paragraph connection index.
[0028] The present invention is improved in that the semantic structure rearrangement module includes:
[0029] The pairing extraction submodule analyzes the paragraph connection index based on the dependency relationship between the subject and the verb in the paragraph, identifies the direct dependency connection between the subject and its verb, and eliminates non-core adverbs and prepositions through grammatical rules to establish a set of gerund-noun combination pairs;
[0030] The path calculation submodule analyzes the dependency path length of each gerund in the sentence based on the gerund pair set, calculates the node distance in the path and the frequency of occurrence of the noun in the text, and uses the formula:
[0031]
[0032] Get the semantic dependency offset Du within the sentence o , among which Pu o represents the average dependency path length of the oth group of gerund pairs, Lu ok Cu represents the dependency path length of the kth gerund combination in the oth group, ok represents the coefficient of variation of the dependency path distance of the kth gerund-noun pair in the oth group, fu o Represents the co-occurrence frequency of the oth group of nouns in the entire text, NU o represents the number of gerund pairs in group o;
[0033] The structure scoring submodule analyzes the position and dependency of the subject words in the paragraph according to the semantic dependency offset within the sentence, scores the symmetry of the distribution of the subject words, and rearranges the content based on the semantic structure and contextual relationship within the paragraph to obtain a structure offset index.
[0034] The present invention is improved in that the system comprises:
[0035] The semantic coherence verification module analyzes the consistency of the subjects of the opening and closing sentences of each paragraph in the chapter based on the structural deviation index, evaluates the subject matching rate and the distribution density of the prepositions in the connecting sentences, identifies the continuity of the connection paths between paragraphs, verifies whether the semantics are consistent in the different parts of the documents, and generates a semantic coherence score;
[0036] The semantic coherence score includes semantic consistency level, semantic break detection rate, and coherence restoration effect.
[0037] The present invention is improved in that the semantic coherence verification module includes:
[0038] The subject matching test submodule extracts the subject of the first and last sentences of each paragraph in the document based on the structure deviation index, compares the subject consistency, calculates the similarity between the subjects, determines whether the consistency standard is met, and obtains the subject matching rate;
[0039] The preposition distribution analysis submodule calls the subject matching rate, evaluates the frequency and distribution of prepositions in connected sentences, calculates preposition density, analyzes its impact on paragraph coherence, and generates preposition distribution density;
[0040] The paragraph connectivity assessment submodule analyzes the semantic continuity between paragraphs based on the preposition distribution density, monitors semantic transitions and path changes, evaluates whether the changes are within an acceptable range, and verifies whether the semantics are consistent in the different parts of the documents, thereby generating a semantic coherence score.
[0041] Compared with the prior art, the advantages and positive effects of the present invention are:
[0042] In the present invention, by adopting real-time data sources, dynamically updating and expanding the knowledge graph, the synchronization of document content and current information trends is ensured. Intelligent entity recognition accurately analyzes noun phrases and entity distribution in the text, thereby improving the accuracy of information extraction. By calculating the overlap of keywords between paragraphs and intelligently inserting synonymous entities, the contextual connection quality of the document is improved. The document structure is automatically rearranged according to the relevance of the content, the logical presentation of information is optimized, and the reading experience is enhanced. In addition, through complex semantic coherence verification, the overall semantic consistency of the document is ensured, interpretation ambiguity is reduced, and the efficiency of document creation and analysis is effectively improved to adapt to rapidly changing information needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a system flow chart of the present invention;
[0044] Figure 2 This is a flowchart of the atlas dynamic update module in the present invention;
[0045] Figure 3 This is a flow chart of the entity recognition and mapping module in the present invention;
[0046] Figure 4 is a flowchart of the context cohesion analysis module in the present invention;
[0047] Figure 5 This is a flowchart of the semantic structure rearrangement module in the present invention;
[0048] Figure 6 This is a flowchart of the semantic coherence verification module in the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present 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 only used to explain the present invention and are not intended to limit the present invention.
[0050] In the description of the present invention, it should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings and are only for the convenience of describing the present invention and simplifying the description. They do not indicate or imply that the devices or elements referred to must have a specific direction, be constructed and operate in a specific direction, and therefore should not be understood as limiting the present invention. In addition, in the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0051] Example
[0052] See also Figure 1 The present invention provides a technical solution: a document intelligent writing and analysis system based on knowledge graph, comprising:
[0053] The graph dynamic update module collects hot words and tags from social media and scientific articles based on external data sources, analyzes the relevance of these words to existing entities in the knowledge graph, determines the need for new entities, and updates and expands the existing knowledge graph to obtain statistics on new entities.
[0054] The entity recognition and mapping module analyzes the frequency of noun phrases and field parameters in the text based on the newly added entity statistics, the field parameters, paragraph text, and entity names in the structured input data, determines the distribution of entities appearing in the first and last sentences of the text, identifies and extracts named entities, and categorizes and compares the extraction results to obtain entity mapping weights.
[0055] The context cohesion analysis module analyzes keyword combinations within a paragraph based on entity mapping weights and calculates the overlap of keywords in adjacent paragraphs. If the overlap is less than the context cohesion threshold, the corresponding synonymous entity segment is inserted into the original paragraph. The module also optimizes the cohesion of the paragraph content through continuity analysis to obtain the paragraph connectivity index.
[0056] The semantic structure rearrangement module extracts gerund-noun pairs based on the paragraph connectivity index and the dependency relationship between the subject and verb in the paragraph, calculates the length of the dependency path within the sentence and the co-occurrence frequency of nouns, scores the symmetry of the paragraph content according to the subject words, and rearranges the content based on the contextual dependency structure to obtain the structural shift index.
[0057] The semantic coherence verification module analyzes the consistency of the subjects of the opening and closing sentences of each paragraph in a chapter based on the structural deviation index, evaluates the subject matching rate and the distribution density of prepositions in connecting sentences, identifies the continuity of the connection paths between paragraphs, verifies whether the semantics are consistent in the different parts of the document, and generates a semantic coherence score.
[0058] New entity statistics include entity recognition rate, new entity types, and entity integration; entity mapping weights include weight classification, mapping accuracy, and entity relevance; paragraph connection indicators include connection strength, cohesion improvement rate, and synonymous entity insertion effect; structural shift index includes content adjustment frequency, content symmetry improvement results, and dependency structure optimization degree; semantic coherence scores include semantic consistency level, semantic break detection rate, and coherence recovery effect.
[0059] The Structural Shift Index is an indicator used to describe the degree of change in the layout and organizational structure of the content of each chapter in a document after rearrangement relative to the original layout. For example, if a paragraph is moved to another part of the document because it better fits the contextual logic, the degree and importance of this move will be expressed by the Structural Shift Index. In addition, the Structural Shift Index helps analyze and adjust the internal structure of the document to ensure a smooth transition from one section to another, improving the reading experience and the efficiency of information reception.
[0060] See also Figure 2 , the graph dynamic update module includes:
[0061] The vocabulary collection submodule collects frequently appearing words, tags, and keyword phrases from social media texts and scientific articles in external data sources. It then monitors and extracts data on word frequency trends, source distribution, and time span. It then uses word frequency fluctuation benchmarks to determine which vocabulary samples meet the requirements and generate a hot word tag set.
[0062] First, the data sources are classified according to content characteristics. For example, social platform data are clustered according to topic tags, and scientific article data are classified according to abstract keywords. After establishing text indexes, all words in each type of document are extracted. Then, word frequency statistics are performed to identify keywords that appear more than 200 times in a certain period of time and appear in different sources. Keywords are initially included in the candidate set. On this basis, a word frequency time series is constructed, and the change rate of word frequency values at different time nodes is calculated. For example, "quantum algorithm" appears 120 times in the first week and 260 times in the second week. Its volatility is (260-120) / 120=1.17, indicating a significant increase. If this value is greater than the preset benchmark of 0.5 Then record it; then count the number and proportion of source distribution of each word from the original literature. For example, "nanomaterial" appears 60 times in social media and 90 times in scientific articles, with a total of 150 times, then the source distribution is 40% and 60%, and use this to construct a source distribution vector. Then count whether the word has continued to appear in the past three weeks and calculate the time interval span. If a word first appears at T0 and the most recent time is T3, with a span of 3 weeks, those who meet the set standard of more than two weeks will enter the next step of screening. Through the above analysis and judgment, keyword groups that meet the frequency, time span and source distribution requirements are obtained, including "deep learning", "synthetic biology", etc., which are collected as a sample set and assigned identification numbers to generate a hot word tag set.
[0063] The association calculation submodule calls the hot word tag set to analyze the semantic association between the vocabulary and the existing knowledge graph entity nodes using the formula:
[0064]
[0065] Calculate the correlation score RG between vocabulary and entities, screen the entities and vocabulary requirements to be added, and generate a new entity mapping table, where SG ij represents the semantic similarity between vocabulary i and entity j, CG ij Indicates the frequency of co-occurrence of word i and entity j in the corpus, PG ij represents the depth of the structured path between vocabulary i and entity j, αr and βr are the adjustment weights corresponding to the parameters, γr is a constant to avoid the denominator being zero, and n rg is the total number of words, which identifies the scope of words for semantic analysis and association calculation, that is, the number of all words to be analyzed, m rg is the total number of entities, which is the number of entities already existing in the knowledge graph that are associated with the newly collected vocabulary;
[0066] Combine each hot word with the entity node in the knowledge graph one by one, and calculate their semantic similarity, co-occurrence frequency and structural path depth value in turn, where the word meaning similarity SG ijThe word vector cosine angle method is used to measure that if the angle between the word vector of the word "brain-computer interface" and the entity "neural interface" is 25 degrees, then the cosine value is cos(25°)≈0.906, which is used as the similarity score. If converted to the interval of 0 to 1, its standardized value can be set to 0.75; the co-occurrence frequency CG ij It is measured by the number of times a word and an entity appear together in the same text block. For example, if the word "blockchain" and the entity "smart contract" appear 18 times in 500 articles, the co-occurrence frequency is 18 times; the structural path depth PG ij is the shortest connection number between vocabulary and entity in the knowledge graph. If the shortest path between “artificial intelligence” and “graph neural network” is 3, then the path depth is 3. After that, the following formula is used for comprehensive scoring, where the parameter values are set as: αr = 1.2, βr = 0.5, γr = 1.0, and the total number of vocabulary n rg =3, total number of entities m rg =3;
[0067] Set the input sample data as follows:
[0068] Group 1 (vocabulary 1 and entity 1): SG 11 =0.75, CG 11 =18,PG 11 =3;
[0069] Group 2 (vocabulary 2 and entity 1): SG 21 =0.62, CG 21 =25,PG 21 =5;
[0070] Group 3 (vocabulary 3 and entity 2): SG 32 =0.58, CG 32 =10,PG 32 =2;
[0071] Then calculate the values in turn as follows:
[0072] Group 1 numerator: 1.2 0.75 + 0.5 18 = 0.9 + 9 = 9.9;
[0073] Group 2 numerator: 1.2 0.62 + 0.5 25 = 0.744 + 12.5 = 13.244;
[0074] Sub-item of group 3: 1.2·0.58+0.5·10=0.696+5=5.696;
[0075] The sum of the numerators is:
[0076]
[0077] The total path depth is:
[0078]
[0079] Substitute the formula to calculate the final score:
[0080]
[0081] The result shows that the overall correlation between vocabulary and entities is 2.622. If the judgment standard for the new entity mapping requirement is set to RG greater than 2.5, then the score meets the standard, indicating that there are multiple words in the vocabulary sample set with sufficient semantic and structural coupling, which can be used to establish connections with existing knowledge graph entities, and then generate a new entity mapping table.
[0082] The entity expansion submodule builds connections between new entities and existing nodes in the knowledge graph based on the new entity mapping table, calculates connection weights and structural influences, updates and expands the existing knowledge graph, and obtains statistics for new entities.
[0083] All word-entity pairs are sorted according to the RG value, and the paired combinations with scores exceeding the set standard value are selected to participate in the graph update construction. The set standard is RG>2.5. For example, the RG corresponding to the word "brain-like computing" and the entity "neuromorphic chip" is 2.74, which is included in the graph construction link. Then, a connection relationship is constructed for the newly added combination. Each pairing is connected in the graph in the form of a new edge, and its edge weight is set to the RG score value, that is, the weight of the edge from "brain-like computing" to "neuromorphic chip" is 2.74. In this way, the connection edge construction of all qualified pairs is completed. After the connection is completed, the edge weights of all newly added connection edges are counted, and the average edge weight and the standard edge weight are calculated. For example, among the 10 newly added edges, the average edge weight is 2.65 and the standard deviation is 0.42. Then calculate the density index of the newly added edges. Suppose the total number of entity nodes in the original graph is 500 and the number of newly added connection edges is 50, then the edge density is 50 / 500=0.1. Combined with the combined judgment conditions of standard deviation and density, if the newly added edge density is greater than 0.08 and the edge weight standard deviation is less than 0.5, then the corresponding newly added entity connection set is retained. Finally, the constructed newly added entity nodes are inserted into the original graph structure. The number of nodes in the updated graph is expanded to the original number of nodes plus the number of newly added entities. Assuming that there are 15 newly added entities in total, the total number of nodes after update is 515, and the new entity statistics are obtained.
[0084] See also Figure 3 , the entity recognition and mapping module includes:
[0085] The frequency extraction submodule extracts noun phrases from the text based on the newly added entity statistics, the field parameters in the structured input data, and the paragraph text. It analyzes the frequency of occurrence of each noun phrase in the entire text, and classifies them according to the field parameters to generate the text noun frequency quantity.
[0086] Using the field parameters provided in the structured input data, we traverse the text paragraphs field by field, segment the text content, and extract all noun phrases. We then build a vocabulary pool within each field and set recognition rules to distinguish entity phrases from non-entity phrases. We then calculate the frequency of each noun phrase by counting the number of repetitions of different words within the same field. For example, in the text segment "Company X in the past five years..." under the field "Organization Name," "Company X" appears three times, with a frequency of 3. Based on this, we build a classifier that categorizes and archives these frequency results according to the field parameters, generating a noun phrase frequency set under the "Organization Name" field. We also attach a corresponding field label to each phrase as a classification identifier, and further establish a frequency database for each noun phrase. For example, under the "Company Name" field, "XX Group" appears with a frequency of 5, and "Technology Co., Ltd." appears with a frequency of 2. We then aggregate the word frequency data under different fields to obtain a frequency distribution table. We then test the frequency statistics logic based on the content of different text segments to obtain the frequency of nouns in the text.
[0087] The distribution positioning submodule evaluates the sentence position distribution of each noun phrase based on the frequency of nouns in the text and the index position of the first and last sentences of the noun phrase in the paragraph text, compares it with the entity recognition threshold of the field parameter, selects qualified named entities, and generates a named entity positioning interval;
[0088] Extract all noun phrase index information under the field parameters, mark the first and last sentence positions in the paragraph text respectively, and calculate the distance between the two as the sentence span. By recording the start and end sentence indexes of each noun phrase, a preliminary positioning vector set is formed. For example, the phrase "XX University" appears for the first time in the second sentence of the paragraph and the last in the ninth sentence, so its sentence span is 7. By setting the entity recognition threshold (for example, when the sentence span is greater than 5 and the frequency is not less than 2, it is recognized as an entity), the above positioning vector and frequency value are jointly determined to determine whether it constitutes a named entity. If it meets the requirements, it is filtered into the named entity set. For example, "XX University" has a frequency of 3 and a span of 7, which meets the entity conditions and is filtered into the set. At the same time, its start and end sentence index range in the paragraph is recorded, and its belonging field is generated, such as "Name of Educational Institution". Similarly, this screening mechanism is executed on all noun phrases, and the result set is stored in the sentence interval distribution matrix to generate a named entity positioning interval.
[0089] The weight calculation submodule is based on the named entity positioning interval. For each qualified named entity, it analyzes its distribution frequency and the difference in the first and last positions in the text, using the formula:
[0090]
[0091] Get the entity mapping weight value WS e , where n ws Represents the total number of named entities that meet the field parameter matching conditions, fs z Indicates the frequency of the zth named entity in the text, ps z is the sentence index where the zth named entity first appears in the text, qs z is the sentence index of the last occurrence of the z-th named entity in the text, es z The environmental variation coefficient of the z-th named entity is an indicator to measure the degree of change of the entity in different text environments. log(es z +1) is to perform logarithmic transformation on the environmental coefficient of variation to smooth its influence and ensure that the weight value is not distorted by extreme values;
[0092] Count the frequency of each entity in the paragraph and record it as f s , by traversing the paragraph text to determine its first occurrence sentence index p s and the last occurrence sentence index q s , and calculate its sentence span |p s -q s |, and extract the contextual semantic differences of the entity when it appears in different contexts. The degree of environmental variation is quantified by the difference between the word co-occurrence set and the context vector, and the environmental variation coefficient e is obtained. s For example, if the entity "XX Hospital" has co-occurring words {treatment, department, bed} in segment 1 and {research, experiment, case} in segment 2, the Jaccard distance between the two is 0.66, which can be used as the basis for variation measurement. Then, all parameters are substituted into the formula for calculation. Let the total number of named entities n be ws =3, taking entities A, B, and C as examples, the parameters are as follows:
[0093] Entity A:
[0094] Entity B:
[0095] Entity C:
[0096] The calculation process is as follows:
[0097]
[0098] Calculate the average:
[0099]
[0100] The results show that after considering the three factors of frequency of occurrence, sentence span and degree of variation, it is possible to measure the importance of entities in the discourse structure and obtain a weighted optimized entity list.
[0101] See also Figure 4 , the context cohesion analysis module includes:
[0102] The overlap calculation submodule extracts keyword combinations from paragraphs based on the entity mapping weight values, analyzes the frequency of occurrence of keywords in adjacent paragraphs, calculates the keyword overlap between each pair of paragraphs, and generates the paragraph keyword overlap;
[0103] Locate the combination of keywords in the text paragraph, specifically by traversing the vocabulary items with semantic functions in each paragraph for structured extraction. For example, in "Using machine learning to model text content", "system", "machine learning", "text" and "modeling" are identified as core keywords. Then, the keyword sets of two adjacent paragraphs are counted in parallel, and the number of intersections and the total number of keywords are recorded respectively. For example, paragraph A contains keywords A1, A2, and A3, and paragraph B contains A2, A3, and B1. The intersection is A2 and A3, a total of 2 items, and the total number of keywords is 5. The ratio of the intersection to the total number generates a preliminary overlap index. On this basis, the entity mapping weight is added. The weight value is used as an adjustment item. The weight value comes from the relevance score between each keyword and its semantic category. The score can be obtained by counting the frequency of the keyword's connection path with other entities in the knowledge graph. For example, the keyword "modeling" appears more frequently in the graph than "algorithm", "reasoning" and "machine", so it is assigned a value of 0.82. The overlap and the weight value are weightedly combined to construct the final comparison basis. This process is performed in multiple paragraph combinations to form a list of overlap scores for each paragraph. The system judges the score sequence with the context connection threshold. If the score of any segment deviates significantly from the baseline value, it is marked as a weak connection position. At this time, the paragraph keyword overlap can be generated.
[0104] The synonymous segment insertion submodule uses the paragraph keyword overlap to detect whether it is lower than the context cohesion threshold. If so, it extracts synonymous entity phrases corresponding to the low-overlap keywords from the text and selects segments with similar semantics and structure to the original text for insertion to obtain the number of synonymous entity supplementary paragraphs.
[0105] The system determines whether it is less than the preset context connection threshold. This threshold is set as the lower limit of acceptable keyword overlap between segments based on experience, for example, it is set to 0.40. If the overlap between a segment and its subsequent segment is 0.30, the system will mark it as a segment pair that needs to be inserted with repair content. The system will then filter the keywords in the segment and select terms with low overlap, such as "prediction model" and "behavioral trend". The keywords are entered into the synonym expansion mechanism to find their corresponding semantic equivalent phrases. For example, the phrases corresponding to "prediction model" are "inferred structure", "estimation method" and "probability construction". After that, each synonym group is context-matched. Semantic matching degree calculation: Semantic matching degree can be evaluated by comparing whether the semantic levels of candidate words and original paragraph keywords are in the same category, or whether the number of path jumps between the two in the semantic graph is less than a given threshold. For example, the path between "estimation method" and "prediction model" is 2 hops, which is less than the threshold of 3 hops, which is a match. The match will be further compared to see whether its sentence structure is consistent with the original paragraph. For example, if the original paragraph starts with "This study proposes...", the candidate sentence should also have an initial expression of the subject-predicate structure. If it meets the requirements, it can be inserted. After executing this screening, the system counts the number of synonymous sentences that are actually adopted and inserted. This number is the number of synonymous entity supplementary paragraphs.
[0106] The paragraph connection optimization submodule supplements the number of paragraphs based on synonymous entities, analyzes the coherence feature vectors of the inserted paragraph set, compares the coherence of the original and modified paragraphs, evaluates and optimizes the content connection between paragraphs, and obtains the paragraph connection index;
[0107] The system first re-integrates the paragraph content after the inserted sentence segment and generates a continuity feature vector for each paragraph. The vector can be constructed from three aspects: the degree of vocabulary association between sentences, the integrity of the semantic chain, and the continuity of the structure. For example, if "the system structure has been constructed" appears at the end of the first paragraph and "the structure can be used for training" appears at the beginning of the second paragraph, and the "structure" terms are repeated in the two and there is subject continuation, then a connection relationship is established in the semantic chain and recorded as strong coherence. If the first paragraph mentions "the efficiency of the algorithm needs to be optimized" and the second paragraph starts to talk about "the distribution characteristics of the text corpus", there is no obvious connection. Point, it is weak coherence. The system establishes a scoring index for the semantic continuity of each paragraph pair. The difference in score between the original content and the inserted revised content is the change in inter-segment coherence. If the change value is positive, it means that the coherence is enhanced after insertion. For example, the coherence score before insertion is 0.52, and after insertion it is 0.71, with a difference of 0.19, which means that the optimization is effective. The system combines the change values of all paragraph pairs with their positions in the overall structure of the text for position weighting processing. For example, the weight of the front or the end of the paragraph is relatively large. Finally, the weighted coherence scores between each paragraph are summarized to obtain a comprehensive evaluation value of the overall paragraph connection status of the text.
[0108] See also Figure 5 , the semantic structure rearrangement module includes:
[0109] The pairing extraction submodule analyzes the paragraph connection index based on the dependency relationship between the subject and verb in the paragraph, identifies the direct dependency connection between the subject and its verb, and eliminates non-core adverbs and prepositions through grammatical rules to establish a set of gerund-noun combination pairs.
[0110] Dependencies between all subjects and verbs in a sentence are read and annotated with the "nsubj" dependency tag using a syntactic analysis tool. Each subject-predicate structure is identified. For example, in the sentence "The user inputs a command and starts the system," two subject-predicate pairs, "user-input" and "user-start," are identified. Each subject-predicate pair is processed as a record. For each verb, the child nodes in its dependency structure are traversed to find noun phrases with a dependency type of "dobj." For example, "input-command" and "start-system" are valid gerund-noun pairs. If there are modifying prepositional structures such as "through the interface" or adverbial components such as "quickly," non-core nodes are skipped and not included in the path analysis. In practice, a paragraph such as "The system executes commands based on user input and provides feedback" can be set up to identify three subject-predicate structures: "user-input," "system-execution," and "system-feedback." The three gerund-noun pairs, "input-command," "execution-command," and "feedback-result," are then extracted. Each combination records the position index of its verb and noun in the sentence, for example, "input" is at position 2 and "command" is at position 4, and is accompanied by subject-verb dependency tags, part of speech and other meta-information, forming a structurally stable set of gerund-noun combinations, numbered U1, U2, U3, etc.
[0111] The path calculation submodule analyzes the dependency path length of each gerund in the sentence based on the set of gerund-noun pairs, calculates the node distance in the path and the frequency of occurrence of the noun in the text, using the formula:
[0112]
[0113] Get the semantic dependency offset Du within the sentence o , among which Pu o represents the average dependency path length of the oth group of gerund pairs, reflecting the average distance from verb to noun. ok represents the dependency path length of the kth gerund combination in the oth group, indicating the dependency distance of a specific combination, Cu ok represents the coefficient of variation of the dependency path distance of the kth gerund pair in the oth group, quantifying the stability and consistency of the dependency path, fu o Represents the co-occurrence frequency of the oth group of nouns in the entire text, indicating the frequency and importance of the noun in the text. o represents the number of gerund pairs in group o;
[0114] Each gerund combination is limited to two pairs, namely NU o =2, for each gerund combination, extract its path length in the syntactic dependency structure, and record it as Lu o1 With Lu o2 For example, in the gerund group U1, the two combinations “input-command” and “start-system” correspond to path lengths Lu o1 =2.5, Lu o2 =3.1, further calculate the coefficient of variation Cu corresponding to the above path ok , and square them separately to get:
[0115]
[0116] Then calculate the absolute value of the difference between the path length and the square root of its coefficient of variation, that is:
[0117]
[0118] Adding the two terms together gives the deviation sum:
[0119]
[0120] Let the average path length of this group be The frequency of noun co-occurrence in the paragraph is fu o =3, then according to the formula in the path calculation submodule:
[0121]
[0122] Substitute specific numbers into:
[0123]
[0124] Combination U2 contains two pairs of gerunds "obtain-information" and "process-data", and its path length is Lu o1 =1.9, Lu o2 =2.4, and the coefficients of variation are Cu o1 =0.16, Cu o2 =0.25, the corresponding square root is The deviation value is calculated as follows: |1.9-0.4|=1.5, |2.4-0.5|=1.9, the sum is 3.4, the average path Co-occurrence frequency fu o =2, substituting into the formula we get:
[0125]
[0126] Another set of combinations U3, the gerund pairs are "analysis-result" and "record-log", and the path length is Lu o1 =3.0, Lu o2 =2.6, and the coefficients of variation are Cu o1 =0.64, Cu o2 =0.36, the square root is The calculated path deviation is: |3.0-0.8|=2.2, |2.6-0.6|=2.0, the sum is 4.2, and the average path length is The co-occurrence frequency is fu o =4, we get:
[0127]
[0128] Du o The value represents the degree of deviation of the path structure of each group of gerunds in the segment. The higher the value, the greater the volatility of the dependency path and the degree of semantic deviation.
[0129] The structure scoring submodule analyzes the position and dependency relationship of the subject words in the paragraph based on the semantic dependency offset within the sentence, scores the symmetry of the distribution of the subject words, and rearranges the content based on the semantic structure and contextual relationship within the paragraph to obtain the structure offset index.
[0130] Read the occurrence positions of all nouns in the paragraph and construct a position index array. For example, if the noun "module" appears at the beginning of the sentence, in the third and fifth sentences, its position index is [1, 3, 5]. If the central sentence of the paragraph is the fourth sentence, then use 4 as the reference point to calculate the deviation distance respectively: |1-4|=3, |3-4|=1, |5-4|=1, forming an offset array [3, 1, 1]. The calculated offset mean is 1.67 and the offset variance is 1.56, which is used to reflect the symmetry of the noun distribution. If another noun "system" appears in sentences 2, 6 and 7, its deviation values are 2, 2, 3, with a mean of 2.33 and a variance of 0.33, which is more symmetrical than "module". The frequency and position distribution of all nouns are counted respectively. The symmetry score is a part of the structural shift index. Its calculation formula can be defined as the sum of the position shift variances of the paragraph subject words divided by the number of subject words. For example, the shift variances of the three nouns "module", "system" and "command" are 1.56, 0.33 and 2.12 respectively, and the total is 4.01. The structural shift index is 1.34, which indicates the uneven distribution of subject words in the paragraph. In implementation, the symmetry score only calculates the absolute value of the position shift, without processing the semantic level content. The final structural shift index is used to control the output order of the content structure and to rearrange the semantically dense areas.
[0131] See also Figure 6 , the semantic coherence verification module includes:
[0132] The subject matching test submodule extracts the subjects of the first and last sentences of each paragraph in the document based on the structural deviation index, compares the subject consistency, calculates the similarity between the subjects, determines whether the consistency standard is met, and obtains the subject matching rate;
[0133] Extract the subject of the first and last sentence of each paragraph in the document, traverse each paragraph in the document, extract the subject terms in the grammatical structure of the first and last sentences respectively, and quantify the subject terms using the word vector method based on semantic distance, converting them into comparable numerical vectors. Then, use cosine similarity as a comparison index to calculate the semantic distance between the first and last subjects. If the subject of the first sentence in a paragraph is "system" and the subject of the last sentence is also "system", then the angle between their vectors is 0 and the similarity is 1, which is judged as a complete match. If the subject of the first sentence in another paragraph is "user" and the subject of the last sentence is also "system", then the angle between their vectors is 0 and the similarity is 1, which is judged as a complete match. The subject of the sentence is "service". After encoding, its similarity score is 0.35, which does not reach the consistency benchmark value. The consistency benchmark value needs to be set based on the results of subject comparison of a large amount of corpus. It is usually set to 0.80, which means that it is considered consistent only when the similarity between subjects is greater than or equal to 0.80. After marking the subject matching of all paragraphs, the ratio of the number of successfully matched paragraphs to the total number of paragraphs is counted, which is the subject matching rate. For example, if we analyze 4 paragraphs of data, of which 2 paragraphs have matching subjects, the subject matching rate is 2 divided by 4, which is 0.5, and the subject matching rate is finally obtained.
[0134] The preposition distribution analysis submodule uses the subject matching rate to evaluate the frequency and distribution of prepositions in connected sentences, calculates the preposition density, and analyzes its impact on paragraph coherence to generate the preposition distribution density;
[0135] Locate the set of sentences marked as connecting sentences in each paragraph, extract all the interposition items in the set, and count the number of preposition occurrences according to the connecting sentence number. In an actual document, if a paragraph contains 5 connecting sentences, in which the interpositions are "therefore", "in addition", "and then", "even if", and "at the same time", there is an average of 1 interposition in each sentence, and the calculated interposition density is 5 divided by 5, that is, 1.0. If in another paragraph, only the two interpositions "and" and "thus" appear in the 5 connecting sentences, the interposition density is 2 divided by 5, that is, 0.4. This density value can reflect the importance of interpositions in connecting sentences. The distribution density is determined by normalizing the preposition density values calculated for all paragraphs and classifying them according to the set density judgment threshold. For example, if the threshold is 0.6, paragraphs below this value are considered to have insufficient preposition distribution. The threshold is set based on the average value of the preposition density of text paragraphs in a large amount of corpus. In paragraphs with insufficient preposition distribution, the paragraph numbers are recorded and their proportion is counted. The final density score is obtained by multiplying the preposition density proportion with the coverage of connecting sentences. Combining the above indicators, a quantitative description of the preposition density is completed to generate the preposition distribution density.
[0136] The paragraph connectivity assessment submodule analyzes the semantic continuity between paragraphs based on the density of preposition distribution, monitors semantic transitions and path changes, evaluates whether the changes are within an acceptable range, and verifies whether the semantics are consistent in the different parts of the document, generating a semantic coherence score.
[0137] Extract the first and last sentences between adjacent paragraphs and pair them to construct a semantic connection path. By analyzing the semantic pointing features between the last sentence of the first paragraph and the first sentence of the next paragraph, mark the semantic span, semantic continuity and turning points of the words in the connection path. The semantic span can be obtained by calculating the word vector distance. For example, if the last sentence of a paragraph is "system optimization" and the first sentence of the next paragraph is "processing efficiency", and the word vector distance between the two is 0.65, then the path span is medium. If the vector distance is above 0.9, it is judged as a semantic break. The semantic continuity is judged by the logical consistency of consecutive word classes, such as "cause-result", "action-result". The "do-affect" type connection constitutes a continuation relationship, and the turning point is determined by detecting antonyms, contrasting words or semantic reversal conjunctions, such as "however", "but", "on the contrary", etc. Once the number of semantic turning points between consecutive paragraphs exceeds the set threshold (for example, the number of turning points in every two paragraphs is greater than 2), it is considered a path break. After completing the detection of all paragraph pairs, the ratio of the number of paragraph pairs with continuous semantic connections to the total number of paragraph pairs is calculated, and the ratio is further corrected by combining the path span and the preposition density to obtain the paragraph semantic path stability score, which is used as the main measurement basis for whether the document structure is semantically coherent.
[0138] The above are merely preferred embodiments of the present invention and do not limit the present invention in any other form. Any technician familiar with the profession may use the technical content disclosed above to change or modify it into an equivalent embodiment with equivalent changes and apply it to other fields. However, any simple modification, equivalent change and modification made to the above embodiment based on the technical essence of the present invention without departing from the content of the technical solution of the present invention shall still fall within the scope of protection of the technical solution of the present invention.
Claims
1. A document intelligent writing and analysis system based on knowledge graph, characterized by: The system comprises: The graph dynamic update module collects hot words and tags from social media and scientific articles based on external data sources, analyzes the relevance of these words to existing entities in the knowledge graph, updates and expands the existing knowledge graph, and obtains statistics for newly added entities. The entity recognition and mapping module analyzes the occurrence frequency and field parameters of noun phrases in the text based on the newly added entity statistics, determines the distribution of the entity's first and last sentences in the text, and obtains the entity mapping weight; The context cohesion analysis module calculates the overlap of keywords in adjacent paragraphs based on the entity mapping weights. If the overlap is less than the context cohesion threshold, the corresponding synonymous entity segment is inserted into the original paragraph, and the cohesion of the paragraph content is optimized through continuity analysis to obtain a paragraph connection index. The semantic structure rearrangement module extracts gerund-noun pairings based on the paragraph connection index and the dependency relationship between the subject and the verb in the paragraph, calculates the length of the dependency path within the sentence and the co-occurrence frequency of nouns, scores the symmetry of the paragraph content according to the keyword, and rearranges the content based on the context dependency structure to obtain a structural shift index.
2. The document intelligent writing and analysis system based on knowledge graph according to claim 1 is characterized in that: The newly added entity statistics include entity recognition rate, new entity type, and entity integration; the entity mapping weights include weight classification, mapping accuracy, and entity relevance; the paragraph connection indicators include connection strength, cohesion improvement rate, and synonymous entity insertion effect; the structural deviation index includes content adjustment frequency, content symmetry improvement results, and dependency structure optimization degree.
3. The document intelligent writing and analysis system based on knowledge graph according to claim 1 is characterized in that: The graph dynamic update module includes: The vocabulary collection submodule collects frequently appearing words, tags, and keyword phrases from social media texts and scientific articles in external data sources. It then monitors and extracts data on word frequency trends, source distribution, and time span. It then uses word frequency fluctuation benchmarks to determine which vocabulary samples meet the requirements and generate a hot word tag set. The association calculation submodule calls the hot word tag set and analyzes the semantic association between the vocabulary and the existing knowledge graph entity nodes using the formula: Calculate the correlation score RG between vocabulary and entities, screen the entities and vocabulary requirements to be added, and generate a new entity mapping table, where SG ij represents the semantic similarity between vocabulary i and entity j, CG ij Indicates the frequency of co-occurrence of word i and entity j in the corpus, PG ij represents the depth of the structured path between vocabulary i and entity j, αr and βr are the adjustment weights corresponding to the parameters, γr is a constant to avoid the denominator being zero, and n rg is the total number of words, m rg is the total number of entities; The entity expansion submodule constructs connections between the new entities and existing nodes of the knowledge graph based on the new entity mapping table, calculates connection weights and structural influences, updates and expands the existing knowledge graph, and obtains statistics of the new entities.
4. The document intelligent writing and analysis system based on knowledge graph according to claim 1 is characterized in that: The entity recognition and mapping module includes: The frequency extraction submodule extracts noun phrases from the text based on the newly added entity statistics, the field parameters in the structured input data, and the paragraph text, analyzes the frequency of occurrence of each noun phrase in the entire text, and classifies them according to the field parameters to generate a text noun frequency quantity; The distribution positioning submodule evaluates the sentence position distribution of each noun phrase based on the frequency of nouns in the text and the index positions of the first and last sentences of the noun phrase in the paragraph text, compares the results with the entity recognition threshold of the field parameter, selects qualified named entities, and generates a named entity positioning interval; The weight calculation submodule analyzes the distribution frequency and the difference in the first and last positions of each qualified named entity in the text based on the named entity positioning interval, using the formula: Get the entity mapping weight value WS e , where n ws Represents the total number of named entities that meet the field parameter matching conditions, fs z Indicates the frequency of the zth named entity in the text, ps z is the sentence index where the zth named entity first appears in the text, qs z is the sentence index of the last occurrence of the z-th named entity in the text, es z represents the environmental variation coefficient of the z-th named entity.
5. The document intelligent writing and analysis system based on knowledge graph according to claim 1 is characterized in that: The context cohesion analysis module includes: The overlap calculation submodule extracts keyword combinations from the paragraphs based on the entity mapping weight values, analyzes the frequency of occurrence of keywords in adjacent paragraphs, calculates the keyword overlap between each pair of paragraphs, and generates a paragraph keyword overlap; The synonymous segment insertion submodule calls the paragraph keyword overlap degree to detect whether it is lower than the context cohesion threshold. If it is lower than the threshold, it extracts synonymous entity phrases corresponding to the low-overlap keywords from the text, and selects and inserts sentences that are close to the original text in terms of semantics and structure to obtain the number of synonymous entity supplementary paragraphs; The paragraph connection optimization submodule supplements the paragraph quantity according to the synonymous entities, analyzes the coherence feature vectors of the inserted paragraph set, compares the coherence of the original and modified paragraphs, evaluates and optimizes the content connection between paragraphs, and obtains the paragraph connection index.
6. The document intelligent writing and analysis system based on knowledge graph according to claim 1 is characterized in that: The semantic structure rearrangement module includes: The pairing extraction submodule analyzes the paragraph connection index based on the dependency relationship between the subject and the verb in the paragraph, identifies the direct dependency connection between the subject and its verb, and eliminates non-core adverbs and prepositions through grammatical rules to establish a set of gerund-noun combination pairs; The path calculation submodule analyzes the dependency path length of each gerund in the sentence based on the gerund pair set, calculates the node distance in the path and the frequency of occurrence of the noun in the text, and uses the formula: Get the semantic dependency offset Du within the sentence o , among which Pu o represents the average dependency path length of the oth group of gerund pairs, Lu ok represents the dependency path length of the kth gerund combination in the oth group, Cu ok represents the coefficient of variation of the dependency path distance of the kth gerund pair in the oth group, fu o Represents the co-occurrence frequency of the oth group of nouns in the entire text, NU o represents the number of gerund pairs in group o; The structure scoring submodule analyzes the position and dependency of the subject words in the paragraph according to the semantic dependency offset within the sentence, scores the symmetry of the distribution of the subject words, and rearranges the content based on the semantic structure and contextual relationship within the paragraph to obtain a structure offset index.
7. The document intelligent writing and analysis system based on knowledge graph according to claim 1 is characterized in that: The system comprises: The semantic coherence verification module analyzes the consistency of the subjects of the opening and closing sentences of each paragraph in the chapter based on the structural deviation index, evaluates the subject matching rate and the distribution density of the prepositions in the connecting sentences, identifies the continuity of the connection paths between paragraphs, verifies whether the semantics are consistent in the different parts of the documents, and generates a semantic coherence score; The semantic coherence score includes semantic consistency level, semantic break detection rate, and coherence restoration effect.
8. The document intelligent writing and analysis system based on knowledge graph according to claim 7 is characterized in that: The semantic coherence verification module includes: The subject matching test submodule extracts the subject of the first and last sentences of each paragraph in the document based on the structure deviation index, compares the subject consistency, calculates the similarity between the subjects, determines whether the consistency standard is met, and obtains the subject matching rate; The preposition distribution analysis submodule calls the subject matching rate, evaluates the frequency and distribution of prepositions in connected sentences, calculates preposition density, analyzes its impact on paragraph coherence, and generates preposition distribution density; The paragraph connectivity assessment submodule analyzes the semantic continuity between paragraphs based on the preposition distribution density, monitors semantic transitions and path changes, evaluates whether the changes are within an acceptable range, and verifies whether the semantics are consistent in the different parts of the documents, thereby generating a semantic coherence score.
Citation Information
Cited By
Multi-modal digital publishing intelligent checking system and method based on large model
CN120930637A
Big model-based multi-modal digital publishing intelligent proofreading system and method
CN120930637B
Intelligent official document writing method and system based on knowledge graph
CN120951958A
Structured knowledge unit generation method and system based on semantic prediction
CN121029783A
File digital evidence storage and tamper-proofing method and system based on block chain technology
CN121239386A