A method and system for extracting geographical entity relationships from ancient texts

By employing a hierarchical bidirectional correction mechanism and leveraging the synergistic effect of global and local classifiers, the problems of category imbalance and type confusion in entity relationship extraction from ancient Chinese geographical documents are resolved, thereby improving the accuracy and robustness of ancient Chinese geographical information extraction.

CN122311200APending Publication Date: 2026-06-30ZHEJIANG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610338926.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-19
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing entity relation extraction methods cannot effectively handle the complex and sparse entity and relation types in ancient geographical documents, and suffer from problems such as category imbalance, insufficient utilization of hierarchical information, lack of global document information, and type confusion.

Method used

A hierarchical bidirectional correction mechanism is adopted. The global classifier predicts the probability distribution of document-level entities and relation types, and the local classifier is combined to perform hierarchical classification. The information of major categories guides the classification of minor categories, and the synergistic effect of global and local classification is optimized through a bidirectional mutual enhancement mechanism.

Benefits of technology

It improves the accuracy of identifying long-tail and fine-grained types in ancient Chinese geographical documents, reduces false positive errors, and enhances the accuracy and robustness of ancient Chinese geographical information extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122311200A_ABST
    Figure CN122311200A_ABST
Patent Text Reader

Abstract

This application provides a method and system for extracting entity relationships from ancient Chinese geographical texts. The method includes: acquiring document text; using a global classifier to obtain the predicted entity types and relationship types in the document text; extracting continuous text segments of length that meet a preset condition from the document text and using them as candidate spans; obtaining the entity class probability distribution for each candidate span and using it as entity class probability distribution information; obtaining the entity subclass probability distribution for each candidate span and using it as entity subclass probability distribution information; identifying candidate spans with subclass predicted probabilities higher than their corresponding thresholds as identified entities and generating candidate entity pairs; obtaining the relationship class probability distribution; obtaining the relationship subclass probability distribution for each of the aforementioned relationship subclasses and using it as relationship subclass probability distribution information; filtering out entities and relationships with probabilities higher than their corresponding preset thresholds; and constructing a structured extraction result based on the filtered entities and relationships.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of natural language processing, and in particular relates to a method and system for extracting geographical entity relationships from ancient texts. Background Technology

[0002] Ancient geographical texts contain a wealth of knowledge about entities and relationships, but also a significant amount of meaningless information. The key to information extraction lies in accurately identifying geographical entities (such as mountains, rivers, palaces, and temples) from unstructured ancient texts and extracting the spatial relationships (such as orientation and topological relationships) between these entities.

[0003] However, ancient geographical texts are characterized by their archaic language, complex and large-scale system of entity and relation types (up to 24 entity types and 34 relation types), extremely sparse type distribution (with a large number of long-tail types), and natural hierarchical structures between types (e.g., "temple" and "Taoist temple" both belong to the category of "religious and cultural space"). Conventional information extraction methods are insufficient to meet their requirements.

[0004] Based on this, this application provides a method and system for extracting geographical entity relationships from ancient texts, in order to improve related technologies. Summary of the Invention

[0005] In view of the shortcomings of the prior art, the purpose of this application is to provide a method and system for extracting geographical entity relationships from ancient texts.

[0006] The first aspect of this application proposes a stress detection method for bridge structures, wherein the method is applied to a central server, and the method includes: S101, send the corresponding precast beam area division information to each edge server in a preset order; the preset order is arranged from largest to smallest according to the deformation weight of the piers corresponding to each edge server. S102, take any edge server as the target edge server, obtain the first stress sensing information set sent by it in the current acquisition cycle, obtain the investigation area of ​​the precast beam from the preset area based on the first stress sensing information set, and send it to the target edge server. S103, acquire the second stress sensing information set sent by the target edge server, the second stress sensing information set includes the stress sensing information of the investigation area in the next acquisition cycle; acquire the area that does not meet the stress evaluation standard according to the second stress sensing information set and use it as the target detection area, summarize the area information of the target detection area and send it to the target edge server.

[0007] Preferably, after S106, the method further includes: S107, taking the maximum value in each type dimension and aggregating according to the entity subclass probability distribution information and the relation subclass probability distribution information, concatenating the aggregation result with the document-level global representation vector and sending it into the refinement network, outputting the correction amount, and using the correction amount to refine the network.

[0008] Preferably, S108 further includes: sending the extraction result to a user terminal or storing it in a knowledge graph database on the server.

[0009] Preferably, in S101, the output of the pre-trained language model after encoding further includes a context representation vector for each word; in S105, obtaining the entity pair representation vector for each entity pair includes: The spans with a subclass prediction probability higher than the threshold are selected as the identified entities, and these entities are paired to form candidate entity pairs. For each entity pair, the representation vectors of the two entities and the context representation vector between the entity pairs are concatenated to form the entity pair representation vector.

[0010] Preferably, S102 includes: The document-level global representation vector is fed into the global entity classifier and the global relation classifier respectively to obtain the predicted entity types and relation types in the document text. The global entity classifier is a fully connected layer with an input dimension of 768 and an output dimension of the number of corresponding entity subclasses. After passing through the Sigmoid activation function, it outputs the probability of each entity type existing in the document. The global relation classifier is a fully connected layer with an input dimension of 768 and an output dimension of the number of corresponding relation subclasses, outputting the probability of each relation type existing in the document.

[0011] Preferably, S103 further includes: generating a length embedding vector based on the length of the candidate span; S104 includes: Perform the first-level entity classification by concatenating the representation vector and length embedding vector corresponding to the candidate span, and then feeding them into the entity classifier to obtain the entity class probability distribution. The second layer of entity subclass classification is performed by concatenating the representation vector, length embedding vector, entity class probability distribution and global entity probability vector corresponding to the candidate span, and then feeding them into the entity subclass classifier to obtain the entity subclass probability distribution.

[0012] Preferably, the entity classifier is a fully connected layer, the output dimension is the dimension requirement of the entity class, and the output is the entity class probability distribution after passing through the Softmax function; The entity subclass classifier is a fully connected layer, and its output dimension meets the dimensional requirements of the entity subclass. After passing through the Softmax function, it outputs the entity subclass probability distribution.

