CN115269806A - Question-answering method, electronic device and storage medium applied to mineral domain knowledge graph - Google Patents
Question-answering method, electronic device and storage medium applied to mineral domain knowledge graph Download PDFInfo
- Publication number
- CN115269806A CN115269806A CN202210943240.XA CN202210943240A CN115269806A CN 115269806 A CN115269806 A CN 115269806A CN 202210943240 A CN202210943240 A CN 202210943240A CN 115269806 A CN115269806 A CN 115269806A
- Authority
- CN
- China
- Prior art keywords
- question
- knowledge graph
- mineral
- intention
- entity
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/289—Phrasal analysis, e.g. finite state techniques or chunking
- G06F40/295—Named entity recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
- G06F40/35—Discourse or dialogue representation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Physics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Databases & Information Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- Human Computer Interaction (AREA)
- Animal Behavior & Ethology (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Evolutionary Computation (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a question-answering method applied to a knowledge graph in the field of minerals, which comprises the following steps: defining question intention categories according to the existing mineral knowledge graph, introducing related question words, constructing a question set, training a question intention identification and entity/attribute extraction model, performing intention identification and entity/attribute extraction on the questions input by a user by using the trained model, generating a knowledge graph query statement, inputting the query statement into the knowledge graph, and obtaining corresponding question answers. According to the mineral knowledge map question-answering method, the electronic device and the storage medium, the model based on the Bert is trained by constructing the question intention template and the question set, the number of the questions is increased in the question set construction process through the modes of synonymy conversion, sentence pattern reconstruction, chinese-English inter-translation conversion and the like, the capability of answering various natural language questions is improved, and the accurate answer of the natural language input questions is realized. The question-answering method can be applied to intelligent query of the mineral domain knowledge graph.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to a question and answer method, an electronic device and a storage medium applied to a knowledge graph in the field of minerals.
Background
The acquisition of mineral knowledge is very important for mineral and related geological research, and the existing mineral knowledge acquisition methods are mainly divided into two types: one is to input relevant keywords in a special mineral database to acquire mineral knowledge; one is to perform related mineral knowledge queries on general search engines such as Baidu, google. The method for acquiring knowledge on a special mineral database cannot process the question input in the natural language form, and although the general search engine can process the question input in the natural language form, the returned result is not professional enough, and further manual screening is required by a user, so that the efficiency is low.
Disclosure of Invention
In view of the above, it is necessary to construct a mineral knowledge question-answering system capable of answering questions input by a user in a natural language on a knowledge graph which is used for organizing and storing mineral knowledge recently, so as to answer the mineral knowledge questions of the user professionally, accurately and efficiently.
The invention provides a question-answering method applied to a mineral domain knowledge graph, which is applied to an electronic device and comprises the following steps:
defining question intention categories according to the existing mineral knowledge graph and introducing related questioning words;
constructing a question set, and training a question intention identification and entity/attribute extraction model;
performing intention identification and entity/attribute extraction on a question input by a user by using the trained model, and generating a knowledge graph query sentence;
and inputting query sentences into the knowledge graph to obtain corresponding question answers.
Preferably, the step of defining question intention categories and introducing related interrogatories according to the existing mineral knowledge graph specifically comprises the following steps:
according to the existing mineral knowledge map, 12 types of question and intention templates such as 'English names', 'physical characteristics', 'chemical characteristics', 'mineral classification', 'crystal system', 'crystal class', 'place of production', 'generation', 'main use', 'reserves', 'co/concomitant' and 'technical means' are defined, and question words such as 'what', 'where', 'when', 'how much' and 'how' are introduced.
Preferably, "constructing a question set, training a question intention recognition and entity/attribute extraction model" specifically includes:
and randomly extracting entities, relations/attributes from the existing mineral knowledge graph, combining the entities, relations/attributes with the introduced related question words, and constructing a question according to the constructed question intention template. In order to make the question-answering system process more diversified question sentences, the generated question sentences are processed by means of synonymy transformation, sentence pattern reconstruction, chinese-English translation transformation and the like, so that the number of the question sentences is increased, and the generalization capability of the model is improved. And after the intention and entity/attribute labeling is carried out on the generated question, a question set is generated and divided into training data, verification data and test data according to the proportion of 7.5.
In order to answer input questions of a user as soon as possible, intention recognition and entity/attribute extraction are carried out only by using a Bert-based deep learning model, other network layers such as BilSTM are not added, the model is trained by using training data in a generated question set, verification is carried out by using verification data, and the model finally used for intention recognition and entity/attribute extraction is obtained.
Preferably, the "performing intent recognition and entity/attribute extraction on a question input by a user by using a trained model, and generating a knowledge-graph query sentence" specifically includes:
applying the trained query sentence intention identification and entity/attribute extraction model based on the Bert to the query questions input by the user to obtain the user question intention types and the related entities/attributes, and generating the knowledge graph query sentences according to the constructed query sentence intention template.
Preferably, "inputting a query sentence to the knowledge graph and obtaining a corresponding answer to the query sentence" specifically includes:
and inputting the generated knowledge graph query sentence into a knowledge graph for query to obtain a final answer.
A second aspect of the present invention provides an electronic apparatus, comprising:
a processor; and the memory is stored with a plurality of program modules, and the program modules are loaded by the processor and execute the question-answering method applied to the mineral domain knowledge graph.
A third aspect of the invention provides a storage medium having stored thereon at least one computer instruction which is loaded by a processor and which performs the above described method of question answering applied to a knowledge graph in the field of minerals.
The question-answering method, the electronic device and the storage medium applied to the mineral domain knowledge graph realize a method for inquiring through natural language aiming at the mineral domain knowledge graph, and the returned answer is professional, accurate and efficient, so that a foundation is laid for subsequent related mineral and geological researches.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flow chart of a question-answering method applied to a mineral domain knowledge graph according to a preferred embodiment of the present invention
FIG. 2 is a diagram of the existing mineral knowledge-graph entities and quantities provided by the preferred embodiment of the present invention
FIG. 3 is a diagram of the relationship/attributes and quantities of the existing mineral knowledge-maps provided by the preferred embodiment of the present invention
FIG. 4 is a prior art mineral knowledge map (section) provided by a preferred embodiment of the present invention
FIG. 5 is a diagram of a question and sentence intent template according to a preferred embodiment of the present invention
FIG. 6 is a diagram of a question-and-sentence intent recognition and entity/attribute extraction model according to an embodiment of the present invention
FIG. 7 is a mineral question answering system interface according to a preferred embodiment of the present invention
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a question-answering method applied to a mineral domain knowledge graph, including the following steps:
s1, preparing data. And defining question intention categories and introducing related questions according to the existing mineral knowledge graph.
There are already mineral knowledge maps stored in the Neo4j database, containing 22568 entities in 8 classes as shown in fig. 2, and 91699 relations/attributes in 9 classes as shown in fig. 3, and some knowledge maps are shown in fig. 4. According to the existing mineral knowledge map, 12 question and intention categories such as "english names", "physical characteristics", "chemical characteristics", "mineral classifications", "crystal systems", "crystal types", "production places", "formation times", "main uses", "reserves", "co-production", "technical means", and the like are defined, and question words such as "what", "where", "when", "how much", and "how" are introduced.
And S2, constructing a question set, and training a question intention identification and entity/attribute extraction model.
And randomly extracting entities, relations/attributes from the existing mineral knowledge graph, combining the entities, relations/attributes with the introduced related question words, and constructing a question according to the template shown in fig. 5. In order to enable the question answering system to process more diverse question sentences, the generated question sentences are processed in the modes of synonymy transformation, sentence pattern reconstruction, chinese-English inter-translation transformation and the like, so that the number of the question sentences is increased, and the model generalization capability is improved. And (3) after intention and entity/attribute labeling is carried out on the generated question, 16000 question sets are formed through symbiosis, wherein 12000 question sets are used as training data, 2000 question sets are used as verification data, and 2000 question sets are used as test data.
In order to answer the input questions of the user as soon as possible, intention recognition and entity/attribute extraction are performed only by using the Bert model shown in fig. 6, other network layers such as BilSTM are not added, the model is trained by 12000 question sentences and verified by 2000 question sentences, and the model finally used for intention recognition and entity/attribute extraction is obtained.
And S3, performing intention identification and entity/attribute extraction on the question input by the user by using the trained model, and generating a knowledge graph query sentence.
Applying the trained query sentence intention recognition and entity/attribute extraction model based on Bert to the query questions input by the user to obtain the user question intention categories and the related entities/attributes, and generating the knowledge graph query sentences according to the question template shown in FIG. 5. For example, for the user question "what color is quartz", the intention identified by the model is "physical property", the extracted entity is "quartz", and the extracted attribute is "color", the corresponding Cyper query statement "MATCH (n: minor) where n.name = 'quartz' RETURN n.color" is obtained according to the question template shown in fig. 5.
And S4, inputting query sentences into the knowledge graph to obtain corresponding question answers.
And inquiring in a Neo4j database stored in a knowledge graph according to the Cypher inquiry statement obtained in the S3 to obtain a final answer. As an example of the question in S3, "what color quartz is", the answer is obtained as "often colorless, milky white, often multiple colors due to the presence of different inclusions or mechanical inclusions", as shown in fig. 7. The answer correctness rate of the test of 2000 test questions was 91.2%.
Those of ordinary skill in the art would appreciate that the modules, elements, and/or method steps of the various embodiments described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (8)
1. A question-answering method applied to a mineral domain knowledge graph is applied to an electronic device, and is characterized by comprising the following steps:
defining question intention categories according to the existing mineral knowledge graph and introducing related questioning words;
constructing a question set, and training a question intention identification and entity/attribute extraction model;
performing intention recognition and entity/attribute extraction on a question input by a user by using a trained model, and generating a knowledge graph query sentence;
and inputting query sentences into the knowledge graph to obtain corresponding question answers.
2. The question-answering method applied to the mineral domain knowledge graph as claimed in claim 1, wherein the step of defining question intention categories and introducing related questioning words according to the existing mineral knowledge graph specifically comprises:
according to the existing mineral knowledge map, 12 types of question and intention templates such as 'English name', 'physical characteristic', 'chemical characteristic', 'mineral classification', 'crystal system', 'crystal class', 'place of production', 'age of formation', 'main use', 'reserve', 'co/concomitant' and 'technical means' are defined, and question words such as 'what', 'where', 'when', 'how much' and 'how' are introduced.
3. The question-answering method applied to the mineral domain knowledge graph according to claim 1, wherein the steps of constructing a question set, training a question intention recognition and entity/attribute extraction model specifically comprise:
and randomly extracting entities, relations/attributes from the existing mineral knowledge graph, combining the entities, relations/attributes with the introduced related question words, and constructing the question according to the constructed question intention template. In order to enable the question answering system to process more diverse question sentences, the generated question sentences are processed in the modes of synonymy transformation, sentence pattern reconstruction, chinese-English inter-translation transformation and the like, so that the number of the question sentences is increased, and the processing capacity of the more abundant and diverse natural language question sentences is improved. And after the generated question is labeled with intentions and entities/attributes, generating a question set, and dividing the question set into training data, verification data and test data according to the proportion of 7.5.
In order to answer input questions of a user as soon as possible, intention recognition and entity/attribute extraction are carried out only by using a Bert-based deep learning model, other network layers such as BilSTM are not added, the model is trained by using training data in a generated question set, verification is carried out by using verification data, and the model finally used for intention recognition and entity/attribute extraction is obtained.
4. The method for question answering applied to the mineral domain knowledge graph according to claim 1, wherein the step of performing intention recognition and entity/attribute extraction on a question input by a user by using a trained model and generating a knowledge graph query sentence specifically comprises the following steps:
applying the trained question and sentence intent recognition and entity/attribute extraction model based on Bert to the query questions input by the user to obtain the user question intent categories and related entities/attributes, and generating the knowledge graph query sentences according to the constructed question and sentence intent templates.
5. The question-answering method applied to the mineral domain knowledge graph according to claim 1, wherein the step of inputting query sentences to the knowledge graph and obtaining corresponding question answers specifically comprises:
and inputting the obtained knowledge graph query sentence into the mineral knowledge graph for query to obtain a final answer.
6. The question-answering method applied to the mineral domain knowledge graph as claimed in claim 1, wherein: the question-answering method applied to the knowledge graph in the mineral field is used for intelligently inquiring the knowledge graph in the mineral field and accurately and quickly obtaining professional answers by inputting natural language question sentences.
7. An electronic device, comprising:
a processor; and a memory in which a plurality of program modules are stored, the program modules being loaded by the processor and executing the method of question answering as claimed in any one of claims 1 to 5, as applied to a mineral domain knowledge graph.
8. A storage medium having stored thereon at least one computer instruction, wherein the instruction is loaded by a processor to perform the method of any one of claims 1 to 5 for application to a mineral domain knowledge graph.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210943240.XA CN115269806A (en) | 2022-08-08 | 2022-08-08 | Question-answering method, electronic device and storage medium applied to mineral domain knowledge graph |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210943240.XA CN115269806A (en) | 2022-08-08 | 2022-08-08 | Question-answering method, electronic device and storage medium applied to mineral domain knowledge graph |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115269806A true CN115269806A (en) | 2022-11-01 |
Family
ID=83748826
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210943240.XA Pending CN115269806A (en) | 2022-08-08 | 2022-08-08 | Question-answering method, electronic device and storage medium applied to mineral domain knowledge graph |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115269806A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117909487A (en) * | 2024-03-20 | 2024-04-19 | 北方健康医疗大数据科技有限公司 | Medical question-answering service method, system, device and medium for old people |
-
2022
- 2022-08-08 CN CN202210943240.XA patent/CN115269806A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117909487A (en) * | 2024-03-20 | 2024-04-19 | 北方健康医疗大数据科技有限公司 | Medical question-answering service method, system, device and medium for old people |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Hjorland | Fundamentals of knowledge organization | |
CN102262634B (en) | Automatic questioning and answering method and system | |
CN111488467B (en) | Construction method and device of geographical knowledge graph, storage medium and computer equipment | |
CN109416826A (en) | The system and method for search and matching content on social networks relevant to individual | |
CN110413783B (en) | Attention mechanism-based judicial text classification method and system | |
CN109325040B (en) | FAQ question-answer library generalization method, device and equipment | |
CN110188147B (en) | Knowledge graph-based document entity relationship discovery method and system | |
CN112667799B (en) | Medical question-answering system construction method based on language model and entity matching | |
CN109308321A (en) | A kind of knowledge question answering method, knowledge Q-A system and computer readable storage medium | |
CN116561274A (en) | Knowledge question-answering method based on digital human technology and natural language big model | |
CN113590737B (en) | Event data processing method, device, equipment and medium based on knowledge graph | |
CN115269806A (en) | Question-answering method, electronic device and storage medium applied to mineral domain knowledge graph | |
CN113190692B (en) | Self-adaptive retrieval method, system and device for knowledge graph | |
Perez-Beltrachini et al. | Semantic parsing for conversational question answering over knowledge graphs | |
CN110413882A (en) | Information-pushing method, device and equipment | |
CN114490984A (en) | Question-answer knowledge extraction method, device, equipment and medium based on keyword guidance | |
CN113590844A (en) | Knowledge graph-based question-answer library generation method and device, electronic equipment and storage medium | |
CN114647719A (en) | Question-answering method and device based on knowledge graph | |
CN115455169A (en) | Knowledge graph question-answering method and system based on vocabulary knowledge and semantic dependence | |
CN114238595A (en) | Metallurgical knowledge question-answering method and system based on knowledge graph | |
KR101662399B1 (en) | Apparatus and method for question-answering using user interest information based on keyword input | |
CN111831880A (en) | Intelligent question and answer method based on micro hotel platform | |
CN109815313A (en) | Personalization technology survey data processing method, device, equipment and storage medium | |
Huang et al. | Professional competence management for university students based on knowledge graph technology | |
CN117131181B (en) | Construction method of heterogeneous knowledge question-answer model, information extraction method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |