Method and apparatus for constructing event-based knowledge graph

CN122903624APending Publication Date: 2026-10-13启元实验室
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610829506.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-09
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0003]相关技术中,目前利用大语言模型构建知识图谱时,一般是针对某一特定需求对模式进行人工定义,且人工定义的模式局限于实体间关系的静态模式,导致对事件等复杂语义信息的保留精度低,进而使得知识图谱的构建过程效率低下且通用性差

Benefits of technology

通过本申请所提供的上述实施例,通过将文本数据切分为目标文本块,有效降低了大语言模型处理长文本的复杂度与计算开销,提升了信息处理的效率与模型输入的针对性。利用预设的大语言模型从文本块中自动提取信息并生成标准化三元组,充分发挥了大模型强大的语义理解与泛化能力,显著提高了事件相关实体、关系及属性抽取的准确率与完整性,解决了传统方法依赖人工定义模式导致的灵活性差与信息保留精度低的问题。基于三元组自动映射为知识图谱的点和边,实现了从非结构化文本到结构化知识网络的高效转换,不仅大幅提升了知识图谱的构建效率与自动化水平,还确保了图谱能够精准、全面地反映事件的动态过程与内在逻辑,从而构建出更高质量、更具实用价值的事件知识图谱。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122903624A_ABST
    Figure CN122903624A_ABST
Patent Text Reader

Abstract

The application provides a method and device for constructing an event-based knowledge graph, and relates to the technical field of knowledge graphs. The method comprises: based on a preset length threshold and a preset complete segmentation condition, segmenting text data to generate a plurality of preliminary text blocks, and generating a target text block according to a preset large language model and the plurality of preliminary text blocks; based on the large language model, extracting information of the target text block to generate a triple in a predetermined format; based on the triple, determining points and edges of a knowledge graph to be constructed to generate a target knowledge graph based on the points and edges. The application abstracts the extracted entities, events and relationships through a large language model to generate a general pattern covering multiple dimensions of semantic categories. This mechanism achieves high-level semantic alignment with human-designed patterns without human intervention, breaking the bottleneck of traditional methods that rely on domain experts to preset patterns, and significantly improving the cross-domain adaptability and construction efficiency of the knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of knowledge graph technology, and for example to a method and apparatus for constructing an event-based knowledge graph. Background Technology

[0002] In the information-exploding digital age, transforming massive amounts of unstructured text into structured, machine-readable knowledge has long been a core challenge in the field of artificial intelligence. Knowledge graphs, as a key technology for achieving this transformation, have become the semantic foundation of numerous applications such as search engines, question-answering systems, and recommendation engines, and their importance has become increasingly prominent in recent years. However, traditional knowledge graph construction methods are always constrained by a fundamental contradiction: they heavily rely on predefined patterns from domain experts. This reliance fundamentally restricts the scalability, adaptability, and cross-domain coverage of knowledge graphs. In practical applications, manual design not only consumes significant time and manpower but also struggles to cope with rapidly changing knowledge demands. When facing emerging fields or cross-domain integration scenarios, predefined patterns often appear rigid, unable to incorporate new entity and relation types in a timely manner, resulting in a significant reduction in the semantic coverage of the knowledge graph. At the same time, traditional knowledge graph triple extraction focuses primarily on entity-entity relationships, with insufficient modeling of dynamic events, further exacerbating the limitations of knowledge representation. Knowledge in the real world is inherently dynamic. Events carry a wealth of crucial information, including time sequences, causal relationships, and procedural knowledge, which cannot be fully captured by static entity-entity relationships. Knowledge graphs that only retain entity information can only preserve about 70% of the original text content. This gap directly leads to the poor performance of traditional knowledge graphs in handling complex reasoning tasks. In recent years, the rapid development of large language models has provided new possibilities for overcoming these bottlenecks. Through pre-training on massive amounts of text, large language models have accumulated powerful semantic understanding and abstract inductive capabilities, enabling them to automatically identify entities, events, and their relationships from text, and even infer implicit semantic connections based on context. This capability makes it possible to extract both entities and events simultaneously, thus fully capturing both static attributes and dynamic processes in the text. More importantly, large language models possess the ability to inductively summarize abstract concepts from concrete examples, automatically generating patterns covering entity types, event types, and relationship types without relying on manual definition. This autonomous pattern derivation based on large language models and the ability to extract event-based triples provides a completely new paradigm for building next-generation knowledge graphs. By dynamically generating patterns that adapt to text content, knowledge graphs can adapt to knowledge structures in different domains, significantly improving cross-domain scalability; by simultaneously modeling entities and events, knowledge graphs can retain richer semantic information, providing support for complex reasoning tasks; and the automated construction process greatly reduces reliance on domain experts, making it possible to process massive corpora and build large-scale knowledge graphs.

