Prompt learning and knowledge completion-based domain event element extraction method and system
By combining prompting learning and knowledge completion methods, the problem of insufficient model generalization ability in Chinese event element extraction is solved, achieving accurate identification and completion in complex scenarios, outputting standardized event data, and providing efficient structured input for subsequent analysis.
Patent Information
- Application Number
- CN202511858539.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-03-20
AI Technical Summary
Existing event element extraction methods suffer from problems such as insufficient model generalization ability, high training cost, unstable output and incomplete information in Chinese text, especially in complex sentence structures and multi-event scenarios where it is difficult to accurately identify and complete event elements.
We employ a prompt-based learning and knowledge completion approach. We guide a large language model to extract event elements through structured prompt templates, and combine them with an external knowledge base for verification and supplementation. We use the SimCSE model for sentence matching and vector retrieval, introduce the HanLP tool for syntactic analysis and entity recognition, optimize event elements, and use a weighted similarity algorithm for deduplication and unified output.
It achieves stable extraction of event elements with a small number of labeled samples, improves the model's cross-domain adaptability and the accuracy and consistency of its output, provides standardized and structured event data, and supports subsequent event relationship mining and knowledge graph construction.
Smart Images

Figure CN121706775A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of natural language processing and artificial intelligence technology, and more specifically relates to a method and system for extracting domain event elements based on prompting learning and knowledge completion. Background Technology
[0002] Currently, with the continuous growth of data volume on the Internet, information extraction technology has been widely applied in various fields. Events, as a form of information representation, are often implicit in large-scale text data. While research has made some progress in event detection and extraction from English corpora, research on Chinese corpora lags behind due to their linguistic characteristics, such as the lack of word separation, polysemy, and complex sentence structures, making error propagation a difficult problem to avoid in natural language processing. Event element extraction, as an important branch of information extraction, plays a core role in economic analysis, public opinion analysis, public safety early warning, and knowledge graph construction. This task aims to identify key information elements constituting an event from unstructured text, such as event type, subject, action, object, time, and location, providing structured input for higher-level event relationship analysis and causal reasoning.
[0003] Existing event element extraction methods can be mainly divided into three categories: rule-based methods, deep learning-based supervised methods, and pre-trained model-based methods. Early rule-based methods relied on manually compiled templates and grammatical rules, requiring significant manual effort. Deep learning-based supervised methods (such as BERT and BiLSTM-CRF models) are trained on large-scale labeled data and achieve good results on general corpora, but still have significant shortcomings in domain transfer, insufficient sample size, and multi-element collaborative extraction. With the development of Large Language Models (LLMs), this method constructs natural language task instructions, enabling the model to have strong task adaptability without requiring extensive parameter updates. Event element extraction methods based on pre-trained language models typically use models such as BERT or RoBERTa, identifying event trigger words and their argument roles through classification or sequence labeling, encoding the input text into context vectors, and using multi-layer classifiers to predict the element labels of each word. This method can capture local semantic relationships, but its ability to identify element boundaries in complex sentence structures and multi-event scenarios is insufficient, and the model requires fine-tuning on large-scale labeled data, resulting in high training costs.
[0004] Generative event extraction methods based on prompting learners guide large language models to output text containing event elements by constructing prompt instructions. While this approach reduces reliance on task-specific parameters, existing prompt designs are mostly static templates, lacking optimization for domain semantics. Furthermore, these methods generally do not incorporate external knowledge sources for validation and supplementation, leading to decreased accuracy when faced with knowledge gaps or domain semantic biases.
[0005] The main shortcomings of existing event extraction methods include: Sequence labeling methods based on pre-trained models rely on a large number of manually labeled samples for model training. When the amount of target domain corpus is limited or the semantic distribution varies greatly, the generalization ability of the model decreases significantly, resulting in low element recognition accuracy and high model training and deployment costs.
[0006] While cue-based extraction methods can reduce annotation requirements, cue template design lacks domain specificity. The simple structure and insufficient semantic constraints of cue words lead to instability in the format, semantic consistency, and structural integrity of the event elements output by the model. This is especially true in scenarios with multiple events or complex sentence structures, where issues such as missing elements or unclear boundaries often occur.
[0007] Furthermore, existing methods generally lack external knowledge supplementation mechanisms, making it impossible to effectively verify and complete the extracted results. When the input text contains omissions, implicit or ambiguous expressions, the model struggles to infer missing elements, resulting in incomplete output information and difficulty in tracing its origin. In addition, existing technologies lack a unified standard for output, with inconsistent formats between different models or data sources, making it difficult to directly use them for subsequent event relationship mining and knowledge graph construction. Summary of the Invention
[0008] To address, or at least partially address, the technical problems existing in the background art described above, this invention provides a method and system for extracting domain event elements based on prompting learning and knowledge completion. This invention, by combining prompting learning and knowledge completion technologies, can achieve efficient conversion of unstructured text into structured event elements, thereby improving the performance of domain event agents in complex information processing and multi-dimensional relationship mining, and is of great significance for intelligence association analysis in specific domains.
[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows: In a first aspect, the present invention provides a method for extracting domain event elements based on prompting learning and knowledge completion, the method comprising the following steps: S1. Receive task prompts and news text to be processed, segment the news text into a sentence list by sentence; and use a pre-trained semantic vector model to vectorize each sentence in the task prompts and the sentence list respectively, calculate the similarity between the task prompt vector and each sentence vector, and filter out matching sentences with similarity higher than the first threshold. S2. For the matched sentence, a structured prompt template is used to guide the large language model to extract event elements; the matched sentence is then analyzed using syntactic analysis tools to perform named entity recognition and dependency parsing, extract entity information, and optimize the event elements. S3. Search the pre-built domain knowledge vector database, select task-related event information with similarity higher than the second threshold, add / fill it into the original task event, obtain structured knowledge base event element information and label the source; S4. Merge the optimized event elements with the event elements in the knowledge base, and use a weighted similarity algorithm to remove duplicate events while retaining events from the original text source; S5. Perform unified relation extraction on the deduplicated events and output standardized, structured element data.
[0010] Preferably, in step S1, the nltk tool is used to segment the news text into multiple sentences.
[0011] Preferably, in step S1, matching sentences are selected by calculating the cosine similarity between the task prompt vector and each sentence vector.
[0012] Preferably, in step S2, the structured prompt template is a natural language instruction in the form of slots, including event type prompts, feature constraint prompts, and formatted output prompts, and the label and slot form of each target field are clearly defined in the prompts.
[0013] Preferably, in step S2, the extracted event elements include: event type, event subject, event action, event object, event time, and event location; the extracted entity information includes: subject-verb-object structure and time and location.
[0014] Preferably, in step S2, the syntactic analysis tool used is HanLP, which performs the following operations: word segmentation, named entity recognition, dependency parsing, and semantic role labeling.
[0015] Preferably, in step S2, the optimization of event elements includes: event element alignment and completion, subject-verb-object structure matching correction, and normalization of synonyms or expressions; wherein: The process of event element alignment and completion includes: traversing the output six-tuple fields, first identifying missing fields or fields with abnormal formats, and when the confidence of the information extracted by HanLP meets the preset conditions, completing the entity according to the standard format and marking the source; For cases where the subject / object in the output is a pronoun or a domain abbreviation, the antecedent is located based on HanLP dependency parsing, and then replaced with the standard entity name using the domain entity alias library, with the source marked. If no matching entity or antecedent is found, mark it as: missing or pending manual review, and do not force filling.
[0016] Secondly, the present invention also provides a domain event element extraction system based on prompting learning and knowledge completion. This system can be combined with an intelligent agent control framework, including a task perception module, a module scheduling module, and a result evaluation module. The above-mentioned method is applied to extract domain event elements and output standardized and structured element data.
[0017] Compared with the prior art, the present invention has at least the following beneficial effects: 1. This invention proposes a domain event element extraction method based on prompting learning and knowledge completion. This method, which combines prompting learning and knowledge completion techniques, can achieve efficient transformation of unstructured text into structured event elements, thereby improving the performance of domain event agents in complex information processing and multi-dimensional relationship mining, and is of great significance for intelligence association analysis in specific domains.
[0018] 2. In this invention, the extraction task is first transformed into a constrained generation problem through structured prompts. This fully leverages the existing knowledge priors of large language models, achieving stable extraction with a small number of labeled samples, reducing reliance on large-scale labeled data, and enhancing cross-domain adaptability. Furthermore, a vectorized knowledge retrieval mechanism is introduced to obtain relevant evidence from external knowledge sources to complete elements not explicitly expressed in the text, enhancing information completeness. Knowledge verification further improves the accuracy and credibility of the results. Based on this, an adaptive fusion mechanism of prompts and knowledge enables the model to flexibly balance textual context and external knowledge, improving robustness to complex contexts and ambiguous expressions. Finally, this method outputs standardized, structured element data, providing a convenient interface for downstream event graph construction and analysis tasks, contributing to improved automation of domain knowledge processing and system integration efficiency.
[0019] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.
[0020] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0021] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0022] Figure 1 This is a schematic diagram of the domain event element extraction method based on prompting learning and knowledge completion provided by the present invention.
[0023] Figure 2 This is a schematic diagram of sentence list matching provided by the present invention.
[0024] Figure 3 This is a schematic diagram illustrating the extraction of event elements and optimization of results for highly matched sentences provided by the present invention.
[0025] Figure 4 This is a schematic diagram illustrating the event element extraction based on syntactic analysis provided by the present invention.
[0026] Figure 5 This is a knowledge retrieval diagram provided by the present invention.
[0027] Figure 6 This is a schematic diagram illustrating the event deduplication and formatted output provided by the present invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0029] In the description of this invention, it should be noted that some processes described in this application specification and accompanying drawings include multiple operations that appear in a specific order. However, it should be clearly understood that these operations may be performed in any order or in parallel. Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention.
[0030] With the accumulation of large amounts of event data, the event elements and relationships within a domain become increasingly complex. Traditional event element extraction methods, relying on rules and statistical models, struggle to handle the intricate semantic relationships between events. To address potential model comprehension biases in domain event element extraction and enhance the analytical capabilities of event element extraction models, this invention proposes a domain event element extraction method based on prompting learning and knowledge completion. See also Figure 1As shown, the main steps of this method include: Step 1: Receive task prompts and news text, segment sentences and match relevant sentences; Step 2: Extract the six elements of events from relevant sentences and optimize the results using the HanLP tool; Step 3: Retrieve relevant event information from the knowledge base, structure the information, and label the sources. Step 4: Integrate the original extraction results with the knowledge base information and execute the deduplication algorithm; Step 5: Extract unified relationships from the deduplicated events and output standardized structured data.
[0031] This method is primarily implemented through the following framework: (1) To address the issues of data dependency and transferability, this invention designs a structured prompt template, transforming the extraction task into a constrained text generation task. The template explicitly defines the element categories and formats using natural language, stably guiding the large language model to generate standardized results under conditions of few samples, reducing dependence on labeled data and improving generalization ability.
[0032] (2) To address the issues of weak reasoning ability and incomplete information, this invention introduces a vector retrieval and knowledge injection mechanism. By querying an external knowledge base, the preliminary results are dynamically verified, evidence is enhanced, and missing information is filled in to ensure the integrity and consistency of the element information. The traceability of the results is ensured by explicitly labeling the source.
[0033] (3) To address the problem of comprehension bias in complex contexts, this invention adopts an attention aggregation strategy that combines prompts and knowledge. This strategy enables the model to dynamically integrate textual semantics with external knowledge and adaptively adjust dependency weights, thereby improving robustness in complex scenarios.
[0034] The specific implementation methods and working principles of the present invention will be described in detail below with reference to the accompanying drawings: 1. Knowledge base transformation of news texts: This method preferentially uses the DSN-DEMAMD dataset as the base corpus for knowledge base transformation (other knowledge bases such as DuEE-Fin financial dataset, Chinese emergency corpus CEC, and Wikidata can also be used). DSN-DEMAMD is based on news texts and annotations from multiple fields, including global economics and military news, and contains approximately 14,000 annotated event relationship pairs. These text data come from multiple publicly available news websites. Each annotated event relationship pair includes the strength type of the event relationship (direct or indirect), and detailed information on six basic elements: event type, the subject involved in the event, the main action (movement) involved in the event, the object (representative / secondary action) of the event, the time of the event, and the location of the event.
[0035] During the knowledge base transformation process, the original event texts were processed to extract structured news event elements and their relationships. These were then organized and stored using a unified JSON format to ensure consistency and reusability of event representation. To ensure data traceability, each event in the knowledge base was tagged with '("Is this knowledge base data":true)', allowing for clear identification and differentiation of the event information's source during subsequent model calls and output. The SimCSE-BERT-base-Chinese pre-trained model was used to vectorize the knowledge base sentences, generating 768-dimensional sentence vectors. An IVF_FLAT type index was constructed using Faiss (Facebook AI Similarity Search), with 100 cluster centers and a similarity threshold of 0.7, generating corresponding index files to balance retrieval efficiency and accuracy. This vector database will be used for subsequent task prompts and similarity matching with knowledge base content, enabling fast and efficient retrieval of event-related sample information and supporting the classification of causal relationships between events.
[0036] example: { Event Type: "Artificial Intelligence Technology Release" Subject of the incident: "Zhixing Technology" "Event Action": "Publish", "Event Object": "Multimodal Large Model Training Framework", "Event Time": "2024 / 10 / 20", Event Location: Hangzhou / Global Artificial Intelligence Conference Original sentence: "On October 20, 2024, Zhixing Technology released its independently developed multimodal large model training framework at the Hangzhou Global Artificial Intelligence Conference." "Is it knowledge base data": true, }
[0037] 2. Event Element Extraction: See Figure 2 As shown, the system first receives task prompts and corresponding news text input. The nltk tool is used to segment the news text into sentences, and the SimCSE model is used to calculate the similarity between the task prompts and each sentence, achieving sentence-level matching. For successfully matched sentences, structured event information containing six elements (including event type, subject, action, object, time, and location) is extracted through prompt template construction or by combining the rule extraction capabilities of the HanLP tool.
[0038] 2.1 List of sentences matched by the SimCSE model: First, the news text T is split into multiple sentences using the nltk library. Among them ( (where m is the total number of sentences, and m is the i-th clause) - Sentence List .
[0039] Transform the segmented sentence list S and task prompts P into vector representations. .
[0040] Connect the task prompt Vec(P) with each clause Calculate cosine similarity The similarity between the text and the task prompt is obtained, and a similarity list is generated. The cosine similarity is calculated as follows, where... for The t-th dimension component, for The t-th dimension component .
[0041]
[0042] After calculating the cosine similarity between the task prompt and each clause, the similarity scores are filtered. Sτ of sentences with a value ≥0.6: (Sτ) ) If there are more than 2 sentences k that meet the criteria, select the Top-2; if there are fewer than 2, select all sentences that meet the criteria.
[0043] 2.2 Extraction of event elements from highly matched sentences: The overall process of extracting event elements from the design prompt template is as follows: Figure 3 As shown.
[0044] (1) Event element extraction based on LLM: This invention employs an end-to-end event extraction strategy based on a large language model. Even in the absence of structured auxiliary information, it completes the task of extracting event six-tuples solely from raw sentences. By constructing an input-output mapping from "sentence to six-tuple" and using a lightweight fine-tuning method (LoRA) to train a pre-trained model (e.g., ChatGLM2-6B), only the attention layer parameters are fine-tuned, while other layers are frozen to reduce training costs. This enables the model to automatically identify and generate information such as event type, subject, action, object, time, and location. For the retrieved Top-k related sentences, a few-shot prompting strategy is used to guide the model to extract event elements one by one, thereby improving the quality of generated structured information.
[0045] In this embodiment, to improve the structural consistency of the extracted six elements of an event and the model's perception of the extraction target, a template-based prompting method and a schema-guided design are combined to construct a task prompt template oriented towards the event structure. The prompt explicitly defines the label and slot format for each target field, such as "Event Type: [ ]", enabling the model to learn the mapping function from the original text to the structure filling, guiding the language model to fill in the blanks as needed, and improving the consistency of the output and the extraction accuracy.
[0046] The slot format encodes structural information into cues, helping the model understand the positional alignment of "feature-semantics." During model training, the output format is essentially equivalent to learning a mapping function:
[0047] Where: x is the original input text. It is the information corresponding to the i-th slot, such as =“Economic event”.
[0048] The input prompt format can be abstracted into the following structure:
[0049] Where: x is the original text; [ ] represents the placeholder slots for generating and filling the model. The Prompt template design based on agent-based event element extraction is shown in Table 1 below.
[0050] Table 1. LLM-based Event Element Extraction Prompt Template Design
[0051] (2) Event element extraction based on syntactic analysis: Event analysis is implemented using the HanLP toolkit: HanLP's StandardTokenizer is used for tokenization, and the BiLSTM-CRF Named Entity Recognition (NER) module is used to extract entities such as names, organizations, time, and location. DependencyParser performs syntactic analysis to determine the subject-verb-object structure. The final step is semantic recognition and keyword mapping: "Subject" → event subject, "Object" → event object, "Verb" → event action, etc. See [link to detailed process] for more information. Figure 4 As shown.
[0052] (3) Optimization of event element extraction results: In the post-processing stage of the model output, the results extracted by HanLP tools (or equivalent language analysis tools such as spaCy and LTP) are used to calibrate and complete the generated event element six-tuples. Through HanLP's word segmentation, named entity recognition, and dependency parsing functions, subject-verb-object structure and entity information such as time and location in the sentences are extracted to verify the consistency and completeness of the model's output fields. This mainly includes three aspects of processing: ① event element alignment and completion, ② subject-verb-object structure matching correction, and ③ synonym or expression normalization. Specifically: ① Event Element Alignment and Completion: Traverse the six-tuple fields output by the model, first identify missing fields (such as empty time) or fields with abnormal format (such as time "May 2023" not yet reached). When the confidence of the corresponding NER entity extracted by HanLP is ≥0.7, complete the entity according to the standard format (time → ISO "YYYY / MM / DD", location → "country / city" level), and mark the source as "HanLP NER Completion"; for cases where the subject / object in the model output is a pronoun (such as "he") or a domain abbreviation, locate the antecedent based on HanLP dependency parsing, and replace it with the standard entity name in combination with the "domain entity alias library", and mark the source as "HanLP syntactic analysis + alias library correction"; if no matching entity or antecedent is found, mark it as "missing (no matching entity)" or "awaiting manual review", and do not force filling.
[0053] ② Subject-Verb-Object Structure Matching Correction: Extract core subject-verb-object triples (e.g., "Huaxin Microelectronics - Release - FinFET Mass Production Technology") through HanLP dependency parsing, calculate the matching degree between them and the model output "Subject-Action-Object". When the matching degree is <0.6, it is judged as a role mismatch (e.g., model output "Subject: Global Semiconductor Innovation Summit; Action: Release"). Correction is performed based on HanLP triples (confidence ≥0.85), and the source is marked "HanLP Syntactic Analysis Verification". When the matching degree is ≥0.6, the model output is retained and marked "Verification Passed".
[0054] ③ Synonym or Expression Normalization: Construct a domain terminology mapping table (including three sub-tables: action words, event types, and objects). Based on domain dictionaries (economic, military, diplomatic, etc.) and the WordNet semantic database, use the cosine similarity algorithm (based on 300-dimensional Word2Vec word vectors) to calculate the semantic similarity of terms. Terms with similarity ≥ 0.8 are grouped into the same standard expression (e.g., action words "release", "expand", "conduct" → "announce", objects "crude oil", "petroleum" → "petroleum products"). The mapping table supports iterative optimization: new domain terms are collected every quarter, candidate mapping relationships are automatically generated, and updated to the system after being reviewed by domain experts (pass rate ≥ 90%). If a term has no corresponding standard expression (similarity < 0.8), the original expression is retained and added to the candidate pool.
[0055] 3. The knowledge base supplements missing information: See Figure 5 The above describes the introduction of a knowledge base to supplement missing information. The SimCSE model is used to vectorize the original sentences in the task and the knowledge base respectively. The task prompts, news text and original sentences in the knowledge base are converted into vectors. All knowledge base vectors are put into the vector database (FAISS). The task vectors are retrieved in the FAISS vector database. The number of retrieved results is set to n=3, and the similarity threshold is ≥0.75 to ensure that the returned information is highly relevant to the task.
[0056] The matched sentences are formatted (tagged) using the method described above for analyzing event element information. The retrieved task-related event information is then added / filled into the original task events, adding background information (such as similar historical events or related domain terms).
[0057] Example: { Event Type: "Artificial Intelligence Technology Release" Subject of the incident: "Zhiqi Technology" "Event Action": "Publish", "Event Object": "Multimodal Pre-trained Model", Event Date: October 10, 2024 Event Location: Beijing - Global Artificial Intelligence Conference Original description: "On October 10, 2024, Zhiqi Technology released its independently developed multimodal pre-trained model at the Global Artificial Intelligence Conference in Beijing." Source: Knowledge Base }
[0058] 4. Deduplication of event element information: join Figure 6 As shown, the structured event element A extracted from the original text and the structured event element B retrieved from the knowledge base are integrated together; it is determined whether there are "duplicate / identical events" among them; after deduplication, the integrated event information is used to perform unified relation extraction; when outputting, the event elements from the knowledge base are enclosed in parentheses to distinguish them.
[0059] A weighted similarity calculation method is used to remove duplicate events. The weights of the six elements are: event type (0.2), subject (0.25), action (0.25), object (0.15), time (0.1), and location (0.05). The total similarity KΣ (element similarity × corresponding weight) is calculated. When K≥0.8, it is judged as a duplicate event. The events extracted from the original text are retained, and duplicate events in the knowledge base are removed.
[0060] K=0.2 +0.25 +0.25 +0.15 +0.1 +0.05
[0061] in (Event type) (main body), (action), (object), (time), (Location), corresponding to the similarity of each element (values range from 0 to 1).
[0062] Use the most distinctive field among the six elements to concatenate the data. If the types are the same, the subjects are similar, the actions are similar (judged by word vectors or edit distance), and the time difference is not significant, the information can be aggregated into the same event if there is overlap but not complete consistency.
[0063] Furthermore, the present invention also provides a domain event element extraction system based on prompting learning and knowledge completion. This system can be combined with an intelligent agent control framework, including a task perception module, a module scheduling module, and a result evaluation module, and apply the above method to extract domain event elements.
[0064] The system provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the aforementioned method embodiment, and will not be repeated here.
[0065] As described in the above embodiments, those skilled in the art will understand that the present invention proposes a method and system for extracting domain event elements based on prompting learning and knowledge completion. It reduces data dependency and training costs through a prompting learning mechanism, improving the model's transferability and generalization ability in domain tasks; it improves the accuracy and consistency of event element extraction by constructing structured prompt templates and multi-stage semantic constraints; it enhances the completeness and traceability of output information by introducing a vector-based knowledge completion mechanism, enabling automatic verification, element completion, and source annotation of the extraction results; and it provides standardized input data for subsequent event relationship reasoning and knowledge graph construction through a unified structured event output template. The specific technical advantages are as follows: (1) Event Element Extraction Framework Based on Cue Learning: This invention provides a domain event element extraction method that combines a cue learning mechanism. By constructing a multi-level, structured cue template, including a basic template, a one-shot learning template, and a few-shot learning template, the event extraction task is transformed into a controllable text generation task. The cue template includes event type cue, element constraint cue, and formatted output cue. It clearly defines the labels and slots for the six elements of an event (such as "Event Type: [ ]"). By using LoRA lightweight fine-tuning of the pre-trained model, it can guide a large language model to complete the identification and structured extraction of six standard elements, including event type, event subject, event action, event object, event time, and event location, under unsupervised or few-sample conditions.
[0066] (2) Event Information Enhancement Mechanism Integrating Knowledge Supplementation: This invention further proposes an event information enhancement mechanism integrating knowledge retrieval and supplementation. By vectorizing the task prompts and performing vector similarity matching with the domain event corpus pre-stored in the knowledge base, knowledge information retrieval and dynamic supplementation related to the semantics of the current task are realized. The mechanism uses the retrieved knowledge fragments to verify and complete the original text extraction results, and marks the source of the supplemented information in the output stage to ensure the integrity, consistency and traceability of event elements.
[0067] (3) Collaborative Optimization Strategy of Prompt Template and Knowledge Fusion: This invention designs a collaborative optimization strategy of prompt template and knowledge supplementation, which inputs semantic features from the text and external information from the knowledge base into the language model to achieve joint modeling at the semantic and knowledge levels. By introducing a multi-stage input control and attention aggregation mechanism, the model can adaptively adjust the attention weight of text semantics and knowledge prompts during the event element generation process, thereby improving the accuracy and robustness of event extraction.
[0068] (4) Unified Format Structured Output and Annotation Method: This invention establishes a unified structured output template for event elements, which imposes unified format constraints on element information from different sources. The output template represents events in the form of six tuples, supporting explicit annotation and source tracing of supplementary information to the knowledge base.
[0069] (5) Automated Execution and Optimization Process Based on Intelligent Agents: In specific implementation, this invention can be combined with an intelligent agent control framework, including a task perception module, a module scheduling module, and a result evaluation module: ① The task perception module receives user task prompts and identifies the task type; ② The module scheduling module adaptively calls the prompt generation module (selecting the prompt template for the corresponding domain), the knowledge retrieval module (adjusting the retrieval threshold), and the output formatting module according to the task type; ③ The result evaluation module scores the completeness (no missing six elements) and accuracy (consistent with the text / knowledge base) of the extracted results. If the score is <0.8, it returns to the corresponding module for reprocessing, realizing end-to-end automated optimization. This enables the system to have task perception and dynamic optimization capabilities.
[0070] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, devices, or computer program products, etc. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0071] It should be noted that the word "comprising" does not exclude the presence of components or steps not listed in the claims. The words "a" or "an" preceding a component do not exclude the presence of a plurality of such components. This invention can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer.
[0072] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0073] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for extracting domain event elements based on prompting learning and knowledge completion, characterized in that, The method includes the following steps: S1. Receive task prompts and news text to be processed, segment the news text into a sentence list by sentence; and use a pre-trained semantic vector model to vectorize each sentence in the task prompts and the sentence list respectively, calculate the similarity between the task prompt vector and each sentence vector, and filter out matching sentences with similarity higher than the first threshold. S2. A structured prompt template is used to guide the large language model to extract event elements from the matched sentence; and syntactic analysis tools are used to perform named entity recognition and dependency parsing on the matched sentence to extract entity information and optimize the event elements; S3. Search the pre-built domain knowledge vector database, select task-related event information with similarity higher than the second threshold, add / fill it into the original task event, obtain structured knowledge base event element information and label the source; S4. Merge the optimized event elements with the event elements in the knowledge base, and use a weighted similarity algorithm to remove duplicate events while retaining events from the original text source; S5. Perform unified relation extraction on the deduplicated events and output standardized, structured element data.
2. The domain event element extraction method based on prompting learning and knowledge completion according to claim 1, characterized in that, In S1, the nltk tool is used to segment the news text into multiple sentences.
3. The domain event element extraction method based on prompting learning and knowledge completion according to claim 1, characterized in that, In step S1, matching sentences are selected by calculating the cosine similarity between the task prompt vector and each sentence vector.
4. The domain event element extraction method based on prompting learning and knowledge completion according to claim 1, characterized in that, In S2, the structured prompt template is a natural language instruction in the form of slots, including event type prompts, feature constraint prompts and formatted output prompts, and the label and slot form of each target field are clearly defined in the prompts.
5. The domain event element extraction method based on prompting learning and knowledge completion according to claim 1, characterized in that, In step S2, the extracted event elements include: event type, event subject, event action, event object, event time, and event location; the extracted entity information includes: subject-verb-object structure and time and location.
6. The method for extracting domain event elements based on prompting learning and knowledge completion according to claim 1, characterized in that, In S2, the syntactic analysis tool used is HanLP, which includes word segmentation, named entity recognition, dependency parsing, and semantic role labeling.
7. The method for extracting domain event elements based on prompting learning and knowledge completion according to claim 1, characterized in that, In S2, the event elements are optimized, including: event element alignment and completion, subject-verb-object structure matching correction, and normalization of synonyms or expressions.
8. A domain event element extraction system based on prompting learning and knowledge completion, characterized in that, The system can be combined with an intelligent agent control framework, including a task perception module, a module scheduling module, and a result evaluation module, and apply the method described in any one of claims 1–7 to extract domain event elements and output standardized, structured element data.
Citation Information
Cited By
Media data acquisition method and system for constructing space-time knowledge tree based on prompt engineering
CN121960464A
Media data acquisition method and system for constructing spatio-temporal knowledge tree based on hint engineering
CN121960464B