CN115964465A - Intelligent question and answer method and device and electronic equipment - Google Patents

Intelligent question and answer method and device and electronic equipment Download PDF

Info

Publication number
CN115964465A
CN115964465A CN202211678750.5A CN202211678750A CN115964465A CN 115964465 A CN115964465 A CN 115964465A CN 202211678750 A CN202211678750 A CN 202211678750A CN 115964465 A CN115964465 A CN 115964465A
Authority
CN
China
Prior art keywords
template
question
rule template
library
graph query
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
Application number
CN202211678750.5A
Other languages
Chinese (zh)
Inventor
任珂
任展
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Cloudminds Beijing Technologies Co Ltd
Original Assignee
Cloudminds Beijing Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Cloudminds Beijing Technologies Co Ltd filed Critical Cloudminds Beijing Technologies Co Ltd
Priority to CN202211678750.5A priority Critical patent/CN115964465A/en
Publication of CN115964465A publication Critical patent/CN115964465A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

One or more embodiments of the present specification disclose an intelligent question answering method, an intelligent question answering device, and an electronic device, wherein the method includes: searching a matched candidate rule template for the problem requested to be processed from a preset rule template library, extracting a target entity and key attribute parameters from the problem requested to be processed, performing semantic matching with the problem requested to be processed according to the target entity and the searched candidate rule template, and searching a corresponding graph query path from a mapping relation between the template and the path based on the matched candidate rule template; then, generating a graph query statement for the problem requested to be processed based on the target entity, the key attribute parameters and the graph query path; and then, searching a corresponding answer from the knowledge map library based on the map query statement, and returning. Therefore, the compiling of complex graph query sentences is avoided, the use threshold is reduced, the coverage capacity of the problem of map question answering is improved, and the matching accuracy is improved.

Description

