| In the era of big data,countless and redundant information has cropped up on the internet.Therefore,extracting key information to gain value from the information has become a top priority.At the same time,knowledge graph and Q&A system,as effective tools to realize data value,has received more and more attention for its task of entity recognition and relation extraction.In recent years,generative pre-training language models,such as GPT-3,provide a new way for information extraction.At present,fine-tuning approach will lead to gaps between the model and downstream task and problems such as the overlapping of entities in information extraction tasks,which leads to the inaccuracy and completeness of extracted information.Meanwhile,there is a lack of a disease and drug solution for the current epidemic.Given the above problems,this paper studies the information extraction task based on prompt learning method,designs and uses information extraction model to participate in the realization of knowledge graph and Q&A system.1.Research on entity relationship joint extraction method based on prompt learning.According to the characteristics of information extraction tasks,triples are extracted.Templates are designed by humans.Prompt templates are composed of identifiers,slots and natural language for linking contexts.Target templates are designed as triples to guide the model to generate expected outputs.Considering that manual templates may have different effect with different length and content,three types of prompt templates are designed by adjusting the position of the relation in the triple.Aiming at the case of entity overlap in the data,two templates are designed for the cases of overlapping and non-overlapping.In order to further enrich the prompt content of the template,the entity relationship information is inserted into the slot of the template according to the data annotation.In order to enhance the prompt effect of the template in the model,corresponding coding layers are designed for the prompt template and the target template.On the other hand,in order to reduce the learning effect of artificial template,this thesis introduces wildcard to replace the natural language text used to link the context in the prompt template,and simplifies the prompt template and the target template.At the same time,a hint template optimization layer is designed to optimize only the parameters of the wildcard,so that the model can find the best template form by training optimization.Experimental results show that the proposed method can effectively closes the gap between pre-trained models and downstream tasks by prompt templates extract,and the template-based method can solve the problem of entity overlap effectively.2.Knowledge map construction based on COVID-19 and drugs.Use the webpage knowledge of the encyclopedia famous doctor website as the data source,and complete the data collection through crawler technology.Secondly,use the information extraction model to extract knowledge from the collected data.Finally,the neo4 j graph database is used to realize the knowledge storage and visualization of knowledge graph.3.Research on the construction of Q&A system based on COVID-19 and drugs..Firstly,the requirements of Q&A system are defined through analysis.The Q&A system is designed as three layers,which are application layer,processing layer and data layer from top to bottom.Secondly,use the Django framework to design the system architecture as MVT mode.Next,design and implement the business logic of the application modules in the system.Finally,displayed and test the designed system. |