[0003] In related technologies, when building knowledge graphs using large language models, patterns are usually manually defined for a specific need. Moreover, manually defined patterns are limited to static patterns of relationships between entities, resulting in low accuracy in preserving complex semantic information such as events. Consequently, the knowledge graph construction process is inefficient and lacks versatility. Summary of the Invention

[0004] This application aims to provide a method, apparatus, electronic device, and storage medium for constructing an event-based knowledge graph.

[0005] According to one aspect of this application, a method for constructing an event-based knowledge graph is proposed, comprising: segmenting text data based on a preset length threshold and preset complete segmentation conditions to generate multiple preliminary text blocks; generating a target text block based on a preset large language model and the multiple preliminary text blocks, wherein the target text block includes context information of the corresponding preliminary text blocks, and the text data corresponds to the event to be constructed in the knowledge graph; extracting information from the target text block based on the large language model to generate triples in a predetermined format; determining the points and edges of the knowledge graph to be constructed based on the triples, and generating the target knowledge graph based on the points and edges.

[0006] According to one aspect of this application, an apparatus for constructing an event-based knowledge graph is proposed, comprising: The segmentation module is used to segment text data based on a preset length threshold and preset complete segmentation conditions to generate multiple preliminary text blocks, and to generate target text blocks according to a preset large language model and the multiple preliminary text blocks. The target text block includes the context information of the corresponding preliminary text block, and the text data corresponds to the event to be constructed in the knowledge graph. The information extraction module is used to extract information from target text blocks based on a large language model in order to generate triples in a predetermined format. The construction module is used to determine the points and edges of the knowledge graph to be constructed based on triples, and to generate the target knowledge graph based on the points and edges.

[0007] According to one aspect of this application, an electronic device is provided, comprising: a processor; and a memory storing a computer program that, when executed by the processor, causes the processor to perform the method described above.

[0008] According to one aspect of this application, a non-transitory computer-readable medium is proposed, on which readable instructions are stored, which, when executed by a processor, cause the processor to perform the method described above.

[0009] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this application.

[0010] Beneficial effects: The embodiments provided in this application effectively reduce the complexity and computational overhead of large language models in processing long texts by segmenting text data into target text blocks, thereby improving the efficiency of information processing and the relevance of model input. By automatically extracting information from text blocks and generating standardized triples using a pre-defined large language model, the powerful semantic understanding and generalization capabilities of the large model are fully utilized, significantly improving the accuracy and completeness of extracting event-related entities, relationships, and attributes. This solves the problems of poor flexibility and low information retention accuracy caused by the reliance on manually defined patterns in traditional methods. Based on the automatic mapping of triples to points and edges in a knowledge graph, an efficient conversion from unstructured text to a structured knowledge network is achieved. This not only significantly improves the construction efficiency and automation level of the knowledge graph but also ensures that the graph can accurately and comprehensively reflect the dynamic process and internal logic of events, thus constructing a higher-quality and more practical event knowledge graph. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings, without exceeding the scope of protection claimed by this application.

[0012] Figure 1 A flowchart illustrating the method for constructing an event-based knowledge graph provided in this application embodiment; Figure 2 A block diagram of an apparatus for constructing an event-based knowledge graph provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0013] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided so that this application will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.

[0014] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.

[0015] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0016] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0017] It should be understood that although the terms first, second, third, etc., may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another. Therefore, the first component discussed below may be referred to as the second component without departing from the teachings of this application. As used herein, the term "and / or" includes all combinations of any one and more of the associated listed items.

[0018] For specific implementation details, please refer to the following examples.

[0019] Figure 1 A flowchart illustrating a method for constructing an event-based knowledge graph as provided in an embodiment of this application. Figure 1 As shown, the method includes steps S10, S11 and S12.