[0013] Preferably, S106 includes: Distance information is obtained by subtracting entity distance from location; the first layer of relationship classification is performed by fusing entity pair representation vectors, distance information and context representation vectors and feeding them into the relationship classifier to obtain the relationship class probability distribution; The second layer of relation subclass classification is performed by concatenating the entity pair representation vector, distance information, context representation vector, relation class probability distribution and global relation probability vector, and feeding them into the relation subclass classifier to obtain the relation subclass probability distribution. The relation subclass classification adopts a multi-label classification method.

[0014] A second aspect of this application proposes a method for extracting geographical entity relationships from ancient texts, applied to a user terminal, the method comprising: Send document text to the server and obtain the extraction result of the document text from the server, wherein the extraction result is obtained by the server using the ancient text geographical entity relationship extraction method described in any one of the first aspects.

[0015] A third aspect of this application proposes a system for extracting ancient geographical entity relationships, the system comprising an electronic device, the electronic device including a memory and at least one processor, the memory storing a computer program, the processor being configured to execute the computer program to enable the electronic device to implement the method as described in any one of the first aspects.

[0016] This application provides a method and system for extracting geographical entity relationships from ancient texts. This method addresses the class imbalance problem by addressing the hierarchical classification mechanism. The technical solution provided in this application classifies fine-grained types into major categories. The major category classification task has a small number of categories and a relatively balanced distribution. The model can first learn a stable major category classification ability and then use the major category information to guide the classification of minor categories.

[0017] To address the type confusion problem by using hierarchical structure constraints, the classification results of major categories provide hierarchical constraints for the classification of minor categories. The minor category classifier will distinguish between types under the major category, avoiding misclassification across major categories.

[0018] Meanwhile, global document-level type determination provides prior information. Global branches predict possible types based on the overall semantics of the document, providing document-level contextual constraints for local classification and reducing false positive errors.

[0019] The bidirectional mutual enhancement mechanism enables collaborative optimization of the global and local levels. In forward enhancement, global probabilities are injected into local classifiers; in backward refinement, the aggregated local classification results are fed back to correct the global judgment, forming a closed loop. Attached Figure Description

[0020] The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Throughout the drawings, the same reference numerals denote the same components. Obviously, the drawings described below are merely some embodiments described in this application, and those skilled in the art can obtain other drawings based on these drawings.

[0021] Figure 1 This is a flowchart illustrating an entity relation extraction method provided in an embodiment of this application.

[0022] Figure 2 This is a schematic diagram of the overall architecture of the hierarchical bidirectional correction model provided in the embodiments of this application.

[0023] Figure 3 This is a schematic diagram of the hierarchical classification provided in the embodiments of this application.

[0024] Figure 4 This is a schematic diagram of the bidirectional correction mechanism provided in the embodiments of this application. Detailed Implementation

[0025] To enable those skilled in the art to better understand the technical solutions in the embodiments of this application, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. It should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application. Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in this application.

[0026] In related technologies, the following conventional methods can be used to extract geographical entity relationships from ancient texts: (1) Pipeline method The pipelined approach decomposes entity relation extraction into two independent subtasks: first, named entity recognition (NER), and then relation classification (RC) of the recognized entities. This approach is simple to implement, and each module can be optimized independently, but it suffers from a significant error propagation problem—errors in the entity recognition stage directly affect the performance of relation extraction, and the two subtasks cannot share information or reinforce each other.

[0027] (2) Joint method based on triple extraction To address the error propagation problem in pipelined methods, researchers have proposed several joint extraction methods. Among them, CasRel employs a cascaded decoding strategy, first identifying subject entities, and then identifying the corresponding relations and objects for each subject; TPLinker models triple extraction as a token pair linking problem, using a handshake annotation strategy to solve the overlapping triple problem; OneRel uniformly models relation triples as a relation-specific corner-tag task, simplifying the decoding process. These methods focus on end-to-end triple extraction and perform well when handling overlapping triples.

[0028] (3) Span-based joint method Span-based methods such as SpERT (Span-based Entity and Relation Transformer) encode the input text using a pre-trained language model, enumerate all possible text segments (spans) for entity type classification, and then classify the identified entity pairs for relation classification. This method employs a flat classification strategy, directly classifying each span to a specific entity type and each entity pair to a specific relation type, thus simultaneously performing entity recognition and typed relation extraction.

[0029] (4) Graph Neural Network-based methods Methods such as HGERE utilize graph neural networks to model the dependencies between entities and relation triples, and enhance the interaction between entity and relation information through message passing mechanisms, achieving certain results in capturing local structural dependencies.

[0030] However, the above methods still have the following main drawbacks: (1) The triplet extraction method does not support fine-grained type identification. Methods such as CasRel, TPLinker, and OneRel focus on pure triple extraction tasks, only recognizing (subject, relation, object) triple structures. They do not include entity type information and cannot extract discrete entities. They are not friendly to sparse relations and are generally suitable for news and academic journal texts. However, they are not suitable for extracting geographical information from ancient texts. In application scenarios such as ancient geographical documents, it is necessary not only to extract spatial relation triples but also to identify the specific types of entities (such as "mountains", "rivers", "temples", etc.). These methods cannot meet the requirements.

[0031] (2) Not applicable to sparse relational and discrete type scenarios The aforementioned triplet extraction method assumes that relationships are relatively concentrated. However, ancient geographical texts contain as many as 34 types of relationships with sparse distribution, and as many as 24 types of entities with a large number of long-tailed types. Such methods struggle to effectively handle complex scenarios with discrete and unevenly distributed types.

[0032] (3) Lack of type prediction from a global perspective While methods based on graph neural networks, such as HGERE, model local dependencies between entities and relation triples, they still lack a document-level global perspective. These methods cannot pre-determine the types of entities and relations that may appear in a document based on the semantics of the entire document, thus failing to provide global prior guidance for local classification.

[0033] (4) The problem of category imbalance is serious. In ancient geographical texts, the distribution of entity types and relation types is extremely uneven. The sample size of common types is much larger than that of rare types. Existing flat classification methods treat all types equally, causing the models to be biased towards predicting high-frequency types and perform poorly in recognizing long-tail types.

