Intelligent question and answer method, device and equipment based on knowledge graph, storage medium and program product
By constructing an energy data knowledge graph and performing word segmentation processing and semantic analysis on user queries, the problem of low retrieval accuracy of intelligent question-and-answer system is solved, and a more accurate and comprehensive query results are achieved.
Patent Information
- Application Number
- CN202411699665.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-11-26
AI Technical Summary
The search accuracy of the intelligent question-and-answer system based on knowledge graph is not high.
By obtaining energy knowledge data, conducting text semantic design, obtaining data entities and data relationships, building an energy data knowledge graph, performing word segmentation processing on the query statements entered by users, obtaining the query entity and user intention, querying based on the knowledge graph, and obtaining intelligent question-and-answer results.
Improve the accuracy and interactivity of the query and enhance the comprehensiveness of the query results.
Smart Images

Figure CN119692446A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an intelligent question-answering method, apparatus, device, storage medium, and program product based on a knowledge graph. Background Art
[0002] As a basic industry, the energy industry has an increasing demand for intelligent question-answering systems under the background of rapid development of information technology. The introduction of knowledge graphs can well integrate large-scale data and make more systematic use of these information resources. The energy knowledge intelligent question-answering system based on knowledge graphs can provide users with convenient energy knowledge query and usage services.
[0003] Traditional knowledge graph-based intelligent question-answering systems rely too much on templates and have large errors when matching, resulting in low retrieval accuracy. Summary of the invention
[0004] The main purpose of this application is to provide a knowledge graph-based intelligent question answering method, device, equipment, storage medium and program product, aiming to solve the technical problem of low retrieval accuracy of the knowledge graph-based intelligent question answering system.
[0005] To achieve the above objectives, the present application proposes an intelligent question-answering method based on a knowledge graph, and the intelligent question-answering method based on a knowledge graph includes:
[0006] Acquire energy knowledge data for building knowledge graphs;
[0007] Performing text semantic design based on the energy knowledge data to obtain data entities and data relationships between the data entities;
[0008] Constructing an energy data knowledge graph based on the data entities and the data relationships;
[0009] Perform word segmentation on the energy query sentence input by the user to obtain the query entity and user intention;
[0010] The query entity and user intention are queried based on the energy data knowledge graph to obtain a target intelligent question and answer result.
[0011] In one embodiment, the step of querying the query entity and the user intention based on the energy data knowledge graph to obtain a target intelligent question answering result includes:
[0012] Searching in the energy data knowledge graph based on the query entity to obtain a target entity;
[0013] Searching for a matching template in preset templates based on the user intention;
[0014] Obtaining a target entity relationship based on the matching template;
[0015] Generate a target intelligent question answering result based on the target entity and entity relationship.
[0016] In one embodiment, the method further includes:
[0017] If the matching template cannot be found, the energy query statement is detected based on the entity detection model to obtain an energy knowledge subgraph;
[0018] Knowledge graph embedding is performed based on the energy knowledge subgraph to obtain entity relationships.
[0019] In one embodiment, the step of searching the energy data knowledge graph based on the query entity to obtain the target entity includes:
[0020] Performing entity matching on the query entity in the energy data knowledge graph to obtain a successfully matched target entity, wherein a basis for the successful matching is that the name of the query entity is consistent with that of the target entity;
[0021] Extract partial names of unmatched query entities to obtain sub-entity pairs;
[0022] In the energy data knowledge graph, entity similarity matching is performed on the sub-entity pairs to obtain target entities whose similarity is greater than a preset threshold.
[0023] In one embodiment, the step of performing text semantic design based on the energy knowledge data to obtain data entities and data relationships between the data entities includes:
[0024] Performing semantic analysis on the energy knowledge data to obtain data text features of the energy knowledge data;
[0025] Entity relationships are extracted from the data text features to obtain data entities and data relationships between the data entities.
[0026] In one embodiment, the step of constructing an energy data knowledge graph based on the data entities and the data relationships includes:
[0027] Constructing energy data triples based on the data entities and the data relationships;
[0028] The energy data triples are stored in a preset graph database to obtain an energy knowledge graph.
[0029] In addition, to achieve the above purpose, the present application also proposes an intelligent question-answering device based on a knowledge graph, and the intelligent question-answering device based on a knowledge graph includes:
[0030] In addition, to achieve the above-mentioned purpose, the present application also proposes an intelligent question-answering device based on a knowledge graph, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the intelligent question-answering method based on the knowledge graph as described above.
[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the intelligent question-answering method based on the knowledge graph as described above are implemented.
[0032] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the intelligent question-answering method based on the knowledge graph as described above.
[0033] One or more technical solutions proposed in this application have at least the following technical effects:
[0034] This application obtains energy knowledge data for building a knowledge graph; performs text semantic design based on energy knowledge data to obtain data entities and data relationships between data entities; builds an energy data knowledge graph based on data entities and data relationships; performs word segmentation on energy query statements input by users to obtain query entities and user intentions; queries query entities and user intentions based on the energy data knowledge graph to obtain target intelligent question-answering results. Since the accuracy of the query is improved by performing text semantic design on energy knowledge data, and the interactivity of the query and the comprehensiveness of the query results are improved by building an energy data knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0037] Figure 1 A flowchart diagram of the first embodiment of the intelligent question-answering method based on knowledge graph provided in this application;
[0038] Figure 2This is a schematic diagram of the structure of a time series extraction module in one implementation of the knowledge graph-based intelligent question answering method of this application;
[0039] Figure 3 A schematic diagram of a bidirectional long short-term memory network structure in one implementation of the knowledge graph-based intelligent question answering method of this application;
[0040] Figure 4 A flowchart diagram of the second embodiment of the intelligent question-answering method based on knowledge graph of this application;
[0041] Figure 5 This is a schematic diagram of the module structure of an intelligent question-answering device based on a knowledge graph according to an embodiment of the present application;
[0042] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the knowledge graph-based intelligent question-answering method in the embodiment of the present application.
[0043] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0045] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0046] The main solutions of the embodiments of the present application are: obtaining energy knowledge data for constructing a knowledge graph; performing text semantic design based on the energy knowledge data to obtain data entities and data relationships between data entities; constructing an energy data knowledge graph based on data entities and data relationships; performing word segmentation processing on energy query statements input by users to obtain query entities and user intentions; querying query entities and user intentions based on the energy data knowledge graph to obtain target intelligent question and answer results.
[0047] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a computer, server, etc., or an electronic device, virtual device, etc. that can realize the above functions. The following takes an intelligent question-and-answer device based on a knowledge graph (hereinafter referred to as a question-and-answer device) as an example to illustrate this embodiment and the following embodiments.
[0048] Based on this, the present application embodiment provides an intelligent question answering method based on knowledge graph, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the intelligent question-answering method based on knowledge graph in this application.
[0049] In this embodiment, the intelligent question answering method based on knowledge graph includes steps S10 to S50:
[0050] Step S10, obtaining energy knowledge data for constructing a knowledge graph.
[0051] It can be understood that a knowledge graph is a semantic network used to describe the relationship between entities. It can be a semi-structured data representation method used to describe entities, attributes, and the relationship between entities. Energy knowledge data can be information that records and describes various aspects of the energy industry, such as energy production, supply, consumption, reserves, prices, emissions, and related policies and technologies. These data can be collected and organized through various channels, such as statistical reports of energy companies, surveys and monitoring by government departments, and data released by international organizations.
[0052] It should be understood that building a knowledge graph based on energy knowledge data can help improve the efficiency of energy resource utilization, optimize energy structure, etc. By identifying entities in energy knowledge data and extracting the relationships between entities, using entities as nodes of the knowledge graph and relationships as edges between nodes, a knowledge graph can be constructed, which can provide strong support for decision-making, research and practice in the energy field.
[0053] In a specific implementation, the question-and-answer device can obtain energy knowledge data for constructing a knowledge graph.
[0054] Step S20: Perform text semantic design based on the energy knowledge data to obtain data entities and data relationships between the data entities.
[0055] It should be noted that text semantic design is a series of designs and methods for semantic analysis and processing of energy knowledge data text in the process of knowledge graph construction. Through text semantic design, the accuracy and completeness of knowledge graph construction can be improved, so that it can better support various intelligent applications, such as semantic search, intelligent recommendation, natural language processing, etc.
[0056] In some implementations of the embodiments of the present application, the step of performing text semantic design based on the energy knowledge data to obtain data entities and data relationships between the data entities includes:
[0057] Perform semantic analysis on the energy knowledge data to obtain data text features of the energy knowledge data; perform entity relationship extraction on the data text features to obtain data entities and data relationships between the data entities.
[0058] In the embodiment of the present application, the characteristics of the energy knowledge data text can be analyzed first, the range of the data set can be selected, and then the collected energy knowledge data text can be preprocessed to obtain an unlabeled energy knowledge data set. After that, the entity relationship design of the knowledge graph and the training data annotation are performed, and at the same time, the entity relationship joint model of the energy knowledge data text is selected to extract related entities and relationships, and finally the extracted entities and relationships are imported into a preset graph database (such as a Neo4j graph database).
[0059] Specifically, energy knowledge data texts can be collected from energy companies, documents, networks and other channels, which may include a large number of terms and vocabulary related to the energy field. At present, common entity recognition is usually for some special nouns such as names, place names, and regional names. The use of traditional machine learning algorithms can achieve good results, but some entities in the energy field are large in number and have diverse forms of expression, such as equipment names, equipment parts, equipment failures, and rectification measures. It is difficult to include them all in the dictionary, and the texts written by Zhuier are usually more colloquial and do not fully comply with the grammatical structure, which makes it difficult to find the central word through syntactic analysis methods and difficult to perform structural division. In this application, a model for knowledge extraction of energy knowledge data entity relationships is trained, that is, an entity relationship joint extraction model.
[0060] It should be noted that since energy is just a knowledge graph of data belonging to a specific field, there may not be publicly labeled data for the time being. Therefore, before training the entity relationship joint extraction model, data labeling can be performed first. The labeling can be based on task requirements and data characteristics, and can be determined based on actual application usage. The embodiments of this application do not limit this.
[0061] It is understandable that entity relationship extraction can refer to extracting relationships and corresponding entities from text that has not been processed in a specific format, thereby forming a complete triple (Subject-Predicate-Object, SPO). Among them, S represents the head entity, P represents the relationship, and P represents the tail entity. The entity relationship joint extraction model of the embodiment of the present application can include three modules, specifically the tail is an encoder module, a timing extraction module, and an entity relationship extraction module.
[0062] It can be understood that the encoder module can encode the input energy knowledge data to obtain input features for input into the time series extraction module.
[0063] In the embodiment of the present application, the time series extraction module may include a bidirectional long short-term memory network and an attention network. The specific module composition can refer to Figure 2As shown. Among them, the bidirectional long short-term memory network is a function that integrates the forward and backward LSTM layers. It uses the known time series and reverse position sequence to deepen the extraction of the original sequence time series features through forward and backward propagation bidirectional operations, thereby improving the accuracy of the model output results. In the embodiment of the present application, the network structure of the bidirectional long short-term memory network can refer to Figure 3 As shown. Among them, X1-X N Used to represent input features, O1-O N Represents the output features.
[0064] It should be noted that the attention network of the embodiment of the present application can adopt a self-attention mechanism, which can get rid of the distance limitation of words and realize the weight allocation of each word. By fusing the input features and the results processed by the attention network into the second bidirectional long short-term memory network, it can be used to extract local information.
[0065] In the embodiment of the present application, the entity relationship extraction module may include a coding layer, a head entity recognition layer, and a relationship and tail entity recognition layer. The coding layer can be used to obtain the coding sequence of the input text; the head entity recognition layer can directly decode the structure obtained by the coding layer to identify the possible body theft; the relationship and tail entity recognition layer can be used to identify the head entity and the related tail entity under each relationship category. The specific recognition process can be modeled based on machine learning or other methods, and the embodiment of the present application does not limit this.
[0066] In a specific implementation, the question-and-answer device can extract entities and relationships based on energy knowledge data to obtain energy data triples, and can also determine the data relationships between data entities.
[0067] Step S30, constructing an energy data knowledge graph based on the data entities and the data relationships.
[0068] It is understandable that when the data entities and data relationships are obtained, the data entities can be used as nodes of the knowledge graph and the data relationships can be used as edges between the nodes to construct the energy data knowledge graph. Specifically, the step of constructing the energy data knowledge graph based on the data entities and the data relationships includes: constructing energy data triples based on the data entities and the data relationships; and obtaining the energy knowledge graph by storing the energy data triples in a preset graph database.
[0069] Step S40, performing word segmentation processing on the energy query sentence input by the user to obtain the query entity and the user intention;
[0070] Step S50, querying the query entity and user intention based on the energy data knowledge graph to obtain a target intelligent question and answer result.
[0071] It should be noted that when the user needs to make a query, he can input the energy query statement into the question-and-answer device, and the question-and-answer device can perform word segmentation on the input energy query statement to obtain the query entity and user intention; then, based on the established energy data knowledge graph, the query entity and user intention are queried to obtain the target intelligent question-and-answer result.
[0072] It is understandable that word segmentation is a basic task in natural language processing, which refers to the process of dividing a continuous text string into an independent word or phrase. Through word segmentation, complex energy query statements can be simplified into a series of independent vocabulary units, which facilitates subsequent semantic analysis and processing. The query entity is the specific object or concept mentioned in the energy query statement. Based on the query entity, it can be searched in the energy knowledge graph to realize the question and answer of the energy query statement. User intent refers to the purpose or need of the user's query. User intent can be used to guide the query and optimize the answer recommendation.
[0073] For example, the energy query statement input by the user may be: "What is solar energy?", and the corresponding query entity may be "solar energy". If the user's intention is "what", the concept of solar energy may be returned as the target intelligent question and answer result.
[0074] The embodiment of the present application obtains energy knowledge data for constructing a knowledge graph; performs text semantic design based on the energy knowledge data to obtain data entities and data relationships between data entities; constructs an energy data knowledge graph based on data entities and data relationships; performs word segmentation processing on energy query statements input by users to obtain query entities and user intentions; queries query entities and user intentions based on the energy data knowledge graph to obtain target intelligent question and answer results. Since the accuracy of the query is improved by performing text semantic design on the energy knowledge data, and the interactivity of the query and the comprehensiveness of the query results are improved by constructing the energy data knowledge graph.
[0075] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 In the implementation of this application, the step of querying the query entity and user intention based on the energy data knowledge graph to obtain the target intelligent question and answer result includes:
[0076] Step S51, searching in the energy data knowledge graph based on the query entity to obtain a target entity;
[0077] Step S52, searching for a matching template in preset templates based on the user intention;
[0078] Step S53, obtaining entity relationships based on the matching template;
[0079] Step S54, generating a target intelligent question and answer result based on the target entity and entity relationship.
[0080] It should be noted that the above-mentioned target entity, that is, the entity in the knowledge graph, can be an entity with the same name as the query entity, or an entity with a similarity with the query entity name greater than a certain value, and the embodiments of the present application do not impose any restrictions on this.
[0081] In one implementation of the embodiment of the present application, the step of obtaining the target entity by searching the energy data knowledge graph based on the query entity includes: performing entity matching on the query entity in the energy data knowledge graph to obtain a successfully matched target entity, wherein a basis for the successful matching is that the name of the query entity is consistent with that of the target entity; performing partial name extraction on the unsuccessful matched query entity to obtain a sub-entity pair; performing entity similarity matching on the sub-entity pair in the energy data knowledge graph to obtain a target entity whose similarity is greater than a preset threshold.
[0082] It should be noted that when there is an entity with a name consistent with the query entity in the knowledge graph, the entity can be used as the target entity; when there is no entity with a name inconsistent with the query entity in the knowledge graph, a partial name of the query entity can be extracted to obtain sub-entity pairs, and further entity similarity matching can be performed based on the sub-entity pairs.
[0083] It should be explained that the above sub-entities can be obtained by dividing the query entity. For example, the query entity obtained after word segmentation is "nuclear kinetic energy", and the sub-entity pairs "nuclear", "kinetic", and "energy" are obtained after partial name extraction. By performing similarity matching on the sub-entity pairs, the similarity between the entities in the energy data knowledge graph can be determined, and the entities greater than the similarity threshold are used as target entities.
[0084] It should be noted that, for different query entities, the corresponding preset thresholds may be different. Specifically, the preset threshold is related to the number of words corresponding to the query entity.
[0085] In some implementations of the embodiments of the present application, when the number of words in the query entity is two or less, the corresponding preset threshold is 1; when the number of words in the query entity is three, the corresponding preset threshold is 0.65; when the number of words in the query entity is four, the corresponding preset threshold is 0.5.
[0086] It should be noted that query structures or frameworks can be predefined in the question-answering device, and these query statements or frameworks are also templates. For example, when the template content is "What is solar energy" and the user's question is "What is solar energy", the user intention mentioned in the user's query statement can be matched to the corresponding matching template through the relationship extraction model, and then the target entity relationship can be determined based on the matching template and the entity relationship corresponding to the target entity. By filling the target entity and entity relationship into the matching template, the target intelligent question-answering result can be generated.
[0087] It should be explained that based on the content designed in the matching template, the target entity relationship can be determined in the entity relationship of the target entity. For example, the question and answer template related to power generation can determine other entities that can generate power to obtain the target entity, and the embodiments of the present application are not limited to this.
[0088] In some implementations of the embodiments of the present application, the method further includes:
[0089] If the matching template cannot be found, the energy query statement is detected based on the entity detection model to obtain an energy knowledge subgraph;
[0090] Knowledge graph embedding is performed based on the energy knowledge subgraph to obtain entity relationships.
[0091] It should be noted that when a matching template cannot be found, the question-and-answer device can perform entity detection based on the energy query statement input by the user. The entity detection method can be based on an entity detection model or other methods, and the embodiments of the present application are not limited to this.
[0092] It can be understood that all entities in the energy query statement are detected by the entity detection model to assist in generating the energy knowledge subgraph. By embedding the generated energy knowledge subgraph into the knowledge graph, a vector representation of entities and relationships can be obtained. By classifying the vector representation into templates, it is determined which template it belongs to, and then the corresponding matching template and entity relationship are determined.
[0093] It should be noted that the above-mentioned entity detection model can be a model built based on a neural network. The embodiment of the present application does not impose any specific restrictions on its construction method, and it can be selected according to the needs of actual applications.
[0094] The embodiment of the present application obtains the target entity by searching in the energy data knowledge graph based on the query entity; searches for a matching template in the preset template based on the user's intention; obtains the target entity relationship based on the matching template; and generates the target intelligent question and answer result based on the target entity and the entity relationship. If a matching template cannot be found, the energy query statement is detected based on the entity detection model to obtain an energy knowledge subgraph; the knowledge graph is embedded based on the energy knowledge subgraph to obtain the entity relationship. Since the matching template is searched in the preset template based on the user's intention, and the energy knowledge subgraph is obtained by detection based on the entity detection model when it cannot be found, the accuracy of the question and answer result is improved.
[0095] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the intelligent question-answering method based on the knowledge graph of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0096] This application also provides an intelligent question-answering device based on knowledge graph, please refer to Figure 5 , the intelligent question-answering device based on knowledge graph includes:
[0097] A data acquisition module 10, used to acquire energy knowledge data for constructing a knowledge graph;
[0098] A relationship design module 20, used for performing text semantic design based on the energy knowledge data to obtain data entities and data relationships between the data entities;
[0099] A knowledge graph construction module 30, used to construct an energy data knowledge graph based on the data entities and the data relationships;
[0100] The sentence processing module 40 is used to perform word segmentation processing on the energy query sentence input by the user to obtain the query entity and the user intention;
[0101] The intelligent question and answer module 50 is used to query the query entity and user intention based on the energy data knowledge graph to obtain a target intelligent question and answer result.
[0102] The intelligent question-answering device based on knowledge graph provided by the present application adopts the intelligent question-answering method based on knowledge graph in the above-mentioned embodiment, which can solve the technical problem of low retrieval accuracy of the intelligent question-answering system based on knowledge graph. Compared with the prior art, the beneficial effects of the intelligent question-answering device based on knowledge graph provided by the present application are the same as the beneficial effects of the intelligent question-answering method based on knowledge graph provided by the above-mentioned embodiment, and the other technical features in the intelligent question-answering device based on knowledge graph are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0103] The present application provides an intelligent question-answering device based on a knowledge graph, and the intelligent question-answering device based on a knowledge graph includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the intelligent question-answering method based on the knowledge graph in the above-mentioned embodiment one.
[0104] Reference below Figure 6 , which shows a schematic diagram of the structure of an intelligent question-answering device based on a knowledge graph suitable for implementing the embodiment of the present application. The intelligent question-answering device based on a knowledge graph in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The knowledge graph-based intelligent question-and-answer device shown is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present application.
[0105] like Figure 6As shown, the intelligent question-answering device based on the knowledge graph may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the intelligent question-answering device based on the knowledge graph are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other via a bus 1005. The input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the intelligent question-and-answer device based on the knowledge graph to communicate wirelessly or wired with other devices to exchange data. Although the figure shows an intelligent question-and-answer device based on the knowledge graph with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0106] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0107] The intelligent question-answering device based on knowledge graph provided by the present application adopts the intelligent question-answering method based on knowledge graph in the above embodiment, which can solve the technical problem that the retrieval accuracy of the intelligent question-answering system based on knowledge graph is not high. Compared with the prior art, the beneficial effects of the intelligent question-answering device based on knowledge graph provided by the present application are the same as the beneficial effects of the intelligent question-answering method based on knowledge graph provided by the above embodiment, and the other technical features in the intelligent question-answering device based on knowledge graph are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0108] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0109] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0110] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the knowledge graph-based intelligent question-answering method in the above-mentioned embodiment.
[0111] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0112] The above-mentioned computer-readable storage medium may be included in the intelligent question-answering device based on the knowledge graph; or it may exist independently without being assembled into the intelligent question-answering device based on the knowledge graph.
[0113] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the intelligent question-answering device based on the knowledge graph, the intelligent question-answering device based on the knowledge graph:
[0114] Acquire energy knowledge data for building knowledge graphs;
[0115] Performing text semantic design based on the energy knowledge data to obtain data entities and data relationships between the data entities;
[0116] Constructing an energy data knowledge graph based on the data entities and the data relationships;
[0117] Perform word segmentation on the energy query sentence input by the user to obtain the query entity and user intention;
[0118] The query entity and user intention are queried based on the energy data knowledge graph to obtain a target intelligent question and answer result.
[0119] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0120] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0121] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0122] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned intelligent question-answering method based on knowledge graphs, and can solve the technical problem that the retrieval accuracy of the intelligent question-answering system based on knowledge graphs is not high. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the intelligent question-answering method based on knowledge graphs provided in the above-mentioned embodiments, and will not be repeated here.
[0123] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the above-mentioned knowledge graph-based intelligent question-answering method.
[0124] The computer program product provided by this application can solve the technical problem that the retrieval accuracy of the intelligent question-answering system based on the knowledge graph is not high. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the intelligent question-answering method based on the knowledge graph provided in the above embodiment, which will not be repeated here.
[0125] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. An intelligent question-answering method based on knowledge graph, characterized in that: The method comprises: Acquire energy knowledge data for building knowledge graphs; Performing text semantic design based on the energy knowledge data to obtain data entities and data relationships between the data entities; Constructing an energy data knowledge graph based on the data entities and the data relationships; Perform word segmentation on the energy query sentence input by the user to obtain the query entity and user intention; The query entity and user intention are queried based on the energy data knowledge graph to obtain a target intelligent question and answer result.
2. The intelligent question-answering method based on knowledge graph according to claim 1, characterized in that: The step of querying the query entity and the user intention based on the energy data knowledge graph to obtain a target intelligent question answering result includes: Searching in the energy data knowledge graph based on the query entity to obtain a target entity; Searching for a matching template in preset templates based on the user intention; Obtaining a target entity relationship based on the matching template; Generate a target intelligent question answering result based on the target entity and entity relationship.
3. The intelligent question-answering method based on knowledge graph according to claim 2, characterized in that: The method further comprises: If the matching template cannot be found, the energy query statement is detected based on the entity detection model to obtain an energy knowledge subgraph; Knowledge graph embedding is performed based on the energy knowledge subgraph to obtain entity relationships.
4. The intelligent question-answering method based on knowledge graph according to claim 2, characterized in that: The step of searching in the energy data knowledge graph based on the query entity to obtain the target entity includes: Performing entity matching on the query entity in the energy data knowledge graph to obtain a successfully matched target entity, wherein a basis for the successful matching is that the name of the query entity is consistent with that of the target entity; Extract partial names of unmatched query entities to obtain sub-entity pairs; In the energy data knowledge graph, entity similarity matching is performed on the sub-entity pairs to obtain target entities whose similarity is greater than a preset threshold.
5. The intelligent question-answering method based on knowledge graph according to claim 1, characterized in that: The step of performing text semantic design based on the energy knowledge data to obtain data entities and data relationships between the data entities includes: Performing semantic analysis on the energy knowledge data to obtain data text features of the energy knowledge data; Entity relationships are extracted from the data text features to obtain data entities and data relationships between the data entities.
6. The intelligent question-answering method based on knowledge graph according to claim 1, characterized in that: The step of constructing an energy data knowledge graph based on the data entities and the data relationships includes: Constructing energy data triples based on the data entities and the data relationships; The energy data triples are stored in a preset graph database to obtain an energy knowledge graph.
7. An intelligent question-answering device based on knowledge graph, characterized in that: The intelligent question-answering device based on the knowledge graph includes: A data acquisition module, used to acquire energy knowledge data for building a knowledge graph; A relationship design module, used for performing text semantic design based on the energy knowledge data to obtain data entities and data relationships between the data entities; A knowledge graph construction module, used to construct an energy data knowledge graph based on the data entities and the data relationships; The sentence processing module is used to perform word segmentation on the energy query sentence input by the user to obtain the query entity and user intention; The intelligent question and answer module is used to query the query entity and user intention based on the energy data knowledge graph to obtain a target intelligent question and answer result.
8. An intelligent question-answering device based on knowledge graph, characterized in that: The device includes: a memory, a processor, and a knowledge graph-based intelligent question-answering program stored in the memory and executable on the processor, wherein the knowledge graph-based intelligent question-answering program is configured to implement the steps of the knowledge graph-based intelligent question-answering method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores an intelligent question-answering program based on a knowledge graph, and when the intelligent question-answering program based on the knowledge graph is executed by the processor, the steps of the intelligent question-answering method based on the knowledge graph are implemented.
10. A computer program product, characterized in that The computer program product includes a computer program, which, when executed by a processor, implements the steps of the knowledge graph-based intelligent question-answering method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Knowledge graph-based patient medical record similarity evaluation method and system
CN112364174A
Intelligent question and answer method and system based on tourism knowledge graph
CN113535917A
Intelligent question answering method, system and equipment based on aircraft knowledge graph and medium
CN115599899A
Intelligent question and answer method based on knowledge graph
CN116089581A
Intelligent question answering method and device based on industry knowledge graph, equipment and medium
CN116257610A