[0020] In step S10, the text data is segmented based on a preset length threshold and a preset complete segmentation condition to generate multiple preliminary text blocks. A target text block is generated based on a preset large language model and the multiple preliminary text blocks. The target text block includes the context information of the corresponding preliminary text block, and the text data corresponds to the event to be constructed in the knowledge graph.

[0021] In this application, text data can be collected in advance from public platforms or private document libraries that allow data collection. This text data is plain text document-type data. Multiple pieces of text data can be collected, and each piece must be document-type data containing valuable semantic information; it can be a paragraph or a complete document. To ensure the effectiveness of the final knowledge graph construction, some implementations first perform data cleaning on the text data, including but not limited to data deduplication and data filtering, to remove low-quality content and ensure the high quality of the input text data.

[0022] Content that is too short, contains repetition, includes irrelevant and distracting content such as garbled text, or has poor literary quality can be classified as low-quality content. A minimum content threshold, a method for judging garbled text, and a method for judging literary quality can be preset to determine which data is considered low-quality and will be removed. High-quality text can be information published on public platforms that is authentic, reliable, verifiable, and free of misleading content.

[0023] Text data can be quite long. Excessively long texts not only exceed the context window limit of large language models, leading to processing failures, but also result in lower information density in the output of triple extraction, losing much of the original text's detail and affecting the information retention accuracy of the final knowledge graph. Therefore, segmentation is necessary. Some implementations use fixed-length splits, where a maximum length threshold for each text block is fixed (e.g., 2560 characters). Segmentation is performed each time the text data reaches the length threshold, resulting in multiple target text blocks.

[0024] In some implementations, this application can also pre-set a length threshold, such as 256 characters, and pre-set complete segmentation conditions. In some implementations, the complete segmentation condition can be a fixed maximum length threshold for each text block, with segmentation performed each time the length of the input text data reaches the threshold. In other implementations, the complete segmentation condition can also be to perform segmentation simultaneously if the length of the input text data equals the threshold and at the end of a sentence (such as a period, exclamation mark, etc.), ensuring that each segmented text block is a complete sentence.

[0025] This application allows for the pre-configuration of a large language model and the setting of pre-defined guiding words. For example, it can instruct the model to output target text blocks that are associated with the context, or to remove target text blocks containing pre-defined words and sentences. Multiple preliminary text blocks are input into the large language model, which processes the data according to the pre-defined settings and guidance to obtain target text blocks that meet the criteria. In the specific implementation, the model can output target text blocks that are associated with the context information from the preliminary text blocks.

[0026] In step S11, information from the target text block is extracted based on the large language model to generate triples in a predetermined format.

[0027] In this application, a general large language model can be used for information extraction. Cue words can be pre-set, enabling the large language model to extract and output triples in a predetermined format. The cue words are simply a piece of text that tells the large language model what processing to perform.

[0028] In some implementations, the predefined format can include entity-entity, entity-event, and event-event. An entity is the most basic building block in a knowledge graph, which can be understood as any independent, identifiable concrete or abstract object in the real world. In a graph, entities are typically represented as nodes, which can be concrete people, places, items, organizations, or abstract concepts. An event is a special and more complex type of entity in a knowledge graph. It no longer describes static objects, but rather an action or state change jointly performed by one or more participants within a specific spatiotemporal context. Events organize multiple entities, time, location, and other elements together to form a complete story or fact. It upgrades the knowledge graph from a static network describing "what" to a dynamic network capable of describing "what happened." Relationships are used to describe the semantic connections between entities or between an entity and its attributes. In a graph, relationships are typically represented as edges connecting nodes.

[0029] An entity-entity triple takes the form (entity1, relation, entity2), where each entity is a noun and the relation is a verb or phrase describing the relationship between the two entities. An entity-event triple takes the form (entity, relation, event), where the definition of an entity is the same as above, an event is a description of the event, and the relation describes the entity's participation in the event and its role (e.g., participating, initiating, influencing). An event-event triple takes the form (event1, relation, event2), where event1 and event2 are two different events, and the relation describes the semantic relationships between the events, such as temporal sequence (e.g., before, after), causal dependence (e.g., because, leading to), and logical progression (e.g., simultaneously, furthermore).

[0030] Taking the extraction of relationships between entities as an example, prompts can be: Please analyze the given passage and briefly summarize all the important entities and the relationships between them. Relationships should concisely summarize the connections between entities, rather than simply repeating entity information. Entities should be as specific as possible. Entities cannot be pronouns. The output should strictly adhere to a specific JSON format.