[0034] (5) Ignoring the hierarchical structure between types Entity types and relationship types have a natural hierarchical structure (e.g., "temple" and "Taoist temple" belong to the category of "religious and cultural space", and "east" and "west" belong to the category of "locational relationship"). However, existing methods flatten all types, failing to utilize this hierarchical information to assist in classification decisions, thus increasing the difficulty of distinguishing fine-grained types.

[0035] (6) Type confusion problem Similar types (such as "temple" and "Taoist temple", "contains" and "belongs to") are easily confused. Flat classifiers place all types at the same level for differentiation, making it difficult to learn the subtle semantic differences between types.

[0036] In summary, the entity relation extraction methods provided by related technologies are not well-suited for extracting entity relations from ancient Chinese geographical texts. This application proposes a method and system for extracting entity relations from ancient Chinese geographical texts. Specifically, it is a spatial entity relation joint extraction method that can effectively utilize type hierarchy and document-level global information to improve the accuracy of identifying long-tailed and fine-grained types, avoiding technical problems such as category imbalance, insufficient utilization of hierarchical information, lack of global document information, and type confusion that exist in existing entity relation joint extraction methods.

[0037] The technical solutions of the embodiments of this application and how the technical solutions of the embodiments of this application solve the above-mentioned technical problems will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the various embodiments or technical features described below can be arbitrarily combined to form new embodiments. The order of description of the embodiments below is not intended to limit the preferred order of embodiments. The same or similar concepts or processes may not be described again in some embodiments. Obviously, the described embodiments are some embodiments of the embodiments of this application, but not all embodiments.

[0038] Example 1.

[0039] This embodiment provides a method for extracting geographical entity relationships from ancient texts. The method is applied on a server side and includes: S101, Obtain the document text, which is the document text of ancient geographical literature; Add a CLS tag to the beginning of the document text, then input it into a pre-trained language model for encoding, and output a document-level global representation vector including the CLS tag; S102, Based on the document-level global representation vector, use a global classifier to obtain the predicted entity types and relation types appearing in the document text; S103, extract continuous text segments whose length meets the preset conditions from the document text and use them as candidate spans, and generate a corresponding representation vector for each candidate span; S104. For each candidate span, perform hierarchical classification according to the major entity category, obtain the probability distribution of the major entity category for each candidate span and use it as the probability distribution information of the major entity category; according to the probability distribution information of the minor entity category and the major entity category, obtain the probability distribution of the minor entity category for each candidate span and use it as the probability distribution information of the minor entity category. S105, based on the probability distribution information of the entity subclass, candidate spans with predicted subclass probabilities higher than their corresponding thresholds are identified as entities, and the identified entities are paired up to generate candidate entity pairs; obtain the entity pair representation vector of each entity pair. S106, for each candidate entity pair, first predict the major relationship category and obtain the probability distribution of the major relationship category; then, based on the probability distribution of the major relationship category and the global prior, predict the minor relationship category and obtain the probability distribution of the minor relationship category for each minor relationship category as the probability distribution information of the minor relationship category. S108, Based on the probability distribution information of the entity subclass and the probability distribution information of the relation subclass, filter out entities and relations with probabilities higher than their corresponding preset thresholds; construct structured extraction results based on the filtered entities and relations.

[0040] This technical solution employs a hierarchical, bidirectional constraint mechanism guided by document-level global priors. It achieves joint extraction of entity relationships from ancient geographical documents through global perception, local layering, and hierarchical progression. Specifically, a pre-trained language model captures the global semantic representation (document-level global representation vector) of the entire document using CLS tags added to the header. A global classifier uses this vector to predict the probability distribution of all possible entity and relation types in the document in parallel, generating document-level global prior information. This avoids the limitations of traditional methods that only focus on local fragments, enabling the model to predict the text's topic category (such as geographical location descriptions, administrative divisions, etc.) from an overall semantic level, providing top-level constraints for subsequent local classification. Furthermore, it uses hierarchical, progressive type determination to differentiate from flat classification, employing a hierarchical classification mechanism from broad categories to specific categories for both entities and relations.

[0041] This technical solution alleviates the problem of extreme class imbalance through pre-screening of broad categories; it effectively distinguishes easily confused fine-grained types (such as "temple" and "Taoist temple," "contains" and "belongs to") by utilizing hierarchical semantic constraints, reducing the risk of misclassification across broad categories; and the prior probability guidance provided by the global classifier improves the model's type consistency in the context of archaic and long texts. In summary, this technical solution is applied to entity relation extraction from ancient geographical documents with archaic texts, complex entity and relation type systems, and large scale, improving the accuracy of information extraction from ancient geographical documents.

[0042] In an exemplary embodiment, after S106, the method further includes: S107, taking the maximum value in each type dimension and aggregating according to the entity subclass probability distribution information and the relationship subclass probability distribution information, concatenating the aggregation result with the document-level global representation vector and sending it into the refinement network, outputting the correction amount, and using the correction amount to refine the network.

[0043] This technical solution avoids the problem of type omission caused by the initial global prediction bias by using local evidence reverse aggregation and correction quantity refinement network.

[0044] In an exemplary embodiment, S108 further includes: sending the extraction result to a user terminal or storing it in a knowledge graph database on the server.

[0045] Storing the extraction results in a knowledge graph database solves the problems of easy loss and difficulty in reusing single extraction results. By sending the extraction results to user terminals in real time, it can be used to support domain experts (such as historians and historical geographers) to conduct online review and verification of the automatically extracted results. Therefore, it meets users' needs for immediate viewing of extraction results and realizes the structured storage of ancient Chinese geographical knowledge through the knowledge graph database.

[0046] In an exemplary embodiment, in S101, the output of the pre-trained language model encoding further includes a context representation vector for each word; in S105, obtaining the entity pair representation vector for each entity pair includes: The spans with a subclass prediction probability higher than the threshold are selected as the identified entities, and these entities are paired to form candidate entity pairs. For each entity pair, the representation vectors of the two entities and the context representation vector between the entity pairs are concatenated to form the entity pair representation vector.

