Graph-based document expressive description method and system and readable storage medium
Through the graph-based document expression description method, the heterogeneous graph is constructed using semantic web technology, which solves the ambiguity problem when the machine understands the document, realizes accurate understanding and efficient retrieval of the document, and improves the knowledge representation and intelligent retrieval capabilities of information resources.
Patent Information
- Application Number
- CN202411969707.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The syntactic sequence form and meaning of natural language are many-to-many relationships, which leads to ambiguity easily when machines process documents. Humans need to use domain knowledge and common sense to understand sentences, which is difficult to store them all in computer databases.
The document expression description method based on graphs is adopted to semanticize documents through semantic web technology, construct heterogeneous graphs, understand and interpret document content from multiple angles, eliminate domain term ambiguity, and achieve accurate understanding and efficient retrieval of documents.
Effectively eliminate the ambiguity of domain terms, build a shared domain concept model, improve the knowledge representation and intelligent retrieval capabilities of information resources, and significantly improve the accuracy and efficiency of document processing.
Smart Images

Figure CN119903829A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of document processing and semantic analysis, and in particular to a graph-based document expressiveness description method, system and readable storage medium. Background Art
[0002] There is a many-to-many relationship between the syntactic sequence form and meaning of natural language, and it is easy for machines to produce ambiguity when processing documents. Human natural language sentences are coherently grouped, and there is a lack of systematic research on mining their implicit contextual meanings. In addition, humans need to use domain knowledge and common sense to do correlation analysis to understand sentences, and it is difficult to store all this knowledge in computer databases. Cognitive linguistics proposes an interactive interpretation method. People use their interpretation ability to act on semantic content, which will cause changes in the framework and cognitive domain parameters. Different cognitive domains will lead to different understandings of the same information. Therefore, a new method is needed to better expressively describe documents in order to solve the problem of machine understanding of documents. Summary of the invention
[0003] The purpose of the present invention is to provide a graph-based document expressive description method, which can semanticize documents through semantic web technology, construct heterogeneous graphs, understand and interpret document content from multiple perspectives, eliminate ambiguity in domain terminology, and achieve accurate understanding and efficient retrieval of documents; a further purpose is to be able to build a shared conceptual model while meeting the special needs of vertical domain documents, and provide effective support for knowledge representation and intelligent retrieval of information resources.
[0004] In order to solve the above technical problems, this application provides the following technical solutions:
[0005] A graph-based document expressive description method comprises the following steps:
[0006] (1) Semantize document information resources to present them in a machine-readable form and reveal the semantic connections between and within documents. At the same time, serialize the relationships between document entities and their attributes to build a corpus.
[0007] (2) Model the entire corpus as a heterogeneous graph according to the hierarchical structure of words, sentences, and passages;
[0008] (3) Provide a detailed expressive description of the document, gradually expanding from fine-grained to coarse-grained to provide a comprehensive document description.
[0009] Preferably, it adopts RDF (Resource Description Framework) and URI (Uniform Resource Identifier) to standardize document resource description and location, granularize document information, break down management levels, and be precise to the inside of the document, ensuring the matching and accuracy between the document's metadata and the resources it describes.
[0010] Preferably, in terms of the linking mechanism of linked data, a more universal URI model is used as the means of association, and the linked data model is constructed in combination with URI to realize the semantic processing of resources; a stable URI source is combined with a precise RDF description to provide a basic framework for the digitization of official document resources.
[0011] Preferably, URI identifiers are used to make semantic associations with document entities, each document record is regarded as an entity and its classes and attributes, a URI structure that is easy to parse is determined, and the composition and location of resources are understood through URI hierarchical parsing.
[0012] Preferably, the RDF resource framework is applied to describe the document entity semantically. RDF uses the triple "subject-predicate-object" to describe the document entity and its class and attributes, forming a directed graph structure with nodes and edges with labels / attributes.
[0013] Preferably, the triple acquisition method is divided into a fine-grained level and a coarse-grained level: the fine-grained level, i.e., the internal graph of the resource entity, uses triples in the form of "subject, predicate, object" as directed graphs of nodes and edges, performs named entity recognition on document resources, obtains entities as subjects of triples and entities as objects, extracts predicates through syntactic dependency analysis, and combines them into triples of subject-predicate-object structures that can summarize the main content of the sentence, performs semantic description of triples in N-Triples format, and performs code serialization and text implementation based on official document data of a policy document library of a certain institute;
[0014] At the coarse-grained level, that is, the association graph between resource entities, that is, the heterogeneous graph of words, sentences, and documents, words, sentences, and documents are used as nodes respectively. Edges are constructed between nodes according to the co-occurrence of words in the corpus: "word-word edge", the appearance of words in sentences; "word-sentence edge" and the appearance of words in documents "word-document edge", and finally the graph is constructed using triplets in the form of "word, edge, word", "word, edge, sentence", "word, edge, document" and "sentence, edge, document".
[0015] A URI hierarchical parsing method is used to summarize heterogeneous graphs, allowing users to freely select attributes and relationships of interest to generate a flexible graph summary; the graph summary compresses multiple similar nodes into a supernode to create a summary graph, retains the graph structure, and outputs a more abstract and compact graph. Users can control the parsing of the graph summary to achieve drilling down or scrolling up of information.
[0016] A graph-based document expressive description system is also disclosed, comprising:
[0017] The semantic processing module is used to semantically process document information resources, present them in a machine-readable form, reveal the semantic connections between documents and within them, serialize the relationships between document entities and their attributes, and construct a corpus;
[0018] The graph construction module is used to model the entire corpus into a heterogeneous graph according to the hierarchical structure of words, sentences, and passages;
[0019] Description module, which is used to describe the document in detail, from fine-grained to coarse-grained, to provide a comprehensive document description;
[0020] Standardization module, used to standardize document resource description and location using RDF and URI;
[0021] The association module is used to apply URI identifiers to semantically associate document entities and apply RDF resource framework to semantically describe document entities;
[0022] The parsing module is used to summarize heterogeneous graphs using the URI hierarchical parsing method and generate smart graph summaries.
[0023] And a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned graph-based document expressive description method are implemented.
[0024] Compared with the prior art, the document expressive description method based on graph of the present invention has at least the following beneficial effects:
[0025] 1. Enhanced knowledge representation and retrieval capabilities: This method can effectively eliminate the ambiguity of domain terms and build a shared domain concept model. This achievement has laid a solid foundation for the knowledge representation of information resources, and also provided strong support for intelligent retrieval, greatly improving the accuracy and efficiency of information retrieval.
[0026] 2. Improve document processing quality: With the help of semanticization and heterogeneous graph construction technology, machines can understand document content more deeply, effectively reduce processing errors caused by semantic ambiguity, significantly improve the accuracy and efficiency of document processing, and enable machines to perform better in document processing.
[0027] 3. Comprehensive and in-depth understanding of the document: It provides fine-grained and coarse-grained document description methods to analyze the document content from different levels. This multi-dimensional analysis perspective allows users to fully and deeply understand the document, not missing any details, and also grasp the core points of the document as a whole.
[0028] 4. Improve the flexibility and practicality of the method: The application of URI hierarchical parsing and dynamic graph summarization methods gives users the ability to control the parsing process. Users can easily obtain the required information according to their own needs. This high degree of autonomy enhances the flexibility and practicality of the method in practical applications.
[0029] 5. Accurately grasp document semantics: Through semanticization and heterogeneous graph construction, it is possible to keenly capture the semantic relationship in the document and fundamentally eliminate possible ambiguity. This makes the machine's understanding of the document more accurate and provides a reliable guarantee for subsequent processing.
[0030] 6. Optimize information retrieval experience: It provides an effective way to represent the knowledge of information resources, and realizes accurate retrieval function based on carefully constructed semantic models and graph structures. When users search for information, they can quickly and accurately obtain the required content, greatly improving the retrieval efficiency.
[0031] 7. Meet the needs of vertical fields: Taking full account of the special needs of vertical fields (such as official documents), it can well adapt to the requirements of confidentiality and targeted release. Through graph summarization and URI parsing technology, it provides flexible information services for different users and meets the diverse information processing needs of vertical fields.
[0032] 8. Adapt to multiple processing scenarios: Users can freely control the parsing granularity according to actual needs, and can quickly browse the overall summary of the document or deeply analyze the detailed content of the document. This flexibility greatly improves the efficiency and adaptability of document processing and can be widely used in various processing scenarios.
[0033] The following is a further explanation of a graph-based document expressive description method of the present invention in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A flexible graph summary schematic diagram (triplet) of a graph-based document expressive description method of the present invention. DETAILED DESCRIPTION
[0035] The present invention adopts RDF (Resource Description Framework) and URI (Uniform Resource Identifier) to standardize document resource description and location, granularize document information, break the management hierarchy, and accurately identify the document. This ensures the matching and accuracy between the metadata of the document and the resources it describes. When transmitting semantic data between machines that do not understand each other, ambiguity can be eliminated, improving the accessibility and comprehensibility of the document.
[0036] Although URL is one of the most important means of explaining the location of information resources and can provide a path to find resources, URL is only an address and does not contain a description of the resource domain. Therefore, in terms of the linking mechanism of associated data, the present invention adopts a more universal URI model as an association means, combines it with the URI, and constructs an associated data model, thereby realizing the semantic processing of resources. Its advantages are mainly reflected in the combination of a stable URI source with an accurate RDF description, providing a convenient and easy-to-manage basic framework for the digitization of official document resources. As long as the monotony and stability of the URI are maintained, multiple semantic models can be associated with it to achieve the decentralization of resources, thereby realizing the association between official document resources.
[0037] [Example scenario - official documents] Through the semantic web technology method, a graph-based expressive description method for official documents is implemented. This method uses formal description technology to accurately define the concepts, terms and relationships in official documents, and then realizes the collection, structured processing and recovery functions of official document data. This method can eliminate the ambiguity of terminology in the official document field, analyze the logical relationship contained in the content of official document sentences, conduct a deeper semantic analysis of official document information, and realize the expressive description of official documents based on graphs. It enables machines to organize official document knowledge through understandable language expressions, build a shared official document field concept model, and provide effective support for the knowledge representation and intelligent retrieval of official document resources.
[0038] [Special example scenario - confidentiality, targeted release] Due to the needs of economic and social development, official document information resources are often used at a high rate, and there is also a need for cross-use between different institutions and departments. However, due to the confidentiality of official document information resources themselves, when departments have confidential and confidential characteristics, they are not required to open the data, but can publish the relevant information of official document resources in the form of linked data in a targeted manner according to the attributes and needs of the visitors.
[0039] This paper proposes a new graph-based document expressive description method, which applies recognition capabilities to semantic content. By adjusting the parameters of the framework (triple framework at the fine-grained and coarse-grained levels) and cognitive domain (hierarchical analysis from fine-grained to coarse-grained), the document content can be understood and interpreted from multiple perspectives, thereby enabling a better expressive description of the document. The specific steps are as follows:
[0040] Semantic processing and corpus construction: Through semantic web technology, formal descriptions are provided for concepts, terms, and relationships in a given vertical field to achieve the collection, structuring, and recovery of linked data. Parse the sentence content in the document, identify the implied logical relationship, use the Resource Description Framework (RDF) to extract the sentence as a [subject-predicate-object] relationship, and serialize the relationship between document entities and their attributes to form a corpus.
[0041] Heterogeneous graph modeling: The entire corpus is modeled as a heterogeneous graph according to the hierarchical structure of [word-sentence-article]. The heterogeneous graph includes the internal graph of resource entities and the association graph between resource entities.
[0042] Fine-grained and coarse-grained description:
[0043] Fine-grained level: The internal graph of the resource entity adopts a fine-grained triple structure to semantically describe the document entity and its classes and attributes, and uses the N-Triples format for serialized storage.
[0044] Coarse-grained level: The resource entity association graph adopts a coarse-grained triple structure, with words, sentences, and documents as nodes. According to the co-occurrence of words in the corpus, the occurrence of words in sentences, and the occurrence of words in documents, the association edges between words, sentences, and documents are constructed, and the weights of the edges are calculated respectively.
[0045] Generate graph summaries: Provide document descriptions from fine-grained to coarse-grained, allowing users to freely select attributes and relationships of interest through URI hierarchical parsing methods to generate flexible graph summaries with controllable information content.
[0046] The concept of the present invention is described in detail below with a specific embodiment. A URI hierarchical parsing method is used to parse official document information resources.
[0047] 1. Prepare document resources
[0048] Select the following multiple document resources as processing objects:
[0049] 1.1 Official document resource 1:
[0050] There is an official document record, the specific content of which is as follows:
[0051] Title: Notice of the General Office of a Ministry on planning and reserving major agricultural and rural projects and deepening financing docking services
[0052] URL:https: / / www.*gov.cn / zhengce / zhengceku / 202408 / content_6969488.htm
[0053] Issuing authority: General Office of a certain ministry
[0054] Document number: Agricultural Office Planning and Finance
[2024] No. 20
[0055] Source: A certain website
[0056] Subject classification: Urban and rural construction, environmental protection\Urban and rural construction (including housing)
[0057] Document type: Notice
[0058] Date of writing: August 9, 2024
[0059] Text: In order to thoroughly implement the decisions and arrangements of * and a certain hospital, implement * No. 1... (part of the text content is omitted here) Document resource 2 (assuming it exists):
[0060] Title: Opinions of a certain ministry on strengthening agricultural science and technology innovation and promotion
[0061] URL:https: / / www.*gov.cn / zhengce / zhengceku / 202407 / content_6888888.htm
[0062] Issuing authority: a certain department
[0063] Document number: Agricultural Science
[2024] No. 15
[0064] Source: A certain website
[0065] Subject classification: Science and technology, education\technology
[0066] Document type: Opinion
[0067] Date of writing: July 15, 2024
[0068] Text: Agricultural science and technology innovation is the key driving force for agricultural modernization. In order to accelerate the pace of agricultural science and technology innovation and improve the level of transformation and application of agricultural science and technology achievements, a certain department has put forward the following opinions... (Part of the text is omitted here)
[0069] Official document resource three (assuming it exists):
[0070] Title: Implementation Plan of the General Office of a Ministry on Promoting Green Development of Agriculture
[0071] URL:https: / / www.*gov.cn / zhengce / zhengceku / 202406 / content_6777777.htm
[0072] Issuing authority: General Office of a certain ministry
[0073] Document number: Agricultural Office Environmental Protection
[2024] No. 10
[0074] Source: A certain website
[0075] Subject classification: Agriculture, forestry, water conservancy\Agriculture, forestry, water conservancy
[0076] Document type: Implementation plan
[0077] Date of writing: June 20, 2024
[0078] Text: In order to implement the ecological civilization thought, promote the sustainable development of agriculture, and realize the green transformation of agriculture, this implementation plan is specially formulated... (Part of the text is omitted here)
[0079] 2. Semantic processing and corpus construction
[0080] This batch of official document resources is processed semantically, and various types of information in the documents are converted into a form that can be interpreted by machines, and the semantic connections between and within documents are clarified. For example, in official document resource 1, the name of the institution ("the General Office of a certain ministry"), the time ("August 9, 2024"), and the subject-related entities ("major agricultural and rural projects" and "financing docking services" are identified; in official document resource 2, the name of the institution ("a certain ministry"), the time ("July 15, 2024"), and the subject-related entities ("agricultural science and technology innovation" and "transformation of scientific and technological achievements" are identified; in official document resource 3, the name of the institution ("the General Office of a certain ministry"), the time ("June 20, 2024"), and the subject-related entities ("green development of agriculture" and "ecological civilization thought" are identified. At the same time, the relationship between these entities and their attributes is serialized and constructed into a corpus.
[0081] 3. Constructing a heterogeneous graph
[0082] The constructed corpus is modeled as a heterogeneous graph according to the hierarchical structure of words, sentences, and articles. In this graph, words, sentences, and documents are respectively regarded as different types of nodes, and edges are constructed according to the relationship between them. For example, for official document resource 1, the co-occurrence of words such as "agriculture" and "rural" in the corpus constructs a word-word edge, the words in the sentence "major agricultural and rural projects plan and reserve to deepen financing docking services" construct a word-sentence edge, and the sentence and the entire official document construct a sentence-document edge, etc. Similarly, similar construction operations are performed on official document resources 2 and 3, and finally a heterogeneous graph containing multiple official document resource information is formed.
[0083] A graph-based document expressive description method that understands and analyzes documents from multiple perspectives by adjusting the framework and cognitive domain parameter changes. The framework refers to the background or environment in which the document information is located, including various elements and relationships related thereto. The present invention implements the framework from a fine-grained level and a coarse-grained level respectively (4. Document expressive description (fine-grained level); 5. Document expressive description (coarse-grained level)). The cognitive domain refers to the observation angle or reference range used by people when understanding and analyzing information. Different cognitive domains will lead to different understandings and analyses of the same document information. The present invention implements the cognitive domain from the perspective of graph analysis (6. Graph analysis and graph summary function implementation).
[0084] 4. Document expressive description (fine-grained level)
[0085] At the fine-grained level, i.e., the internal graph of resource entities, triples in the form of [subject, predicate, object] are used as directed graphs with nodes and edges. Named entity recognition is performed on document resources to obtain entities that are subjects and objects of triples. Predicates are extracted through syntactic dependency analysis and combined into triples of subject-predicate-object structures that can summarize the main content of the sentence. The triples are semantically described in the N-Triples format, and the code is serialized and implemented in text based on the official document data of a certain hospital policy document library.
[0086] ① Named Entity Recognition:
[0087] Identify entities with specific meanings in unstructured text, mainly including names of people, places, institutions, time, quantity, etc. Use Python language and spaCy library to do named entity recognition tasks, convert text into spaCy Doc objects, and store all relevant NLP features obtained from syntax.
[0088] For the sentence in the official document resource 1, "Notice of the General Office of a Certain Ministry on Planning, Reserving and Deepening Financing Docking Services for Major Agricultural and Rural Projects", we use the Python language and spaCy library to perform named entity recognition, convert the text into a spaCy Doc object, and identify entities such as the subject "General Office of a Certain Ministry", the object "financing docking services", and related NLP features.
[0089] For the sentence "Opinions of a certain ministry on strengthening agricultural science and technology innovation and promotion" in the official document resource 2, entities such as the subject "a certain ministry" and the object "agricultural science and technology innovation and promotion" are identified.
[0090] For the sentence in document resource three, “Implementation plan of the General Office of a certain ministry on promoting green development of agriculture”, entities such as the subject “General Office of a certain ministry” and the object “green development of agriculture” are identified.
[0091] ② Predicate extraction:
[0092] After named entity recognition, predicates are extracted based on the relationship between entities. Predicates are attributes attached to entities. The date and address of a document are examples of predicates.
[0093] 1. After named entity recognition of document resource 1, predicates are extracted based on the relationship between entities, such as "about".
[0094] 2. Similar predicate extraction operations are also performed in document resource two and document resource three, such as predicates such as "strengthen" in document resource two and predicates such as "promote" in document resource three.
[0095] ③Triple construction and serialized storage (N-Triples format):
[0096] The N-Triples format is used to serialize and store the extracted document semantic triples.
[0097] Combine the entities and predicates identified in the document resource 1 into triples in the form of [subject, predicate, object], such as [General Office of a certain ministry, about, financing docking service], etc., and serialize and store the subject, predicate and object triples of each document in N-Triples format. The document number is used as the identification ID, and the predicate adopts the semantic logical attributes of the hybrid RDF core metadata, Dublin Core metadata, Schema.org metadata and custom document metadata, and the object is the metadata value of the document. For example, for the document resource entity with the document number "No. 20 of the Agricultural Office of Finance and Economics
[2024] ", its RDF serialization description is as follows:
[0098] <http: / / hostname / zhengce#Agricultural Office and Finance Department
[2024] No. 20><http: / / www.w3.org / 1999 / 02 / 22-rdf-syntax-ns#type><http: / / hostname / zhengce#entity>.
[0099] <http: / / hostname / zhengce#Agricultural Office and Finance Department
[2024] No. 20><http: / / purl.org / dc / elements / 1.1 / creator><http: / / hostname / zhengce#General Office of a Certain Ministry>.
[0100] <http: / / hostname / zhengce#Agricultural Office and Finance Department
[2024] No. 20><http: / / purl.org / dc / elements / 1.1 / date>"September 9, 2024"^^<http: / / www.w3.org / 2001 / XMLSchema#date>.
[0101] <http: / / hostname / zhengce#Agricultural Office and Finance Department
[2024] No. 20><http: / / hostname / zhengce#id>"Agricultural Office and Finance Department
[2024] No. 20".
[0102] <http: / / hostname / zhengce#Agricultural Office and Finance Department
[2024] No. 20><http: / / schema.org / location>"https: / / www.gov.cn / zhengce / zhengceku / 202408 / content_6969488.htm".
[0103] <http: / / hostname / zhengce#Agricultural Office and Finance Department
[2024] No. 20><http: / / purl.org / dc / elements / 1.1 / title>"Notice of the General Office of a Certain Ministry on Doing a Good Job in Planning, Reserving, Deepening Financing Docking Services for Major Agricultural and Rural Projects".
[0104] Similar triple construction and serialized storage operations are also carried out on Document Resource 2 and Document Resource 3. For example, the document number of Document Resource 2 is "Agricultural Science
[2024] No. 15", and its corresponding RDF serialized description is constructed (based on the actually identified entities and attributes). The document number of Document Resource 3 is "Agricultural Office of Environmental Protection
[2024] No. 10", and its RDF serialized description is also constructed.
[0105] Thus, we get triples containing attributes, such as Figure 1 As shown, Figure 1 Part (a) is the sentence, part (b) is the document, and part (c) is the heterogeneous graph.
[0106] 5. Document expressive description (coarse-grained level)
[0107] At the coarse-grained level, the relationship graph between resource entities is a heterogeneous graph of words, sentences, and documents, whose triple structure is in the form of [node-relationship-node].
[0108] Different from the fine-grained level, the coarse-grained level uses words, sentences, and documents as nodes, and constructs edges between nodes based on the co-occurrence of words in the corpus (word-word edge), the occurrence of words in sentences (word-sentence edge), and the occurrence of words in documents (word-document edge). Finally, the graph is constructed using triples in the form of [word, edge, word], [word, edge, sentence], [word, edge, document], [sentence, edge, document], etc.
[0109] Calculate the weight of the edge between nodes:
[0110] 5.1. For the weights of word nodes and edges between word nodes, taking the words in official document resources 1, 2, and 3 as examples, such as "agriculture", "technology", "green", etc., according to the number of sliding windows in the corpus and other information, the normalized point-by-point mutual information NPMI is used to calculate the edge weights (see the formula below) to quantify the strength of the semantic association between them.
[0111] The weight of the edge between node i and node j is defined as
[0112]
[0113] The weight of the edge between a word node and a word node (i, j) is calculated using the normalized point-wise mutual information NPMI, defined as
[0114]
[0115] Where #W(i) is the number of sliding windows in the corpus that contain word i, #W(i,j) is the number of sliding windows that contain words i and j, and #W is the total number of sliding windows in the corpus.
[0116] 5.2. For the weight of the edge between the word node and the document node, take the word "major project" in the official document resource 1 as an example, based on the number of times it appears in the document, the frequency in all documents, and the number of documents containing the word, use TF-IDF to calculate the weight of the edge (see the formula below) to determine the importance of the word to the document. Similarly, similar calculations are performed for the related words in official document resources 2 and 3.
[0117] The weight of the edge between a word node and a document node (i, j) is calculated using TF-IDF and is defined as
[0118] TF-IDF i,j =TF i,j ×IDF i
[0119]
[0120]
[0121] Among them, n i,j Representation word t i In the document d j The number of occurrences in TF i,j Representation word t i In the document d j The frequency of occurrence in. |D| represents the number of all documents, |m:t i ∈d j | indicates that the word t is included i The number of documents containing the word t i The number of documents is 0, which causes an error in the calculation, so the denominator is increased by 1. IDF i Representation word t i The importance of a word. If there are fewer documents containing a word, it means that the word is more important and the IDF value is larger.
[0122] 5.3. For the weight of the edge between the sentence node and the document node, take a sentence in the document resource 1 as an example, and use BM25 to calculate the edge weight (see the formula below) based on the number of words in the sentence, the inverse document frequency of each word, the number of times it appears in the document, and the average length of all documents (these parameters can be adjusted according to the actual application scenario). Perform the same calculation operation on the sentences in the document resources 2 and 3.
[0123] The weight of the edge between the sentence node and the document node (i, j) is calculated using BM25 and is defined as
[0124]
[0125] Where i represents a sentence, j represents a document, and n is the number of words in sentence i. z is the zth word in the sentence, IDF(i z ) is the word i z The inverse document frequency, f(i z ,j) is word i z The number of times it appears in document j. avgdl is the average length of all documents. Parameter k 1It is used to standardize the range of article word frequencies. Parameter b is used to adjust the impact of document length on the score. These parameters usually need to be tuned according to the actual application scenario.
[0126] 5.3. Construct the relationship diagram between resource entities:
[0127] The graph is constructed using triples in the form of [word, edge, word], [word, edge, sentence], [word, edge, document], [sentence, edge, document], etc. For example, in the heterogeneous graph of official document resources 1, 2, and 3, the word nodes such as "agriculture" and "rural" are connected according to the calculated edge weights, and the "agriculture" word node is connected with the sentence node and document node containing the word according to the corresponding edge weights. In this way, the entire resource entity association graph containing multiple official document resources is constructed.
[0128] 6. Implementation of graph parsing and graph summary functions
[0129] Cognitive domain refers to the perspective or reference range people use when understanding and analyzing information. Different cognitive domains will lead to different understandings and interpretations of the same information.
[0130] The present invention adopts a more controllable and intuitive graph parsing method, namely a URI hierarchical parsing method, which aggregates the above heterogeneous graphs and allows users to freely select attributes and relationships of interest, and then uses these characteristics to generate a graph with controllable information volume, namely a smart graph summary. Users can control the parsing of the graph summary to achieve information drilling down or scrolling up, as shown in the following example. Figure 1 shown.
[0131] Graph summarization compresses multiple similar nodes into a supernode to create a summary graph, retains the graph structure, and outputs a more abstract and compact graph.
[0132] The graph summary function is flexible, allowing users to freely adjust the level of detail of the analysis, and can achieve in-depth exploration from the overall to the details by drilling down, or achieve an overview from the details to the overall by scrolling up.
[0133] 6.1.URI hierarchical parsing:
[0134] 6.1.1. Perform URI hierarchical parsing on the document resource 1. Its namespace is http: / / hostname / zhengce, abbreviated as zhengce; the URI is http: / / hostname / zhengce / General Office of a Certain Ministry / Urban and Rural Construction, Environmental Protection\Urban and Rural Construction (including Housing) / Notice / Nongbanjicai〔2024〕No. 20. The specific parsing is as follows:
[0135] ① Scheme layer: http, which identifies the protocol used for resource access (HTTP protocol).
[0136] ②Authority identification layer (Authority): hostname, identifies the host or domain name where the resource is located.
[0137] ③Path Initial Segment: zhengce / , identifies the type or category of resources.
[0138] ④ Path Detailed Segment: General Office of a Ministry / Urban and Rural Construction, Environmental Protection\Urban and Rural Construction (including Housing) / Notice / , refines the resource path and provides context information (the document is issued by the General Office of a Ministry, subject classification and document type, etc.).
[0139] ⑤ Resource Identifier layer (Resource Identifier): No. 20 of the Office of Agriculture and Finance
[2024] , uniquely identifies the official document resource itself.
[0140] 6.1.2. Perform URI hierarchical parsing on the second official document resource. Its namespace is assumed to be http: / / hostname / zhengce, abbreviated as zhengce; the URI is assumed to be http: / / hostname / zhengce / A Certain Department / Science and Technology, Education\Science and Technology / Opinions / Agricultural Science
[2024] No. 15, and is parsed in a similar hierarchical manner as above (the specific parsing content is determined based on actual conditions).
[0141] 6.1.3. Perform URI hierarchical resolution on the official document resource three, and its namespace is also assumed to be http: / / hostname / zhengce, abbreviated as zhengce; the URI is assumed to be http: / / hostname / zhengce / General Office of a Certain Ministry / Agriculture, Forestry, Water Conservancy\Agriculture, Forestry, Water Conservancy / Implementation Plan / Nongbanhuan〔2024〕No. 10, and perform corresponding hierarchical resolution (the specific resolution content is determined according to the actual situation).
[0142] 6.2. Generate smart graph summaries:
[0143] A graph parsing method is used to summarize heterogeneous graphs containing multiple document resources to generate a flexible graph summary. Take these documents in a certain hospital’s policy document library as an example (for the representation of nodes and edges, see Figure 1As shown in the figure, nodes starting with "d" are document nodes, nodes starting with "s" are sentence nodes, and other nodes are word nodes; gray thin lines are word-word edges, black thin lines are word-sentence, word-document, sentence-sentence edges, and black thick lines are sentence-document edges). The graph summary compresses multiple similar nodes into a supernode to create a summary graph, retaining the graph structure and outputting a more abstract and compact graph. Users can freely select the attributes and relationships of interest according to their needs, and achieve in-depth exploration from the overall to the details by drilling down, or achieve an overview from the details to the overall by scrolling up. For example, if a user wants to view the document details of a certain topic (such as agricultural development) in multiple official documents, he can drill down to specific word and sentence nodes through the graph summary to obtain more detailed information; if he wants to understand the overall situation of these official document resources, he can scroll up to view the macro relationship between document nodes.
[0144] 7. Use RDF and URI standardization
[0145] RDF (Resource Description Framework) and URI (Uniform Resource Identifier) are used to standardize document resource description and location. The document information is fine-grained and accurate to the inside of the document, ensuring the matching and accuracy between the document metadata and the resources it describes, and improving the accessibility and comprehensibility of the document. For example, the URI structure of the above-mentioned official document resource 1 (http: / / hostname / zhengce / A certain department office / urban and rural construction, environmental protection\urban and rural construction (including housing) / Notice / Nongbanjicai〔2024〕No. 20) can clearly locate and understand the official document resource, and use the triple structure of RDF to accurately describe the official document entity and its attributes, such as the N-Triples format serialization description mentioned above, so that the machine can better process and understand the official document information. Similarly, official document resources 2 and 3 are also standardized through the corresponding URI and RDF. At the same time, in terms of the link mechanism of linked data, a more general URI model is used as the association means, combined with URI, to construct a linked data model and realize the semantic processing of resources. The combination of a stable URI source and precise RDF description provides a convenient and easy-to-manage basic framework for the digitization of official document resources. As long as the monotony and stability of the URI are maintained, multiple semantic patterns can be associated with it to achieve decentralization of resources, thereby realizing the association between official document resources.
[0146] 8.URI identifies the semantic association of document entities
[0147] Treat each document resource record as an entity and its classes and attributes, and determine a URI structure that is easy to parse, such as http: / / hostname / level / level2 / level3 / . Taking document resource 1 as an example, its namespace is http: / / hostname / zhengce, abbreviated as zhengce; the URI is http: / / hostname / zhengce / General Office of a Certain Ministry / Urban and Rural Construction, Environmental Protection\Urban and Rural Construction (including Housing) / Notice / Nongbanjicai〔2024〕No. 20. This URI uniquely and accurately identifies the resource composition and positioning method of the document. Through URI hierarchical parsing (such as the above-mentioned scheme layer, authority identification layer, path initial layer, path refinement layer, and resource identifier layer parsing), the composition and positioning method of the resource can be clearly understood, providing effective support for document management, retrieval, and sharing. Similarly, document resources 2 and 3 also construct corresponding URIs according to their respective characteristics to realize the semantic association of document entities (the specific construction content is determined according to actual conditions).
[0148] 9. RDF resource framework semantic description of document entities
[0149] In a specific embodiment of the present invention, the N-Triples format is selected to serialize and store the extracted document semantic triples. The Turtle format uses indentation to display nested structures and supports prefix declarations to simplify URIs, which is convenient and easy for humans to read and edit. However, machine parsing of Turtle requires more computing resources and time, especially when processing large data sets, the efficiency difference is significant. N-Triples stores each triple (subject-predicate-object) in a row, separated by spaces and ending with a period, containing complete and possibly prefixed detailed information, which is intuitive and easy for machine parsing and processing. In the scenario of processing a large amount of RDF data containing multiple official document resources, the advantages of N-Triples are reflected, and the semantic description and data processing of document entities can be more efficiently realized.
[0150] The RDF of the present invention uses the form of triples [subject-predicate-object] to describe document entities and their classes and attributes, forming a directed graph structure with nodes and edges with labels / attributes. The triples acquisition method is divided into fine-grained level and coarse-grained level.
[0151] 10Use NPMI to calculate the weight of the edge between word nodes
[0152] This specific embodiment prefers NPMI to calculate the weights of the edges between word nodes instead of using Euclidean distance. Although Euclidean distance is intuitive and easy to understand, it is sensitive to the scale of the data. Data of different units or dimensions may lead to deviations in the calculation results, and as the data dimension increases, it may face the "dimensionality disaster", which makes it impossible to accurately reflect the actual similarity between word nodes. NPMI can effectively capture the positive correlation strength between word nodes, quantify semantic relationships, focus on the positive values of mutual information, avoid interpretation problems that may be caused by negative values, ensure more stability and reliability in practical applications, and is more suitable for calculating the weights of edges between word nodes in multiple official document resources, so as to accurately construct the relationship graph between resource entities and better express the semantic relationship between document content.
[0153] 11. Use TF-IDF to calculate the weight of the edge between the word node and the document node
[0154] The present invention uses TF-IDF to calculate the weight of the edge between the word node and the document node. Its advantage is that it can effectively extract the key words of the document, focusing on the frequency of the words in the document and the inverse document frequency, and ignoring the task of capturing the semantic associations between texts. The GCN model introduced later captures the semantic associations between texts in network interactions. This model focuses on the frequency of terms and ignores semantic relationships in order to avoid repeated calculations. Through the synergy of TF-IDF calculation of the weight of the edge between the word node and the document node and the GCN model, it is possible to expressively describe multiple official document resources more comprehensively and effectively, mine information in documents from different angles, and improve the accuracy and efficiency of document processing and analysis.
[0155] 12. Flexible display of graph summary function
[0156] Take these documents in the policy document library of a certain hospital as an example. In the figure abstract (such as Figure 1 As shown in the figure, users can clearly see the composition of nodes and edges. Through different types of nodes (document nodes, sentence nodes, word nodes) and edges (different colors and thicknesses represent different types of edges), you can intuitively understand the relationship between multiple official documents, sentences, and words. Users can freely adjust the level of detail of the analysis according to their needs. For example, if you want to have a deeper understanding of the specific content of a certain official document (such as official document resource 1), you can drill down from the document node to the sentence node and word node to obtain more detailed information; if you want to have a macro grasp of the entire official document collection, you can scroll up from the word node and sentence node to the document node to view the overall structure and relationship. This flexible graph summary function provides users with a convenient and efficient way to explore and understand multiple official document resources, which helps to improve the utilization efficiency and management level of official document resources.
[0157] 13. Overall advantages
[0158] Through the above series of implementation steps, the document expressive description method based on graphs of the present invention realizes the precise definition of concepts, terms and relationships in multiple official documents. It can eliminate the ambiguity of terms in the field of official documents, parse the logical relationship contained in the content of official document sentences, conduct a deeper semantic analysis of official document information, and realize the expressive description of official documents based on graphs. It enables the machine to organize official document knowledge through understandable language expressions, build a shared official document domain concept model, and provide effective support for the knowledge representation and intelligent retrieval of multiple official document resources. At the same time, when dealing with confidentiality and targeted release requirements, it can better publish the relevant information of official document resources in the form of associated data according to the attributes and needs of the visitor, meet the diversified needs of official document information resources in economic and social development, improve the management and utilization efficiency of official document resources, and promote the intelligent and digital process of official document processing. For example, for official document resources involving confidential information, targeted information services can be provided to authorized users under the premise of ensuring information security through precise semantic processing and graph structure construction, so as to realize efficient use and safe sharing of information. Moreover, this method is highly applicable to official documents of different types and themes (such as various agricultural-related official document resources 1, 2, and 3), and can effectively integrate and tap the value of official document resources, providing strong data support and knowledge reference for government departments, enterprises, and research institutions in decision-making, policy research, and business development.
[0159] 14. Further improvement and expansion
[0160] 14.1. With the continuous accumulation and updating of official document resources, this method can continuously optimize and enrich the graph structure and semantic model. When new official documents are added, their semantic information will be automatically integrated into the existing system to further refine and expand the knowledge network. For example, when new official documents on agricultural ecological protection subsidy policies are added later, the system can quickly identify the key entities and relationships therein and link them with previous agricultural-related official documents, such as associating the keyword "agricultural ecological protection" with the theme of "agricultural green development" in official document resource three, thus making the entire knowledge graph more complete and comprehensive.
[0161] 14.2. In terms of cross-departmental collaboration, official documents of different departments have their own focus and terminology systems. This method helps to break down the information barriers between departments and achieve information sharing through a unified semantic framework. For example, when the official documents of the agricultural department and the environmental protection department involve agricultural non-point source pollution control, this method can be used to achieve terminology alignment and information fusion, providing a more accurate basis for collaborative decision-making.
[0162] 14.3. From a long-term perspective, the document knowledge model constructed based on this method can serve as the basis for further application of artificial intelligence in the field of document processing. For example, by analyzing the semantic graphs of a large number of documents through machine learning algorithms, it is possible to achieve functions such as automatic document classification, summary generation, and even intelligent writing assistance, greatly improving the efficiency and quality of document processing and further promoting the improvement of office automation and intelligence.
[0163] 15. Application prospects
[0164] In the field of policy research, researchers can use this method to quickly retrieve and analyze massive amounts of official documents and accurately grasp the policy context and development trends. For example, when studying the evolution of agricultural policies, through semantic analysis of relevant official documents over the years, the policy adjustment direction and changes in key areas can be clearly presented, providing strong support for the formulation of scientific and reasonable policy recommendations.
[0165] For enterprises, timely and accurate interpretation of official document information is crucial. This method can help enterprises obtain policy guidance related to their own business more efficiently, and plan and adjust development strategies in advance. For example, agricultural enterprises can accurately locate investment directions, optimize resource allocation, and enhance market competitiveness based on information on agricultural industry support policies in official document resources.
[0166] In terms of education and teaching, this method can be applied to official document writing courses to help students better understand the structure and logic of official documents and improve their official document writing skills. Teachers can use the rich official document case library to demonstrate the characteristics and writing skills of excellent official documents through semantic analysis, and guide students to imitate and innovate.
[0167] Looking into the future, with the continuous advancement of technology, this method is expected to be integrated with more cutting-edge technologies. For example, blockchain technology can be used to ensure the authenticity and non-tamperability of official document information and enhance the credibility of official document management; big data analysis technology can further explore the potential value of official document data and provide more in-depth and accurate decision-making support for social governance, economic development and other fields, thereby playing an important role in a wider range and promoting the coordinated development and progress of all aspects of society.
[0168] In summary, the present invention provides a document expressive description method based on a graph. Aiming at the problem that machines are prone to ambiguity in understanding documents in natural language processing, the interactive recognition method of cognitive linguistics is used to give machines the ability to process and understand document information. By adjusting the framework and cognitive domain parameters, the machine can examine and interpret the document content from different angles or reference ranges. The document information resources are semanticized through semantic web technology. The hierarchical structure of [word-sentence-article] is modeled as a heterogeneous graph at the framework level. At the fine-grained level, [subject-predicate-object] triples are used to construct the internal graph of resource entities; at the coarse-grained level, words, sentences, and documents are used as nodes, and the relationships between nodes are edges. The [node-relationship-node] triples are used to construct the relationship graph between resource entities, and the edge weights are calculated using algorithms such as normalized point-by-point mutual information NPMI, TF-IDF, and BM25. At the same time, the URI hierarchical parsing and dynamic graph summarization methods are used from the cognitive domain perspective to control the document parsing level and depth. This method can eliminate ambiguity in domain terminology, build a shared concept model, effectively support information resource knowledge representation and intelligent retrieval, improve the accuracy and efficiency of document processing, and provide a new and effective solution for document expressive description.
[0169] The embodiments described above are merely descriptions of preferred implementation modes of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A graph-based document expressive description method, characterized in that: The following steps are involved: (1) Semantize document information resources to present them in a machine-readable form and reveal the semantic connections between and within documents. At the same time, serialize the relationships between document entities and their attributes to build a corpus. (2) Model the entire corpus as a heterogeneous graph according to the hierarchical structure of words, sentences, and passages; (3) Provide a detailed expressive description of the document, gradually expanding from fine-grained to coarse-grained to provide a comprehensive document description.
2. A graph-based document expressive description method according to claim 1, characterized in that: RDF and URI, namely the Resource Description Framework and Uniform Resource Identifier, are used to standardize document resource description and location, granularize document information, break down management hierarchies, and be precise to the inside of the document, ensuring the matching and accuracy between the document's metadata and the resources it describes.
3. The graph-based document expressive description method according to claim 2, characterized in that: In terms of the linking mechanism of linked data, a more universal URI model is adopted as the means of association, which is combined with URI to construct the linked data model to achieve semantic processing of resources; the stable URI source is combined with the precise RDF description to provide a basic framework for the digitization of document resources.
4. The document expressive description method based on graph according to claim 3 is characterized in that: Use URI identifiers to make semantic associations between document entities, treat each document record as an entity and its classes and attributes, determine a URI structure that is easy to parse, and understand the composition and location of resources through URI hierarchical parsing.
5. The graph-based document expressive description method according to claim 4, characterized in that: The RDF resource framework is used to describe document entities semantically. RDF uses the triple "subject-predicate-object" form to describe document entities and their classes and attributes, forming a directed graph structure with nodes and edges with labels / attributes.
6. The graph-based document expressive description method according to claim 5, characterized in that: The triplet acquisition method is divided into fine-grained level and coarse-grained level: At the fine-grained level, i.e., the internal graph of resource entities, triples in the form of "subject, predicate, object" are used as directed graphs with nodes and edges to perform named entity recognition on document resources, obtain entities that are subjects of triples and entities that are objects, extract predicates through syntactic dependency analysis, and combine them into triples of subject-predicate-object structures that can summarize the main content of the sentence. The triples are semantically described in the N-Triples format, and are serialized into codes and implemented in text based on the official document data of a certain hospital's policy document library; At the coarse-grained level, that is, the association graph between resource entities, that is, the heterogeneous graph of words, sentences, and documents, words, sentences, and documents are used as nodes respectively. According to the co-occurrence of words in the corpus: "word-word edge", the appearance of words in sentences: "word-sentence edge" and the appearance of words in documents: "word-document edge", edges are constructed between nodes respectively. Finally, the graph is constructed using triplets in the form of "word, edge, word", "word, edge, sentence", "word, edge, document" and "sentence, edge, document".
7. The graph-based document expressive description method according to claim 6, characterized in that: The weights of the edges between word nodes are calculated using the normalized point-wise mutual information (NPMI), and the formula is: Where #W(i) is the number of sliding windows in the corpus containing word i, #W(i,j) is the number of sliding windows containing words i and j, and #W is the total number of sliding windows in the corpus; The weight of the edge between the word node and the document node is calculated using TF-IDF, and the formula is: TF-IDF i,j =TF i,j ×IDF i , Among them, n i,j Representation word t i In the document d j The number of occurrences in TF i,j Representation word t i In the document d j The frequency of occurrence in. |D| represents the number of all documents, |m:t i ∈d j | indicates that the word t is included i The number of documents containing the word t i The number of documents is 0, which causes an error in the calculation, so the denominator is increased by 1. IDF i Representation word t i The importance of a word. If there are fewer documents containing a word, it means that the word is more important and the IDF value is larger. The weight of the edge between the sentence node and the document node is calculated using BM25, and the formula is: Where i represents a sentence, j represents a document, and n is the number of words in sentence i; z is the zth word in the sentence, IDF(i z ) is the word i z The inverse document frequency, f(i z ,j) is word i z The number of times it appears in document j; avgdl is the average length of all documents; parameter k1 is used to standardize the range of article word frequency, and parameter b is used to adjust the impact of document length on the score.
8. The graph-based document expressive description method according to any one of claims 1 to 7, characterized in that: A URI hierarchical parsing method is used to summarize heterogeneous graphs, allowing users to freely select attributes and relationships of interest to generate a flexible graph summary; the graph summary compresses multiple similar nodes into a supernode to create a summary graph, retains the graph structure, and outputs a more abstract and compact graph. Users can control the parsing of the graph summary to achieve drilling down or scrolling up of information.
9. A graph-based document expressive description system, characterized in that: include: The semantic processing module is used to semantically process document information resources, present them in a machine-readable form, reveal the semantic connections between documents and within them, serialize the relationships between document entities and their attributes, and construct a corpus; The graph construction module is used to model the entire corpus into a heterogeneous graph according to the hierarchical structure of words, sentences, and passages; Description module, which is used to describe the document in detail, from fine-grained to coarse-grained, to provide a comprehensive document description; Standardization module, used to standardize document resource description and location using RDF and URI; The association module is used to apply URI identifiers to semantically associate document entities and apply RDF resource framework to semantically describe document entities; The parsing module is used to summarize heterogeneous graphs using the URI hierarchical parsing method and generate smart graph summaries.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the graph-based document expressive description method as described in any one of claims 1 to 8 are implemented.