[0031] In step S12, the points and edges of the knowledge graph to be constructed are determined based on the triples, and the target knowledge graph is generated based on the points and edges.

[0032] In this application, based on the triples generated above, the entities and events are formed into points of the knowledge graph, and the relationships are formed into edges of the knowledge graph, thus obtaining the target knowledge graph.

[0033] The generated target knowledge graph can be saved as a file, such as the commonly used GraphML (Graph Markup Language) format, or it can be stored in a graph database, such as the open-source Neo4j software. The large language model used in this application can be open-source or closed-source; no limitation is made here.

[0034] This application effectively reduces the complexity and computational overhead of large language models processing long texts by segmenting text data into target text blocks, thereby improving the efficiency of information processing and the relevance of model input. It automatically extracts information from text blocks and generates standardized triples using a pre-defined large language model, fully leveraging the powerful semantic understanding and generalization capabilities of the large model. This significantly improves the accuracy and completeness of extracting event-related entities, relationships, and attributes, solving the problems of poor flexibility and low information retention accuracy caused by traditional methods relying on manually defined patterns. Based on the automatic mapping of triples to points and edges in a knowledge graph, it achieves an efficient conversion from unstructured text to a structured knowledge network. This not only greatly improves the efficiency and automation level of knowledge graph construction but also ensures that the graph accurately and comprehensively reflects the dynamic process and internal logic of events, thus constructing a higher-quality and more practically valuable event knowledge graph.

[0035] According to some embodiments, synonyms in points can be detected, and points corresponding to synonyms can be identified as synonym points; synonym edges can be established based on synonym points; and a target knowledge graph can be generated based on points, edges, and synonym edges.

[0036] In this application, multiple sets of synonyms can be pre-defined. Taking a specific point as an example, the pre-defined sets of synonyms are used to match the synonyms of the words corresponding to that point. The points corresponding to the synonyms and the point itself are considered as a pair of synonym points in the target knowledge graph. The pair of synonym points is then connected to generate synonymous edges. The previously generated points serve as the ground nodes, the edges serve as entity relationship edges connecting the nodes, and the synonymous edges serve as special connection edges representing synonymous attributes between nodes. According to a pre-defined graph data structure, the nodes and edges are assembled to obtain the target knowledge graph.

[0037] This application identifies points in a knowledge graph that share the same semantic meaning (i.e., points corresponding to synonyms) and establishes dedicated synonym edges for them. This allows for the explicit expression of semantic equivalence relationships while preserving the original point and edge structure. It effectively solves the problems of data redundancy, semantic inconsistency, and broken reasoning paths caused by synonyms in traditional knowledge graphs, improving the semantic coherence and reasoning accuracy of the knowledge graph. Simultaneously, it provides explicit structural support for subsequent applications such as knowledge fusion, query expansion, and entity disambiguation.

[0038] According to some embodiments, a large model and points can be generated based on preset vectors, and the text vectors corresponding to the points can be determined; synonyms can be determined based on the similarity of the text vectors and a preset similarity threshold; and synonyms can be identified as synonym points.

[0039] In this application, a large vector generation model can be pre-set, such as BERT (Bidirectional Encoder Representations from Transformers), RoBERTa (Robustly Optimized BERT Pretraining Approach), Sentence-BERT (Sentence Embeddings using Siamese BERT-Networks), or any applicable pre-trained language model. The name, attributes, and text of each point in the target knowledge graph are used as input to the model. Through the model's forward computation, the point is mapped to a vector space, thus obtaining the text vector corresponding to each point.

[0040] The similarity between text vectors of any two points can be calculated using cosine similarity, Euclidean distance, dot product, or other algorithms that can measure distance in a vector space. In some implementations, cosine similarity can be used, defined as the cosine of the angle between two vectors.

[0041] A similarity threshold can be preset, for example, 0.8. If the calculated similarity is greater than or equal to the similarity threshold, the two words are considered synonyms, and the corresponding two points are considered synonyms. If the calculated similarity is less than the similarity threshold, the two words are considered not synonyms, and the corresponding two points are not synonyms either.

[0042] This application introduces a large-scale vector generation model to map discrete node text into text vectors, enabling deep extraction of the contextual semantic features of nodes. This overcomes the shortcomings of traditional methods based on literal matching or relying on manually constructed thesaurus, which struggle to identify semantically identical words with different literal meanings. This significantly improves the semantic understanding and generalization capabilities of synonym detection. Calculations based on text vector similarity transform ambiguous semantic equivalence relationships into precisely calculable numerical distances. Combined with a preset similarity threshold, the process of determining synonyms becomes objective and quantifiable. Furthermore, by adjusting the preset similarity threshold, the strictness of synonym determination can be flexibly controlled, effectively balancing the precision and recall of synonym recognition and reducing the risk of false positives and false negatives.

[0043] According to some embodiments, target text blocks are added to the knowledge graph to be built to generate text points; source edges are constructed based on text points and points; and the target knowledge graph is generated based on text points, points, edges, and source edges.

[0044] In this application, the original target text blocks (entity points / event points) and edges are extracted. These target text blocks are added as independent nodes to the knowledge graph to be constructed, generating text points, and each text point is assigned a unique text node identifier. For existing points in the graph, the target text point from which the point originates is determined. A source edge pointing to the target text point is created between the existing point and the target text point, and a preset source relationship label is set for the source edge. The points, edges, text points, and source edges are topologically assembled according to the graph data structure, and the assembled graph network data is persistently stored in a graph database to generate the target knowledge graph.

[0045] This application establishes a mapping channel between structured knowledge and original unstructured text by constructing source edges that trace back from entity / event points to their source text points. This allows any knowledge point in the graph to be traced back to its original text source along the source edges, effectively overcoming the semantic fragmentation problem caused by the black-box extraction of traditional knowledge graphs and enhancing the interpretability and credibility of the graph. When entity or event information in the graph is disputed or needs to be updated, the original text block can be quickly located through the source edges without having to re-search the entire corpus, significantly improving the efficiency and accuracy of knowledge verification. Introducing the original text block as a text point into the graph network not only preserves contextual details that may be lost during graph construction but also enables the direct acquisition of the complete original text description along the source edges when performing knowledge retrieval or question answering based on the graph, improving the completeness and accuracy of knowledge services.

[0046] According to some embodiments, multiple preliminary text blocks include the current text block and other text blocks. This application can process other text blocks using a large language model for the current text block to generate summary information; the summary information is then added as context information to the current text block to generate the target text block corresponding to the current text block.

[0047] In this application, after segmentation, multiple preliminary text blocks can be obtained. Any one of these text blocks is taken as the current text block, and the text blocks generated before the current text block are taken as other text blocks.

[0048] For the current text block, information from other text blocks can be input into the large language model, which outputs a summary as the summary information. This summary information can then be added to the current text block as context information to obtain the target text block.

[0049] In some implementations, if the current text block is the first text block, there is no need to generate context information; the current text block can be directly used as the target text block.

[0050] Traditional hard text segmentation easily disrupts the semantic coherence across text blocks, leading to incomprehensible local information due to missing context. This application utilizes a large language model to summarize other text blocks and injects this summary information as context into the current text block. This ensures that each target text block not only retains local details but also possesses a global semantic perspective, significantly improving the semantic integrity and coherence of individual text blocks. Compared to directly concatenating the entire content of other text blocks into the current text block, this solution uses a large language model to generate summary information. While preserving the core semantics of other text blocks, it greatly compresses the redundant length of the context, avoiding word overflow or computational resource overload caused by long text concatenation, thus achieving an effective balance between context enhancement and computational efficiency.

[0051] According to some embodiments, triples include entity-entity triples, entity-event triples, and event-event triples. This application can also utilize a large language model to abstract entities, events, and relations in the target knowledge graph to generate event concepts and relation concepts, wherein event concepts are used to form concept points in the target knowledge graph, and relation concepts serve as additional attributes of edges in the target knowledge graph.

[0052] In this application, existing entity nodes, event nodes, and relational edge data connecting them can be extracted from the target knowledge graph. The entity nodes, event nodes, and relational edge data are input into a large language model. Based on a preset concept abstraction prompt template, the large language model is instructed to perform upward semantic induction on entities and events to output event concepts, and to perform semantic classification on relations to output relation concepts. The output of the large language model is parsed, and event concepts are added as new nodes to the target knowledge graph to form concept points. Instantiated mapping edges are established between specific events or entities and concept points. Relational concepts are written as extended attribute fields of the corresponding relational edges into the edge attribute data structure of the target knowledge graph.