[0047] In classical Chinese geographical texts, directional relationships (such as "east," "west," "south," and "north") and topological relationships (such as "located in" and "contains") are often expressed through specific prepositions, directional words, or sentence structures between entities (e.g., "east of..." in "Deshou Palace is east of Wangxian Bridge"). By explicitly concatenating contextual representation vectors between entities, the relation classifier can directly access these key relation indicator words, significantly improving the sensitivity to directional and topological relationships and avoiding misjudgments caused by relying solely on the semantics of the entities themselves. The introduction of contextual representation vectors enables the model to leverage the deep syntactic awareness of pre-trained language models to capture long-distance dependencies and implicit relation markers, enhancing the model's robustness to the special word order of classical texts.

[0048] In an exemplary embodiment, S102 includes: The document-level global representation vector is fed into the global entity classifier and the global relation classifier respectively to obtain the predicted entity types and relation types in the document text. The global entity classifier is a fully connected layer with an input dimension of 768 and an output dimension of the number of corresponding entity subclasses. After passing through the Sigmoid activation function, it outputs the probability of each entity type existing in the document. The global relation classifier is a fully connected layer with an input dimension of 768 and an output dimension of the number of corresponding relation subclasses, outputting the probability of each relation type existing in the document.

[0049] Traditional methods determine types based on local fragments, lacking an understanding of the overall theme of the document. This technical solution predicts possible types in a document through a global representation vector, forming a prior type distribution, which provides semantic constraints for subsequent local classifications in S104 and S106.

[0050] In an exemplary embodiment, S103 further includes: generating a length embedding vector based on the length of the candidate span; S104 includes: Perform the first-level entity classification by concatenating the representation vector and length embedding vector corresponding to the candidate span, and then feeding them into the entity classifier to obtain the entity class probability distribution. Perform entity subclass classification for the second layer. Concatenate the representation vector corresponding to the candidate span, the length embedding vector, the entity superclass probability distribution, and the global entity probability vector, and then send them into the entity subclass classifier to obtain the entity subclass probability distribution.

[0051] Ancient Chinese geographical entities have obvious length distribution biases (such as single-character building names like "Palace" and "Hall", and multi-character administrative region names like "XX Mansion"). Through the length embedding vector, it is possible to make a comprehensive judgment by combining the morphological length and semantic content of the span, effectively distinguish cases with fuzzy boundaries, and reduce segmentation errors caused by simply relying on context semantics.

[0052] In an exemplary embodiment, the entity superclass classifier is a fully connected layer, the output dimension meets the dimension requirements of the entity superclass, and after passing through the Softmax function, the entity superclass probability distribution is output; The entity subclass classifier is a fully connected layer, the output dimension meets the dimension requirements of the entity subclass, and after passing through the Softmax function, the entity subclass probability distribution is output. Both the entity superclass classifier and the entity subclass classifier adopt a fully connected layer structure.

[0053] In an exemplary embodiment, S106 includes: Obtain distance information by taking the difference in the entity distance positions; perform relation superclass classification for the first layer, fuse the entity pair representation vector, the distance information, and the context representation vector, and send them into the relation superclass classifier to obtain the relation superclass probability distribution; Perform relation subclass classification for the second layer. Concatenate the entity pair representation vector, the distance information, the context representation vector, the relation superclass probability distribution, and the global relation probability vector, and send them into the relation subclass classifier to obtain the relation subclass probability distribution. Among them, the relation subclass classification uses a multi-label classification method.

[0054] Ancient geographical descriptions often use compound space expressions. Traditional single-label classification forces an entity pair to correspond to only a single relationship, resulting in information loss. This solution reduces the classification complexity through hierarchical constraints and captures multiple associations through multi-label modeling, effectively solving the extraction problem caused by the coexistence of multiple entity relationships and complex types in ancient Chinese geographical literature.

[0055] As an example, a method for jointly extracting ancient Chinese geographical entities and orientation relationships with hierarchical type prior mutual enhancement is proposed, including the following main steps: S_{1}, text encoding and global feature extraction step.

[0056] The input document text is fed into a pre-trained language model for encoding. The input format of the pre-trained language model is to add a special marker [CLS] at the beginning of the text (i.e., CLS marker), and the output is the context representation vector of each word and the document-level global representation vector at the [CLS] position.

[0057] Specifically, the server receives the document text to be processed uploaded by the user terminal, performs word segmentation on the text, and then inputs the word sequence into a pre-trained language model (such as BERT or RoBERTa) to obtain a 768-dimensional representation vector for each word position and a 768-dimensional document-level global representation vector for the [CLS] position.

[0058] S2, Global Type Determination Steps.

[0059] Based on the document-level global representation vector of [CLS], a global classifier is used to predict the probability of entity types and relation types that may appear in the document. This process aims to guide local category judgment by prioritizing the categories that may appear in the document.

[0060] Specifically, the server feeds the [CLS] vector (document-level global representation vector) into the global entity classifier and the global relation classifier, respectively. The global entity classifier is a fully connected layer with an input dimension of 768 and an output dimension of 24 (corresponding to 24 entity subclasses). After passing through the Sigmoid activation function, it outputs the probability of each entity type existing in the document. The global relation classifier has the same structure, with an output dimension of 34 (corresponding to 34 relation subclasses), and outputs the probability of each relation type existing in the document. Its calculation formula is as follows:

[0061]

[0062] A document-level global representation vector. and This is the learnable weight matrix for the global classifier; This is the weight matrix of the global entity classifier, responsible for mapping the 768-dimensional document representation to the logits space of 24 entity types; This is the weight matrix of the global entity classifier, responsible for mapping to the logits space of 34 relation types; For activation function, This is the global entity probability vector. This is the global relation probability vector.

[0063] S3, steps for generating and representing candidate spans.

[0064] Enumerate all continuous text segments in the document whose length does not exceed a preset threshold as candidate spans, and generate a representation vector for each candidate span.

[0065] Specifically, the server iterates through all combinations of start and end positions in the document, filtering out candidate spans with a length of no more than 10 tokens. For each candidate span, a 768-dimensional representation vector for the span is obtained by average pooling the representation vectors of all tokens within the span. Simultaneously, a 25-dimensional embedding vector is generated based on the span's length.

[0066] S4, Hierarchical entity classification steps.

[0067] Each candidate span is classified in a two-level hierarchical manner: first, the major category of the entity is predicted, and then the minor category of the entity is predicted based on the major category and global prior.

