Interactive task knowledge base construction method and device based on large language model
Through an interactive method based on large language model, the problem of low efficiency and insufficient accuracy of task knowledge base construction is solved, and efficient and accurate automated construction and adaptability improvement are achieved.
Patent Information
- Application Number
- CN202510075297.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2045-01-17
AI Technical Summary
In the prior art, the construction efficiency of task knowledge bases is low and the accuracy is insufficient, making it difficult to adapt to the rapidly changing needs, especially when switching scenarios in semantic communication systems, the knowledge base needs to be reconstructed.
An interactive task knowledge base construction method based on a large language model is adopted, and a task corpus request instruction is generated through the first keyword prompt template, the task corpus of the target task is obtained, and a large language model is used for text comparison and analysis and entity extraction to generate a task knowledge base for the task objective.
It realizes efficient and precise automation of the task knowledge base, improves adaptability to different application scenarios, reduces the need for manual intervention, reduces the construction cost, and improves the repeatability and scalability of the construction process.
Smart Images

Figure CN119513228A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of semantic communication technology, and in particular to a method and device for constructing an interactive task knowledge base based on a large language model. Background Art
[0002] As an emerging communication technology, semantic communication has shown great development potential with its unique advantages and is an important development direction in the future communication field. As a key component, the task knowledge base can significantly improve the performance of the semantic communication system, enabling it to better understand and respond to communication needs, and is an important link in semantic communication to achieve efficient and accurate information transmission. Therefore, how to solve the problem of knowledge base construction is the key to the current development and application of semantic communication technology.
[0003] Traditional knowledge base construction schemes include manual construction, automatic construction, and semi-automatic construction. Although the manual construction method can ensure the accuracy and authority of knowledge, it is extremely dependent on the expertise and subjective judgment of domain experts. This method has low construction efficiency and is difficult to adapt to the needs of large-scale and fast-paced knowledge updates. In addition, it is limited by the knowledge scope and subjective bias of experts, which may lead to limited coverage of the knowledge base and insufficient objectivity. The automatic construction method automatically extracts knowledge from massive data through information extraction technology to reduce the manual burden. However, in the face of text data with diverse structures and complex semantics, the automatic construction method is difficult to accurately identify entities, attributes, and relationships, and cannot handle complex situations such as implicit relationships and ambiguous expressions. The semi-automatic construction method combines the advantages of manual and automatic methods, but still faces the problems of inefficiency and error-proneness when processing large amounts of data with complex relationships. However, the task knowledge base is a key component of the task-oriented semantic communication system. When switching scenarios, the task knowledge base usually needs to be rebuilt. Therefore, how to optimize the construction efficiency and accuracy of the task knowledge base is a key link in the development and application of semantic communication technology. Summary of the invention
[0004] The present invention provides a method and device for constructing an interactive task knowledge base based on a large language model, which is used to solve the problems of low construction efficiency, insufficient accuracy and difficulty in adapting to rapidly changing needs in the prior art, realize efficient and accurate automatic construction of a task knowledge base, and improve its adaptability to different application scenarios.
[0005] In a first aspect, the present invention provides a method for constructing an interactive task knowledge base based on a large language model, comprising: generating a task corpus request instruction for a target task based on a first keyword prompt template, inputting the task corpus request instruction into a large language model, and acquiring the task corpus for the target task; matching a target standard task corpus from a preset standard task corpus according to the task corpus request instruction, performing text comparison and analysis on the task corpus using the target standard task corpus, and determining whether the task corpus meets the preset task corpus requirements; when it is determined that the task corpus meets the preset task corpus requirements, generating an entity extraction instruction based on a second keyword prompt template, and inputting the entity extraction instruction into a large language model, and acquiring key semantic information of the task corpus; the key semantic information comprises at least one entity information, and each entity information comprises an entity target focused on by the task and a task relevance score of the entity target; based on the key semantic information of the task corpus, generating a task knowledge base for the task target using a large language model.
[0006] According to a method for constructing an interactive task knowledge base based on a large language model provided by the present invention, a target standard task corpus is matched from a preset standard task corpus according to a task corpus request instruction, and a text comparison analysis is performed on the task corpus using the target standard task corpus to determine whether the task corpus meets the preset task corpus requirements, including: parsing the task corpus request instruction and extracting matching information; the matching information includes at least one of the following information: a task subject of the target task and keywords of the task content; matching the target standard task corpus from the standard task corpus based on the matching information; extracting feature vectors from the task corpus and the target standard task corpus, and calculating the similarity of the feature vectors of the two; when the similarity of the feature vectors is greater than or equal to a preset threshold, determining that the task corpus meets the preset task corpus requirements; when the similarity of the feature vectors is less than the preset threshold, determining that the task corpus does not meet the preset task corpus requirements.
[0007] According to a method for constructing an interactive task knowledge base based on a large language model provided by the present invention, task corpus for a target task is obtained, including: determining the source of the task corpus; determining an initial publisher through the source of the task corpus, and determining whether the initial publisher is within a preset publisher range; eliminating task corpus whose initial publisher is not within the preset publisher range, and retaining task corpus whose initial publisher is within the preset publisher range.
[0008] According to a method for constructing an interactive task knowledge base based on a large language model provided by the present invention, when it is determined that the task corpus does not meet the preset task corpus requirements, a third keyword prompt template is used to generate fine-tuning instructions, and the fine-tuning instructions are input into the large language model to fine-tune the large language model until the task corpus output by the large language model meets the preset task corpus requirements; wherein the third keyword prompt template is used to describe the fine-tuning criteria for the large language model.
[0009] According to a method for constructing an interactive task knowledge base based on a large language model provided by the present invention, after obtaining the key semantic information of the task corpus, the method further includes: using a pre-built classification model to classify the entity information in the key semantic information; the classification types include entity omission, entity misrecognition, entity wrong recognition, task relevance score wrong recognition and correct classification; based on the classification result, a fourth keyword prompt template is generated, and the large language model is fine-tuned so that the proportion of entity information in the key semantic information output by the large language model that belongs to the correct classification is greater than the preset proportion.
[0010] According to a method for constructing an interactive task knowledge base based on a large language model provided by the present invention, based on the key semantic information of the task corpus, a task knowledge base of the task target is generated using a large language model, including: generating program writing instructions based on a fifth keyword prompt template, inputting the program writing instructions into the large language model, and obtaining a target program; executing the target program; the target program is used to generate a visual task knowledge base according to the key semantic information.
[0011] According to the present invention, a method for constructing an interactive task knowledge base based on a large language model also includes: testing the visualized task knowledge base; if there is no problem with the test result, completing the construction of the task knowledge base; if there is a problem with the test result, fine-tuning the large language model.
[0012] In a second aspect, the present invention further provides an interactive task knowledge base construction device based on a large language model, comprising: A first processing module is used to generate a task corpus request instruction for a target task based on a first keyword prompt template, input the task corpus request instruction into a large language model, and obtain the task corpus for the target task; The second processing module is used to match the target standard task corpus from the preset standard task corpus according to the task corpus request instruction, and use the target standard task corpus to perform text comparison analysis on the task corpus to determine whether the task corpus meets the preset task corpus requirements; The third processing module is used to generate an entity extraction instruction based on the second keyword prompt template when it is determined that the task corpus meets the preset task corpus requirements, and input the entity extraction instruction into the large language model to obtain key semantic information of the task corpus; the key semantic information is at least one entity information, Each piece of entity information includes the entity target that the task focuses on and the task relevance score of the entity target; The fourth processing module is used to generate a task knowledge base of the task target based on the key semantic information of the task corpus using a large language model.
[0013] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for constructing an interactive task knowledge base based on a large language model as described in any one of the above are implemented.
[0014] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described methods for constructing an interactive task knowledge base based on a large language model.
[0015] The interactive task knowledge base construction method and device based on a large language model provided by the present invention have the following beneficial effects compared with the prior art: Compared with the prior art, the interactive task knowledge base construction method and device based on the large language model provided by the present invention have the following significant beneficial effects: (1) Through automation and intelligent means, with the help of large language models, the need for human intervention is greatly reduced, thereby accelerating the process of building the task knowledge base. Compared with traditional manual or semi-automatic methods, this method can process large-scale data more quickly and adapt to the fast-paced knowledge update needs.
[0016] (2) By utilizing the powerful natural language processing capabilities of the large language model and the prompt word engineering, we can more accurately parse the text content and extract the entities, attributes, and relationships related to the task, thus ensuring the high quality of the generated task knowledge base information. In addition, by performing standard comparison analysis on the generated task corpus, we further ensure its accuracy and consistency.
[0017] (3) Through automation and semi-automation, the technology of this application reduces the reliance on manual participation of domain experts, reduces construction costs, and improves the repeatability and scalability of the construction process.
[0018] (4) Introducing a user feedback loop allows end users to directly participate in the optimization process of the knowledge base. This not only improves the practicality of the system, but also enhances user satisfaction and participation. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 It is a flowchart of a method for constructing an interactive task knowledge base based on a large language model provided by the present invention; Figure 2 It is a schematic diagram of a framework for establishing a disaster awareness task knowledge base in a drone aerial photography scenario provided by the present invention; Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] It should be noted that, in the description of the embodiments of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.
[0023] The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0024] Combine the following Figure 1-Figure 3 The method and device for constructing an interactive task knowledge base based on a large language model provided by an embodiment of the present invention are described.
[0025] Figure 1 is a flow chart of the method for constructing an interactive task knowledge base based on a large language model provided by the present invention. Figure 1 As shown, including but not limited to the following steps: Step 101: Generate a task corpus request instruction for a target task based on a first keyword prompt template, input the task corpus request instruction into a large language model, and obtain task corpus for the target task; The first keyword prompt template is used to describe the requirements of the target task. For example, please collect news reports and official announcements related to earthquake drone post-disaster rescue.
[0026] In order to further refine the process of obtaining task corpus for the target task, the present invention introduces a verification step for the source of the task corpus and the initial publisher. This process ensures that the acquired task corpus is not only related to the target task, but also comes from a reliable, pre-defined publisher range. Specifically, it includes the following steps: (1) Determine the source of the task corpus: Identify and determine all potential data sources that may contain relevant information for the target task. These sources may include but are not limited to public online resources, internal databases, professional literature repositories, social media platforms, etc.
[0027] These data sources are classified according to different criteria (such as reliability, authority, timeliness, etc.) for subsequent screening.
[0028] (2) Determine the initial publisher based on the source of the task corpus and judge whether it is within the preset publisher range: For each task corpus in the data source, trace it back to its original publisher. This can be achieved by parsing metadata, looking up author information, or using other identifiers.
[0029] The identified initial publisher is compared with a pre-defined publisher range. The pre-defined publisher range can be a trust list or a blacklist based on factors such as organizational structure, personal qualifications, and historical contributions.
[0030] (3) Eliminate the task corpus whose initial publisher is not within the pre-defined publisher range, and retain the task corpus whose initial publisher is within the pre-defined publisher range: The present invention can implement strict filtering rules to retain only those task corpora from a preset range of publishers.
[0031] Through this screening method, it is ensured that the task corpus ultimately used to construct the task knowledge base has a high degree of credibility and authority, thereby improving the quality and reliability of the entire knowledge base.
[0032] Step 102: matching a target standard task corpus from a preset standard task corpus according to the task corpus request instruction, performing text comparison analysis on the task corpus using the target standard task corpus, and determining whether the task corpus meets the preset task corpus requirements; As an optional embodiment, step 102 can be further refined into the following specific steps to improve the accuracy and reliability of the acquired task corpus: (1) Parse the task corpus request instructions and extract matching information: The matching information includes at least one of the following information: a task theme of the target task and keywords of the task content.
[0033] The present invention can analyze the natural language in the request instruction and extract key phrases or sentences describing the core content of the task as the task subject.
[0034] The present invention can utilize text processing technology (such as TF-IDF and other algorithms) to automatically extract keywords of the task content from the task corpus request instruction.
[0035] (2) Match the target standard task corpus from the standard task corpus based on the matching information: The present invention can use the extracted task themes and keywords as query conditions to quickly search in a pre-set standard task corpus, which should have been index-optimized so as to efficiently find the most relevant target standard task corpus.
[0036] Optionally, if there are too many preliminary search results, the candidate set can be narrowed down by adding more filtering conditions (such as time range, source type, etc.) to ensure that the target standard task corpus finally selected is as close to the requirements of the target task as possible.
[0037] (3) Extract feature vectors from the task corpus and the target standard task corpus, and calculate the similarity of their feature vectors: For the task corpus and the corresponding target standard task corpus, natural language processing technology and machine learning models (such as Word2Vec, BERT, etc.) are used to convert the text into numerical feature vectors. These feature vectors can capture the semantic information of the text, including text structure, contextual relationships, etc.
[0038] Use an appropriate similarity measurement method (such as cosine similarity) to calculate the feature vector similarity between the task corpus and its matched target standard task corpus.
[0039] (4) Determine whether the preset task corpus requirements are met: According to the preset similarity threshold, it is determined whether the calculated feature vector similarity reaches or exceeds this threshold. If the similarity is greater than or equal to the preset threshold (similarity threshold), the task corpus is considered to meet the preset task corpus requirements; conversely, if the similarity is lower than the preset threshold, it is considered not to meet the requirements.
[0040] Through the above steps, the present invention not only enhances the accuracy of task corpus matching, but also introduces automated and intelligent means to ensure the efficiency of the matching process. This method is particularly suitable for processing large-scale text data and can maintain high accuracy and reliability in complex application scenarios. In addition, by dynamically adjusting the similarity threshold and other parameters, the system can also continuously optimize its own performance to adapt to the specific needs of different tasks.
[0041] Step 103: When it is determined that the task corpus meets the preset task corpus requirements, an entity extraction instruction is generated based on the second keyword prompt template, and the entity extraction instruction is input into the large language model to obtain key semantic information of the task corpus; the key semantic information is at least one entity information, and each entity information includes an entity target of the task focus and a task relevance score of the entity target.
[0042] The second keyword prompt template is used to describe the extraction method and output form of key semantic information, for example: Please refer to the example and use [] to mark entities in the corpus, and summarize the typical tasks in the corpus in the form of a triple of task execution subject-entity target-score, the task focus entity target, and the task relevance score of the target. The example is as follows: At 10:01 on September 6, [Model A UAV] flew to the disaster area again to scout the tributary of River B [Lake C], [house collapse], [tunnel collapse], [water pipe rupture], [land slide], etc., and completed the communication guarantee and real-time transmission of audio and video information in areas such as Township D and Village E, and realized the real-time transmission of disaster investigation information back to the command center of the Ministry of Emergency Management, providing strong support for the scientific and timely deployment of earthquake relief work. The key semantic information in the form of triples is as follows: Model A UAV-C Lake-8 Model A drone-collapsed house-10 Model A UAV-collapsed tunnel-6 Model A UAV-Broken Water Pipe-4 Model A UAV-Landslide-5 As an optional embodiment, when it is determined that the task corpus does not meet the preset task corpus requirements, a third keyword prompt template is used to generate fine-tuning instructions, and the fine-tuning instructions are input into the large language model to fine-tune the large language model until the task corpus output by the large language model meets the preset task corpus requirements; wherein the third keyword prompt template is used to describe the fine-tuning criteria for the large language model.
[0043] Specifically, the present invention designs and uses a third keyword prompt template based on the difference between the unverified task corpus features and the preset task corpus requirements. The template should describe in detail the aspects that need to be adjusted, such as terminology in a specific field, depth of context understanding, entity recognition accuracy, etc.
[0044] Based on the third keyword hint template, a set of detailed fine-tuning instructions are automatically generated. These instructions are designed to guide the large language model on how to improve its output to better match the requirements of the target task.
[0045] The generated fine-tuning instructions are provided as input to the large language model, triggering its internal parameter adjustment mechanism. An iterative feedback loop is established, allowing the system to re-evaluate whether the task corpus meets the preset requirements based on the output after each fine-tuning. If it still does not meet the requirements, new fine-tuning instructions are generated and the above process is repeated.
[0046] By introducing this dynamic fine-tuning mechanism, the present invention can not only effectively solve the problem that the initially generated task corpus does not meet the requirements, but also provide an opportunity for continuous self-optimization for the large language model.
[0047] For example, for the task corpus: "More than a decade ago, we could only rely on manual photography to understand the disaster situation. Now we not only have a panoramic view of the disaster situation, but also only need more than ten minutes at the fastest." lacks key data and is determined not to meet the preset task corpus requirements, then the third keyword prompt template is designed: The above corpus lacks key information. Please collect relevant corpus containing the work completed by drones in post-disaster rescue, such as "At 10:01 on September 6, Model A drone flew to the disaster area again to scout the tributary of River B, Lake C, collapsed houses, collapsed tunnels, broken water pipes, landslides, etc., and completed the communication guarantee and real-time transmission of audio and video information in areas such as Township D and Village E, and achieved real-time transmission of disaster survey information back to the command center of the Ministry of Emergency Management, providing strong support for the scientific and timely deployment of earthquake relief work." Step 104: Based on the key semantic information of the task corpus, a task knowledge base of the task target is generated using a large language model.
[0048] Optionally, in step 104, based on the key semantic information of the task corpus, the process of using the large language model to generate a task knowledge base of the task target can be further refined into the following specific steps: (1) Generate program writing instructions based on the fifth keyword prompt template Design of the fifth keyword prompt template: Design and use the fifth keyword prompt template based on the task requirements and the characteristics of key semantic information. The template should describe in detail the program logic, functional modules, and visualization requirements that need to be generated.
[0049] (2) Input the programming instructions into the large language model to obtain the target program The generated program writing instructions are provided as input to a pre-trained large language model; the large language model automatically generates one or more target programs that meet the task requirements based on the received instructions.
[0050] (3) Execute the target program Set up an appropriate operating environment, including but not limited to installing necessary dependent libraries, configuring servers, etc., to ensure that the target program can run normally in the specified environment. For example, set up the operating environment for Python programs.
[0051] Start the target program and let it generate a task knowledge base based on key semantic information. During this process, the program will automatically load, process, and analyze data and build a structured knowledge representation.
[0052] (4) Generate a visual task knowledge base After the target program is executed, one or more visual interfaces will be generated. These interfaces can be in the form of charts, tables, graphical networks, etc., which are used to display the information in the task knowledge base.
[0053] Through the above steps, the present invention not only realizes the automatic generation from key semantic information to the task knowledge base, but also introduces visualization elements, which greatly enhances the readability and practicality of the knowledge base.
[0054] Based on the content of the above embodiment, as an optional embodiment, the method for constructing an interactive task knowledge base based on a large language model provided by the present invention further includes: (1) Testing the visualized task knowledge base; The present invention can perform knowledge question and answer on the task knowledge base based on the large language model to implement the test of the task knowledge base.
[0055] (2) If the test results are normal, complete the construction of the task knowledge base; if there are problems with the test results, fine-tune the large language model.
[0056] If the output result is correct, it is determined that there is no problem; otherwise, there is a problem with the test and the large language model needs to be fine-tuned based on the existing problem.
[0057] Based on the content of the above embodiment, as an optional embodiment, the interactive task knowledge base construction method based on the large language model provided by the present invention further introduces entity information classification and targeted fine-tuning mechanism after obtaining the key semantic information of the task corpus. The following is a description of the specific steps of this embodiment: (1) Use the pre-built classification model to classify the entity information in the key semantic information: Use a pre-trained classification model to analyze entity information in the key semantic information obtained from the large language model. The classification model should be able to identify multiple classification types, including but not limited to: Missed entity recognition: Failure to identify task-related entities.
[0058] Entity misidentification: An item that is incorrectly identified as an entity but is not.
[0059] Entity misidentification: An entity that is incorrectly identified, such as misclassifying one entity as another.
[0060] Task Relevance Score Misidentification: The task relevance score of the entity is inaccurate.
[0061] Correctly classified: An entity that is accurately identified and classified.
[0062] Classification result output: The classification model outputs the classification labels for each entity information and records these labels for subsequent processing.
[0063] The classification model is pre-trained based on entity information samples and corresponding sample labels.
[0064] (2) Generate the fourth keyword prompt template based on the classification results: Based on the classification results, analyze the main problems of the current large language model in entity recognition. For example, if a large number of entities are missed, the model's understanding of specific domain terms needs to be strengthened; if there are many entity misrecognitions, the context parsing capability may need to be improved.
[0065] Based on the above analysis, a fourth keyword prompt template is designed and generated. This template is used to guide how to adjust the large language model so that it can reduce or eliminate the identified problems in future outputs. The template content should be specific and clear, including detailed adjustment directions and expected results.
[0066] (3) Fine-tune the large language model: The fourth keyword prompt template is converted into a specific fine-tuning instruction and input into the large language model to start the fine-tuning process. A feedback loop is established to allow the system to re-evaluate the key semantic information output after each fine-tuning, especially the classification of the entity information. Through continuous iteration, the proportion of entity information that belongs to the correct classification is gradually increased until it exceeds the preset proportion.
[0067] Through this process of continuous learning and self-optimization, the present invention not only solves the inaccuracy problem that may occur when the task corpus and its key semantic information are generated for the first time, but also enhances the understanding ability and adaptability of the large language model for specific task scenarios.
[0068] Figure 2 is a schematic diagram of a framework for establishing a disaster awareness task knowledge base in a drone aerial photography scenario provided by the present invention, such as Figure 2 As shown, the technical solution of the present invention is further described below in conjunction with specific application scenarios.
[0069] Step 1: Propose initial requirements to the large language model based on the key prompt word template.
[0070] Corresponding key word template: Please collect news reports and official announcements related to earthquake drone post-disaster rescue.
[0071] Step 2: Perform a sample review of the corpus output by the large language model and check whether it meets the preset task corpus requirements in combination with the target standard task corpus. If it does, proceed to step 4; otherwise, proceed to step 3.
[0072] Step 3: It is found that some corpus lacks key data (more than a decade ago, we could only rely on manual photography to understand the disaster situation. Now we not only have a panoramic view of the disaster situation, but also only need more than ten minutes to complete it). The operator proposes fine-tuning standards to the large language model based on the key prompt word template. Then go to step 2.
[0073] The corresponding key word template: The above corpus lacks key information. Please collect relevant corpus containing the work completed by drones in post-disaster rescue, such as "At 10:01 on September 6, Model A drone flew to the disaster area again to scout the tributary of River B, Lake C, collapsed houses, collapsed tunnels, broken water pipes, landslides, etc., and completed the communication guarantee and real-time transmission of audio and video information in areas such as Township D and Village E, and achieved real-time transmission of disaster survey information back to the command center of the Ministry of Emergency Management, providing strong support for the scientific and timely deployment of earthquake relief work." Step 4: Propose the initial requirement of entity extraction to the large language model based on the key word template.
[0074] The corresponding key word template: Please refer to the example and use [] to mark the entities in the corpus, and summarize the task execution subject, task focus entity target, and task relevance score of the target in the corpus in the form of a triple of task execution subject-entity target-score. The example is as follows: At 10:01 on September 6, [Model A UAV] flew to the disaster area again to scout the tributary of River B [Lake C], [house collapse], [tunnel collapse], [water pipe rupture], [land slide], etc., and completed the communication guarantee and real-time transmission of audio and video information in areas such as Township D and Village E, and realized the real-time transmission of disaster investigation information back to the command center of the Ministry of Emergency Management, providing strong support for the scientific and timely deployment of earthquake relief work. The key semantic information in the form of triples is as follows: Model A UAV-C Lake-8 Model A drone-collapsed house-10 Model A UAV-collapsed tunnel-6 Model A UAV-Broken Water Pipe-4 Model A UAV-Landslide-5 Step 5: Use the classification model to sample and review the triples output by the large language model to check for problems. If there are no problems, proceed to step 7; otherwise, proceed to step 6.
[0075] Step 6: Review and find that some triples (drone-real-time image-10, drone-communication service-8) are not physical operators that can be directly focused on in drone aerial photography. Based on the key prompt word template, fine-tuning criteria are proposed to the large language model. Then proceed to step 5.
[0076] The corresponding key word template: The above triples contain entities that cannot be noticed in the drone aerial images. Please adjust the triples to ensure that the entities are targets that can be directly noticed in the drone aerial images, such as Lake C, collapsed houses, damaged roads, broken water pipes, etc.
[0077] Step 7: Propose programming requirements to the large language model based on the key prompt word template.
[0078] Key word template: Please write a program according to the Python programming specification, with the input being the above triples and the output being a visual knowledge base.
[0079] Step 8: Import the program output by the large language model into Python and run it to generate a visual knowledge base.
[0080] Step 9: Conduct knowledge questions based on the large language model and test the task knowledge base.
[0081] Question: Output all entities of interest in flood disaster relief and their relevance scores; Answer: Trapped people - 9; rescue ships - 8; temporary shelters - 8...
[0082] Step 10: Analyze the test results. If there are no problems, complete the knowledge base construction; if there are problems, proceed to step 11.
[0083] Step 11: The operator submits modification requests to the large language model based on the key prompt word template, and then proceeds to step 8.
[0084] Keyword template: The above knowledge base has XXX problems, please modify it according to XXX standards.
[0085] On the other hand, the present invention also provides an interactive task knowledge base construction device based on a large language model, the device comprising: A first processing module is used to generate a task corpus request instruction for a target task based on a first keyword prompt template, input the task corpus request instruction into a large language model, and obtain the task corpus for the target task; The second processing module is used to match the target standard task corpus from the preset standard task corpus according to the task corpus request instruction, and use the target standard task corpus to perform text comparison analysis on the task corpus to determine whether the task corpus meets the preset task corpus requirements; The third processing module is used to generate an entity extraction instruction based on the second keyword prompt template when it is determined that the task corpus meets the preset task corpus requirements, and input the entity extraction instruction into the large language model to obtain key semantic information of the task corpus; the key semantic information is at least one entity information, and each entity information includes an entity target focused on by the task and a task relevance score of the entity target; The fourth processing module is used to generate a task knowledge base of the task target based on the key semantic information of the task corpus using a large language model.
[0086] It should be noted that the device for constructing an interactive task knowledge base based on a large language model provided in an embodiment of the present invention can execute the method for constructing an interactive task knowledge base based on a large language model described in any of the above embodiments during specific operation, which will not be elaborated in this embodiment.
[0087] Figure 3 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the interactive task knowledge base construction method based on the large language model.
[0088] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the interactive task knowledge base construction method based on a large language model provided in the above-mentioned embodiments.
[0089] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the interactive task knowledge base construction method based on a large language model provided in the above-mentioned embodiments.
[0090] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for constructing an interactive task knowledge base based on a large language model, characterized in that: include: Generate a task corpus request instruction for the target task based on the first keyword prompt template, input the task corpus request instruction into the large language model, and obtain the task corpus for the target task; According to the task corpus request instruction, the target standard task corpus is matched from the preset standard task corpus, and the target standard task corpus is used to perform text comparison and analysis on the task corpus to determine whether the task corpus meets the preset task corpus requirements; When it is determined that the task corpus meets the preset task corpus requirements, an entity extraction instruction is generated based on the second keyword prompt template, and the entity extraction instruction is input into the large language model to obtain key semantic information of the task corpus; the key semantic information is at least one entity information, and each entity information includes an entity target focused on by the task and a task relevance score of the entity target; Based on the key semantic information of the task corpus, a large language model is used to generate a task knowledge base for the task objectives.
2. The method for constructing an interactive task knowledge base based on a large language model according to claim 1, characterized in that: According to the task corpus request instruction, the target standard task corpus is matched from the preset standard task corpus, and the task corpus is compared and analyzed with the target standard task corpus to determine whether the task corpus meets the preset task corpus requirements, including: Parsing the task corpus request instruction and extracting matching information; the matching information includes at least one of the following information: the task subject of the target task and the keywords of the task content; Matching a target standard task corpus from the standard task corpus based on the matching information; Extract feature vectors from the task corpus and the target standard task corpus, and calculate the similarity of their feature vectors; When the similarity of the feature vectors is greater than or equal to a preset threshold, it is determined that the task corpus meets the preset task corpus requirements; when the similarity of the feature vectors is less than the preset threshold, it is determined that the task corpus does not meet the preset task corpus requirements.
3. The method for constructing an interactive task knowledge base based on a large language model according to claim 1, characterized in that: Obtain the task corpus of the target task, including: Determine the source of the task corpus; Determine the initial publisher based on the source of the task corpus and determine whether the initial publisher is within the preset publisher range; The task corpus whose initial publisher is not within the pre-defined publisher range is eliminated, and the task corpus whose initial publisher is within the pre-defined publisher range is retained.
4. The method for constructing an interactive task knowledge base based on a large language model according to claim 1, characterized in that: When it is determined that the task corpus does not meet the preset task corpus requirements, a third keyword prompt template is used to generate a fine-tuning instruction, and the fine-tuning instruction is input into the large language model to fine-tune the large language model until the task corpus output by the large language model meets the preset task corpus requirements; The third keyword prompt template is used to describe the fine-tuning criteria for the large language model.
5. The method for constructing an interactive task knowledge base based on a large language model according to claim 1, characterized in that: After obtaining the key semantic information of the task corpus, it also includes: Use the pre-built classification model to classify entity information in key semantic information; classification types include entity omission, entity misrecognition, entity misrecognition, task relevance score misrecognition, and correct classification; Based on the classification result, a fourth keyword prompt template is generated, and the large language model is fine-tuned so that the proportion of entity information in the key semantic information output by the large language model that belongs to the correct classification is greater than the preset proportion.
6. The method for constructing an interactive task knowledge base based on a large language model according to claim 1, characterized in that: Based on the key semantic information of the task corpus, a large language model is used to generate a task knowledge base of the task target, including: generating a program writing instruction based on the fifth keyword prompt template, inputting the program writing instruction into the large language model, and obtaining a target program; Execute the target program; the target program is used to generate a visualized task knowledge base based on key semantic information.
7. The method for constructing an interactive task knowledge base based on a large language model according to claim 6, characterized in that: Also includes: Testing the visualized task knowledge base; If there are no problems with the test results, complete the construction of the task knowledge base; Fine-tune the large language model if there are issues with the test results.
8. An interactive task knowledge base construction device based on a large language model, characterized in that: include: A first processing module is used to generate a task corpus request instruction for a target task based on a first keyword prompt template, input the task corpus request instruction into a large language model, and obtain the task corpus for the target task; The second processing module is used to match the target standard task corpus from the preset standard task corpus according to the task corpus request instruction, and use the target standard task corpus to perform text comparison analysis on the task corpus to determine whether the task corpus meets the preset task corpus requirements; The third processing module is used to generate an entity extraction instruction based on the second keyword prompt template when it is determined that the task corpus meets the preset task corpus requirements, and input the entity extraction instruction into the large language model to obtain key semantic information of the task corpus; the key semantic information is at least one entity information, and each entity information includes an entity target focused on by the task and a task relevance score of the entity target; The fourth processing module is used to generate a task knowledge base of the task target based on the key semantic information of the task corpus using a large language model.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method for constructing an interactive task knowledge base based on a large language model as described in any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for constructing an interactive task knowledge base based on a large language model as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method and device for automatically expanding question and answer knowledge base
CN112948561A
Corpus generation method and related device
CN117009491A
Model-based code generation method and device, storage medium and electronic equipment
CN117873453A
Automatic construction method and device of knowledge base, electronic equipment and storage medium
CN118312577A
Meteorological environment information crawling and analyzing method based on large language model
CN119248986A
Cited By
Cloud function configuration detection method based on large language model
CN120822615A
A cloud function configuration detection method based on a large language model
CN120822615B