[0053] Examples of prompts generated by the event concept in some implementations: Please provide an abstract event phrase of 1 to 2 words describing the given event. Your answer must be in the following format: phrase 1, phrase 2, phrase 3, ... Do not output anything other than the answer. The abstract event phrase must meet the following requirements: 1. Abstract event phrases can effectively express events; they can be the type of event or related concepts.

[0054] 2. Strictly follow the provided format and do not add any extra characters or words.

[0055] 3. Write down three or more phrases at different levels of abstraction if possible.

[0056] 4. Do not repeat the same words or inputs in your answers.

[0057] 5. If you cannot provide more phrases, please stop immediately; no explanation is needed.

[0058] Example: Event: A man lived in seclusion in the mountains; The answers given: seclusion, relaxation, escape, nature, solitude.

[0059] Event: A cat chases its prey into its hiding place; The given answers are: hunting, fleeing, preying, hiding, and stalking.

[0060] Event: Xiaoming is playing with his dog; The given answers are: relaxation, caressing, playing, building connections, and friendship.

[0061] Event: [Event]; The given answer is: ...

[0062] This application introduces a hierarchical ontology structure of instances and concepts into the target knowledge graph by abstracting specific entities and events to generate event concept points. This allows the graph to possess not only low-level factual details but also high-level macroscopic semantics, effectively overcoming the problem of difficulty in cross-domain generalization and reasoning caused by overly specific nodes in pure instance graphs. Fine-grained, long-tailed specific relationships are abstracted into relationship concepts and treated as additional attributes of edges. This allows semantically similar but differently expressed relationships to be aggregated at the conceptual level, facilitating subsequent macroscopic path search and subgraph pattern mining on the graph while ignoring fine-grained differences. Introducing relationship concepts as additional attributes of edges, rather than independent concept nodes, enriches the semantic characterization of edges while avoiding the problems of rapid expansion of the graph topology and exponential increase in path traversal complexity caused by introducing a large number of relationship concept nodes, achieving a balance between semantic enhancement and graph computational efficiency.

[0063] According to some embodiments, a large language model of the same language can be selected based on the language of the text data; pre-set concept generation prompt words for the language can be obtained to provide prompts to the large language model; the target knowledge graph can be input into the prompted large language model to abstract entities, events and relationships in the target knowledge graph and generate event concepts and relationship concepts.

[0064] In this application, after obtaining the language of the original text data used to construct the target knowledge graph, a suitable large language model is selected. Specifically, if the original text data is Chinese, a large language model trained with Chinese as the native language is selected, such as a model pre-trained on a massive Chinese corpus. If the original text data is English, a large model trained with English as the native language is selected. Here, "same language" refers not only to the macro-level language category but also to specific domains or dialect variations within the same language, to ensure the model's ability to analyze the deep semantics of the text.

[0065] This application can pre-build and store multiple sets of concept generation prompt word templates tailored to the language habits, grammatical structures, and cultural contexts of different languages. Once the target language is determined, the corresponding prompt words for that language are retrieved from the database. For example, Chinese prompt words will use instructions that conform to Chinese logic, such as "Please summarize the following entities and events into superordinate concepts," while English prompt words will use instructions that conform to English logic. By filling in partial data structures or examples of the target knowledge graph into the prompt word templates for that language, precise contextual prompts are formed, guiding the large model to perform abstraction tasks according to the thinking patterns of that specific language.

[0066] The serialized target knowledge graph, such as a list of triples or graph-structured text described in natural language, is input into a large language model that has undergone language adaptation and prompt word guidance. Leveraging its powerful semantic understanding capabilities in its native language, the large model generalizes specific entities and events in the graph. For example, it abstracts the entity "Company A" into the event concept "technology company," and the event "releasing product a" into the event concept "product release." Simultaneously, it extracts specific relationships, ultimately outputting a structured set of event concepts and a set of relationship concepts.