[0068] The first layer of classification: The server concatenates the representation vector and length embedding vector corresponding to the candidate span and feeds them into the entity classifier. The entity classifier is a fully connected layer with an output dimension of 7 (6 entity classes plus 1 None class), which outputs the probability distribution of the major classes after passing through the Softmax function. The 6 entity classes include: political and administrative space, religious and cultural space, living and urban space, natural environmental elements, transportation and military space, and economic and social facilities. Its mathematical expression is:

[0069] The second layer of subclass classification: The server concatenates the representation vector, length embedding vector, major class probability distribution, and global entity probability vector corresponding to the candidate span, and feeds them into the entity subclass classifier. The entity subclass classifier outputs a dimension of 25 (24 entity subclasses plus 1 None class), and outputs the subclass probability distribution after passing through the Softmax function. The search space for subclass classification is constrained by the major class classification results, improving the accuracy of fine-grained classification. Its mathematical expression is:

[0070] S5, Entity pair generation and representation steps.

[0071] The identified entities are paired up to generate candidate entity pairs, and a representation vector is constructed for each entity pair.

[0072] Specifically, the server selects spans whose subclass prediction probability is higher than a threshold as identified entities, and pairs these entities together to form candidate entity pairs. For each entity pair, the server concatenates the representation vectors of the two entities and the context representation vector between the entity pairs to form a 2304-dimensional entity pair representation vector.

[0073] S6, Hierarchical Relationship Classification.

[0074] For each candidate entity pair, a two-level hierarchical classification is performed: first, the major category of the relationship is predicted, and then the minor category of the relationship is predicted based on the major category and global prior.

[0075] The first layer of major category classification: The server fuses entity pair representation vectors, distance information, and context representation vectors and feeds them into the relationship major category classifier. The relationship major category classifier outputs a 5-dimensional value (4 major relationship categories plus 1 None category), and outputs the major category probability distribution after passing through the Softmax function. The 4 major relationship categories include: directional relationships, topological relationships, naming evolution relationships, and dynamic change relationships.

[0076] The second level of subclass classification: The server concatenates the entity pair representation vector, distance information, context representation vector, relationship class probability distribution, and global relationship probability vector, and then feeds them into the relationship subclass classifier. Since a pair of entities may have multiple relationships, the relationship subclass uses a multi-label classification method.

[0077] S7, Global Type Judgment Refinement Steps.

[0078] Aggregate all local classification results and use feedback to refine the global type judgment, forming a closed loop of two-way mutual reinforcement (i.e., two-way correction).

[0079] Specifically, the server collects the entity subclass probability distributions of all candidate spans and the relation subclass probability distributions of all entity pairs. It aggregates the maximum values ​​of all predictions across each type dimension, concatenates the aggregated result with the [CLS] vector, and feeds it into a refinement network. The network outputs correction values ​​and refines the global type probability using gating or residuals. Its mathematical expression is:

[0080] S8, output the result.

[0081] The server filters out entities and relationships with probabilities higher than a preset threshold based on the probability of entity subclasses and relation subclasses, constructs structured extraction results, and returns the results to the user terminal for display or storage in the knowledge graph database.

[0082] To address the class imbalance problem in hierarchical classification mechanisms, the technical solution provided in this application categorizes fine-grained types into major categories. Major category classification tasks have fewer categories and a relatively balanced distribution. The model can first learn a stable major category classification ability and then use the major category information to guide the classification of minor categories.

[0083] To address the type confusion problem by using hierarchical structure constraints, the classification results of major categories provide hierarchical constraints for the classification of minor categories. The minor category classifier will distinguish between types under the major category, avoiding misclassification across major categories.

[0084] Meanwhile, global document-level type determination provides prior information. Global branches predict possible types based on the overall semantics of the document, providing document-level contextual constraints for local classification and reducing false positive errors.

[0085] The bidirectional mutual enhancement mechanism enables collaborative optimization of the global and local levels. In forward enhancement, global probabilities are injected into local classifiers; in backward refinement, the aggregated local classification results are fed back to correct the global judgment, forming a closed loop.

[0086] Meanwhile, the entity relation extraction method provided in this application can improve overall extraction performance. Compared with traditional flat classification methods, the F1 score for relation extraction on ancient geographical document datasets is improved by 1-3 percentage points. It can significantly improve long-tail type recognition; for rare entity and relation types, the F1 score can be improved by approximately 5 percentage points. It can reduce type confusion; for easily confused entity and relation pairs, the classification accuracy is improved by about 3 percentage points. It can reduce the false positive rate; through the guiding role of global type judgment, it effectively suppresses erroneous predictions of irrelevant types.

[0087] In practical applications, besides RoBERTa, other pre-trained language models such as BERT, ALBERT, and ERNIE can be used, with the domain-adapted version adapted to classical Chinese texts being selected. Hierarchical classification can be designed with three or more layers depending on the complexity of the type system, in addition to a two-layer hierarchical structure. Global information injection methods include vector concatenation, attention mechanisms, and gating mechanisms. Local information aggregation methods include max pooling, average pooling, and attention-weighted aggregation.

[0088] See Figure 1 , Figure 1 This is a flowchart illustrating an entity relation extraction method provided in an embodiment of this application. The diagram shows the complete processing flow from input text to output result, as well as the technical architecture of bidirectional mutual enhancement between global and local methods, as detailed below: The entire process begins with the input text (i.e., the document text of ancient geographical literature). The input text is first fed into an encoder (a pre-trained language model, such as BERT or RoBERTa), which performs deep encoding on the text to generate a document-level semantic representation.

[0089] The feature representation output from the encoder is divided into three main paths: In the global entity branch, the document-level global representation vector output by the encoder is fed into the global entity type prior module. This module predicts the possible entity types (such as palace, bridge, etc.) in the text based on the overall semantics of the document and generates a global prior probability distribution.

[0090] In the entity-level classification branch, the contextual representation output by the encoder first enters the entity coarse-class prediction module to perform a first-level classification of candidate spans, determining their major category (e.g., "political and administrative space," "living and urban space," etc.). Subsequently, the entity coarse-class prediction result, along with the local features output by the encoder and the guiding signal from the global entity type prior (injected via guiding arrows), are fed into the entity fine-class prediction module. Under the constraints of the global prior, a second-level fine-grained classification is performed to identify the specific entity type (e.g., "Deoksugung" is classified as "palace"). In the global relation branch, the encoder also feeds document-level representations to the global relation type prior module to predict the possible relation types (e.g., locational relations, topological relations, etc.) that may exist in the document.

