Industrial pollution knowledge relation extraction method based on enhanced knowledge retrieval and large language model collaborative optimization
By enhancing the method of collaborative optimization of knowledge retrieval and large language model, the problem of insufficient accuracy in the existing technology when dealing with text in complex fields is solved, high-precision extraction of industrial pollution relationships is achieved, and the optimization of environmental management policies is supported.
Patent Information
- Application Number
- CN202411503974.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-01-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing relationship extraction method has insufficient accuracy when dealing with long-tail relationships and complex field texts, especially in the absence of contextual information support, which makes it difficult to meet high-precision needs, especially in identifying industrial pollution risks and their when related factors.
Using a method based on enhanced knowledge retrieval and large language model collaborative optimization, the pollution data is processed by collecting and segmenting sentences, and similar sentences are constructed using cosine similarity calculation and encoding databases. Combining the prompt builder and the parameter efficient fine-tuning framework, high-quality relationships are generated Extract the result.
It improves the accuracy and generalization ability of relationship extraction, can more accurately identify complex relationships, meet high-precision needs, optimize environmental management policies, and improve environmental quality.
Smart Images

Figure CN119312897A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a relationship extraction method, and more specifically to an industrial pollution knowledge relationship extraction method based on enhanced knowledge retrieval and collaborative optimization of a large language model. Background Art
[0002] Relation extraction occupies a core position in the field of natural language processing. Its goal is to extract semantic relationships between entities from unstructured Chinese texts through text modeling and convert them into structured data. As a key step in knowledge graph construction, relationship extraction plays an important role in many fields, including but not limited to knowledge graph construction, question-answering systems, automatic summarization, and intelligent recommendations. In urban environmental management, effective identification of industrial pollution risks and their related factors is crucial to the formulation of effective environmental strategies.
[0003] Although traditional relation extraction methods rely on feature engineering and supervised learning, they usually require a large amount of annotated data and lack cross-domain generality. These methods rely on hand-designed features and shallow machine learning models, making it difficult to capture multidimensional semantic information in sentences, such as vocabulary, syntactic structure, contextual semantics, and domain-specific nouns. The diversity of sentence structure and the complexity of semantic relations make it difficult for traditional models to accurately identify the relationship between entities. With the rapid development of deep learning technology, large language models can master rich semantic knowledge through large-scale unsupervised learning, thereby demonstrating strong reasoning capabilities in information extraction tasks such as entity recognition and relation extraction. However, existing generation-based relation extraction methods still have limitations when dealing with long-tail relations and complex domain texts. Especially in the absence of contextual information support, the relations generated by large language models may not be accurate enough to meet the needs of high-precision relation extraction.
[0004] At present, the multi-dimensional, multi-type, multi-source and large-scale characteristics of polluted site information urgently need to be deeply mined and managed through digital and information means. Automated industrial pollution relationship extraction methods are crucial for extracting high-quality knowledge from large-scale unstructured texts. This can not only improve the accuracy of information retrieval, but also provide data support for pollution prevention and control strategies, optimize environmental management policies, and thus improve the overall environmental quality. The focus of research is gradually shifting to combining external knowledge bases and retrieval enhancement technologies to improve the ability of large language models to recognize complex relationships. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention proposes an industrial pollution knowledge relationship extraction method based on enhanced knowledge retrieval and collaborative optimization of a large language model.
[0006] The technical solution of the present invention is: a method for extracting industrial pollution knowledge relations based on enhanced knowledge retrieval and collaborative optimization of a large language model, comprising the following steps:
[0007] S1) Collect large-scale pollution data of a city, segment and clean the collected text, remove invalid characters and noise, and construct a training data set d.
[0008] S2), according to the sentence q in the training data set d obtained in step S1), retrieve q and entity pairs related to q (including: head entity and tail entity). Encode the retrieved query sentence q, build an encoding database, and use cosine similarity calculation to obtain a similarity score. The sentence with the highest score in the encoding database is taken as a sentence similar to q.
[0009] S3) By inputting the query sentence q and its similar sentences into the prompt builder, prompt instructions for specific entity pairs are constructed, and a large language model is used to generate potential relationships for reasoning.
[0010] S4) According to the constructed prompt instructions, the large language model is fine-tuned using a parameter-efficient fine-tuning framework to generate high-quality relation extraction results.
[0011] In the above method, in step S1), the collected text is sentence-separated and cleaned to remove invalid characters and noise, and a training data set d is constructed, as follows:
[0012] Segment the collected text into sentences. This can be done based on punctuation marks (such as period, question mark, exclamation mark, etc.), ensuring that each sentence is extracted separately.
[0013] Remove invalid characters from text, such as extra spaces, line breaks, tabs, etc.
[0014] Identify and remove noise data in the text, including but not limited to irrelevant advertisements, web page information, repeated content, garbled characters, etc.
[0015] Perform preliminary validation of the retained text content to ensure it is relevant to the intended mission objectives.
[0016] In the above method, in step S2), according to the query sentence q in the training data set d obtained in step S1), q and entity pairs related to q (including: head entity and tail entity) are retrieved. The retrieved query sentence q is encoded, and an encoding database is constructed. The similarity score is obtained by using cosine similarity calculation. The sentence with the highest score in the encoding database is taken as the sentence similar to q, as follows:
[0017] Use the pre-trained bge-base-zh-v1.5 model as the encoding model and input the retrieved query sentence q into the encoder model for processing. The model encodes each input sentence, converts it into a high-dimensional vector, and constructs an encoding database.
[0018] Using cosine similarity, in the encoding database, calculate the sentence similarity score between each vector and all training samples. According to the calculated cosine similarity score, sort the vectors of all training sentences in the database from high to low in terms of similarity. Select several sentences with the highest similarity from the sorted results as the most similar query instances. The calculation formula for cosine similarity is as follows:
[0019]
[0020] Among them, A and B are two embedded vectors, the dot product represents the similarity between the two vectors, and the denominator is the modulus of the two vectors. The similarity score ranges from [-1, 1]. The closer the score is to 1, the more similar the semantics of the two embedded vectors are.
[0021] According to the calculated cosine similarity score, the embeddings of all training sentences in the database are sorted from high to low by similarity. The higher the similarity score, the closer the sentence is to the query sentence in terms of semantics. From the sorted results, the sentences with the highest similarity are selected as the most similar query instances.
[0022] The most similar sentence instance set is used as the input of data augmentation to generate a similar dataset. The sentences in this similar dataset are semantically close to the query sentence q, so they can be used to enhance the diversity of training data.
[0023] In the above method, in step S3), by inputting the query sentence q and its similar sentences into the prompt builder, a prompt instruction for a specific entity pair is constructed, and a large language model is used to generate potential relationships for reasoning, as follows:
[0024] First, the sentence q in the training dataset d, the corresponding entity pairs and the relationship between them are input into the prompt builder to provide the necessary context information for the generation task. At the same time, the sentences retrieved in step S2) with high similarity to q are input into the prompt builder together with the entity pairs and their relationships in these similar sentences. These similar sentences not only provide more context information for the large language model, but also provide a reference for the relationship reasoning of the target entity pairs.
[0025] The prompt builder receives all inputs and builds prompts containing specific entity pairs based on the input information. These prompts are designed to guide the generative model to generate correct triple relations. The constructed prompts include the following key elements: target sentences, target entity pairs, similar sentences and their entity pairs and relations, and the type of relations that the model can choose. This multi-level prompt design helps large models better understand the relationship between entities during the generation process and ensure the accuracy and consistency of the generated results.
[0026] In the above method, in step S4), according to the constructed prompt instruction, the large language model is fine-tuned using the parameter efficient fine-tuning framework to generate high-quality relationship extraction results, as follows:
[0027] PEFT technology effectively addresses the challenge of high resource consumption of fine-tuning by fine-tuning only a small number of parameters in a large language model instead of adjusting all parameters. This method significantly reduces the resources required for fine-tuning while maintaining similar performance to full parameter fine-tuning. As an example of PEFT technology, LoRA utilizes low-rank matrix approximation and implements small adjustments to the weights of a large language model by introducing two low-rank matrices labeled A and B. This strategy helps to reduce memory usage during the fine-tuning process of a large language model by reducing the overall changes to the parameters of the large language model. For example, considering the weight matrix W0 of the large language model, its update is constrained by low-rank decomposition and only involves training B and A, where B∈Rd×r, A∈Rr×k, r≪min(d,k). The specific expression is as follows:
[0028]
[0029] The present invention selects the Qwen1.5-7B large language model for fine-tuning to achieve the Chinese relation extraction task.
[0030] During the fine-tuning process, in order to adapt to the specific industrial pollution relationship extraction task, carefully designed prompt instructions and expected answers are input. These prompt instructions usually cover key elements, including the sentence to be analyzed, the entity pairs involved, sentences similar to the original sentence, entity pairs in similar sentences, and the known relationships between these entity pairs. This design aims to provide rich contextual information for the large language model to more accurately predict the relationship between entity pairs.
[0031] After receiving these inputs, the large language model will use its parameter set W and the additional parameters A and B introduced by the low-rank matrix approximation technique to work together in the prediction process. The goal of the large language model is to generate a relationship label that accurately describes the relationship between the specified entity pairs in the input. Through a series of network structure layers, the relationship between given entities in the input text is generated. Its basic mechanism can be summarized by the following formula:
[0032]
[0033] The large language model uses the cross entropy loss function as a measurement standard. The specific expression of the cross entropy loss function is:
[0034]
[0035] Among them, N represents the total number of samples, y i is the true relation label of the i-th sample.
[0036] Through the above technical solutions, it can be seen that compared with the prior art, the present invention designs a retrieval-generation-reasoning framework for relation extraction, which combines the open source big language model with the training data to retrieve relevant sentences and perform contextual reasoning. In addition, during the reasoning process, the retrieval module can be plug-and-play with different big language models to improve their performance.
[0037] The present invention extracts similar ontology knowledge and example sentences from training examples to guide the large language model to generate effective relevant entity pair relationships, and enhances the contextual reasoning ability of the large language model through context learning (ICL) adjustment. The generated similar data set is used as training data. In order to enable the large language model to perceive and understand the internal relationship between given sentences and entities, an instruction supervision fine-tuning method is adopted to enhance its logical perception and reasoning ability, thereby obtaining appropriate extraction results. In the reasoning stage, LoRA is used to fine-tune the Qwen1.5-7B large language model, and the generated data is spliced with the original data set to form prompt instructions to improve the accuracy of the final output. The present invention provides a comprehensive method to handle complex relationship extraction tasks, and uses a large language model, a retrieval method and LoRA fine-tuning technology to implement a method for industrial pollution relationship extraction, providing an efficient, flexible and accurate solution for the field of Chinese relationship extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only 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.
[0039] Figure 1 The present invention is a flowchart of an industrial pollution knowledge relationship extraction method based on enhanced knowledge retrieval and large language model collaborative optimization.
[0040] Figure 2 A schematic diagram of the flow of the retrieval module in an embodiment of the present invention.
[0041] Figure 3 A schematic diagram of a flow chart of generating a prompt instruction in an embodiment of the present invention.
[0042] Figure 4 A schematic diagram of the process of fine-tuning a large language model in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The specific implementation of the present invention will be further described with reference to the accompanying drawings:
[0044] In view of the shortcomings of the prior art, the present invention proposes a Chinese relation extraction method for industrial pollution knowledge based on retrieval, generation and reasoning. This method improves the accuracy and generalization ability of the relation extraction task by combining the advantages of retrieval and generative large language models. The whole process is divided into three stages: retrieval, generation and reasoning. First, in the retrieval stage, similar data related to the query sentence q is retrieved through query, and its similarity with the query sentence is calculated, and the retrieval results are sorted using cosine similarity. Then enter the generation stage, input the query sentence and its highly similar sentences into the prompt generator, and construct a valid instruction containing the specified entity pair. Subsequently, the prompt generator is combined with the generative large language model to generate the potential relationship to be inferred. Finally, in the reasoning stage, the large language model is efficiently fine-tuned through the efficient parameter fine-tuning framework, and the fine-tuned model automatically generates the relationship between the entity pairs in the sentence using the input prompt, and outputs the reasoning result. Through this method, the present invention can complete the Chinese relation extraction task in the field of industrial pollution more accurately and efficiently.
[0045] Different from traditional relationship extraction methods, this invention combines large language models, retrieval generation technology and LoRA fine-tuning technology to innovatively achieve accurate identification and extraction of complex relationships in the field of industrial pollution. Traditional relationship extraction methods usually rely on manual feature design or rules, which are difficult to cope with the complex context and diversified relationship expressions in industrial pollution data. Large language models such as GPT have mastered rich language knowledge through pre-training on massive corpora. This knowledge covers everything from basic grammatical rules to complex semantic structures and deep contextual associations.
[0046] like Figure 1 As shown, a method for extracting industrial pollution knowledge relations based on enhanced knowledge retrieval and large language model collaborative optimization includes the following specific steps:
[0047] S1) Collect large-scale pollution data of a city, segment and clean the collected text, remove invalid characters and noise, and construct a training data set d.
[0048] S2) According to the sentence q in the training data set d obtained in step S1), retrieve q and entity pairs related to q (including: head entity and tail entity). Encode the retrieved query sentence q, build an encoding database, and use cosine similarity calculation to obtain a similarity score. The sentence with the highest score in the encoding database is taken as a sentence similar to q.
[0049] S3) constructs prompt instructions for specific entity pairs by inputting the query sentence q and its similar sentences into the prompt builder, and utilizes the large language model to generate potential relations for reasoning.
[0050] S4) According to the constructed prompt instructions, the large language model is fine-tuned using a parameter-efficient fine-tuning framework to generate high-quality relation extraction results.
[0051] In the above method, S2) retrieves the query sentence q and the entity pairs related to q (including the head entity and the tail entity) according to the query sentence q in the training data set d obtained in step S1). Encode the retrieved query sentence q, build an encoding database, and use cosine similarity calculation to obtain a similarity score. The sentence with the highest score in the encoding database is taken as the sentence similar to q. The specific steps are as follows:
[0052] The query sentence q retrieved in step S1) is input into the encoding model bge-base-zh-v1.5. The model will segment each batch and convert it into a tensor format. The encoder model is used to generate vectors and the average value of the last hidden layer is taken. The vector is normalized to be in unit norm and the generated vector is saved as a file in NumPy format.
[0053] Given a sentence in the training dataset d as a query sentence q, the retrieval module aims to retrieve relevant similar sentences from the retrieval corpus. Using cosine similarity, for each vector in the encoding database, the sentence similarity score between the vector and all training samples is calculated. Based on the calculated cosine similarity score, the vectors of all training sentences in the database are sorted from high to low in terms of similarity. From the sorted results, several sentences with the highest similarity are selected as the most similar query instances.
[0054] The most similar sentence instance set is used as the input for data augmentation to generate a set of similar sentences.
[0055] For example Figure 2As shown in the figure, the sentence generated by S2) takes the text "Enping Pinyuan Carton Factory mainly processes: cartons, paper boxes and paper products" as an example, and its corresponding vector is [0.04654128 -0.01415114 -0.05977894 ... -0.02065939 0.02420059 -0.00487438]. It is similar to the example sentence "Enping Pinyuan Carton Factory mainly processes: cartons, paper boxes and paper products" with a similarity of 0.9249. Therefore, the original sentence q and its similar sentences are added to the similarity dataset.
[0056] In the above method, S3) constructs prompt instructions for specific entity pairs by inputting the query sentence q and its similar sentences into the prompt builder, and uses the large language model to generate potential relationships for reasoning, as follows:
[0057] First, the sentences in the training dataset d, the corresponding entity pairs and the relationships between them are input into the prompt builder to provide the necessary context information for the generation task. At the same time, the sentences retrieved in step S2) with high similarity to the query sentence q are input into the prompt builder together with the entity pairs and their relationships in these similar sentences.
[0058] The prompt builder receives all inputs and builds prompt instructions containing specific entity pairs based on the input information. The constructed prompt instructions usually include the following key elements: target sentence, target entity pair, similar sentences and their entity pairs and relations, and the relation type that can be selected by the large language model.
[0059] For example Figure 3 As shown, the similar data set generated by step S2) and the original data set are input into the prompt generation module together.
[0060] The original data set includes "Jiangmen City Pengjiang District Weier Chuang Clothing Co., Ltd. is mainly engaged in design: clothing and accessories", entity pairs "Jiangmen City Pengjiang District Weier Chuang Clothing Co., Ltd." and "clothing and accessories" and the relationship "design". The similar data set "Jiangmen City Pengjiang District Ruziniu Clothing Co., Ltd. is mainly engaged in processing: clothing" contains data similar to the original data, similarity and id. The module will use id to find entity pairs of similar data and the relationship between entity pairs. In the design prompt, the range of relationship types is also specified, which will standardize the large language model to learn and predict relationships in the list of relationship types.
[0061] Example sentence to get the relationship result process:
[0062] 1. Read the query sentence and understand the relevant information about the two entities in the context.
[0063] 2. Based on the sentence content, determine the action or conjunction between the two entities, here it is "design".
[0064] 3. Match this association word with the list of optional relationship types provided.
[0065] 4. In this example, "Design" appears directly in the list, so it is the relationship type between the two entities.
[0066] 5. Therefore, based on the input prompt and the context of the query sentence, we can directly conclude that the relationship type between the two entities is "design".
[0067] In the above method, S4) uses a parameter efficient fine-tuning framework to fine-tune the large language model to generate high-quality relation extraction results. The specific steps are as follows:
[0068] The parameter efficient fine-tuning technology effectively addresses the challenge of high resource consumption of fine-tuning by fine-tuning only a small number of parameters in the large language model instead of adjusting all parameters. This method significantly reduces the resources required for fine-tuning while maintaining similar performance to full parameter fine-tuning. As a method of PEFT technology, LoRA utilizes low-rank matrix approximation and achieves slight adjustments to the weights of the large language model by introducing two low-rank matrices labeled A and B. This strategy helps to reduce memory usage during the fine-tuning process of the large language model by reducing the overall changes to the parameters of the large language model.
[0069] For example Figure 4 As shown, the present invention selects the Qwen1.5-7B large language model for fine-tuning to achieve the Chinese relationship extraction task.
[0070] The prompt instruction generated by step S3) is input into the large language model. After receiving the prompt instruction, the large language model will use its parameter set W and the additional parameters A and B introduced by the low-rank matrix approximation technology to work together in the prediction process. The goal of the large language model is to generate a relationship label that can accurately describe the relationship between the specified entity pairs in the input.
[0071] The query sentence "Jiangmen City Pengjiang District Weier Chuang Clothing Co., Ltd. mainly designs: clothing and accessories" and its similar example sentence "Jiangmen City Pengjiang District Ruziniu Clothing Co., Ltd. mainly processes: clothing and accessories" are jointly constructed into the prompts, which are input into the Qwen1.5-7B large language model fine-tuned by LoRA to perform the Chinese relation extraction task. The output result format is "relation: design".
[0072] During the fine-tuning process, the large language model gradually learns how to generate accurate responses based on the input prompts, thereby demonstrating better performance in the task of extracting industrial pollution knowledge relations.
[0073] The embodiments of the present invention disclosed above are only used to help illustrate the present invention. The embodiments do not describe all the details in detail, nor do they limit the invention to specific implementation methods. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A method for extracting industrial pollution knowledge relations based on enhanced knowledge retrieval and collaborative optimization of large language models, characterized in that: The specific steps include: S1) Collect large-scale pollution data of a city, segment and clean the collected text, remove invalid characters and noise, and construct a training data set d; S2), according to the sentence q in the training data set d obtained in step S1), retrieve q and a pair of entities related to q (head entity and tail entity). Encode the retrieved query sentence q, build an encoding database, and use cosine similarity calculation to obtain a similarity score. The sentence with the highest score in the encoding database is taken as a sentence similar to q; S3), by inputting the query sentence q and its similar sentences into the prompt builder, constructing prompt instructions for specific entity pairs, and using the large language model to generate potential relations for reasoning; S4) Based on constructing effective prompt instructions, use the parameter efficient fine-tuning framework to fine-tune the large language model to generate high-quality relation extraction results.
2. The method for extracting industrial pollution knowledge relations based on enhanced knowledge retrieval and large language model collaborative optimization according to claim 1, characterized in that: In step S1), the collected text is segmented and cleaned to remove invalid characters and noise, and a training data set d is constructed, as follows: Segment the collected text into sentences. This can be done based on punctuation marks (such as period, question mark, exclamation mark, etc.), ensuring that each sentence is extracted separately; Delete invalid characters in the text, such as extra spaces, line breaks, tabs, etc.; Identify and remove noise data in the text, including but not limited to irrelevant advertisements, web page information, repeated content, garbled characters, etc.; Perform preliminary validation of the retained text content to ensure it is relevant to the intended mission objectives.
3. The method for extracting industrial pollution knowledge relations based on enhanced knowledge retrieval and large language model collaborative optimization according to claim 1, characterized in that: In step S2), for the denoised text obtained in step S1), sentence q and a pair of entity pairs related to q (including the head entity and the tail entity) are retrieved. The retrieved query sentence q is encoded, an encoding database is constructed, and a similarity score is obtained using cosine similarity calculation. The sentence with the highest score in the encoding database is taken as a sentence similar to q. The specific steps are as follows: The retrieved query sentence q is input into the encoder model for processing. The model encodes each input sentence, converts it into a high-dimensional vector, and constructs an encoding database. Using cosine similarity, in the encoding database, for each vector, calculate the similarity score between the vector and all query sentences q; According to the calculated cosine similarity score, the embedding vectors of all training sentences in the database are sorted from high to low according to similarity, and several sentences with the highest similarity are selected from the sorted results as the most similar query instances; The most similar sentence instance set is used as the input of data augmentation to generate a set of similar sentences; The sentences in this sentence set are semantically close to the query sentence q, and thus can be used to enhance the diversity of training data.
4. The method for extracting industrial pollution knowledge relations based on enhanced knowledge retrieval and large language model collaborative optimization according to claim 3 is characterized by: In step S3), query statement q and its similar statements are input into the prompt builder to construct prompt instructions for specific entity pairs, and a large language model is used to generate potential relationships for reasoning, as follows: First, the sentences in the training dataset d, the corresponding entity pairs and the relationships between them are input into the prompt builder to provide the necessary context information for the generation task. At the same time, the sentences retrieved in step S2) with high similarity to the query sentence q are input into the prompt builder together with the entity pairs and their relationships in these similar sentences; The prompt builder receives all inputs and builds detailed prompt instructions containing specific entity pairs based on the input information. These prompt instructions are designed to guide the generative model to generate correct triple relations. The constructed prompt instructions usually include the following key elements: target sentence, target entity pair, similar sentences and their entity pairs and relations, and the relationship type that the model can select; This multi-level prompt design helps the large model better understand the relationship between entities during the generation process, ensuring the accuracy and consistency of the generated results; The idea and process of designing prompt instructions mainly include the following steps: Provide examples: Through example sentences and their corresponding entities and relations, let the big model understand how to extract entities and their relations from sentences. This helps to set the context and expected output of the model; Clear task: clearly define the task to be performed, i.e. extracting relations from the query sentence based on the given head and tail entities. This allows the large model to focus on relevant information; Entity identification: By clearly identifying the head and tail entities of the query sentence, the model can accurately identify the elements to be analyzed; Relationship constraints: provide optional relationship types to help large models select a suitable one among multiple possible relationships. At the same time, it emphasizes that if there is no relationship, there is no need to output, reducing unnecessary interference; Thinking step by step: Through step prompts, the large model is encouraged to analyze the sentence step by step instead of guessing blindly, which helps improve the accuracy of extraction.
5. The prompter template is as follows: "prompt":("You are a relation extraction model in the literature field. I will give you a query sentence and extract the following entities and relations according to the requirements." "I will provide a sample sentence, head and tail entities, and relationships to help you understand." "Sample Sentence:" "Example sentence head entity:" "Example sentence end entity:" "Example sentence relationship:" "Now read the query sentence and determine the relationship between the following two entities based on the given entities." "Task constraints: If the relationship type does not exist, there is no need to give it. Please think step by step." "Query sentence:" "Query sentence head entity:" "Query the end-of-sentence entity:" "Optional relationship types include: {"installation","service","processing","processing and installation","processing and production","processing and manufacturing","operation", "mining", "development", "development and production", "design", "production", "repair", "research and development", "business", "printing", "manufacturing"}" "Only output the relationship types between the two entities in the query sentence.") 6. According to claim 4, a method for extracting industrial pollution knowledge relations based on enhanced knowledge retrieval and large language model collaborative optimization is characterized by: In step S4), according to the effective hints, the large language model is fine-tuned using the parameter efficient fine-tuning framework to generate high-quality relation extraction results. The specific steps are as follows: Select a large language model for fine-tuning, input these prompts into the large language model, and generate relation labels through the fine-tuned model; Subsequently, the loss function is calculated to evaluate the difference between the model’s predictions and the actual answers, thus guiding the model’s training and optimization; This process ensures that the generated labels accurately describe the relationship between the specified entity pairs in the input.
Citation Information
Patent Citations
Relationship extraction method and device based on model training, electronic equipment and medium
CN116450767A
Medical knowledge relation extraction method and system based on large language model fine tuning and retrieval enhancement generation
CN118569263A
Cited By
Large language model alignment fine tuning method, system and equipment of recommendation system
CN119886255A
Large language model optimization system and method based on low-rank adaptive technology
CN119886279A
Large Language Model Optimization System and Method Based on Low-Rank Adaptation Technology
CN119886279B
Power distribution system fault recovery method and device based on cooperation of large and small models
CN120012936A
A method and apparatus for power distribution system fault recovery based on large and small model collaboration
CN120012936B