Intelligent question and answer method and device and electronic equipment
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, and in particular, to an intelligent question answering method and apparatus, and an electronic device.
Background
In the current question-answering task, the recognition of graph query paths is difficult for intelligent question-answering realized by a model based on a knowledge graph.
In particular, because of the limited size and number of the graph query paths, more or less misrecognition situations are inevitable, and the situation of question answering is caused. Especially in some scenarios that require further semantic speculation and understanding, the prediction accuracy is low.
Disclosure of Invention
One or more embodiments of the present disclosure provide an intelligent question and answer method, an intelligent question and answer device, and an electronic device, so as to construct a generalized system of graph query paths, search answers in a knowledge graph, and design a set of problem matching system based on a rule template, thereby ensuring accuracy of intelligent question and answer.
To solve the above technical problems, one or more embodiments of the present specification are implemented as follows:
in a first aspect, an intelligent question-answering method is provided, which includes:
receiving a question requesting to be processed, and searching a candidate rule template matched with the question requesting to be processed from a preset rule template library, wherein the rule template in the preset rule template library is determined based on question and answer data in a current knowledge map library;
extracting a target entity and key attribute parameters from the problem requested to be processed, performing semantic matching with the problem requested to be processed according to the target entity and the searched candidate rule template, and searching a corresponding graph query path from a mapping relation between the template and the path based on the matched candidate rule template;
generating a graph query statement for the problem requested to be processed based on the target entity, the key attribute parameters and the graph query path;
and searching a corresponding answer from the knowledge map library based on the map query statement, and returning.
In a second aspect, an intelligent question answering device is provided, which includes:
the receiving module is used for receiving the problem requesting for processing and searching a candidate rule template matched with the problem requesting for processing from a preset rule template library, wherein the rule template in the preset rule template library is determined based on question and answer data in a current knowledge map library;
the matching module is used for extracting a target entity and key attribute parameters from the problem requesting processing, performing semantic matching with the problem requesting processing according to the target entity and the searched candidate rule template, and searching a corresponding graph query path from the mapping relation between the template and the path based on the matched candidate rule template;
a first generating module, configured to generate a graph query statement for the problem requested to be processed based on the target entity, the key attribute parameter, and the graph query path;
and the return module is used for searching the corresponding answer from the knowledge map library based on the map query statement and returning.
In a third aspect, an electronic device is provided, including:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the intelligent question and answer method of the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, which stores one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform the smart question-answering method of the first aspect.
According to the technical scheme provided by one or more embodiments of the specification, a matched candidate rule template is searched for the problem requested to be processed from a preset rule template library, a target entity and key attribute parameters are extracted from the problem requested to be processed, semantic matching is carried out on the problem requested to be processed according to the target entity and the searched candidate rule template, and a corresponding graph query path is searched for from the mapping relation between the template and the path based on the matched candidate rule template; then, generating a graph query statement for the problem requested to be processed based on the target entity, the key attribute parameters and the graph query path; and then, searching a corresponding answer from the knowledge map library based on the map query statement, and returning. Therefore, by simplifying the query language of the knowledge graph, redefining the representation symbols and the representation method of the graph query language, and designating graph query paths through visualized arrow symbols, the query scenes such as single hop, multiple hop, relationship paths, attributes and the like in graph query are supported, the writing of complex graph query sentences is avoided, and the use threshold is reduced. After the questions are classified and generalized by the scheme, a plurality of rule templates can be configured to be associated to the same graph query path, so that the coverage capability of the graph question answering questions is improved, and the accuracy rate close to 100% can be kept. Particularly, the scheme is used in parallel with the model spectrum question answering, and under the preferential condition of the scheme, when on-line problems occur, the problems which cannot be solved by the model spectrum question answering in a short time can be corrected only by simple configuration, so that the instantaneity is strong, and the accuracy is high.
Drawings
In order to more clearly illustrate one or more embodiments or technical solutions in the prior art, the drawings needed to be used in the description of one or more embodiments or prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present specification, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic step diagram of an intelligent question answering method provided in an embodiment of the present specification.
Fig. 2 is a schematic flow chart of an intelligent question answering provided in the embodiment of the present specification.
Fig. 3 is a schematic structural diagram of an intelligent question answering device provided in an embodiment of the present specification.
Fig. 4 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in one or more embodiments of the present specification will be clearly and completely described below with reference to the drawings in one or more embodiments of the present specification, and it is obvious that the one or more embodiments described are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments that can be derived by a person skilled in the art from one or more of the embodiments described herein without making any inventive step shall fall within the scope of protection of this document.
In the current intelligent question-answering scheme, for a question requested in an intelligent question-answering task, a question-answering task to be processed is generally determined, a question-answering entity is extracted from the question-answering task, then a graph query path related to the question-answering entity is queried from a graph according to the extracted question-answering entity, then the matching degree between the graph query path and the question is scored, a graph query path with higher score is selected from the graph query path, and an answer is queried. However, the number of graph query paths involved in such matching schemes is limited, and it is inevitable that questions are answered or misidentified.
Therefore, the embodiment of the specification provides a new intelligent question-answering scheme, and the main inventive concept is as follows: searching a matched candidate rule template for the problem requested to be processed from a preset rule template library, extracting a target entity and key attribute parameters from the problem requested to be processed, performing semantic matching with the problem requested to be processed according to the target entity and the searched candidate rule template, and searching a corresponding graph query path from a mapping relation between the template and the path based on the matched candidate rule template; then, generating a graph query statement for the problem requested to be processed based on the target entity, the key attribute parameters and the graph query path; and then, searching a corresponding answer from the knowledge map library based on the map query statement, and returning. Therefore, the path of graph query and the problem template matching are considered, the writing of complex graph query sentences is avoided, the use threshold is reduced, the coverage capacity of the map question-answering problem is improved, and the matching accuracy is improved.
Example one
Referring to fig. 1, a schematic step diagram of an intelligent question-answering method provided in an embodiment of the present disclosure is shown, it should be understood that an execution subject of the method may be an intelligent robot in an intelligent question-answering system, for example, a mobile robot, an operation robot (industrial field), a chat robot (service field), a sweeping robot (service field), or the like, or an intelligent answering application, for example, various customer service assistants, electronic customer service, or the like. The object interacting with the execution subject may be a user or a user terminal based on which the user is based, and this specification does not limit this.
The intelligent question answering method can comprise the following steps:
step 102: receiving a question requesting to be processed, and searching a candidate rule template matched with the question requesting to be processed from a preset rule template library, wherein the rule template in the preset rule template library is determined based on question and answer data in a current knowledge map library.
In the embodiment of the present specification, the preset rule template library may be generated in advance by:
step one, classifying and summarizing question data in question and answer data in a current knowledge map library.
The current knowledge map library can be an existing knowledge map, and can also comprise a user knowledge library, a general knowledge library and other proprietary problem databases. By performing a statement type analysis of these questions, a summary of the categories is performed, for example, "who Jay's wife is, who yao X's wife is, who you know that liu XX is now, who is, the intention of this kind of question is to ask who is someone's wife, and thus, this can be summarized as the same kind of question data.
And secondly, creating a problem template for each category, and finely adjusting the corresponding problem template by combining key attribute parameters in the problem data in each category.
Then, performing word analysis on the data classified into the same type of problem data, extracting the tone words, the auxiliary words, the connecting words and the like contained in the data, creating a problem template for each category, and finely adjusting the corresponding problem templates by combining key attribute parameters in the problem data in each category. For example, from the above-identified intent of the question to ask someone who his wife is, a question template can be created: [ you know | he knows ] [ who | is | ] [ is | ] (e 1) [ of the present | ] [ wife | man of husband ] [ who | is | ], wherein some tone words, conjunctions and the like in the template need to be replaced and supplemented according to specific contexts, only some parts are listed here, and the actual template can contain a large number of problem sentences formed by combining different tone words, conjunctions, helpwords and the like, which is not exemplified here.
In fact, the key attribute parameters in the question data may include: after the problem template is created, the problem template may be further fine-tuned according to the key attribute parameters of the problem data in each category, for example, "who is the 2 nd wife of yellow XX? The value "2" needs to be extracted, so that the term "Nth any" can be added to the existing problem template for fine adjustment, and the problem template is obtained: [ you know | he knows ] [ who | which | is | ] [ is | ] (e 1) [ of now | Nth ] [ who | is | ] [ wife | husband ] [ who | is which | ]. Therefore, the range of the problem data covered by the problem template after the fine adjustment of the key attribute parameters is wider.
And thirdly, establishing an index with the corresponding problem template based on the word segmentation summarized by the different problem data in the problem template after fine tuning, and generating a preset rule template library.
After the problem model is created and fine-tuned, the required problem template is obtained. Each question template can cover the same kind of question data with similar question intentions, therefore, participles representing different semantic meanings can be extracted and summarized for the same kind of question data respectively, for example, participles combination formed by 'wife' and 'who' and the like can be indexed with the question template [ you know | he knows ] [ who | which | is | ] [ is | ] (e 1) [ now | of the nth any ] [ which | is ] [ wife | old wife | which | is | ] [ does | ]. Similarly, the problem template created for each category may be indexed with the corresponding participle, thereby generating a preset rule template library.
It should be noted that, the various problem templates in the rule template library are preset and designed to match with the problems. Therefore, the problem templates should be compatible with various linguistic words, auxiliary words, connection words, etc. in the problem data, and should also be compatible with flexible limitations of key entities, etc. in the problem data on the problem data.
It should be understood that the problem templates in the preset rule template library are obtained by classifying and summarizing problem data in the existing knowledge graph, but considering that some problem data do not belong to the knowledge graph library due to low scene or use frequency, the problem templates need to be additionally classified and summarized for the special problem data, the problem templates are created for each category, and the corresponding problem templates are finely adjusted by combining key attribute parameters in the problem data in each category; and establishing an index with the corresponding problem template based on the word segmentation summarized by the different problem data in the problem template after fine adjustment, and updating the preset rule template library. In fact, the above-mentioned various problem data not belonging to the knowledge graph library can be implemented in a manner of generating a preset rule template library according to the problem data in the knowledge graph library, which is not described herein again.
In an implementation scheme, when a candidate rule template matching the problem requested to be processed is searched from a preset rule template library in step 102, a problem template having a set matching rate with the word segmentation result may be searched from the preset rule template library as the candidate rule template according to the word segmentation result in the problem requested to be processed and the word segmentation index.
In fact, after the problem requiring processing is determined, one or more relevant participles determined after participle processing can be extracted from the text content of the problem and used as the basis of participle indexes, and the problem template with a set matching rate with the one or more relevant participles in the participle result is searched from a preset rule template library and used as a candidate rule template. In the embodiment of the present specification, the set matching rate may be a segmentation hit rate set according to a requirement, for example, at least half of the segmentation results are matched, that is, a matching rate of more than 50%.
Step 104: extracting a target entity and key attribute parameters from the problem requested to be processed, performing semantic matching with the problem requested to be processed according to the target entity and the searched candidate rule template, and searching a corresponding graph query path from a mapping relation between the template and the path based on the matched candidate rule template.
In this embodiment of the present specification, the mapping relationship between the template and the path is created by: after a preset rule template library is generated, path generalization processing is carried out on the problem templates in the preset rule template library to generate a plurality of graph query paths, and therefore the mapping relation between the templates and the paths is created, wherein each graph query path corresponds to a plurality of different problem templates.
It should be understood that, in the embodiment of the present specification, the graph query path carries a query direction and a query hop count, where the query direction is a unidirectional query or a bidirectional query.
In fact, the key attribute parameters may include: the relationship and the relationship path can be understood as the same meaning, and are the embodiment of the relationship between the entities. For example, the matched problem template: (e 1 { [ person | org. ]) [ and | with ] (e 2 { [ person | org. ]) [ between | ] [ is | having | ] [ what | yam ] [ relationship ]; the problem that can match includes "what relation the yao X has with the shanghai sports college", or "the yao X and the yao XX are what relation; determined query path: (e1) - { p:3} - (e 2), wherein p denotes a relationship, this path denotes a query of the relationship between two nodes e1 and e2, and 3 denotes a path of maximally only three hops. The attributes are mainly used for storing part of data as attributes of the entities and binding the data with the entities. For example, the matched rule template [ introduction | describes | you know ] [ next | once ] (e 1: { [ person ] }) [ do ]; the problem of matching is described as introduction lower leaf X (person); determining a query path: (e 1. Descriptor) that the introduction of the leaf Li related to the descriptor attribute of the e1 node is directly taken as the answer to the question.
Step 106: generating a graph query statement for the requested problem based on the target entity, the key attribute parameters, and the graph query path.
Optionally, in this embodiment of the present specification, when generating a graph query statement for the requested problem based on the target entity, the key attribute parameter, and the graph query path in step 106, the target entity and the key attribute parameter may be specifically filled in a corresponding position of the graph query path to generate the graph query statement corresponding to the requested problem.
Step 108: and searching a corresponding answer from the knowledge map library based on the map query statement, and returning.
Therefore, by simplifying the query language of the knowledge graph, redefining the representation symbols and the representation method of the graph query language, and designating graph query paths through visualized arrow symbols, the query scenes such as single hop, multiple hop, relationship paths, attributes and the like in graph query are supported, the writing of complex graph query sentences is avoided, and the use threshold is reduced. For the complex problem that the generalized graph query can not cover, the direct writing graph query statement is supported. Moreover, the scheme is simple and easy to use, and reduces the configuration threshold of map question answering, particularly the configuration threshold of map query. On the premise of simplicity and easiness, compatibility of the path of graph query and problem template matching is considered, and the method can adapt to various problems. Meanwhile, after the questions are classified and generalized through the scheme, a plurality of rule templates can be configured to be associated to the same graph query path, the coverage capacity of the questions asked and answered by the graph is improved, and the accuracy rate close to 100% can be kept. Under the condition that the scheme is used in parallel with the model map question answering, and the scheme is preferential, when on-line problems occur, the problems which cannot be solved by the model map question answering in a short time can be corrected by only doing simple configuration, and the instantaneity is strong.
In fact, considering that a traditional model-based atlas question-answering scheme needs to firstly find out a certain amount of atlas path information related to a central point from an atlas database, the time consumption of the process is generally linearly related to the atlas data volume, when the atlas is large in scale and indexes in an internal memory are insufficient to cover the whole data, the related data are loaded from a hard disk, and the time consumption is increased in geometric grade. Through the embodiment of the specification, the problems are matched to the corresponding graph query paths, the central nodes are accurately extracted, and the graph query characters of the graph question and answer can be efficiently completed by combining the limited relation paths, the consumed time cannot be increased along with the increase of the scale of the graph, the index is limited in the memory as far as possible, the loaded data cannot be read from the hard disk, and the increase of energy consumption is avoided.
The whole scheme flow is briefly described below with reference to fig. 2.
-generalised graph query path
The graph query path can be defined in two ways:
the first method is as follows: when supplemented by model-based atlas questions and answers
First, collect sort model can't answer or answer wrong questions, sort and generalize the sorted questions, e.g., query who Jay's wife is, who is yao X's wife, who you know who is who liu X east's wife is now. Based on the problem categories summarized in the above process, the following graph query path is obtained by combining the actual situation of the data in the graph: (e1) - { r1: [ wife | husband | wife ] } - > (@ answer. Name), where the restriction of e1 can also be set directly to (e 1: { [ person ] }), thus the coverage is wider; setting a problem template for the same type of problem, for example: [ you know | ] [ who | which | is | ] [ is | ] (e 1 { [ person. The above template supports matching, who the wife of Jay is, who the wife of Yao X is, and who you know the wife in Liu X east is now.
The second method comprises the following steps: as an independent map question-answer scheme
The graph query path supported by the graph can be defined according to the existing graph structure; and (4) sorting the question methods of the related intentions according to the obtained graph query path, writing a corresponding template, wherein the template at the early stage does not need to be very comprehensive, and can be gradually supplemented in the using process. For example, the following graph structure is taken as an example of a graph relationship of poetry = author = > poetry, and the corresponding intention can support similarity, 1: xx (poetry) who the author (poetry) is, 2: xx (author) writes poems and the like. For the problem 1, the template can be set to (e 1: { [ poem ] }) [ of | ] [ author ] [ who | ] ], the graph query path (e 1) - { r1: [ author ] } - > (@ anwswer. Name) for the problem 2, the template can be set to (e 1: { [ poet ] }) [ write over | there is | what | of | the description [ poem | represents the work ], the graph query path (e 1) - { r1: [ author | represents the work ] } - (@ anwser. Name), the graph query path does not specify the direction, is a bidirectional query, namely, the relationship of the work represented by the poet can be moved to the poem, and the poem can be found by the relationship of the author in the reverse direction of the poet.
-creating a rule template library
Specifically, a rule template with the following structure can be designed: (e 1: [ < work > ],/> | interstellar maze | hacker empire ] | [ < work. Novel > ]) [ in | li | ] [ who | which | is and which ] [ is | ] (e 2: [ < county > ] }), for the constraints of the key entities, matching of ontologies of a specified type and their children, ontologies with specified prefixes, entities of specified names is supported, and also mismatch of all the conditions mentioned above. The e1 matching conditions in the above example are the work of all work prefixes, or all sub-ontologies of work, or "interstellar laboring", "hacker empire", and do not match work. The e2 matching condition is an entity belonging to the county.
In fact, the creation of the rule template base can be completed by a template matching system, the generalization of the graph query path can be completed by a graph query path generalization system, and the two cooperate to realize the accurate matching of the question and answer data.
-matching problem template
When a problem to be processed enters a template matching system, full-text indexes of all rule templates of a current graph space are stored to be preliminarily matched with the problem, and the first N pieces of data (N depends on the scale of the template) which preliminarily judge that the data meet the conditions are obtained to serve as candidate rule templates. Among other things, it can be implemented using the elastic search ES indexing tool.
-determining a graph query path
And extracting map entities from the problems. And performing replacement matching by combining the entity extraction result and the template after the initial screening, and returning the graph query path corresponding to the current template after the problem is matched with the template.
-parsing into graph query statements
And extracting key entity parameters meeting the conditions based on the graph query path, and generating a corresponding graph query statement after the graph query path and the key entity parameters are analyzed by a graph query path generalization system.
- -query answer
And carrying out graph query by using the determined graph query statement, and packaging and returning answers after obtaining a result.
According to the technical scheme, a matched candidate rule template is searched for the problem requiring processing from a preset rule template base, a target entity and key attribute parameters are extracted from the problem requiring processing, semantic matching is carried out on the problem requiring processing according to the target entity and the searched candidate rule template, and a corresponding graph query path is searched for from the mapping relation between the template and the path based on the matched candidate rule template; then, generating a graph query statement for the problem requested to be processed based on the target entity, the key attribute parameters and the graph query path; and then, searching a corresponding answer from the knowledge map library based on the map query statement, and returning. Therefore, by simplifying the query language of the knowledge graph, redefining the representation symbols and the representation method of the graph query language, and designating graph query paths through visualized arrow symbols, the query scenes such as single hop, multiple hop, relationship paths, attributes and the like in graph query are supported, the writing of complex graph query sentences is avoided, and the use threshold is reduced. After the questions are classified and generalized by the scheme, a plurality of rule templates can be configured to be associated to the same graph query path, so that the coverage capability of the graph question answering questions is improved, and the accuracy rate close to 100% can be kept. Particularly, the scheme is used in parallel with the model spectrum question answering, and under the preferential condition of the scheme, when an online problem e is encountered, the problem which cannot be solved by the model spectrum question answering in a short time can be corrected only by simple configuration, so that the instantaneity is strong, and the accuracy is high.
Example two
Referring to fig. 3, for the intelligent question answering device provided in the embodiment of the present disclosure, the device 300 may include:
a receiving module 302, configured to receive a request for processing a question, and search a preset rule template library for a candidate rule template matching the request for processing the question, where the rule template in the preset rule template library is determined based on question and answer data in a current knowledge spectrum library;
a matching module 304, configured to extract a target entity and key attribute parameters from the problem requested to be processed, perform semantic matching with the problem requested to be processed according to the target entity and the found candidate rule template, and search a corresponding graph query path from a mapping relationship between the template and the path based on the matched candidate rule template;
a first generating module 306, configured to generate a graph query statement for the requested processing question based on the target entity, the key attribute parameter, and the graph query path;
and a returning module 308, configured to search the knowledge map library for a corresponding answer based on the map query statement, and return.
Optionally, as an embodiment, the apparatus further includes: a second generation module; the second generation module is used for classifying and summarizing question data in question and answer data in the current knowledge map library; creating a problem template for each category, and finely adjusting the corresponding problem templates by combining key attribute parameters in the problem data in each category; and establishing an index with the corresponding problem template based on the word segmentation summarized by the different problem data in the problem template after fine tuning, and generating a preset rule template library.
In a specific implementation manner of the embodiment of this specification, the apparatus further includes: a creation module; the creating module is used for performing path generalization treatment on the problem templates in the preset rule template library after the second generating module generates the preset rule template library to generate a plurality of graph query paths, so as to create a mapping relation between the templates and the paths, wherein each graph query path corresponds to a plurality of different problem templates.
In another specific implementation manner of the embodiment of the present specification, the second generation module is further configured to classify and summarize problem data that does not belong to the current knowledge graph library; creating a problem template for each category, and finely adjusting the corresponding problem template by combining key attribute parameters in the problem data in each category; and establishing an index with the corresponding problem template based on the word segmentation summarized by the different problem data in the problem template after fine adjustment, and updating the preset rule template library.
In another specific implementation manner of the embodiment of the present specification, the graph query path carries a query direction and a query hop count, where the query direction is a unidirectional query or a bidirectional query.
In yet another specific implementation manner of the embodiment of the present specification, when generating the graph query statement for the problem requested to be processed based on the target entity, the key attribute parameter, and the graph query path, the first generation module is specifically configured to fill the target entity and the key attribute parameter to a corresponding position of the graph query path, and generate the graph query statement corresponding to the problem requested to be processed.
According to the technical scheme, a matched candidate rule template is searched for the problem requiring processing from a preset rule template base, a target entity and key attribute parameters are extracted from the problem requiring processing, semantic matching is carried out on the problem requiring processing according to the target entity and the searched candidate rule template, and a corresponding graph query path is searched for from the mapping relation between the template and the path based on the matched candidate rule template; then, generating a graph query statement for the problem requested to be processed based on the target entity, the key attribute parameters and the graph query path; and then, searching a corresponding answer from the knowledge map library based on the map query statement, and returning. Therefore, by simplifying the query language of the knowledge graph, redefining the representation symbols and the representation method of the graph query language, and designating graph query paths through visualized arrow symbols, the query scenes such as single hop, multiple hop, relationship paths, attributes and the like in graph query are supported, the writing of complex graph query sentences is avoided, and the use threshold is reduced. After the questions are classified and generalized by the scheme, a plurality of rule templates can be configured to be associated to the same graph query path, the coverage capability of the questions asked and answered by the graph is improved, and the accuracy rate close to 100% can be kept. Particularly, the scheme is used in parallel with the model spectrum question answering, and under the preferential condition of the scheme, when on-line problems occur, the problems which cannot be solved by the model spectrum question answering in a short time can be corrected only by simple configuration, so that the instantaneity is strong, and the accuracy is high.
EXAMPLE III
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring to fig. 4, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the intelligent question answering device on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
receiving a question requesting to be processed, and searching a candidate rule template matched with the question requesting to be processed from a preset rule template library, wherein the rule template in the preset rule template library is determined based on question and answer data in a current knowledge map library; extracting a target entity and key attribute parameters from the problem requested to be processed, performing semantic matching with the problem requested to be processed according to the target entity and the searched candidate rule template, and searching a corresponding graph query path from a mapping relation between the template and the path based on the matched candidate rule template; generating a graph query statement for the problem requested to be processed based on the target entity, the key attribute parameters and the graph query path; and searching a corresponding answer from the knowledge map library based on the map query statement, and returning.
The method performed by the apparatus disclosed in the embodiment shown in fig. 1 in this specification may be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in one or more embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present disclosure may be embodied directly in a hardware decoding processor, or in a combination of hardware and software modules within the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may also execute the method in fig. 1, and implement the functions of the corresponding apparatus in the embodiment shown in fig. 1, which are not described herein again in this specification.
Of course, besides the software implementation, the electronic device of the embodiment of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
Embodiments of the present specification also propose a computer-readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, are capable of causing the portable electronic device to perform the method of the embodiment shown in fig. 1, and in particular for performing the method of:
receiving a question requesting to be processed, and searching a candidate rule template matched with the question requesting to be processed from a preset rule template library, wherein the rule template in the preset rule template library is determined based on question and answer data in a current knowledge map library; extracting a target entity and key attribute parameters from the problem requesting processing, performing semantic matching with the problem requesting processing according to the target entity and the searched candidate rule template, and searching a corresponding graph query path from a mapping relation between the template and the path based on the matched candidate rule template; generating a graph query statement for the requested processing question based on the target entity, the key attribute parameters, and the graph query path; and searching a corresponding answer from the knowledge map library based on the map query statement, and returning.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present specification shall be included in the protection scope of the present specification.
The system, apparatus, module or unit illustrated in one or more embodiments above may be implemented by a computer chip or an entity, or by an article of manufacture with a certain functionality. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus comprising the element.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.

Claims (10)

1. An intelligent question answering method is characterized by comprising the following steps:
receiving a question requesting to be processed, and searching a candidate rule template matched with the question requesting to be processed from a preset rule template library, wherein the rule template in the preset rule template library is determined based on question and answer data in a current knowledge map library;
extracting a target entity and key attribute parameters from the problem requested to be processed, performing semantic matching with the problem requested to be processed according to the target entity and the searched candidate rule template, and searching a corresponding graph query path from a mapping relation between the template and the path based on the matched candidate rule template;
generating a graph query statement for the requested processing question based on the target entity, the key attribute parameters, and the graph query path;
and searching a corresponding answer from the knowledge map library based on the map query statement, and returning.
2. The intelligent question-answering method according to claim 1, wherein the preset rule template library is generated by:
classifying and summarizing question data in question and answer data in a current knowledge map library;
creating a problem template for each category, and finely adjusting the corresponding problem templates by combining key attribute parameters in the problem data in each category;
and establishing an index with the corresponding problem template based on the word segmentation summarized by the different problem data in the problem template after fine tuning, and generating a preset rule template library.
3. The intelligent question-answering method according to claim 1 or 2, wherein searching a candidate rule template matching the question requested to be processed from a preset rule template library specifically comprises:
and searching a problem template with a set matching rate with the word segmentation result from a preset rule template library as a candidate rule template according to the word segmentation result in the request processing problem and the word segmentation index.
4. The intelligent question-answering method according to claim 2, wherein the mapping relationship of the template and the path is created by:
after a preset rule template library is generated, path generalization processing is carried out on the problem templates in the preset rule template library to generate a plurality of graph query paths, and therefore the mapping relation between the templates and the paths is created, wherein each graph query path corresponds to a plurality of different problem templates.
5. The intelligent question-answering method according to claim 4, further comprising:
classifying and summarizing problem data which do not belong to the current knowledge map library;
creating a problem template for each category, and finely adjusting the corresponding problem template by combining key attribute parameters in the problem data in each category;
and establishing an index with the corresponding problem template based on the word segmentation summarized by the different problem data in the problem template after fine adjustment, and updating the preset rule template library.
6. The intelligent question-answering method according to claim 4, wherein the graph query path carries a query direction and a query hop count, wherein the query direction is a one-way query or a two-way query.
7. The intelligent question-answering method according to any one of claims 1, 2, 4 and 5, wherein generating a graph query statement for the question requested to be processed based on the target entity, the key attribute parameter and the graph query path specifically comprises:
and filling the target entity and the key attribute parameters to the corresponding position of the graph query path to generate a graph query statement corresponding to the problem requested to be processed.
8. An intelligent question answering device, comprising:
the receiving module is used for receiving the problem requesting for processing and searching a candidate rule template matched with the problem requesting for processing from a preset rule template library, wherein the rule template in the preset rule template library is determined based on question and answer data in a current knowledge map library;
the matching module is used for extracting a target entity and key attribute parameters from the problem requested to be processed, performing semantic matching with the problem requested to be processed according to the target entity and the searched candidate rule template, and searching a corresponding graph query path from a mapping relation between the template and the path based on the matched candidate rule template;
a first generating module, configured to generate a graph query statement for the problem requested to be processed based on the target entity, the key attribute parameter, and the graph query path;
and the return module is used for searching the corresponding answer from the knowledge map library based on the map query statement and returning.
9. An electronic device, comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the intelligent question answering method of any one of claims 1 to 7.
10. A computer-readable storage medium characterized in that the computer-readable storage medium stores one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to execute the smart question answering method according to any one of claims 1 to 7.
CN202211678750.5A 2022-12-26 2022-12-26 Intelligent question and answer method and device and electronic equipment Pending CN115964465A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211678750.5A CN115964465A (en) 2022-12-26 2022-12-26 Intelligent question and answer method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211678750.5A CN115964465A (en) 2022-12-26 2022-12-26 Intelligent question and answer method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115964465A true CN115964465A (en) 2023-04-14

Family

ID=87362997

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211678750.5A Pending CN115964465A (en) 2022-12-26 2022-12-26 Intelligent question and answer method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115964465A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117194616A (en) * 2023-11-06 2023-12-08 湖南四方天箭信息科技有限公司 Knowledge query method and device for vertical domain knowledge graph, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117194616A (en) * 2023-11-06 2023-12-08 湖南四方天箭信息科技有限公司 Knowledge query method and device for vertical domain knowledge graph, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN116738233A (en) Method, device, equipment and storage medium for training model online
CN113220782A (en) Method, device, equipment and medium for generating multivariate test data source
CN114817538B (en) Training method of text classification model, text classification method and related equipment
CN117235226A (en) Question response method and device based on large language model
CN117033667B (en) Knowledge graph construction method and device, storage medium and electronic equipment
CN115964465A (en) Intelligent question and answer method and device and electronic equipment
CN112287071A (en) Text relation extraction method and device and electronic equipment
CN108875743B (en) Text recognition method and device
CN116151220A (en) Word segmentation model training method, word segmentation processing method and device
CN117331561B (en) Intelligent low-code page development system and method
CN114090746A (en) Knowledge graph-based answer query method and device and electronic equipment
CN113887234B (en) Model training and recommending method and device
CN115982416A (en) Data processing method and device, readable storage medium and electronic equipment
CN113344197A (en) Training method of recognition model, service execution method and device
CN114970541A (en) Text semantic understanding method, device, equipment and storage medium
CN114817707A (en) Method and device for creating node and problem, electronic equipment and storage medium
CN114625889A (en) Semantic disambiguation method and device, electronic equipment and storage medium
CN110134775B (en) Question and answer data generation method and device and storage medium
CN111177312A (en) Open source code searching method with grammar and semantics fused
CN113535817B (en) Feature broad table generation and service processing model training method and device
CN117252183B (en) Semantic-based multi-source table automatic matching method, device and storage medium
CN117591661B (en) Question-answer data construction method and device based on large language model
CN117952084A (en) Text processing method, device, equipment and storage medium
CN117633031A (en) Large model training and user profile data query method, device and equipment
CN117828041A (en) Method, device, equipment and medium for generating reply corpus based on large model

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