[0091] The relationship hierarchy classification involves constructing candidate entity pairs based on the results of entity fine-class prediction after entity recognition is completed, and then proceeding to the relationship extraction stage. First, the relationship coarse-class prediction module determines the major relationship category (e.g., "location relationship"). Then, combining the contextual features provided by the encoder, the results of the relationship coarse-class prediction, and the guiding signals from the global relationship type prior, the data is sent to the relationship fine-class prediction module for precise relationship type determination (e.g., "location relationship - east").

[0092] It also provides a two-way refinement mechanism. The core of this architecture lies in the two-way mutual reinforcement between global and local levels. After the prediction of entity class and relation class is completed, the local classification results (class probability distribution) are fed back to the corresponding global entity type prior and global relation type prior modules through refinement arrows. The local evidence is used to correct the global prediction, forming a closed-loop optimization of global → local → global.

[0093] Finally, the entity and relationship results, after hierarchical classification and two-way correction, are summarized in the results output module, completing the entire ancient text geographical entity and relationship extraction process.

[0094] Example 2.

[0095] This embodiment provides a method for extracting geographical entity relationships from ancient texts, applied to a user terminal. The method includes: Send document text to the server and obtain the extraction result of the document text from the server, wherein the extraction result is obtained by the server using the ancient text geographical entity relationship extraction method described in any one of Embodiment 1.

[0096] The following provides a specific implementation method to illustrate the technical solutions of Embodiment 1 and Embodiment 2.

[0097] A system for extracting geographical entity relationships from ancient texts is provided, including: User terminal and server. The user terminal is used to input the document text to be processed and to display the extraction results; the server is deployed with the model corresponding to the method protected in Embodiment 1 of this application (called the hierarchical bidirectional mutual enhancement model), which is used to perform entity relationship extraction tasks.

[0098] The server includes the following functional modules: Encoding module: Uses a pre-trained language model to encode the input text and outputs word-level and document-level representations.

[0099] Global classification module: Predicts the entity types and relation types that may appear in a document based on the whole sentence representation.

[0100] Entity classification module: performs hierarchical entity type classification on candidate spans.

[0101] Relationship Classification Module: Classifies candidate entity pairs into hierarchical relationship types.

[0102] Refinement module: Aggregates local prediction results and refines global type judgment.

[0103] Referring to Table 1 below, the entity types adopt a two-level hierarchical structure, including 6 major categories and 24 minor categories: Entity Category Entity subclass Political and administrative space Palaces, government offices, mansions, administrative divisions, and urban zoning Religious and Cultural Space Temples, Taoist temples, sacrificial sites, schools, and temporary burial places Living and Urban Space Streets, gardens, bridges, residences, towns, and citizens' lives Natural environmental factors Mountains, water systems, historical sites Transportation and military space Transportation facilities, military facilities Economic and social facilities Economic activity facilities, water conservancy facilities, social welfare facilities Table 1 Entity Classification Table See Table 2 below. The relation types also adopt a two-level hierarchical structure, including 4 major categories and 34 minor categories: Major Relationship Categories Relationship Subcategories Locational relationships (19 types) Directional relationships (East), (South), (West), (North), (Northeast), (Southeast), (Southwest), (Northwest), (Front), (Rear), (Left), (Right), (Inner), (Outer), (Up), (Down), (Side), (Relative), (Distance) Topological relationships (10 types) Located at, including, belonging to, adjacent to, leading to, bordering, converging, starting point, ending point, former site located at Naming evolution relationships (3 types) Former name, renamed, alias Dynamically changing relationships (2 types) Relocation, reconstruction Table 2 Relationship Classification Table The model training process is as follows: The model training employs a multi-task learning framework, and the total loss function consists of the following parts. The mathematical expression for the total loss function is:

[0104] Let be the total loss function for multi-task learning. Main loss: Entity subclass classification loss (cross-entropy loss) And the classification loss of relation subclasses (binary cross-entropy loss) Among them, the relational loss weight Set it to 1.5 times to balance the difficulty of the task.

[0105] Category Auxiliary Loss: Entity Category Classification Loss Loss by category and relationship Weight Set it to 0.3 to learn hierarchical structures.

[0106] Global auxiliary loss: Global entity type judgment loss and global relation type judgment loss with a weight set to 0.2 for learning document-level type prediction.

[0107] Refined auxiliary loss: Refined global entity type judgment loss and global relation type judgment loss with a weight set to 0.15 to promote the learning of the bidirectional mutual enhancement mechanism.

[0108] During training, the model also adopts a hard negative sampling strategy, sampling entity pairs that are close to the positive samples and share the subject and object as negative samples, and at the same time sampling negative samples with relatively high confidence to train the model's rejection ability.

[0109] Using the above-trained model, combined with Figures 1 to 4 the following details the complete execution process of the method of the present invention through a specific example. Some of its content has been stated above and will not be elaborated again. And a comparative example is provided for analysis.

[0110] (1) Input text through a user terminal (such as a laptop) and send it to the server: "Deshou Palace is to the east of Wangxian Bridge." (2) Text encoding and global feature extraction The server receives the ancient Chinese geographical text to be processed uploaded by the user terminal and first performs word segmentation on the text. After word segmentation, the token sequence obtained is: ["[CLS]", "德", "寿", "宫", "在", "望", "仙", "桥", "之", "东", "。", "[SEP]"].

[0111] The server inputs the token sequence into a pre-trained language model (in this embodiment, chinese-roberta-wwm-ext is used), obtains the 768-dimensional representation vector at each token position, and the 768-dimensional document-level global representation vector at the [CLS] position.

[0112] (3) Global type judgment As Figure 2 shown, the server sends the [CLS] vector into the global entity type prior module and the global relation type prior module respectively to predict the possible types in the document.

[0113] In this example, since the text involves geographical elements such as palaces and bridges, the global entity type prior module outputs a probability of 0.9 for the "palace" type and a probability of 0.9 for the "bridge" type. The global relation type prior module outputs a probability of 0.9 for "orientation (east)" and a probability of 0.6 for "contains". These global prior probabilities will guide the subsequent local classification process.