[0067] This application employs a native language model consistent with the input text's language, enabling the model to directly understand and reason based on the semantic space of the original corpus. This avoids information attenuation and semantic distortion during translation, thus preserving the original text's connotation to the greatest extent and significantly improving the accuracy and deep semantic fit of event and relation concept generation. Different languages ​​have vastly different syntactic structures, such as the semantic structure in Chinese and the hypotactic structure in English. By using concept-generated prompts corresponding to the text's language, the grammatical logic and expression habits of the prompts are highly consistent with the input data. This dual matching of native language instructions and the native language model allows the large model to more accurately capture implicit entities, complex events, and logical relationships in the text, reducing extraction omissions or over-abstractions caused by instruction misunderstandings, thereby achieving optimal triple extraction and concept generation results.

[0068] The following describes an apparatus embodiment of this application, which can be used to perform the method embodiment of this application. For details not disclosed in the apparatus embodiment of this application, please refer to the method embodiment of this application.

[0069] Figure 2 This is a block diagram of an event-based knowledge graph construction apparatus provided in an embodiment of this application. Figure 2 As shown, the event-based knowledge graph construction device 200 includes a segmentation module 201, an information extraction module 202, and a construction module 203.

[0070] The segmentation module 201 segments the text data based on a preset length threshold and preset complete segmentation conditions to generate multiple preliminary text blocks, and generates a target text block according to a preset large language model and the multiple preliminary text blocks. The target text block includes the context information of the corresponding preliminary text block, and the text data corresponds to the event to be constructed in the knowledge graph. The information extraction module 202 is used to extract information from the target text block based on the large language model to generate triples in a predetermined format. Module 203 is used to determine the points and edges of the knowledge graph to be constructed based on triples, and to generate the target knowledge graph based on the points and edges.

[0071] Optionally, in the case of generating a target knowledge graph based on points and edges, the construction module 203 is specifically used for: Detect synonyms in the detection points and identify the points corresponding to the synonyms as synonym points; Based on synonym points, construct synonym edges; Generate a target knowledge graph based on nodes, edges, and synonymous edges.

[0072] Optionally, when the construction module 203 identifies synonyms in the detection points and determines the points corresponding to the synonyms as synonym points, it is specifically used for: Generate a large model and points based on preset vectors, and determine the text vector corresponding to each point; Synonyms are determined based on the similarity of text vectors and a preset similarity threshold; Identify synonyms as synonym points.

[0073] Optionally, in the case of generating a target knowledge graph based on points and edges, the construction module 203 is specifically used for: Add the target text block to the knowledge graph to be built to generate text points; Construct source edges based on text points and points; Generate a target knowledge graph based on text points, points, edges, and source edges.

[0074] Optionally, the multiple preliminary text blocks include the current text block and other text blocks; when the segmentation module 201 generates the target text block based on the preset large language model and the multiple preliminary text blocks, it is specifically used for: For the current text block, use a large language model to process other text blocks to generate summary information; The summary information is added as context information to the current text block to generate the target text block corresponding to the current text block.

[0075] Optionally, the triples include entity-entity triples, entity-event triples, and event-event triples; the event-based knowledge graph construction device 200 also includes a concept abstraction module 204, used for: By using a large language model, entities, events, and relations in the target knowledge graph are abstracted to generate event concepts and relation concepts. Event concepts are used to form concept points in the target knowledge graph, and relation concepts are used as additional attributes of edges in the target knowledge graph.

[0076] Optionally, the concept abstraction module 204 is specifically used for: Based on the language of the text data, select a large language model of the same language; Obtain pre-defined language concepts to generate prompt words and provide suggestions to the large language model; The target knowledge graph is input into a large language model with prompts to abstract entities, events, and relationships in the target knowledge graph and generate event concepts and relationship concepts.

[0077] The device performs functions similar to those described above; other functions are described in the preceding descriptions and will not be repeated here.

[0078] Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 3 As shown, the electronic device 300 of this embodiment may include a memory 301 and a processor 302.

[0079] The memory 301 stores a computer program, which, when executed by the processor 302, causes the processor 302 to perform the method described in the above embodiments.

[0080] The processor 302 and the memory 301 are connected, for example, via a bus.

[0081] Optionally, the electronic device 300 may also include a transceiver. It should be noted that in practical applications, the transceiver is not limited to one, and the structure of the electronic device 300 does not constitute a limitation on the embodiments of this application.

[0082] Processor 302 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 302 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0083] A bus can include a pathway for transmitting information between the aforementioned components. The bus can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, only one thick line is used in the diagram, but this does not imply that there is only one bus or one type of bus.

