A method and device for extracting entity relations based on pre-trained language model
By obtaining candidate templates from the knowledge text library to be extracted and processing iteratively, the pre-trained language model and Prompt Tuning method are used to perform entity knowledge mining, which solves the problem of low efficiency of manual annotation of Prompt templates in the existing technology and achieves efficient knowledge mining. Effect.
Patent Information
- Application Number
- CN202210161990.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-22
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-02-22
AI Technical Summary
Existing knowledge mining solutions based on pre-trained language models require manual annotation of prompt templates, resulting in low efficiency, and the effect is limited by the quality of manual annotation.
By obtaining candidate templates from the knowledge text library to be extracted based on seed knowledge, sorting and filtering are performed to determine the Prompt template, and the pre-trained language model and Prompt Tuning methods are used to perform entity knowledge mining, and iteratively generate new candidate templates to reduce labeling costs. Improve knowledge mining efficiency.
It effectively reduces the labeling cost of prompt templates, improves the efficiency of knowledge mining, reduces the dependence on manual labeling, and realizes the automated knowledge mining process.
Smart Images

Figure CN114661913B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data analysis technology, and more particularly to a method and device for extracting entity relationships based on a pre-trained language model. In addition, the present invention also relates to an electronic device and a processor-readable storage medium. Background Art
[0002] In recent years, with the increasing application of pre-trained language models (PLM) in various fields of natural language processing (NLP), natural language processing has also made great progress. However, with the increase in the number of parameters of pre-trained models, the hardware requirements for fine-tuning and the cost of data annotation are getting higher and higher, and the problem of long cycle is gradually becoming prominent. Therefore, technicians in this field are in urgent need of a more effective prompt-tuning solution to improve the efficiency of knowledge mining based on pre-trained language models. However, the prompt templates used in existing knowledge mining solutions based on pre-trained language models usually require manual annotation, which is time-consuming and labor-intensive, and causes the effect of knowledge mining to be subject to the quality of the manual prompt template. Therefore, how to provide an efficient knowledge mining solution based on large-scale pre-trained language models and automatic prompt template mining has become a problem that needs to be solved urgently. Summary of the invention
[0003] To this end, the present invention provides an entity relationship extraction method and device based on a pre-trained language model to solve the defect in the prior art that prompt template annotation in the knowledge mining solution requires manual participation, resulting in poor knowledge mining efficiency.
[0004] In a first aspect, the present invention provides a method for extracting entity relations based on a pre-trained language model, comprising:
[0005] Based on the seed knowledge, corresponding candidate templates are obtained from the knowledge text library to be extracted; the candidate templates are sorted and screened to determine the Prompt template;
[0006] Perform entity knowledge mining on the original input information based on the prompt text generated by the Prompt template, the pre-trained language model, and the Prompt Tuning method to obtain corresponding entity knowledge;
[0007] The entity knowledge is used as new seed knowledge, and mining is performed using the new seed knowledge to generate new candidate templates. A cyclic iterative process is performed based on the new candidate templates to obtain a knowledge mining result output during the cyclic iterative process.
[0008] Furthermore, the use of the new seed knowledge to perform mining to generate new candidate templates, and performing cyclic iterative processing based on the new candidate templates to obtain knowledge mining results output during the cyclic iterative processing specifically includes:
[0009] Based on the Prompt-Snowball method, new candidate templates corresponding to the new seed knowledge are cyclically mined, and the new candidate templates are sorted and screened again to determine a new Prompt template; based on the prompt text generated by the new Prompt template, the pre-trained language model and the Prompt Tuning method are used to perform entity knowledge mining on the original input information to obtain the knowledge mining results output in the cyclic iterative processing process.
[0010] Furthermore, the step of sorting and screening the candidate templates to determine the Prompt template specifically includes:
[0011] The candidate templates are sorted and screened according to the text matching frequency of the candidate templates or the byte length of the candidate templates to determine the Prompt template.
[0012] Furthermore, the entity relationship extraction method based on the pre-trained language model also includes: generating prompt text based on the Prompt template; generating prompt text based on the Prompt template specifically includes: analyzing the text in the knowledge text library to be extracted according to the Prompt template to extract the entity name corresponding to the Prompt template, and obtaining the corresponding prompt text based on the entity name and the Prompt template.
[0013] Furthermore, the Prompt-Snowball is a cyclic iterative processing strategy for mining knowledge texts based on the Snowball relation extraction algorithm.
[0014] In a second aspect, the present invention further provides an entity relationship extraction device based on a pre-trained language model, comprising:
[0015] A template determination unit is used to obtain corresponding candidate templates from the knowledge text library to be extracted based on seed knowledge; sort and screen the candidate templates to determine the Prompt template;
[0016] A knowledge mining unit, configured to perform entity knowledge mining on the original input information based on the prompt text generated by the Prompt template, the pre-trained language model, and the Prompt Tuning method, to obtain corresponding entity knowledge;
[0017] The loop iterative processing unit is used to take the entity knowledge as new seed knowledge, use the new seed knowledge to mine to generate new candidate templates, and perform loop iterative processing based on the new candidate templates to obtain the knowledge mining results output during the loop iterative processing.
[0018] Furthermore, the loop iterative processing unit is specifically used to: cyclically mine new candidate templates corresponding to the new seed knowledge based on the Prompt-Snowball method, and re-sort and screen the new candidate templates to determine a new Prompt template; generate prompt text based on the new Prompt template, and use the pre-trained language model and Prompt Tuning method to perform entity knowledge mining on the original input information to obtain the knowledge mining results output during the loop iterative processing.
[0019] Furthermore, the template determination unit is specifically used to sort and screen the candidate templates according to the text matching frequency of the candidate templates or the byte length of the candidate templates to determine the Prompt template.
[0020] Furthermore, the entity relationship extraction device based on the pre-trained language model also includes: a prompt text generation unit; the prompt text generation unit is specifically used to: analyze the text in the knowledge text library to be extracted according to the Prompt template to extract the entity name corresponding to the Prompt template, and obtain the corresponding prompt text based on the entity name and the Prompt template.
[0021] Furthermore, the Prompt-Snowball is a cyclic iterative processing strategy for mining knowledge texts based on the Snowball relation extraction algorithm.
[0022] In a third aspect, the present invention also 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 computer program, the steps of the entity relationship extraction method based on a pre-trained language model as described in any one of the above are implemented.
[0023] In a fourth aspect, the present invention further provides a processor-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the entity relationship extraction method based on a pre-trained language model as described in any one of the above are implemented.
[0024] The entity relationship extraction method based on the pre-trained language model provided by the present invention obtains corresponding candidate templates from a knowledge text library to be extracted based on seed knowledge, and sorts and screens the candidate templates to determine the corresponding Prompt template; then, entity knowledge mining is performed on the original input information based on the prompt text generated by the Prompt template, the preset training language model and the PromptTuning method to obtain corresponding entity knowledge; the entity knowledge is used as new seed knowledge, and the new seed knowledge is mined to generate new candidate templates for cyclic iterative processing, and the knowledge mining results output during the cyclic iterative processing are obtained, which can reduce the annotation cost of the Prompt template, thereby effectively improving the efficiency of knowledge mining. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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.
[0026] Figure 1 It is a flowchart of an entity relationship extraction method based on a pre-trained language model provided by an embodiment of the present invention;
[0027] Figure 2 is an application schematic diagram of an entity relationship extraction method based on a pre-trained language model provided in an embodiment of the present invention;
[0028] Figure 3 It is a complete flow chart of the entity relationship extraction method based on the pre-trained language model provided by an embodiment of the present invention;
[0029] Figure 4 It is a structural schematic diagram of an entity relationship extraction device based on a pre-trained language model provided by an embodiment of the present invention;
[0030] Figure 5 It is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments 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.
[0032] The following is a detailed description of an embodiment of the entity relationship extraction method based on a pre-trained language model according to the present invention. Figure 1 As shown, it is a flow chart of the entity relationship extraction method based on the pre-trained language model provided by an embodiment of the present invention, and the specific implementation process includes the following steps:
[0033] Step 101: Acquire corresponding candidate templates from the knowledge text library to be extracted based on seed knowledge; sort and screen the candidate templates to determine the Prompt template.
[0034] In an embodiment of the present invention, it is necessary to predetermine the knowledge text library to be extracted, and use a small number of examples as initial seed knowledge, determine the corresponding candidate template from the knowledge text library based on the seed knowledge, and sort and screen the candidate templates in a preset manner to determine the target candidate template as the corresponding Prompt template. Among them, the candidate templates are sorted and screened in a preset manner to determine the corresponding Prompt template, and the corresponding specific implementation process includes: sorting and screening the candidate templates by comparing the text matching frequency of the candidate templates or the byte length of the candidate templates and other features, so as to determine the candidate templates whose features such as text matching frequency and byte length meet the preset conditions as Prompt templates. For example, the preset condition can be the condition that the text matching frequency reaches or exceeds the preset frequency threshold or the byte length of the candidate template is lower than the preset length threshold, which is also not specifically limited here. In addition, the method can also be implemented by other existing sorting and screening technologies, which is also not specifically limited here.
[0035] Step 102: Based on the prompt text generated by the Prompt template, the preset training language model and the PromptTuning method, entity knowledge mining is performed on the original input information to obtain corresponding entity knowledge.
[0036] In an embodiment of the present invention, it also includes: pre-generating entity knowledge prompt text based on the Prompt template. Specifically, the text in the knowledge text library to be extracted is analyzed according to the Prompt template to extract the entity name corresponding to the Prompt template, and the corresponding entity knowledge prompt text is obtained based on the entity name and the Prompt template. The pre-trained language model can adopt a mature pre-trained language model in the prior art; the Prompt Tuning method refers to the technology of adding additional entity knowledge prompt text to the original input information to better utilize the pre-trained model, which will not be described in detail here.
[0037] like Figure 2As shown in the figure, taking the medical knowledge text as an example, "In the decades, since Aβand tua were identified, development of therapies for AD has primarily focused on Aβ." is the original input information. gene ) and Alzheimer's disease (AD) caused by tau gene disease ) This disease serves as seed knowledge. gene , A.D. disea 》contains the corresponding entity name. Entity relationships such as “…can treat…(…can be used to treat…)” and “…is the taget of…(…is the target of…)” are candidate templates. The required Prompt template is determined by sorting and screening the candidate templates, for example, the Prompt template is determined to be “…is the taget of…”. The corresponding entity knowledge prompt text is determined based on the Prompt template and the entity name. For example, the determined entity knowledge prompt text may be “tua is the taget of AD(tua is the target of AD)”. Among them, tua is the tau gene, and AD is Alzheimer's disease.
[0038] In the specific implementation process, the text in the knowledge text library to be extracted is mined based on the Prompt template determined in the candidate template, that is, the semantic relationship between the original input information and the prompt text generated based on the prompt template is calculated by text implication reasoning to mine and extract the entity knowledge prompt text corresponding to the Prompt template. The information containing the prompt text is input into the pre-trained language model, and the knowledge mining is performed using the Prompt Tuning method to obtain the corresponding entity knowledge. In a feasible embodiment, the prompt text containing the mask (MASK) generated based on the Prompt template can be combined with the initial information to obtain the information containing the prompt text; the information is input into the pre-trained language model for knowledge mining, thereby extracting the corresponding entity knowledge.
[0039] Step 103: Take the entity knowledge as new seed knowledge, use the new seed knowledge to perform mining to generate new candidate templates, and perform cyclic iterative processing based on the new candidate templates to obtain knowledge mining results output during the cyclic iterative processing.
[0040] In the embodiment of the present invention, the entity knowledge is used as new seed knowledge in step 103, and the processing of the above steps 101-102 is continuously looped. The new seed knowledge is used for mining to generate new candidate templates, and the new candidate templates are subjected to loop iterative processing to obtain the knowledge mining results outputted in the loop iterative processing. The corresponding implementation process is as follows: Figure 3 As shown, it specifically includes: taking new seed knowledge as a starting point, using the Promt-Snowball method to mine using the new seed knowledge to generate new candidate templates, determining new Prompt templates by re-sorting and screening the new candidate templates, and based on the prompt text generated by the new Prompt template, using the pre-trained language model and the Prompt Tuning method to perform entity knowledge mining on the original input information, and being able to obtain the knowledge mining results output in the cyclic iterative processing process. Among them, Promt-Snowball is a cyclic iterative processing strategy for mining knowledge texts determined based on the Snowball relation extraction algorithm. The Prompt-Snowball method can be used to perform cyclic iterative mining to continuously obtain new prompt templates without manual labeling.
[0041] In an embodiment of the present invention, the pre-trained language model can be implemented using an existing knowledge mining architecture, for example, the pre-trained language model can be LM (GPT2, GPT3), Mask LM (BERT), etc. The Prompt Tuning method can freeze the pre-trained language model and only fine-tune the continuous prompt template part (i.e., prompt text), which greatly reduces the storage and memory usage of each task during training. The knowledge mining results may include entity knowledge generated by cyclic iterative knowledge mining processing of texts in the knowledge text library to be extracted and the Prompt template corresponding to the entity knowledge determined in the cyclic iterative process, etc., which are not specifically limited here.
[0042] The entity relationship extraction method based on the pre-trained language model described in the embodiment of the present invention is adopted. The corresponding candidate templates are obtained from the knowledge text library to be extracted based on the seed knowledge, and the candidate templates are sorted and screened to determine the corresponding Prompt template; then, entity knowledge mining is performed on the original input information based on the prompt text generated by the Prompt template, the preset training language model and the Prompt Tuning method to obtain the corresponding entity knowledge; the entity knowledge is used as new seed knowledge, and the new seed knowledge is mined to generate new candidate templates for cyclic iterative processing to obtain the knowledge mining results output during the cyclic iterative processing, which can reduce the annotation cost of the Prompt template, thereby effectively improving the efficiency of knowledge mining.
[0043] Corresponding to the above-mentioned method for extracting entity relations based on a pre-trained language model, the present invention also provides an entity relation extraction device based on a pre-trained language model. Since the embodiment of the device is similar to the above-mentioned method embodiment, the description is relatively simple. For relevant parts, please refer to the description of the above-mentioned method embodiment. The embodiment of the entity relation extraction device based on a pre-trained language model described below is only illustrative. Please refer to Figure 4 As shown, it is a structural diagram of an entity relationship extraction device based on a pre-trained language model provided by an embodiment of the present invention.
[0044] The entity relationship extraction device based on the pre-trained language model described in the present invention specifically includes the following parts:
[0045] The template determination unit 401 is used to obtain corresponding candidate templates from the knowledge text library to be extracted based on the seed knowledge; sort and screen the candidate templates to determine the Prompt template;
[0046] A knowledge mining unit 402 is used to perform entity knowledge mining on the input information obtained based on the prompt template according to the pre-trained language model and prompt tuning to obtain corresponding entity knowledge;
[0047] The loop iterative processing unit 403 is used to use the entity knowledge as new seed knowledge, mine the new seed knowledge to generate new candidate templates for loop iterative processing, and obtain the knowledge mining results output during the loop iterative processing. The knowledge mining results include: entity knowledge generated by loop iterative knowledge mining processing on the text and Prompt templates determined based on the entity knowledge.
[0048] Furthermore, the loop iterative processing unit is specifically used to: loop-mine new candidate templates corresponding to the new seed knowledge based on the Prompt-Snowball method, and re-sort and screen the new candidate templates to determine a new Prompt template; generate prompt text based on the new Prompt template, and use the pre-trained language model and Prompt Tuning method to perform entity knowledge mining on the original input information to obtain the knowledge mining results output during the loop iterative processing. The Prompt-Snowball is a loop iterative processing strategy for mining knowledge texts determined based on the Snowball relation extraction algorithm.
[0049] Furthermore, the template determination unit is specifically used to sort and screen the candidate templates according to features such as text matching frequency of the candidate templates or byte length of the candidate templates, and determine a Prompt template that meets preset conditions.
[0050] Furthermore, the entity relationship extraction device based on the pre-trained language model also includes: a prompt text generation unit; the prompt text generation unit is specifically used to: analyze the text in the knowledge text library to be extracted according to the Prompt template to extract the entity name corresponding to the Prompt template, and obtain the corresponding prompt text based on the entity name and the Prompt template.
[0051] The entity relationship extraction device based on the pre-trained language model described in the embodiment of the present invention is adopted. The corresponding candidate templates are obtained from the knowledge text library to be extracted based on the seed knowledge, and the candidate templates are sorted and screened to determine the corresponding Prompt template; then, entity knowledge mining is performed on the original input information based on the prompt text generated by the Prompt template, the preset training language model and the Prompt Tuning method to obtain the corresponding entity knowledge; the entity knowledge is used as new seed knowledge, and the new seed knowledge is mined to generate new candidate templates for loop iterative processing, and the knowledge mining results output during the loop iterative processing are obtained, which can reduce the annotation cost of the Prompt template, thereby effectively improving the efficiency of knowledge mining.
[0052] Corresponding to the entity relationship extraction method based on the pre-trained language model provided above, the present invention also provides an electronic device. Since the embodiment of the electronic device is similar to the above method embodiment, the description is relatively simple. For the relevant parts, please refer to the description of the above method embodiment. The electronic device described below is only illustrative. Figure 5 As shown, it is a schematic diagram of the entity structure of an electronic device disclosed in an embodiment of the present invention. The electronic device may include: a processor 501, a memory 502 and a communication bus 503, wherein the processor 501 and the memory 502 communicate with each other through the communication bus 503 and communicate with the outside through the communication interface 504. The processor 501 can call the logic instructions in the memory 502 to execute the entity relationship extraction method based on the pre-trained language model, the method comprising: obtaining corresponding candidate templates from the knowledge text library to be extracted based on seed knowledge; sorting and screening the candidate templates to determine the Prompt template; performing entity knowledge mining on the original input information based on the prompt text generated by the Prompt template, the pre-trained language model and the PromptTuning method to obtain corresponding entity knowledge; using the entity knowledge as new seed knowledge, using the new seed knowledge to mine to generate new candidate templates, and performing cyclic iterative processing based on the new candidate templates to obtain the knowledge mining results output during the cyclic iterative processing.
[0053] In addition, the logic instructions in the above-mentioned memory 502 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as storage chips, USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks or optical disks.
[0054] On the other hand, an embodiment of the present invention further provides a computer program product, the computer program product includes a computer program stored on a processor-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the entity relationship extraction method based on the pre-trained language model provided by the above-mentioned method embodiments. The method includes: obtaining corresponding candidate templates from the knowledge text library to be extracted based on seed knowledge; sorting and screening the candidate templates to determine the Prompt template; performing entity knowledge mining on the original input information based on the prompt text generated by the Prompt template, the pre-trained language model and the Prompt Tuning method to obtain corresponding entity knowledge; using the entity knowledge as new seed knowledge, using the new seed knowledge to mine to generate new candidate templates, and performing cyclic iterative processing based on the new candidate templates to obtain the knowledge mining results output during the cyclic iterative processing.
[0055] On the other hand, an embodiment of the present invention further provides a processor-readable storage medium, on which a computer program is stored, and when the computer program is executed by the processor, it is implemented to execute the entity relationship extraction method based on the pre-trained language model provided in the above embodiments. The method includes: obtaining corresponding candidate templates from the knowledge text library to be extracted based on seed knowledge; sorting and screening the candidate templates to determine the Prompt template; performing entity knowledge mining on the original input information based on the prompt text generated by the Prompt template, the pre-trained language model and the Prompt Tuning method to obtain corresponding entity knowledge; using the entity knowledge as new seed knowledge, using the new seed knowledge to mine to generate new candidate templates, and performing cyclic iterative processing based on the new candidate templates to obtain the knowledge mining results output during the cyclic iterative processing.
[0056] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0057] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0058] 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, it 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.
[0059] 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 extracting entity relations based on a pre-trained language model, characterized in that: include: Based on the seed knowledge, corresponding candidate templates are obtained from the knowledge text library to be extracted; Sorting and screening the candidate templates to determine a Prompt template; Perform entity knowledge mining on the original input information based on the prompt text generated by the Prompt template, the pre-trained language model, and the Prompt Tuning method to obtain corresponding entity knowledge; The entity knowledge is used as new seed knowledge, and mining is performed using the new seed knowledge to generate new candidate templates. A cyclic iterative process is performed based on the new candidate templates to obtain a knowledge mining result output during the cyclic iterative process.
2. The entity relationship extraction method based on a pre-trained language model according to claim 1, characterized in that: The new seed knowledge is used for mining to generate new candidate templates, and a cyclic iterative process is performed based on the new candidate templates to obtain a knowledge mining result output during the cyclic iterative process, specifically including: Based on the Prompt-Snowball method, new candidate templates corresponding to the new seed knowledge are cyclically mined, and the new candidate templates are sorted and screened again to determine a new Prompt template; based on the prompt text generated by the new Prompt template, the pre-trained language model and the Prompt Tuning method are used to perform entity knowledge mining on the original input information to obtain the knowledge mining results output in the cyclic iterative processing process.
3. The entity relationship extraction method based on a pre-trained language model according to claim 1, characterized in that: The sorting and screening of the candidate templates to determine the Prompt template specifically includes: The candidate templates are sorted and screened according to the text matching frequency of the candidate templates or the byte length of the candidate templates to determine the Prompt template.
4. The entity relationship extraction method based on a pre-trained language model according to claim 1, characterized in that: Also includes: Generate prompt text based on the Prompt template; Generate prompt text based on the Prompt template, specifically including: The text in the knowledge text library to be extracted is analyzed according to the Prompt template to extract the entity name corresponding to the Prompt template, and the corresponding prompt text is obtained based on the entity name and the Prompt template.
5. The entity relationship extraction method based on a pre-trained language model according to claim 2, characterized in that: The Prompt-Snowball is a cyclic iterative processing strategy for mining knowledge texts based on the Snowball relationship extraction algorithm.
6. An entity relationship extraction device based on a pre-trained language model, characterized in that: include: A template determination unit, used for acquiring corresponding candidate templates from a knowledge text library to be extracted based on seed knowledge; Sorting and screening the candidate templates to determine a Prompt template; A knowledge mining unit, configured to perform entity knowledge mining on the original input information based on the prompt text generated by the Prompt template, the pre-trained language model, and the Prompt Tuning method, to obtain corresponding entity knowledge; The loop iterative processing unit is used to take the entity knowledge as new seed knowledge, use the new seed knowledge to mine to generate new candidate templates, and perform loop iterative processing based on the new candidate templates to obtain the knowledge mining results output during the loop iterative processing.
7. The entity relationship extraction device based on a pre-trained language model according to claim 6, characterized in that: The loop iteration processing unit is specifically used to: cyclically mine new candidate templates corresponding to the new seed knowledge based on the Prompt-Snowball method, and re-sort and screen the new candidate templates to determine a new Prompt template; Based on the prompt text generated by the new Prompt template, entity knowledge mining is performed on the original input information using the pre-trained language model and the Prompt Tuning method to obtain the knowledge mining results output in the loop iterative processing process.
8. The entity relationship extraction device based on a pre-trained language model according to claim 6, characterized in that: Also includes: Prompt text generation unit; The prompt text generation unit is specifically used to: analyze the text in the knowledge text library to be extracted according to the Prompt template to extract the entity name corresponding to the Prompt template, and obtain the corresponding prompt text based on the entity name and the Prompt template.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the entity relationship extraction method based on the pre-trained language model as described in any one of claims 1 to 5 are implemented.
10. A processor-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 entity relationship extraction method based on a pre-trained language model as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Data processing method and device, computer equipment and readable storage medium
CN112395425A
Entity matching method and system based on unlabeled corpus
CN113343702A
Few-sample intention recognition method and device
CN113868380A
Language model training method and device, electronic equipment and storage medium
CN114036300A