[0114] (4) Candidate span generation and representation The server traverses all combinations of start and end positions in the document and filters out candidate spans with a length of no more than 10 tokens. The candidate spans generated in this example include "Deshou Palace", "Wangxian Bridge", "Deshou", "Xianqiao", etc. For each candidate span, the server calculates the span representation vector through average pooling and generates a length embedding vector according to the span length.

[0115] (5) Hierarchical entity classification As Figure 3 shown, Figure 3 is a schematic diagram of the hierarchical classification (relation classification) provided by the embodiment of the present application. Each candidate span is subjected to two-layer hierarchical classification. The server first fuses the candidate span representation and the length embedding (Concat) to obtain a fused feature.

[0116] Specifically, Figure 3 reflects a hierarchical two-way constraint mechanism of coarse class pre-screening, fine class precise recognition, and global prior guidance.

[0117] The first layer is the coarse class classification, which first receives three types of input features for initial fusion: The candidate span pair representation is the vector representation of the identified entity pair (such as "Deshou Palace" and "Wangxian Bridge"), which contains the semantic information of the two entities; The distance offset is the entity distance information obtained by taking the difference in entity positions, which characterizes the interval distance between the two entities in the text; The context embedding is the context token representation vector between the entity pair (such as the relation indicator word in "to the east of...").

[0118] The above three types of features are fused through feature fusion (Concat, that is, vector concatenation operation) to generate a fused feature. This fused feature is sent to the coarse class classifier for the first layer of classification.

[0119] The coarse class classifier outputs the category to which the coarse class belongs (such as the large category of "orientation relationship"). This result serves as both an intermediate output and a constraint condition for the second-layer fine class classification - restricting the search space of the relation sub-category to this coarse class to avoid misjudgment across large categories.

[0120] The second layer is fine-category classification, where a residual enhancement strategy is used to achieve synergy between global and local classification. The first-layer fusion features are combined with the coarse class category information and global predictions (such as the document-level prediction that the probability of "direction (east)" is 0.9) to form enhanced fusion features.

[0121] The enhanced feature is fed into the fine classifier, which outputs the fine class distribution probability (such as the probability distribution of 19 specific directional relationships, of which "East" has the highest probability), and finally determines the final category (such as "directional relationship - East").

[0122] The arrows in the diagram indicate the direction of data flow. The data is passed from the bottom-level input features (candidate span pair representation, distance bias, context embedding) to the top layer. After passing through the coarse classifier to generate lateral feedback (the category to which the coarse class belongs), it is aggregated with the global prediction and passed to the downstream fine classifier. Finally, the fine class distribution probability and the final category are output.

[0123] Through this hierarchical architecture, the coarse classifier first solves the class imbalance problem (the four major classes are relatively evenly distributed), and the fine classifier focuses on distinguishing easily confused fine-grained types (such as "east" and "west") under the constraints of the coarse class. At the same time, the global prediction provides document-level prior guidance for local classification, forming a two-way mutually reinforcing closed loop.

[0124] In addition, taking the candidate span "Deoksugung" as an example, during the first coarse classification, the server sends the fused features to the coarse classifier, and the prediction results show that the "political and administrative space" major category has the highest probability. During the second fine classification, the server performs feature fusion (Add) between the global prediction, coarse prediction and fused features, and sends it to the fine classifier. Under the guidance of the global prior "palace (0.9)", it is further determined to be in the "palace" subcategory.

[0125] Following the same process, the candidate span "Wangxian Bridge" was classified as "Living and Urban Space" in the first coarse category classification, and as "Bridge" in the second fine category classification under the guidance of the global prior "Bridge (0.9)".

[0126] (6) Entity Pair Generation and Representation The server selects spans with a subclass prediction probability higher than a threshold as identified entities. In this example, "Desou Palace" and "Wangxian Bridge" are identified. These entities are then paired to form candidate entity pairs, including (Desou Palace, Wangxian Bridge) and (Wangxian Bridge, Desou Palace). For each entity pair, the server fuses and concatenates the representation vectors of the two entities, their distance bias features, and the context representation to form a fused entity pair representation vector.

[0127] (7) Hierarchical relationship classification Taking the entity pair (Deshou Palace, Wangxian Bridge) as an example, in the first coarse classification, the server sends the fused entity pair representation vector into the relation coarse classifier, and the prediction result shows that the "location relation" category has the highest probability. In the second fine classification, guided by the global prior "location (east) (0.9)," it is further determined to be "location relation (east)."

[0128] (8) Refinement of global type judgment like Figure 4 As shown, Figure 4 This is a schematic diagram of the bidirectional correction mechanism provided in the embodiments of this application. The server collects the results of local entity type judgment and local relation type judgment, and performs max pooling aggregation on all local results to obtain an aggregated structure. The encoder output and the aggregated structure are fused (Concat) and then fed into the refinement network to output the correction amount. The correction amount is added to the initial global probability through the residual mechanism (Add) to obtain the refined global type probability.

[0129] After refinement, the probability of "palace" and "bridge" in the global entity type prior remained at 0.9, and the probability of "direction (east)" in the global relation type prior remained at 0.9, verifying the consistency between local prediction and global judgment, forming a two-way mutually reinforcing closed loop.

[0130] (9) Output of Results The server filters out entities and relationships with probabilities higher than a preset threshold based on the probability of entity subclasses and relation subclasses, constructs structured extraction results, and returns them to the user terminal for display or storage in the knowledge graph database.

[0131] (10) Final extraction results: entity: Deoksugung Palace [Political and Administrative Space - Palace], confidence level 0.9 Wangxian Bridge [Living and Urban Space - Bridges], confidence level 0.9 relation: (Deshou Palace, Wangxian Bridge) → Orientation - East, confidence level 0.9.

[0132] Comparative Example 1 This comparative example 1 provides entity recognition and entity pair relationship determination functions. The difference between this example and the technical solution protected by this application is that it does not use global guiding branch prior sentences to design entity or relationship categories, but directly uses local reasoning and does not adopt hierarchical classification, that is, it directly outputs flat classification results in a single layer.