[0084] The memory 301 can be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or it can be EEPROM (Electrically Erasable Programmable Read Only Memory), CD. ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, digital universal discs, Blu-ray discs, etc.), disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0085] The memory 301 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 302. The processor 302 is used to execute the application code stored in the memory 301 to implement the content shown in the foregoing method embodiments.

[0086] Electronic devices include, but are not limited to: mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Servers can also be included. Figure 3 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0087] The electronic device in this embodiment can be used to execute the method of any of the above embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.

[0088] This application also provides a non-transitory computer-readable storage medium storing computer-readable instructions thereon, which, when executed by a processor, cause the processor to perform the method as described in the above embodiments.

[0089] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a non-transitory computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0090] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. Furthermore, any changes or modifications made by those skilled in the art based on the ideas of this application, and on the specific implementation methods and application scope of this application, are all within the scope of protection of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for constructing an event-based knowledge graph, characterized in that, include: Based on a preset length threshold and preset complete segmentation conditions, the text data is segmented to generate multiple preliminary text blocks. Then, a target text block is generated based on a preset large language model and the multiple preliminary text blocks. The target text block includes the context information of the corresponding preliminary text block, and the text data corresponds to the event to be constructed in the knowledge graph. Based on the large language model, information is extracted from the target text block to generate triples in a predetermined format; Based on the triples, the points and edges of the knowledge graph to be constructed are determined, and the target knowledge graph is generated based on the points and edges.

2. The method according to claim 1, characterized in that, The generation of the target knowledge graph based on the points and edges includes: Detect synonyms among the points and identify the points corresponding to the synonyms as synonym points; Based on the aforementioned synonym points, synonym edges are established; The target knowledge graph is generated based on the points, edges, and synonymous edges.

3. The method according to claim 2, characterized in that, The step of detecting synonyms in the points and identifying the points corresponding to the synonyms as synonym points includes: Based on a preset vector generation model and the points, determine the text vector corresponding to the points; The synonyms are determined based on the similarity of the text vectors and a preset similarity threshold; The synonym is identified as the synonym point.

4. The method according to claim 1, characterized in that, The generation of the target knowledge graph based on the points and edges includes: The target text block is added to the knowledge graph to be constructed to generate text points; Based on the text points and the points, construct the source edge; The target knowledge graph is generated based on the text points, the points, the edges, and the source edges.

5. The method according to claim 1, characterized in that, The plurality of preliminary text blocks includes the current text block and other text blocks; The step of generating the target text block based on the preset large language model and the multiple preliminary text blocks includes: For the current text block, the large language model is used to process the other text blocks to generate summary information; The summary information is added as context information to the current text block to generate the target text block corresponding to the current text block.

6. The method according to claim 1, characterized in that, The triples include entity-entity triples, entity-event triples, and event-event triples; The method further includes: Using the large language model, entities, events, and relationships in the target knowledge graph are abstracted to generate event concepts and relationship concepts. The event concepts are used to form concept points in the target knowledge graph, and the relationship concepts are used as additional attributes of the edges in the target knowledge graph.

7. The method according to claim 6, characterized in that, The step of using the large language model to abstract entities, events, and relationships in the target knowledge graph to generate event concepts and relationship concepts includes: Based on the language of the text data, select a large language model of the same language; Obtain pre-set concept-generating prompt words for the language and provide prompts to the large language model; The target knowledge graph is input into a large language model after prompting, so as to abstract the entities, events and relationships in the target knowledge graph and generate the event concept and the relationship concept.

8. An apparatus for constructing an event-based knowledge graph, characterized in that, include: The segmentation module segments the text data based on a preset length threshold and preset complete segmentation conditions to generate multiple preliminary text blocks, and generates a target text block based on a preset large language model and the multiple preliminary text blocks. The target text block includes the context information of the corresponding preliminary text block, and the text data corresponds to the event to be constructed in the knowledge graph. The information extraction module is used to extract information from the target text block based on the large language model to generate triples in a predetermined format. A construction module is used to determine the points and edges of the knowledge graph to be constructed based on the triples, and to generate the target knowledge graph based on the points and edges.

9. An electronic device, characterized in that, include: processor; A memory storing a computer program that, when executed by the processor, causes the processor to perform the method as described in any one of claims 1-7.

10. A non-transitory computer-readable storage medium, characterized in that, It stores computer-readable instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1-7.