Method for creating structured document based on deep learning model
Through the method based on deep learning model, analyzing and building a structured model of documents, the problem of difficulty in constructing a document structure in the existing technology is solved, and more efficient and accurate document creation is achieved.
Patent Information
- Application Number
- CN202510115384.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2045-01-24
AI Technical Summary
When the existing technology processes massive and complex data, it is difficult to automatically build document structures, resulting in data omissions or inconsistencies, affecting the efficiency and accuracy of document creation.
Using a deep learning model-based method, analyzing the structure and logical relationships of sentences and paragraphs is analyzed, a graph neural network model is constructed, and structured documents are generated.
It realizes more accurate keyword extraction and paragraph core information recognition, improving the efficiency and accuracy of document creation, especially when processing complex documents, it can extract key semantic information.
Smart Images

Figure CN119558307A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method for creating structured documents based on a deep learning model. Background Art
[0002] Currently, document creation and management have expanded from single text editing to diversified data integration and information extraction. Traditional document creation methods usually rely on manual editing or template-based semi-automatic tools. Although these methods can meet general needs, they may have problems in automatically building document structures when processing massive and complex data.
[0003] For example, in the scenario of academic paper writing, researchers need to extract key information from a large amount of experimental data and literature and generate structured documents that meet specific specifications. Existing methods complete this process by manually classifying and summarizing data, but this may lead to data omissions or inconsistencies, especially when the document logic is complex and the amount of information is large. The efficiency and accuracy of creating structured documents are significantly affected. Summary of the invention
[0004] The purpose of the present invention is to provide a method for creating structured documents based on a deep learning model, aiming to solve the problems mentioned in the background technology.
[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:
[0006] A method for creating a structured document based on a deep learning model, the method comprising:
[0007] Obtain basic text information collected by users, preprocess it, convert the format into a unified format, and obtain text data;
[0008] By processing the text data, segmenting it according to chapters and paragraphs, obtaining text segmentation data;
[0009] According to the text segmentation data, the structure of the sentences in the paragraph is analyzed to determine the keywords in the sentences and obtain the sentence keyword dataset;
[0010] According to the sentence keyword dataset, the logical relationship between sentences in the paragraph is analyzed, and the sentence keywords in the paragraph are associated to obtain the paragraph keyword dataset;
[0011] According to the paragraph keyword dataset, analyze the correlation between paragraphs in the chapter, identify the core keywords of the chapter, and obtain the chapter keyword dataset;
[0012] According to the chapter keyword dataset, analyze the fields involved in the text, extract the field information of the text, and obtain the text keyword dataset;
[0013] Obtain structured texts from the paper document library and extract keywords from them to obtain a training keyword set;
[0014] Based on the graph neural network model, a preliminary structured document model is constructed, and the preliminary structured document model is trained according to the training keyword set and structured text to obtain a structured document model;
[0015] By inputting text data and text keyword data sets into a structured document model, the semantic association between the text data is determined to obtain a structured document.
[0016] Furthermore, according to the text segmentation data, the structure of the sentences in the paragraph is analyzed to determine the keywords in the sentences, and a sentence keyword dataset is obtained, including:
[0017] Analyze the sentences in the text segmentation data by verbs and build a sentence relationship tree;
[0018] According to the relationship tree, identify the subject, predicate, object and modifying elements of the sentence and determine the sentence structure;
[0019] According to the sentence structure, extract words from the subject, predicate, object and modifying elements to obtain keywords;
[0020] According to the part-of-speech classification, the part-of-speech tags are added to the keywords to obtain the sentence keyword dataset.
[0021] Furthermore, according to the sentence keyword dataset, the logical relationship between the sentences in the paragraph is analyzed, and the sentence keywords in the paragraph are associated to obtain the paragraph keyword dataset, including:
[0022] According to the sentence keyword data set, grammatical matching is performed between adjacent sentences, the logical relationship and its type between adjacent sentences are identified, and logical relationship data is obtained;
[0023] According to the logical relationship data, the sentence keywords corresponding to the logical relationship are associated, merged into a node, and marked with the symbol corresponding to the logical relationship to obtain a paragraph node;
[0024] According to the paragraph nodes, count the number of occurrences of keywords in the paragraph nodes, determine the core keywords of the paragraph nodes, and obtain the characteristics of the paragraph nodes:
[0025] Merge all paragraph node features in a paragraph to obtain a paragraph keyword dataset.
[0026] Furthermore, based on the paragraph keyword dataset, the correlation between paragraphs in the chapter is analyzed to identify the core keywords of the chapter, and the chapter keyword dataset is obtained, including:
[0027] According to the paragraph keyword data set, the correlation between adjacent paragraphs is calculated to obtain the correlation matrix;
[0028] According to the correlation matrix, the paragraph keywords with correlation higher than the preset correlation value are merged to obtain chapter nodes;
[0029] According to the chapter nodes, determine the correlation strength of keywords between different nodes;
[0030] According to the association strength, the chapter nodes are sorted, the weights of different nodes are determined, and the chapter node sequence is obtained;
[0031] According to the chapter node sequence, determine the paragraph keywords with the highest correlation strength in the chapter and mark them as the core keywords of the chapter;
[0032] Semantically supplement the keywords of other paragraphs in the chapter and merge them with the core keyword set to generate a chapter keyword dataset.
[0033] Furthermore, the calculation formula of the correlation is: ,
[0034] in, is the correlation between paragraphs, is the index of the paragraph, For paragraphs Neidi The weight of the keywords, For paragraphs Neidi The weight of the keywords, Separate paragraphs and paragraphs The total number of keywords in is the distance between paragraphs, as a parameter.
[0035] Furthermore, based on the chapter keyword dataset, the fields involved in the text are analyzed, the field information of the text is extracted, and the text keyword dataset is obtained, including:
[0036] According to the chapter keyword data set, the keywords in different chapters are classified and the identifiers of different field types are added to them to obtain the field data set;
[0037] According to the domain data set, the number of keywords identified by different domain types is counted, and the keywords are converted into vector representations to obtain feature values;
[0038] Determine the core domain type of the text by calculating the weight values of different domain types;
[0039] According to the core domain type, relevant keywords are extracted from the chapter keyword dataset to obtain the domain information of the text;
[0040] Based on the domain information, the core domain of the text and its keywords are determined to generate a text keyword dataset.
[0041] Furthermore, the weight value calculation formula is: ,
[0042] in, For the The weight value of each field type, is the index of the field type, is the average feature value of the keywords in the chapter keyword dataset, For the Field type The feature value of a keyword, For the The proportion of keywords in each field type, For the The total number of keywords in each field type, For the Field type The frequency value of the keyword in the chapter keyword dataset, is the coefficient.
[0043] Furthermore, based on the graph neural network model, a preliminary structured document model is constructed, including:
[0044] Configure the input layer to receive the text keyword dataset and text data, and convert the keywords into vectors to obtain keyword vectors;
[0045] Configure the graph structure layer to determine the nodes of the graph structure based on the keyword vector, calculate the semantic similarity between the nodes, and determine the weight of the edges between the nodes;
[0046] Configure the graph neural network layer to propagate nodes through edges through the graph convolutional network, capture the global semantics of text data, and obtain the embedded representation of the graph structure;
[0047] The output layer is configured to determine the hierarchical relationship between keywords based on the embedded representation of the graph structure, divide the keyword hierarchical structure, group and reorganize the text data associated with the keywords according to the hierarchical relationship of the keywords, and generate structured documents.
[0048] Furthermore, the calculation formula of semantic similarity is: ,
[0049] in, is the keyword vector and The semantic similarity between is the index of the keyword vector, is the index of the dimension, is the number of dimensions, Respectively The keyword vector of dimension, The keyword vectors and The norm of Respectively The coefficients of the keyword vector of dimension , is an exponential function, .
[0050] Furthermore, the preliminary structured document model is trained based on the training keyword set and the structured text to obtain a structured document model, including:
[0051] The training keyword set is divided into a training data set and a test data set by random selection;
[0052] Input the training data set into the preliminary structured document model to obtain training documents;
[0053] The difference between the training document and the structured text is calculated through the loss function to obtain the training difference;
[0054] Adjusting the parameters of the preliminary structured document model according to the training difference;
[0055] When the training difference is lower than the preset training difference and the rate of change of its downward trend meets the preset rate of change, the training is stopped to obtain a mid-term structured document model;
[0056] Input the test data set into the mid-term structured document model to obtain a test document;
[0057] The difference between the test document and the structured text is calculated through the loss function to obtain the test difference;
[0058] When the test difference is within the preset test difference, a structured document model is obtained. When the test difference is not within the preset threshold, retraining is performed and the direction of adjusting the parameters is modified.
[0059] The above solution of the present invention includes at least the following beneficial effects:
[0060] By analyzing the structure of sentences, the present invention can more accurately extract the core meaning of sentences and establish a keyword data set at the sentence level, thereby providing more accurate semantic input for the follow-up. This function not only focuses on single words, but also understands the relationship between words in sentences through grammatical analysis, which helps to better grasp the multi-dimensional information in the context. It can process texts containing complex syntactic structures and long sentences, and enhances the system's ability to process complex documents, especially in long texts containing multiple information levels, and can extract key semantic information.
[0061] The present invention can automatically identify the core information of a paragraph and the hierarchical structure between sentences by analyzing the logical relationship between sentences in a paragraph, thereby enhancing the system's ability to understand the semantics of a paragraph and ensuring that information in a paragraph is not missed. The present invention can accurately extract the core keywords of a paragraph by associating and merging the keywords of sentences in a paragraph, thereby avoiding the problems of keyword dispersion and inaccurate information extraction in traditional methods. By merging and sorting the core keywords in a paragraph, the high relevance of the paragraph when creating a document is ensured, especially for paragraphs containing multi-level information and logical relationships. By analyzing the relationship between sentences, the present invention can accurately extract and associate important information in the paragraph.
[0062] By analyzing the correlation between paragraphs, the present invention can understand and identify the core content within a chapter, improve the overall grasp of the document structure, provide a clearer structural view for the chapters of the document, thereby improving the hierarchy and accuracy of document creation, and calculating the correlation strength of each paragraph in the chapter. The system can more accurately locate the core content of the chapter. During the creation process, the system quickly matches related chapters according to chapter keywords, thereby greatly improving creation efficiency and accuracy. The text can be classified and indexed according to the core content of the chapter, thereby improving the degree of structuring of the document.
[0063] The present invention can efficiently create documents for text data input by users by constructing a structured document model based on a graph neural network. Compared with traditional manual editing, the structured document model can understand the relationship between texts from a deeper semantic level, ensuring that the document structure is more accurate. Through continuous training of the structured document model, the structured document model can be dynamically adjusted and optimized to adapt to the creation of different types of documents, thereby improving the long-term stability and adaptability of the system.
[0064] By analyzing the keywords in the text chapters, the present invention can identify the main fields involved in the text and attach accurate field labels to the text. This process helps the system understand the text content from multiple dimensions, improves the semantic understanding ability of the text content, identifies the core field information of the text, and can accurately classify the text, ensuring the field matching of the text at a higher level, making the document creation results more targeted and accurate, analyzing the overall semantic structure of the text, extracting the field information of the text, and deeply understanding the theme and background of the text, thereby providing users with more in-depth structured documents. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a flowchart of a method for creating a structured document based on a deep learning model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0066] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0067] like Figure 1 As shown, an embodiment of the present invention proposes a method for creating a structured document based on a deep learning model, the method comprising:
[0068] Step S100, obtaining basic text information collected by the user, and preprocessing it, converting the format into a unified format, and obtaining text data; Step S200, processing the text data and segmenting it according to chapters and paragraphs to obtain text segmentation data; Step S300, analyzing the structure of sentences in the paragraph according to the text segmentation data, determining the keywords in the sentences, and obtaining a sentence keyword data set; Step S400, analyzing the logical relationship between sentences in a paragraph according to the sentence keyword data set, associating the sentence keywords in the paragraph, and obtaining a paragraph keyword data set; Step S500, analyzing the correlation between paragraphs in a chapter based on the paragraph keyword data set, identifying the core keywords of the chapter, and obtaining the chapter keyword data set; Step S600, analyzing the fields involved in the text according to the chapter keyword data set, extracting the field information of the text, and obtaining the text keyword data set; Step S700, obtaining structured text from a paper document library, and extracting keywords from the text to obtain a training keyword set; Step S800, constructing a preliminary structured document model based on the graph neural network model, and training the preliminary structured document model according to the training keyword set and the unstructured text to obtain a structured document model; Step S900, inputting text data and a text keyword data set into a structured document model, determining semantic associations between the text data, and obtaining a structured document.
[0069] In an embodiment of the present invention, basic text information collected by a user is obtained and preprocessed to convert the format into a unified format to obtain text data, thereby providing a data basis for subsequent document creation; the text data is processed and segmented according to chapters and paragraphs to obtain text segmentation data, thereby improving the accuracy and efficiency of text analysis; based on the text segmentation data, the structure of the sentences in the paragraphs is analyzed to determine the keywords in the sentences to obtain a sentence keyword data set, and by identifying the grammatical structure and contextual relationship of the sentences, the semantics of the sentences is deeply understood, thereby improving the accuracy of keyword extraction; based on the sentence keyword data set, the logical relationship between the sentences in the paragraphs is analyzed, the sentence keywords in the paragraphs are associated to obtain a paragraph keyword data set, and by associating the sentence keywords in the paragraphs, more accurate paragraph matching is ensured.
[0070] According to the paragraph keyword data set, the correlation between paragraphs in the chapter is analyzed, the core keywords of the chapter are identified, and the chapter keyword data set is obtained. According to the correlation between paragraphs, the internal structure of the text is analyzed to help the system understand the core content and overall structure of the chapter; according to the chapter keyword data set, the fields involved in the text are analyzed, the field information of the text is extracted, and the text keyword data set is obtained. By identifying the core field information of the text, it can provide direction for document creation; structured text is obtained through the paper document library, and keywords are extracted from it to obtain a training keyword set to provide data for subsequent model training; based on the graph neural network model, a preliminary structured document model is constructed, and the preliminary structured document model is trained according to the training keyword set and unstructured text to obtain a structured document model, and a structured document model is constructed to integrate text data and create a structured document; by inputting text data and text keyword data sets into the structured document model, the semantic association between text data is determined to obtain a structured document, and a structured document is created for the user according to the user's text.
[0071] Among them, step S100, obtaining basic text information collected by the user, and preprocessing it, converting the format into a unified format, and obtaining text data, specifically includes:
[0072] The text data collected by users can come from a variety of channels, such as documents, web pages, emails or databases. The system first receives these text information through the interface or user input, and cleans and normalizes the basic text information. The specific steps include removing extra spaces, special symbols, repeated content, HTML tags, etc. Then, the text is recognized and segmented through regular expressions, natural language processing toolkits, etc. Finally, the data is converted into a unified encoding format so that it can be correctly parsed by subsequent processing programs.
[0073] Wherein, step S200, by processing the text data, segmenting it according to chapters and paragraphs, and obtaining text segmentation data, specifically includes:
[0074] Use natural language processing technology to segment text data into chapters and paragraphs. The specific steps include analyzing line breaks, title tags, paragraph identifiers, etc. in the text, automatically identifying chapter boundaries, and segmenting different paragraphs. By analyzing the title and subtitle information in the text, the paragraphs are grouped and divided into chapters. The chapter titles usually have clear identifiers, and the system recognizes the structure of the chapters based on these rules.
[0075] In step S700, structured text is obtained from the paper document library, and keywords are extracted from the structured text to obtain a training keyword set, which specifically includes:
[0076] The system accesses the existing paper document library, selects structured documents related to the target text for collection, obtains the content of the relevant documents through API or database query, extracts keywords from the obtained structured documents, and uses BERT technology to analyze the vocabulary in the documents to generate a set of training keywords similar to the target text. These keywords will be used to train the model.
[0077] In a preferred embodiment of the present invention, step S300, according to the text segmentation data, analyzes the structure of the sentences in the paragraph, determines the keywords in the sentences, and obtains a sentence keyword data set, including:
[0078] Analyze the sentences in the text segmentation data by verbs and build a sentence relationship tree;
[0079] According to the relationship tree, identify the subject, predicate, object and modifying elements of the sentence and determine the sentence structure;
[0080] According to the sentence structure, extract words from the subject, predicate, object and modifying elements to obtain keywords;
[0081] According to the part-of-speech classification, the part-of-speech tags are added to the keywords to obtain the sentence keyword dataset.
[0082] In an embodiment of the present invention, sentences in the document segmentation data are analyzed by verbs to construct a sentence relationship tree. By constructing the sentence relationship tree, the system can clearly identify the dependency relationship between the various components in the sentence, laying a foundation for subsequent keyword extraction; according to the relationship tree, the subject, predicate, object and modifying components of the sentence are identified, the sentence structure is determined, the various components in the sentence are clearly classified, and their positions and functions in the sentence are determined, providing a clear grammatical framework for subsequent keyword extraction; according to the sentence structure, words are extracted from the subject, predicate, object and modifying components to obtain keywords. By extracting keywords from the main components of the sentence, the system can accurately extract the core information in the sentence; according to the part-of-speech classification, part-of-speech tags are added to the keywords to obtain a sentence keyword data set. By adding part-of-speech tags to the keywords, the system can more accurately understand the grammatical function and role of each keyword in the sentence.
[0083] In a preferred embodiment of the present invention, step S400, according to the sentence keyword data set, analyzes the logical relationship between the sentences in the paragraph, associates the sentence keywords in the paragraph, and obtains the paragraph keyword data set, including:
[0084] According to the sentence keyword data set, grammatical matching is performed between adjacent sentences, the logical relationship and its type between adjacent sentences are identified, and logical relationship data is obtained;
[0085] According to the logical relationship data, the sentence keywords corresponding to the logical relationship are associated, merged into a node, and marked with the symbol corresponding to the logical relationship to obtain a paragraph node;
[0086] According to the paragraph nodes, count the number of occurrences of keywords in the paragraph nodes, determine the core keywords of the paragraph nodes, and obtain the characteristics of the paragraph nodes:
[0087] Merge all paragraph node features in a paragraph to obtain a paragraph keyword dataset.
[0088] In an embodiment of the present invention, based on a sentence keyword data set, grammatical matching is performed between adjacent sentences, and the logical relationship and its type between adjacent sentences are identified to obtain logical relationship data, thereby ensuring that the logical relationship between sentences is preserved and avoiding misunderstandings caused by ignoring the internal connection between sentences in a paragraph; based on the logical relationship data, sentence keywords corresponding to the logical relationship are associated and merged into a node, and the corresponding logical relationship symbols are marked on them to obtain paragraph nodes, thereby constructing a semantic network of the paragraph to help understand the theme and hierarchical relationship of the paragraph; based on the paragraph nodes, the number of occurrences of keywords in the paragraph nodes is counted, the core keywords of the paragraph nodes are determined, the paragraph node features are obtained, the frequency and context of the keywords are counted, and the system can accurately identify the core keywords of the paragraph to ensure the accurate extraction of the paragraph theme: all paragraph node features in the paragraph are merged to obtain a paragraph keyword data set, thereby comprehensively improving the semantic expression ability of the paragraph and ensuring that the core information of each paragraph is accurately extracted and represented.
[0089] Among them, according to the sentence keyword data set, grammatical matching is performed between adjacent sentences, the logical relationship and its type between adjacent sentences are identified, and logical relationship data is obtained, which specifically includes:
[0090] First, we need to analyze the logical relationship between sentences. Logical relationships may include but are not limited to:
[0091] Parallel relations, such as sentences connected by and, or, etc.;
[0092] Contrasting relations, such as words that express contrast, such as "however" and "although";
[0093] Time relations, such as then, next, etc., indicate the relationship of time sequence;
[0094] The system captures the grammatical relationship between words in a sentence through dependency syntactic analysis technology, identifies the core components of a sentence and their relationship with each other. Dependency syntactic analysis can reveal the dependency structure of words in a sentence, thereby better understanding the logical connection within the sentence.
[0095] For each pair of sentences, the system will evaluate the semantic relevance between them by comparing their core keywords and grammatical structures. For example, by analyzing the conjunctions or similar grammatical structures between the sentences, the system will automatically determine whether there is a causal relationship, a contrast relationship, or other logical relationship between the two sentences.
[0096] Among them, according to the logical relationship data, the sentence keywords corresponding to the logical relationship are associated and merged into a node, and the corresponding logical relationship symbols are marked on it to obtain a paragraph node, which specifically includes:
[0097] A logical relationship tag is assigned to each logical relationship type. These tags can indicate the semantic connection between sentences, thereby helping the system to accurately construct the semantic network of the paragraph; based on the logical relationship, the system merges the sentence keywords in the paragraph and classifies the related sentence keywords according to the logical relationship to form paragraph nodes. For example, for sentences with causal relationships, the system will aggregate the causal keywords in the sentence to form a node representing the causal relationship. For sentences with parallel relationships, the system will aggregate their keywords into a parallel relationship node; multiple sentences in each paragraph will generate a paragraph node after keyword merging. These nodes contain the core information in the paragraph and can represent the semantic theme of the paragraph. For example, in a paragraph discussing the development of artificial intelligence technology, there may be a technology innovation node or an application scenario node.
[0098] Among them, according to the paragraph node, the number of occurrences of the keywords in the paragraph node is counted, the core keywords of the paragraph node are determined, and the paragraph node features are obtained, which specifically include:
[0099] In each paragraph node, the system will count the number of occurrences of each keyword and calculate the importance of each keyword based on the word frequency. The frequency of a keyword is not just the number of occurrences, but also takes into account the context and language of the keyword in the paragraph. Keywords with higher frequencies and appearing in key positions are usually regarded as core keywords. For certain specific keywords, the system will adjust the weights based on their grammatical and semantic contexts. Certain words that appear frequently in the text but have no practical meaning will have their weights automatically adjusted to avoid interference with core keywords. Based on the statistical results, the system will determine the core keywords of the paragraph based on the frequency, weight and language context of the keywords. These keywords reflect the theme of the paragraph and can be used for subsequent retrieval and matching.
[0100] In a preferred embodiment of the present invention, step S500, based on the paragraph keyword data set, analyzes the correlation between paragraphs in the chapter, identifies the core keywords of the chapter, and obtains the chapter keyword data set, including:
[0101] According to the paragraph keyword data set, the correlation between adjacent paragraphs is calculated to obtain the correlation matrix;
[0102] According to the correlation matrix, the paragraph keywords with correlation higher than the preset correlation value are merged to obtain chapter nodes;
[0103] According to the chapter nodes, determine the correlation strength of keywords between different nodes;
[0104] According to the association strength, the chapter nodes are sorted, the weights of different nodes are determined, and the chapter node sequence is obtained;
[0105] According to the chapter node sequence, determine the paragraph keywords with the highest correlation strength in the chapter and mark them as the core keywords of the chapter;
[0106] Semantically supplement the keywords of other paragraphs in the chapter and merge them with the core keyword set to generate a chapter keyword dataset.
[0107] In an embodiment of the present invention, according to a paragraph keyword data set, the correlation between adjacent paragraphs is calculated to obtain a correlation matrix, so as to deeply understand the relationship between paragraphs and more accurately grasp the overall semantics of the chapter; according to the correlation matrix, paragraph keywords with correlation higher than a preset correlation value are merged to obtain chapter nodes, so as to understand the semantics of the chapter from a more macro level and make the expression of the chapter more holistic and coherent; according to the chapter nodes, the correlation strength of keywords between different nodes is determined to better understand the semantic connection between different chapter nodes, thereby providing support for the organization and optimization of subsequent chapters; according to the correlation strength, the chapter nodes are sorted, the weights of different nodes are determined, and a chapter node sequence is obtained. Through sorting and weight allocation, the system can display the most relevant chapter nodes in priority according to user needs and improve user experience; according to the chapter node sequence, the paragraph keywords with the highest correlation strength in the chapter are determined and marked as the core keywords of the chapter, so as to effectively extract the core concepts in the chapter and provide strong support for subsequent document creation; semantic supplementation is performed on other paragraph keywords in the chapter, and they are merged with the core keyword set to generate a chapter keyword data set, which provides detailed semantic information for subsequent document creation.
[0108] In a preferred embodiment of the present invention, the calculation formula of the correlation degree is: ,
[0109] in, is the correlation between paragraphs, is the index of the paragraph, For paragraphs Neidi The weight of the keywords, For paragraphs Neidi The weight of the keywords, Separate paragraphs and paragraphs The total number of keywords in is the distance between paragraphs, as a parameter.
[0110] In an embodiment of the present invention, the correlation between paragraphs is calculated according to the correlation calculation formula, and the semantic correlation between paragraphs is quantified by the correlation value, providing a scientific basis for subsequent chapter node merging and weight calculation, thereby further improving the accuracy and relevance of document creation.
[0111] In a preferred embodiment of the present invention, step S600, based on the chapter keyword dataset, analyzes the fields involved in the text, extracts the field information of the text, and obtains the text keyword dataset, including:
[0112] According to the chapter keyword data set, the keywords in different chapters are classified and the identifiers of different field types are added to them to obtain the field data set;
[0113] According to the domain data set, the number of keywords identified by different domain types is counted, and the keywords are converted into vector representations to obtain feature values;
[0114] Determine the core domain type of the text by calculating the weight values of different domain types;
[0115] According to the core domain type, relevant keywords are extracted from the chapter keyword dataset to obtain the domain information of the text;
[0116] Based on the domain information, the core domain of the text and its keywords are determined to generate a text keyword dataset.
[0117] In an embodiment of the present invention, keywords in different chapters are classified according to a chapter keyword data set, and different domain type identifiers are attached to them to obtain a domain data set, thereby ensuring that the system can understand the semantic direction of the text; according to the domain data set, the number of keywords identified by different domain types is counted, and the keywords are converted into vector representations to obtain eigenvalues, thereby determining the eigenvalues of the keywords; by calculating the weight values of different domain types, the core domain type of the text is determined, and the core domain of the text is accurately identified; according to the core domain type, keywords related to it are extracted from the chapter keyword data set to obtain the domain information of the text, thereby effectively marking the domain information of the document; according to the domain information, the core domain of the text and its keywords are determined to generate a text keyword data set, and the generated text keyword data set provides strong support for document creation by extracting and summarizing the core domain information of the text.
[0118] Among them, according to the chapter keyword data set, the keywords in different chapters are classified, and different field type identifiers are added to them to obtain the field data set, which specifically includes:
[0119] The system extracts a set of keywords from the keyword data set of each chapter and classifies the keywords through natural language processing technology. During the classification process, the system determines which field each keyword belongs to. For example, keywords in medical documents such as cancer and diagnosis will be marked as the medical field, and keywords in computer documents such as algorithms and neural networks will be marked as the computer field.
[0120] In a preferred embodiment of the present invention, the calculation formula of the weight value is: ,
[0121] in, For the The weight value of each field type, is the index of the field type, is the average feature value of the keywords in the chapter keyword dataset, For the Field type The feature value of a keyword, For the The proportion of keywords in each field type, For the The total number of keywords in each field type, For the Field type The frequency value of the keyword in the chapter keyword dataset, is the coefficient.
[0122] In the embodiment of the present invention, the weight value formula avoids the accumulation of errors when judging the domain weight in a single dimension by introducing the characteristic value, proportion and frequency of the keywords, directly links the importance of the keywords with the domain classification, can distinguish the semantic similarities between domains, and reduce the problem of blurred domain boundaries. Through weighted calculation of multiple factors, it comprehensively covers the role of keywords in domain classification and improves the robustness of classification results. This calculation method can more accurately distinguish between primary and secondary domains when there is an intersection between domain types.
[0123] In a preferred embodiment of the present invention, step S800, based on the graph neural network model, constructs a preliminary structured document model, including:
[0124] Configure the input layer to receive the text keyword dataset and text data, and convert the keywords into vectors to obtain keyword vectors;
[0125] Configure the graph structure layer to determine the nodes of the graph structure based on the keyword vector, calculate the semantic similarity between the nodes, and determine the weight of the edges between the nodes;
[0126] Configure the graph neural network layer to propagate nodes through edges through the graph convolutional network, capture the global semantics of text data, and obtain the embedded representation of the graph structure;
[0127] The output layer is configured to determine the hierarchical relationship between keywords based on the embedded representation of the graph structure, divide the keyword hierarchical structure, group and reorganize the text data associated with the keywords according to the hierarchical relationship of the keywords, and generate structured documents.
[0128] In an embodiment of the present invention, an input layer is configured to receive a text keyword data set and text data, and convert keywords into vectors to obtain keyword vectors, thereby ensuring that the input data has a unified format and numerical range, and providing high-quality basic data for the construction of a subsequent graph structure layer; a graph structure layer is configured to determine the nodes of the graph structure according to the keyword vectors, and calculate the semantic similarity between the nodes, determine the weights of the edges between the nodes, and construct a graph structure by edge weights based on semantic similarity, thereby accurately representing the semantic associations between the keywords; a graph neural network layer is configured to propagate nodes through edges through a graph convolutional network, capture the global semantics of text data, and obtain an embedded representation of the graph structure. The graph convolution operation effectively captures the global semantics, making the semantic expression of the nodes more comprehensive; an output layer is configured to determine the hierarchical relationship between keywords according to the embedded representation of the graph structure, divide the keyword hierarchical structure, group and reorganize the text data associated with the keywords according to the hierarchical relationship of the keywords, generate a structured document, and ensure that the generated keyword structure has a clear hierarchy and strong logic through the hierarchical relationship.
[0129] The configuration graph structure layer is used to determine the nodes of the graph structure according to the keyword vector, calculate the semantic similarity between the nodes, and determine the weight of the edges between the nodes, including:
[0130] Based on the keyword vector, a preliminary graph structure is generated, each keyword is used as a node of the graph, and the edge weights between nodes are calculated based on the semantic similarity. Only edges with weights greater than the preset threshold are retained to reduce the complexity of the graph; the nodes in the graph structure are grouped, and the community discovery algorithm is used to identify node groups. Each group represents a set of keywords with close semantic relationships. The nodes and edges in the graph structure are annotated with semantic features to ensure that these features can be fully utilized in subsequent graph neural network processing.
[0131] Among them, the graph neural network layer is configured to propagate nodes through edges through the graph convolutional network, capture the global semantics of text data, and obtain the embedded representation of the graph structure, including:
[0132] The graph structure is processed using a graph convolutional network. Through graph convolution operations, the semantic information of the node is propagated to the neighboring nodes through the edges, gradually capturing the global semantic characteristics. A multi-layer graph convolutional network is used, with each layer responsible for a larger range of node propagation to build deeper semantic associations. The attention mechanism is introduced during the training process, and the edge weights are dynamically adjusted through GTA to enhance the focus on important nodes. The graph embedding representation is reduced in dimensionality, and a dimensionality reduction algorithm is used to compress the high-dimensional semantic embedding vector to a dimension suitable for subsequent grouping.
[0133] In a preferred embodiment of the present invention, the calculation formula of semantic similarity is: ,
[0134] in, is the keyword vector and The semantic similarity between is the index of the keyword vector, is the index of the dimension, is the number of dimensions, Respectively The keyword vector of dimension, The keyword vectors and The norm of Respectively The coefficients of the keyword vector of dimension , is an exponential function, .
[0135] In an embodiment of the present invention, the semantic similarity formula is based on the multidimensional characteristics of the keyword vector, and comprehensively considers the semantic differences between keywords from multiple dimensions. The vector dimension represents the semantic feature vector of the keyword, and the semantic characteristics of the keyword can be captured more comprehensively through the representation of the high-dimensional space; the rapid decay characteristic of the exponential function makes the similarity calculation sensitive to subtle changes in semantics, and can accurately identify keyword pairs with significant differences in large-scale keywords. The calculated semantic similarity is used as the weight of the edge between nodes in the graph structure, which directly determines the accuracy of the keyword hierarchy division. The edge weight can effectively express the strength of the semantic association between different keywords, thereby helping the model to construct a reasonable node grouping in the graph structure. This grouping method can ensure that keywords with strong semantic association are divided into the same level, while keywords with weaker semantic relationships are assigned to different levels. This provides a scientific basis for the subsequent generation of structured documents and ensures that the document is logically clear and hierarchical.
[0136] In a preferred embodiment of the present invention, step S900, training a preliminary structured document model according to a training keyword set and a structured text to obtain a structured document model, includes:
[0137] The training keyword set is divided into a training data set and a test data set by random selection;
[0138] Input the training data set into the preliminary structured document model to obtain a training matching result set;
[0139] The difference between the training matching result set and the structured text is calculated through the loss function to obtain the training difference;
[0140] Adjusting the parameters of the preliminary structured document model according to the training difference;
[0141] When the training difference is lower than the preset training difference and the rate of change of its downward trend meets the preset rate of change, the training is stopped to obtain a mid-term structured document model;
[0142] Input the test data set into the mid-term structured document model to obtain a test matching result set;
[0143] The difference between the test matching result set and the structured text is calculated through the loss function to obtain the test difference;
[0144] When the test difference is within the preset test difference, a structured document model is obtained. When the test difference is not within the preset threshold, retraining is performed and the direction of adjusting the parameters is modified.
[0145] In an embodiment of the present invention, a preliminary structured document model is trained based on a training keyword set and a structured text to obtain a process of the structured document model. The preliminary structured text model is optimized by combining the training keyword set with a machine learning method, thereby improving the effect of structured document creation. The structured text model obtained through training can better capture the relationship between user needs and document content, thereby improving the accuracy and relevance of document creation.
[0146] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for creating structured documents based on a deep learning model, characterized in that: The method comprises: Obtain basic text information collected by users, preprocess it, convert the format into a unified format, and obtain text data; By processing the text data, segmenting it according to chapters and paragraphs, obtaining text segmentation data; According to the text segmentation data, the structure of the sentences in the paragraph is analyzed to determine the keywords in the sentences and obtain the sentence keyword dataset; According to the sentence keyword dataset, the logical relationship between sentences in the paragraph is analyzed, and the sentence keywords in the paragraph are associated to obtain the paragraph keyword dataset; According to the paragraph keyword dataset, analyze the correlation between paragraphs in the chapter, identify the core keywords of the chapter, and obtain the chapter keyword dataset; According to the chapter keyword dataset, analyze the fields involved in the text, extract the field information of the text, and obtain the text keyword dataset; Obtain structured texts from the paper document library and extract keywords from them to obtain a training keyword set; Based on the graph neural network model, a preliminary structured document model is constructed, and the preliminary structured document model is trained according to the training keyword set and structured text to obtain a structured document model; By inputting text data and text keyword data sets into a structured document model, the semantic association between the text data is determined to obtain a structured document.
2. The method for creating a structured document based on a deep learning model according to claim 1, characterized in that: According to the text segmentation data, the structure of the sentences in the paragraph is analyzed to determine the keywords in the sentences and obtain the sentence keyword dataset, including: Analyze the sentences in the text segmentation data by verbs and build a sentence relationship tree; According to the relationship tree, identify the subject, predicate, object and modifying elements of the sentence and determine the sentence structure; According to the sentence structure, extract words from the subject, predicate, object and modifying elements to obtain keywords; According to the part-of-speech classification, the part-of-speech tags are added to the keywords to obtain the sentence keyword dataset.
3. The method for creating a structured document based on a deep learning model according to claim 2, characterized in that: According to the sentence keyword dataset, the logical relationship between sentences in a paragraph is analyzed, and the sentence keywords in the paragraph are associated to obtain the paragraph keyword dataset, including: According to the sentence keyword data set, grammatical matching is performed between adjacent sentences, the logical relationship and its type between adjacent sentences are identified, and logical relationship data is obtained; According to the logical relationship data, the sentence keywords corresponding to the logical relationship are associated, merged into a node, and marked with the symbol corresponding to the logical relationship to obtain a paragraph node; According to the paragraph nodes, count the number of occurrences of keywords in the paragraph nodes, determine the core keywords of the paragraph nodes, and obtain the characteristics of the paragraph nodes: Merge all paragraph node features in a paragraph to obtain a paragraph keyword dataset.
4. The method for creating a structured document based on a deep learning model according to claim 3, characterized in that: According to the paragraph keyword dataset, we analyze the correlation between paragraphs in a chapter, identify the core keywords of the chapter, and obtain the chapter keyword dataset, including: According to the paragraph keyword data set, the correlation between adjacent paragraphs is calculated to obtain the correlation matrix; According to the correlation matrix, the paragraph keywords with correlation higher than the preset correlation value are merged to obtain chapter nodes; According to the chapter nodes, determine the correlation strength of keywords between different nodes; According to the association strength, the chapter nodes are sorted, the weights of different nodes are determined, and the chapter node sequence is obtained; According to the chapter node sequence, determine the paragraph keywords with the highest correlation strength in the chapter and mark them as the core keywords of the chapter; Semantically supplement the keywords of other paragraphs in the chapter and merge them with the core keyword set to generate a chapter keyword dataset.
5. The method for creating a structured document based on a deep learning model according to claim 4, characterized in that: The calculation formula of correlation is: , in, is the correlation between paragraphs, is the index of the paragraph, For paragraphs Neidi The weight of the keywords, For paragraphs Neidi The weight of the keywords, Separate paragraphs and paragraphs The total number of keywords in is the distance between paragraphs, as a parameter.
6. The method for creating a structured document based on a deep learning model according to claim 5, characterized in that: According to the chapter keyword dataset, we analyze the fields involved in the text, extract the field information of the text, and obtain the text keyword dataset, including: According to the chapter keyword data set, the keywords in different chapters are classified and the identifiers of different field types are added to them to obtain the field data set; According to the domain data set, the number of keywords identified by different domain types is counted, and the keywords are converted into vector representations to obtain feature values; Determine the core domain type of the text by calculating the weight values of different domain types; According to the core domain type, relevant keywords are extracted from the chapter keyword dataset to obtain the domain information of the text; Based on the domain information, the core domain of the text and its keywords are determined to generate a text keyword dataset.
7. The method for creating a structured document based on a deep learning model according to claim 6, characterized in that: The weight value is calculated as follows: , in, For the The weight value of each field type, is the index of the field type, is the average feature value of the keywords in the chapter keyword dataset, For the Field type The feature value of a keyword, For the The proportion of keywords in each field type, For the The total number of keywords in each field type, For the Field type The frequency value of the keyword in the chapter keyword dataset, is the coefficient.
8. The method for creating a structured document based on a deep learning model according to claim 7, characterized in that: Based on the graph neural network model, a preliminary structured document model is constructed, including: Configure the input layer to receive the text keyword dataset and text data, and convert the keywords into vectors to obtain keyword vectors; Configure the graph structure layer to determine the nodes of the graph structure based on the keyword vector, calculate the semantic similarity between the nodes, and determine the weight of the edges between the nodes; Configure the graph neural network layer to propagate nodes through edges through the graph convolutional network, capture the global semantics of text data, and obtain the embedded representation of the graph structure; The output layer is configured to determine the hierarchical relationship between keywords based on the embedded representation of the graph structure, divide the keyword hierarchical structure, group and reorganize the text data associated with the keywords according to the hierarchical relationship of the keywords, and generate structured documents.
9. The method for creating a structured document based on a deep learning model according to claim 8, characterized in that: The calculation formula for semantic similarity is: , in, For keyword vector and The semantic similarity between is the index of the keyword vector, is the index of the dimension, is the number of dimensions, Respectively The keyword vector of dimension, The keyword vectors and The norm of Respectively The coefficients of the keyword vector of dimension , is an exponential function, .
10. The method for creating structured documents based on a deep learning model according to claim 9, characterized in that: According to the training keyword set and structured text, the preliminary structured document model is trained to obtain a structured document model, including: The training keyword set is divided into a training data set and a test data set by random selection; Input the training data set into the preliminary structured document model to obtain training documents; The difference between the training document and the structured text is calculated through the loss function to obtain the training difference; Adjusting the parameters of the preliminary structured document model according to the training difference; When the training difference is lower than the preset training difference and the rate of change of its downward trend meets the preset rate of change, the training is stopped to obtain a mid-term structured document model; Input the test data set into the mid-term structured document model to obtain a test document; The difference between the test document and the structured text is calculated through the loss function to obtain the test difference; When the test difference is within the preset test difference, a structured document model is obtained. When the test difference is not within the preset threshold, retraining is performed and the direction of adjusting the parameters is modified.
Citation Information
Patent Citations
Text semantic analysis method
CN109271626A
Financial text summarization method based on keyword heterogeneous graph and semantic matching
CN117725928A
Document generation method based on model
CN118940761A
Standard chapter splitting method
CN119067097A
Segment vectors
US20200184016A1
Cited By
Intelligent word cloud display method and system based on machine learning and ES word cloud statistics
CN119884362A
Agricultural product data space platform construction method and system based on large-scale corpus
CN120086308A
Method and System for Constructing an Agricultural Product Data Space Platform Based on a Large-Scale Corpus
CN120086308B
Large language model construction method and device based on NL2SQL
CN120448410A
PDF text extraction method and system based on large language model
CN120599643A