[0133] The experimental results extracted through the examples are labeled as group 1, and the validation results extracted through the comparative proportions are labeled as group 2. The focus is on measuring the F1 scores of entity and relation extraction, which are respectively scored as follows: , The entity span's boundaries and types are correct, and the subject, object, and relation types of the relation triple are correct.

[0134] Experimental data are recorded in Table 3

[0135] Table 3 Experimental Data Recording Table As shown in Table 3, hierarchical classification and global-local bidirectional correction significantly improved the F1 score of entity and relation extraction, especially for low-frequency types. Therefore, the implementation example improved the extraction effect of ancient Chinese geographical entities and directional relations.

[0136] Example 3.

[0137] This embodiment provides a system for extracting ancient geographical entity relationships. The system includes an electronic device, which includes a memory and at least one processor. The memory stores a computer program, and the processor executes the computer program to enable the electronic device to implement the method as described in any one of Embodiment 1.

[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application.

Claims

1. A method for extracting geographical entity relationships from ancient texts, characterized in that, The method is applied to the server side, and the method includes: S101, Obtain the document text, which is the document text of ancient geographical literature; Add a CLS tag to the beginning of the document text, then input it into a pre-trained language model for encoding, and output a document-level global representation vector including the CLS tag; S102, Based on the document-level global representation vector, use a global classifier to obtain the predicted entity types and relation types appearing in the document text; S103, extract continuous text segments whose length meets the preset conditions from the document text and use them as candidate spans, and generate a corresponding representation vector for each candidate span; S104. For each candidate span, perform hierarchical classification according to the major entity category, obtain the probability distribution of the major entity category for each candidate span and use it as the probability distribution information of the major entity category; according to the probability distribution information of the minor entity category and the major entity category, obtain the probability distribution of the minor entity category for each candidate span and use it as the probability distribution information of the minor entity category. S105, based on the probability distribution information of the entity subclass, candidate spans with predicted subclass probabilities higher than their corresponding thresholds are identified as entities, and the identified entities are paired up to generate candidate entity pairs; obtain the entity pair representation vector of each entity pair. S106, for each candidate entity pair, first predict the major relationship category and obtain the probability distribution of the major relationship category; then, based on the probability distribution of the major relationship category and the global prior, predict the minor relationship category and obtain the probability distribution of the minor relationship category for each minor relationship category as the probability distribution information of the minor relationship category. S108, Based on the probability distribution information of the entity subclass and the probability distribution information of the relation subclass, filter out entities and relations with probabilities higher than their corresponding preset thresholds; construct structured extraction results based on the filtered entities and relations.

2. The method for extracting ancient geographical entity relationships according to claim 1, characterized in that, Following S106, the method further includes: S107, based on the entity subclass probability distribution information and the relation subclass probability distribution information, taking the maximum value in each type dimension for aggregation, concatenating the aggregation result with the document-level global representation vector and sending it into the refinement network, outputting the correction amount, and using the correction amount to refine the network.

3. The method for extracting ancient geographical entity relationships according to claim 1, characterized in that, S108 further includes: sending the extraction result to a user terminal, or storing it in the knowledge graph database on the server.

4. The method for extracting ancient geographical entity relationships according to claim 1, characterized in that, In S101, the output of the pre-trained language model after encoding also includes the context representation vector of each word; in S105, obtaining the entity pair representation vector of each entity pair includes: The spans with a subclass prediction probability higher than the threshold are selected as the identified entities, and these entities are paired to form candidate entity pairs. For each entity pair, the representation vectors of the two entities and the context representation vector between the entity pairs are concatenated to form the entity pair representation vector.

5. The method for extracting ancient geographical entity relationships according to claim 1, characterized in that, S102 includes: The document-level global representation vector is fed into the global entity classifier and the global relation classifier respectively to obtain the predicted entity types and relation types in the document text. The global entity classifier is a fully connected layer with an input dimension of 768 and an output dimension of the number of corresponding entity subclasses. After passing through the Sigmoid activation function, it outputs the probability of each entity type existing in the document. The global relation classifier is a fully connected layer with an input dimension of 768 and an output dimension of the number of corresponding relation subclasses, outputting the probability of each relation type existing in the document.

6. The method for extracting ancient geographical entity relationships according to claim 1, characterized in that, S103 further includes: generating a length embedding vector based on the length of the candidate span; S104 includes: Perform the first-level entity classification by concatenating the representation vector and length embedding vector corresponding to the candidate span, and then feeding them into the entity classifier to obtain the entity class probability distribution. The second layer of entity subclass classification is performed by concatenating the representation vector, length embedding vector, entity class probability distribution and global entity probability vector corresponding to the candidate span, and then feeding them into the entity subclass classifier to obtain the entity subclass probability distribution.

7. The method for extracting ancient geographical entity relationships according to claim 6, characterized in that, The entity classifier is a fully connected layer, and its output dimension meets the dimension requirements of the entity class. After passing through the Softmax function, it outputs the probability distribution of the entity class. The entity subclass classifier is a fully connected layer, and its output dimension meets the dimensional requirements of the entity subclass. After passing through the Softmax function, it outputs the entity subclass probability distribution.

8. The method for extracting ancient geographical entity relationships according to claim 1, characterized in that, S106 includes: Distance information is obtained by subtracting entity distance from location; the first layer of relationship classification is performed by fusing entity pair representation vectors, distance information and context representation vectors and feeding them into the relationship classifier to obtain the relationship class probability distribution; The second layer of relation subclass classification is performed by concatenating the entity pair representation vector, distance information, context representation vector, relation class probability distribution and global relation probability vector, and feeding them into the relation subclass classifier to obtain the relation subclass probability distribution. The relation subclass classification adopts a multi-label classification method.

9. A method for extracting geographical entity relationships from ancient texts, characterized in that, Applied to a user terminal, the method includes: Send document text to the server and obtain the extraction result of the document text from the server, wherein the extraction result is obtained by the server using the ancient text geographical entity relationship extraction method according to any one of claims 1-8.

10. A system for extracting geographical entity relationships from ancient texts, characterized in that, The system includes an electronic device, which includes a memory and at least one processor. The memory stores a computer program, and the processor executes the computer program to enable the electronic device to perform the method as described in any one of claims 1 to 8.