CN113868383A - Question answering method and device executed by electronic equipment - Google Patents

Question answering method and device executed by electronic equipment Download PDF

Info

Publication number
CN113868383A
CN113868383A CN202110945468.8A CN202110945468A CN113868383A CN 113868383 A CN113868383 A CN 113868383A CN 202110945468 A CN202110945468 A CN 202110945468A CN 113868383 A CN113868383 A CN 113868383A
Authority
CN
China
Prior art keywords
question
answer
information
attribute information
entity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110945468.8A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110945468.8A priority Critical patent/CN113868383A/en
Publication of CN113868383A publication Critical patent/CN113868383A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/288Entity relationship models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/338Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present disclosure provides a question answering method, apparatus, device and storage medium executed by an electronic device. The method comprises the following steps: in response to a user input question, extracting corresponding entity information from the user input question; finding out target entity nodes matched with entity information in a knowledge graph, wherein the knowledge graph comprises the following steps: each entity node is connected with each associated answer node through a connecting line, and attribute information marked on each connecting line is used for representing the association relationship between the mutually connected entity nodes and the answer nodes; acquiring attribute information marked on at least one connecting line connected to a target entity node in a knowledge graph; and outputting a corresponding answer for the question input by the user based on the similarity between the acquired at least one attribute information and the question input by the user.

Description

Question answering method and device executed by electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a question answering method performed by an electronic device, a question answering apparatus for an electronic device, and a storage medium.
Background
The existing question-answering method executed by electronic equipment generally adopts the mode of selecting node information which accords with the problem in a fixed knowledge base, and the mode needs to establish a huge and complex knowledge base; the method has no enhancement and supplement of extra information in the question and answer, the question and answer process is not humanized enough, and the processed events of the user are not stored and utilized further. Therefore, an intelligent question-answering method is needed to solve the shortcomings of the prior art.
In implementing the disclosed concept, the inventors found that there are at least the following problems in the related art: under the framework of the related technology, if a user wants to obtain a more accurate answer, a large number of questions are usually required to be maintained for one answer, however, the number of answers corresponding to the questions is usually only one; on the other hand, too many problems to maintain are prone to confusing the intended identification of the problem, giving a wrong answer. Because the more problems the maintenance is, the more actions the similarity is compared with, the higher the probability of causing misrecognition. Ultimately resulting in a questioned user experience.
Disclosure of Invention
In view of the above, the present disclosure provides a question answering method performed by an electronic device, a question answering apparatus for an electronic device, a device, and a storage medium.
One aspect of the present disclosure provides a question answering method performed by an electronic device, including: in response to a user input question, extracting corresponding entity information from the user input question; finding out target entity nodes matched with entity information in a knowledge graph, wherein the knowledge graph comprises the following steps: each entity node is connected with each associated answer node through a connecting line, and attribute information marked on each connecting line is used for representing the association relationship between the mutually connected entity nodes and the answer nodes; acquiring attribute information marked on at least one connecting line connected to a target entity node in a knowledge graph; and outputting a corresponding answer for the question input by the user based on the similarity between the acquired at least one attribute information and the question input by the user.
According to an embodiment of the present disclosure, the outputting a corresponding answer to the question input by the user based on the similarity between the obtained at least one attribute information and the question input by the user includes: calculating the similarity between each attribute information in the at least one attribute information and the question input by the user to obtain at least one corresponding similarity value; determining a maximum value of the at least one similarity value; determining target attribute information corresponding to the maximum value; and determining answer nodes which are marked with the target attribute information and connected by the connecting lines, and outputting corresponding answers based on the answer nodes.
According to an embodiment of the present disclosure, calculating a similarity between each attribute information of the at least one attribute information and the question input by the user to obtain at least one corresponding similarity value includes: extracting a corresponding attribute feature vector for each attribute information in the at least one attribute information to obtain a corresponding at least one attribute feature vector; extracting corresponding problem feature vectors based on the problems input by the user; and calculating the similarity between each attribute feature vector in the at least one attribute feature vector and the problem feature vector to obtain at least one corresponding similarity value.
According to an embodiment of the present disclosure, generating the knowledge-graph includes the following operations: acquiring inventory question-answer information, wherein the inventory question-answer information comprises a plurality of question-answer pairs; extracting a plurality of question sentences from the question-answer pairs; clustering the plurality of question sentences to obtain at least one cluster set, wherein the question sentences in each cluster set are similar to each other; extracting, for each of the at least one cluster set, common entity information involved in question statements contained in the set; determining answer information and attribute information corresponding to the public entity information; and generating a knowledge graph based on the extracted public entity information and answer information and attribute information corresponding to the extracted public entity information.
According to the embodiment of the present disclosure, extracting corresponding entity information from a question input by a user includes: and inputting the input questions into the named entity recognition model to output corresponding entity information.
Another aspect of the present disclosure provides a question answering apparatus for an electronic device, including: the extraction module is used for responding to the user input question and extracting corresponding entity information from the user input question; the searching module is used for finding out a target entity node matched with the last entity information in the knowledge graph, and the knowledge graph comprises: each entity node is connected with each associated answer node through a connecting line, and attribute information marked on each connecting line is used for representing the association relationship between the mutually connected entity nodes and the answer nodes; the acquisition module is used for acquiring attribute information marked on at least one connecting line connected to a target entity node in the knowledge graph; and the output module is used for outputting a corresponding answer aiming at the question input by the user based on the similarity between the acquired at least one attribute information and the question input by the user.
According to an embodiment of the present disclosure, the output module includes: the calculating unit is used for calculating the similarity between each attribute information in the at least one attribute information and the question input by the user to obtain at least one corresponding similarity value; a first determining unit for determining a maximum value of the at least one similarity value; a second determining unit configured to determine target attribute information corresponding to the value; and the output unit is used for determining answer nodes which are marked with the target attribute information and connected by the connecting lines and outputting corresponding answers based on the answer nodes.
According to an embodiment of the present disclosure, the apparatus further includes a generation module configured to perform the following operations: acquiring inventory question-answer information, wherein the inventory question-answer information comprises a plurality of question-answer pairs; extracting a plurality of question sentences from the question-answer pairs; clustering a plurality of question sentences to obtain at least one cluster set, wherein the question sentences in each cluster set are similar to each other; extracting, for each of the at least one cluster set, common entity information involved in a question statement contained in the set; determining answer information and attribute information corresponding to the public entity information; and generating a knowledge graph based on the extracted public entity information and answer information and attribute information corresponding to the public entity information.
Another aspect of the present disclosure provides an electronic device including one or more processors and a memory for storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the above-described methods of embodiments of the present disclosure.
Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which when executed, implement the above-mentioned method of the embodiments of the present disclosure.
Another aspect of the present disclosure provides a computer program comprising computer executable instructions for implementing the above-mentioned method of the embodiments of the present disclosure when executed.
According to the embodiment of the disclosure, at least one attribute of an entity is obtained by extracting the entity of a question in a question presented by a user and searching the entity in a knowledge graph, for each corresponding vector in the at least one attribute, the similarity between the vector and the question presented by the user is respectively calculated, and an answer corresponding to the attribute with the highest vector similarity to the question presented by the user is returned to the user, so that the problems in the prior art can be at least partially overcome (for example, too many problems are maintained, confusion of problem intention identification is easily caused due to too many problems are maintained, and wrong answers are given), and then the accuracy of response can be improved, and thus the use experience of the user can be improved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an exemplary system architecture to which a question-and-answer method performed by an electronic device may be applied, according to an embodiment of the present disclosure;
FIG. 2A schematically illustrates a flow chart of a question-answering method performed by an electronic device, in accordance with an embodiment of the present disclosure;
FIG. 2B schematically illustrates a diagram of a knowledge-graph structure performed by an electronic device, in accordance with an embodiment of the disclosure;
FIG. 3 is a flow chart that schematically illustrates a method for separately calculating a similarity between each of the obtained attribute information and a user input question, in accordance with an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow diagram of a method of generating a knowledge-graph according to an embodiment of the present disclosure;
FIG. 5A schematically illustrates a block diagram of a question answering device for an electronic device provided in accordance with an embodiment of the present disclosure;
FIG. 5B schematically illustrates a block diagram of an output module provided in accordance with an embodiment of the disclosure;
fig. 6 schematically illustrates a block diagram of an electronic device suitable for implementing a question-answering method performed by the electronic device, in accordance with an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Some block diagrams and/or flow diagrams are shown in the figures. It will be understood that some blocks of the block diagrams and/or flowchart illustrations, or combinations thereof, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the instructions, which execute via the processor, create means for implementing the functions/acts specified in the block diagrams and/or flowchart block or blocks. The techniques of this disclosure may be implemented in hardware and/or software (including firmware, microcode, etc.). In addition, the techniques of this disclosure may take the form of a computer program product on a computer-readable storage medium having instructions stored thereon for use by or in connection with an instruction execution system.
An embodiment of the present disclosure provides a question and answer method performed by an electronic device, the method including: in response to a user input question, extracting corresponding entity information from the user input question; finding out a target entity node matched with the entity information in a knowledge graph, wherein the knowledge graph comprises: each entity node is connected with each associated answer node through a connecting line, and attribute information marked on each connecting line is used for representing the association relationship between the mutually connected entity nodes and the answer nodes; acquiring attribute information marked on at least one connecting line connected to the target entity node in the knowledge graph; and outputting a corresponding answer for the question input by the user based on the similarity between the acquired at least one attribute information and the question input by the user.
Fig. 1 schematically illustrates an exemplary system architecture 100 to which a question-and-answer method performed by an electronic device may be applied, according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, and/or social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the question answering method executed by the electronic device provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the system provided by the embodiment of the present disclosure, to which the question answering method executed by the electronic device can be applied, may be generally disposed in the server 105. The question answering method performed by the electronic device of the embodiment of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the system applying the question answering method executed by the electronic device provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Alternatively, the question answering method executed by the electronic device provided by the embodiment of the present disclosure may also be executed by the terminal device 101, 102, or 103, or may also be executed by another terminal device different from the terminal device 101, 102, or 103. Accordingly, the system applying the question answering method executed by the electronic device provided by the embodiment of the present disclosure may also be provided in the terminal device 101, 102, or 103, or in another terminal device different from the terminal device 101, 102, or 103.
For example, the question input by the client may be originally stored in any one of the terminal apparatuses 101, 102, or 103 (e.g., the terminal apparatus 101, but not limited thereto), or stored on an external storage apparatus and may be imported into the terminal apparatus 101. Then, the terminal device 101 may locally execute the question-answering method executed by the electronic device provided by the embodiment of the present disclosure, or transmit the question input by the client to another terminal device, a server, or a server cluster, and execute the question-answering method executed by the electronic device provided by the embodiment of the present disclosure by another terminal device, a server, or a server cluster.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2A schematically illustrates a flow chart of a question-answering method performed by an electronic device according to an embodiment of the present disclosure.
As shown in fig. 2A, the question answering method performed by the electronic device of the embodiment of the present disclosure may include operations S201 to S204.
In operation S201, in response to a user input question, corresponding entity information is extracted from the user input question.
According to an embodiment of the present disclosure, extracting corresponding entity information from a question input by a user may be performed by inputting the question input by the user into an entity recognition model to output an entity involved in the question. The present operation S201 is explained in detail below with reference to a specific application scenario.
Illustratively, if the user input question is: the "where archive" is extracted by inputting the question "where archive" into the entity identification model, and in the case where the entity identification model outputs "archive" for the question, the "archive" is the currently extracted entity information corresponding to "where archive".
In operation S202, a target entity node in the knowledge-graph matching the entity information is found.
According to embodiments of the present disclosure, a knowledge graph may be a graph that is created in advance and stored at a specified location. The knowledge-graph may include: each entity node is connected with each associated answer node through a connecting line, attribute information marked on each connecting line is used for representing the association relation between the mutually connected entity nodes and the answer nodes, each entity node can be connected with a plurality of answer nodes, and each answer node can correspond to a plurality of attribute information.
In operation S203, attribute information labeled on at least one connection line connected to a target entity node in the knowledge-graph is acquired.
According to the embodiment of the disclosure, in the knowledge graph, each entity node may be connected to a plurality of answer nodes, a plurality of connection lines connected to the target node may be provided, and each connection line is labeled with attribute information. The present operation S203 is explained in detail below with reference to a specific application scenario.
For example, as shown in fig. 2B, if the entity information extracted from the entity identification model is "archive", the attribute information marked on the connection line connected to the target entity node "archive" may be "place of deposit", "place of transaction", "time of transaction", and the like, and the above attribute information is acquired. The answer node corresponding to the attribute information storage place is 'XX talent center', the answer node corresponding to the attribute information transaction time is 'workday 9:00-17: 00', and the answer node corresponding to the attribute information transaction place is 'XX building XX seat XX room'.
In operation S204, a corresponding answer is output for the question input by the user based on the similarity between the acquired at least one attribute information and the question input by the user.
According to the embodiment of the disclosure, a plurality of attribute information corresponding to the target entity are acquired from the knowledge graph, the similarity between each acquired attribute information and the user input question is calculated respectively, and the answer corresponding to the attribute information with the highest similarity to the user input question is output to the user. According to an embodiment of the present disclosure, the similarity calculation method adopted in the operation S204 in calculating the similarity between each of the acquired attribute information and the user input question is not limited in the present disclosure. For example, the operation S204 may specifically adopt the method described with reference to fig. 3, which will be explained in detail below, and the disclosure will not be described in detail here.
Illustratively, the acquired attribute information comprises a storage place, a handling time and the like, the similarity between the attribute information and the questions input by the user is respectively calculated, after calculation, if the similarity between the attribute information storage place and the questions input by the user is the highest, an answer node corresponding to the attribute information storage place, such as a talent center, is found in the knowledge graph, and the answer "talent center" can be output to the user as the response of the questions provided by the user.
The method of fig. 2 is further described with reference to fig. 3 in conjunction with specific embodiments.
Fig. 3 schematically shows a flowchart for separately calculating the similarity between each of the acquired attribute information and the user input question according to an embodiment of the present disclosure.
As shown in fig. 3, the method of separately calculating the similarity between each of the acquired attribute information and the user input question according to the embodiment of the present disclosure includes operations S301 to S303.
In operation S301, for each attribute information in the at least one attribute information, a corresponding attribute feature vector is extracted, and a corresponding at least one attribute feature vector is obtained.
According to the embodiment of the disclosure, the attribute vector corresponding to each attribute information may be extracted through a semantic similarity model, or may be extracted through other methods, which is not limited by the disclosure. For example, each attribute information corresponding to a target entity node acquired through the knowledge graph may be input into the semantic similarity model, and an attribute feature vector corresponding to each attribute information is obtained respectively.
In operation S302, based on a question input by a user, a corresponding question feature vector is extracted.
According to the embodiment of the present disclosure, referring to S302, an attribute vector corresponding to a question input by a user may be obtained by inputting the question input by the user into a semantic similarity model.
In operation S303, a similarity between each attribute feature vector of the at least one attribute feature vector and the problem feature vector is calculated to obtain at least one corresponding similarity value.
According to the embodiment of the disclosure, the similarity between each attribute feature vector and the problem feature vector is calculated, and through a semantic similarity model, the higher the similarity between the attribute feature vector and the problem feature vector is, the smaller the included angle between the corresponding vectors is, and the larger the rest chord value is. For example, if the attribute feature vector and the question feature vector are completely coincident, the included angle between the attribute feature vector and the question feature vector is 0, and the cosine value is 1, that is, 100%, so that the cosine value of the vector included angle can be regarded as the similarity between the attribute information and the question input by the user, and the answer corresponding to the attribute feature with the maximum value of the cosine value of the included angle between the attribute feature vector and the question feature vector is obtained, that is, the answer with the highest similarity to the question input by the user.
FIG. 4 schematically shows a flow diagram of a method of generating a knowledge-graph according to an embodiment of the disclosure.
As shown in FIG. 4, the method 400 of generating a knowledge graph of an embodiment of the present disclosure includes operations S401-S406.
In operation S401, inventory question-and-answer information is acquired, wherein the inventory question-and-answer information includes a plurality of question-and-answer pairs.
According to an embodiment of the present disclosure, the inventory question-and-answer information may include a historical question-and-answer pair obtained based on a question input by a historical user and an answer output to the user corresponding to the question, and a question-and-answer pair input in advance. The inventory question-answer information may be continuously updated according to actual needs, such as updating answers or inputting a question-answer peer method, which is not limited herein.
In operation S402, a plurality of question sentences are extracted from a plurality of question-answer pairs.
According to an embodiment of the present disclosure, each question-and-answer pair includes a question statement and an answer statement, for example, in an archive storage location answer pair, the question statement may be: "where does a personal profile exist? "the answer sentence corresponding to the question sentence may be: "personal profiles exist in talent centers. "
In operation S403, a plurality of question sentences are clustered, resulting in at least one cluster set, where the question sentences in each cluster set are similar to each other.
According to the embodiment of the present disclosure, each question sentence is clustered to obtain a cluster set, which is not limited herein, for example, question sentences may be generated into question sentence vectors by a Clustering algorithm such as K-means, DBSCAN (sensitivity-Based Spatial Clustering of Applications with Noise), and then subjected to cluster analysis, the question sentence vectors with high similarity may be clustered into one class to generate different cluster sets, and the question sentences in each cluster set are similar to each other, that is, the question sentences with high semantic similarity may be clustered into one class. For example, the question sentence "where does a personal profile exist? What does the "and question sentence" go to do with the personal profile? "can be set in a cluster set; alternatively, the question statement "personal profile where to handle" and the question statement "personal profile handling time" may be set in a clustered collection.
In operation S404, for each of the at least one cluster set, common entity information involved in the question statement contained in the set is extracted.
According to the embodiment of the disclosure, the common entity information related to each question statement in each cluster set can be extracted through an entity recognition model, each question statement in one cluster set is respectively input into the entity recognition model or the cluster set is input into the entity recognition model, and the common entity information related to each question statement in one cluster set is extracted and obtained. For example, when a cluster set includes the question sentence "where does a personal profile exist? What does the "and question sentence" go to do with the personal profile? "the public entity information that can be extracted by the entity recognition model may be" personal archive location "; or when the question sentence "personal profile where to handle" and the question sentence "personal profile handling time" are included in one cluster set, the common entity information that can be extracted by the entity recognition model may be "personal profile handling".
In operation S405, answer information and attribute information corresponding to the common entity information are determined.
According to the embodiment of the disclosure, the answer information corresponding to the common entity information may be multiple, wherein each answer information may be annotated with multiple attribute information in batch, that is, multiple question sentences may correspond to the same answer, for example, where the question sentence "personal profile exists" and where the question sentence "personal profile goes to extract" may correspond to the same answer. Therefore, the extracted common entity information may correspond to one piece of information, and when the question sentences in one cluster set correspond to the same answer, the common entity information may correspond to one piece of answer information.
In operation S406, a knowledge graph is generated based on the extracted common entity information and answer information and attribute information corresponding to the extracted common entity information.
Table 1 schematically illustrates a knowledge graph provided in accordance with an embodiment of the present disclosure.
TABLE 1
Figure BDA0003216522610000121
According to an embodiment of the present disclosure, a knowledge graph includes entity information, answer information, and attribute information. For example, in table 1, the entity information is "file", the attribute information corresponding to the entity information "file" is "storage place", "transaction place" and "transaction time", the answer information corresponding to the attribute information "storage place" is "XX talent center", the answer information corresponding to the attribute information "transaction place" is "XX building XX room", and the answer information corresponding to the attribute information "transaction time" is "working day 9:00-17: 00"; for example, in table 1, the entity information is "issued with salary", the attribute information corresponding to the entity information "issued with salary" includes "bank flow" and "wage flow", and the answer information corresponding to the attribute information "bank flow" and the attribute information "wage flow" is "printable at counter of any one line of XX bank nationwide, and the identity document is presented to the teller and informed that the salary is issued using the proxy wage function of the kyoto finance, and the wage flow is required to be printed without providing a bank card. Thank you "
Fig. 5A schematically illustrates a block diagram of a question answering device for an electronic device according to an embodiment of the present disclosure.
As shown in fig. 5A, a question answering apparatus 500 executed by an electronic device according to an embodiment of the present disclosure may include: an extraction module 510, a lookup module 520, an acquisition module 530, an output module 540, and a generation module 550.
In particular, the extraction module 510 may be used, for example, to extract corresponding entity information from a user-entered question in response to the user-entered question.
The lookup module 520 may be used, for example, to find a target entity node in the knowledge-graph that matches the entity information.
The obtaining module 530 may be used to obtain attribute information labeled on at least one connection connected to a target entity node in the knowledge-graph, for example.
An output module 540, configured to output a corresponding answer to the question input by the user based on a similarity between the obtained at least one attribute information and the question input by the user.
A generating module 550, the generating module 550 may be configured to perform the following operations: acquiring inventory question-answer information, wherein the inventory question-answer information comprises a plurality of question-answer pairs; extracting a plurality of question sentences from the question-answer pairs; clustering a plurality of question sentences to obtain at least one cluster set, wherein the question sentences in each cluster set are similar to each other; extracting, for each of the at least one cluster set, common entity information involved in a question statement contained in the set; determining answer information and attribute information corresponding to the public entity information; and generating a knowledge graph based on the extracted public entity information and answer information and attribute information corresponding to the public entity information.
Fig. 5B schematically illustrates a block diagram of an output module provided in accordance with an embodiment of the present disclosure.
As shown in fig. 5B, according to an embodiment of the present disclosure, the output module 540 may include, for example: a calculation unit 541, a first determination unit 542, a second determination unit 543, and an output unit 544.
The calculating unit 541 may be configured to calculate a similarity between each of the at least one attribute information and the question input by the user, for example, to obtain at least one corresponding similarity value.
The first determining unit 542 may for example be configured to determine a maximum of the at least one similarity value.
The second determining unit 543 may be used for determining target attribute information corresponding to the above values, for example.
The output unit 544 may be configured to determine an answer node of a link labeled with the target attribute information, and output a corresponding answer based on the answer node.
According to an embodiment of the present disclosure, the computing unit may further include, for example: the device comprises a first extraction subunit, a second extraction subunit and a calculation subunit.
A first extracting subunit, configured to, for example, extract, for each attribute information in the at least one attribute information, a corresponding attribute feature vector to obtain a corresponding at least one attribute feature vector;
a second extraction subunit, for example, configured to extract a corresponding question feature vector based on the question input by the user; and
the calculating subunit, for example, may be configured to calculate a similarity between each attribute feature vector in the at least one attribute feature vector and the problem feature vector, so as to obtain at least one corresponding similarity value.
According to an embodiment of the present disclosure, the above question answering apparatus for an electronic device may further include a generating module, where the generating module includes: the device comprises an acquisition unit, a first extraction unit, a clustering unit, a second extraction unit, a third determination unit and a generation unit.
An obtaining unit, for example, may be configured to obtain inventory question-and-answer information, where the inventory question-and-answer information includes a plurality of question-and-answer pairs;
a first extracting unit, for example, configured to extract a plurality of question sentences from the plurality of question-answer pairs;
the clustering unit may be configured to cluster the plurality of question statements to obtain at least one cluster set, where the question statements in each cluster set are similar to each other;
a second extracting unit, for example, configured to extract, for each of the at least one cluster set, common entity information involved in the question statement included in the set;
a third determining unit, for example, configured to determine answer information and attribute information corresponding to the common entity information; and
the generating unit may be configured to generate the knowledge graph based on the extracted common entity information and answer information and attribute information corresponding to the extracted common entity information, for example.
According to an embodiment of the present disclosure, the extracting module may further include an output unit, for example, the output unit may be configured to input the question input by the user into a named entity recognition model, so as to output the corresponding entity information.
It should be noted that, the embodiments of the apparatus portion of the present disclosure correspond to the same or similar embodiments of the method portion of the present disclosure, and the detailed description of the present disclosure is omitted here.
Any of the modules and units according to embodiments of the present disclosure, or at least part of the functionality of any of them, may be implemented in one module. Any one or more of the modules and units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules and units according to the embodiments of the present disclosure may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging the circuits, or in any one of three implementations of software, hardware, and firmware, or in any suitable combination of any of them. Alternatively, one or more of the modules and units according to embodiments of the disclosure may be implemented at least partly as computer program modules, which, when executed, may perform corresponding functions.
For example, any plurality of the extracting module 510, the searching module 520, the obtaining module 530, the outputting module 540 and the generating module 550 may be combined and implemented in one module/unit/sub-unit, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment of the present disclosure, at least one of the extracting module 510, the searching module 520, the obtaining module 530, the outputting module 540 and the generating module 550 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementations of software, hardware and firmware, or implemented by a suitable combination of any several of them. Alternatively, at least one of the extraction module 510, the lookup module 520, the obtaining module 530, the output module 540, and the generating module 550 may be at least partially implemented as a computer program module that, when executed, may perform a corresponding function.
Fig. 6 schematically shows a block diagram of an electronic device adapted to implement the above described method according to an embodiment of the present disclosure. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, an electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 503. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. Processor 601 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are stored. The processor 601, the ROM602, and the RAM603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 600 may also include input/output (I/O) interface 605, input/output (I/O) interface 605 also connected to bus 604, according to an embodiment of the disclosure. The system 600 may also include one or more of the following components connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM602 and/or RAM603 described above and/or one or more memories other than the ROM602 and RAM 603.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. A question-answering method performed by an electronic device, comprising:
in response to a user input question, extracting corresponding entity information from the user input question;
finding a target entity node in a knowledge graph matched with the entity information, wherein the knowledge graph comprises: each entity node is connected with each associated answer node through a connecting line, and attribute information marked on each connecting line is used for representing the association relationship between the mutually connected entity nodes and the answer nodes;
acquiring attribute information marked on at least one connecting line connected to the target entity node in the knowledge graph; and
and outputting a corresponding answer for the question input by the user based on the similarity between the acquired at least one attribute information and the question input by the user.
2. The method according to claim 1, wherein the outputting a corresponding answer to the question input by the user based on the similarity between the acquired at least one attribute information and the question input by the user comprises:
calculating the similarity between each attribute information in the at least one attribute information and the question input by the user to obtain at least one corresponding similarity value;
determining a maximum value of the at least one similarity value;
determining target attribute information corresponding to the maximum value; and
and determining answer nodes marked with the target attribute information and connected with the connecting lines, and outputting corresponding answers based on the answer nodes.
3. The method of claim 2, wherein calculating a similarity between each of the at least one attribute information and the user-entered question, resulting in a corresponding at least one similarity value, comprises:
extracting a corresponding attribute feature vector for each attribute information in the at least one attribute information to obtain a corresponding at least one attribute feature vector;
extracting a corresponding problem feature vector based on the problem input by the user; and
and calculating the similarity between each attribute feature vector in the at least one attribute feature vector and the problem feature vector to obtain at least one corresponding similarity value.
4. The method of claim 1, wherein the knowledge-graph is generated by:
acquiring inventory question-answer information, wherein the inventory question-answer information comprises a plurality of question-answer pairs;
extracting a plurality of question sentences from the plurality of question-answer pairs;
clustering the plurality of question sentences to obtain at least one cluster set, wherein the question sentences in each cluster set are similar to each other;
extracting, for each of the at least one cluster set, common entity information involved in question statements contained in the set;
determining answer information and attribute information corresponding to the public entity information; and
and generating the knowledge graph based on the extracted public entity information and answer information and attribute information corresponding to the extracted public entity information.
5. The method of claim 1, wherein the extracting corresponding entity information from the user-entered question comprises:
and inputting the questions input by the user into a named entity recognition model so as to output the corresponding entity information.
6. A question answering apparatus for an electronic device, comprising:
the extraction module is used for responding to the user input question and extracting corresponding entity information from the user input question;
a searching module, configured to find a target entity node in a knowledge graph that matches the entity information, where the knowledge graph includes: each entity node is connected with each associated answer node through a connecting line, and attribute information marked on each connecting line is used for representing the association relationship between the mutually connected entity nodes and the answer nodes;
the acquisition module is used for acquiring attribute information marked on at least one connecting line connected to the target entity node in the knowledge graph; and
and the output module is used for outputting a corresponding answer aiming at the question input by the user based on the similarity between the acquired at least one attribute information and the question input by the user.
7. The apparatus of claim 6, wherein the output module comprises:
the calculating unit is used for calculating the similarity between each attribute information in the at least one attribute information and the question input by the user to obtain at least one corresponding similarity value;
a first determining unit for determining a maximum value of the at least one similarity value;
a second determining unit configured to determine target attribute information corresponding to the maximum value; and
and the output unit is used for determining answer nodes which are marked with the target attribute information and connected by the connecting lines, and outputting corresponding answers based on the answer nodes.
8. The apparatus of claim 6, further comprising a generation module to:
acquiring inventory question-answer information, wherein the inventory question-answer information comprises a plurality of question-answer pairs;
extracting a plurality of question sentences from the plurality of question-answer pairs;
clustering the plurality of question sentences to obtain at least one cluster set, wherein the question sentences in each cluster set are similar to each other;
extracting, for each of the at least one cluster set, common entity information involved in question statements contained in the set;
determining answer information and attribute information corresponding to the public entity information; and
and generating the knowledge graph based on the extracted public entity information and answer information and attribute information corresponding to the extracted public entity information.
9. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-5.
10. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to carry out the method of any one of claims 1 to 5.
CN202110945468.8A 2021-08-17 2021-08-17 Question answering method and device executed by electronic equipment Pending CN113868383A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110945468.8A CN113868383A (en) 2021-08-17 2021-08-17 Question answering method and device executed by electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110945468.8A CN113868383A (en) 2021-08-17 2021-08-17 Question answering method and device executed by electronic equipment

Publications (1)

Publication Number Publication Date
CN113868383A true CN113868383A (en) 2021-12-31

Family

ID=78990591

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110945468.8A Pending CN113868383A (en) 2021-08-17 2021-08-17 Question answering method and device executed by electronic equipment

Country Status (1)

Country Link
CN (1) CN113868383A (en)

Similar Documents

Publication Publication Date Title
US10108605B1 (en) Natural language processing system and method
CN113204621B (en) Document warehouse-in and document retrieval method, device, equipment and storage medium
CN111046237A (en) User behavior data processing method and device, electronic equipment and readable medium
CN111538837A (en) Method and device for analyzing enterprise operation range information
CN110059172B (en) Method and device for recommending answers based on natural language understanding
US20230004819A1 (en) Method and apparatus for training semantic retrieval network, electronic device and storage medium
US11645545B2 (en) Train a digital assistant with expert knowledge
CN111857674A (en) Business product generation method and device, electronic equipment and readable storage medium
CN113507419A (en) Training method of flow distribution model, and flow distribution method and device
CN112491649A (en) Interface joint debugging test method and device, electronic equipment and storage medium
US20140244641A1 (en) Holistic customer record linkage via profile fingerprints
CN113553386A (en) Embedded representation model training method, knowledge graph-based question-answering method and device
CN107291923B (en) Information processing method and device
CN109710634B (en) Method and device for generating information
CN114238611B (en) Method, apparatus, device and storage medium for outputting information
CN116629792A (en) Recommendation system and operation method thereof
CN113360672B (en) Method, apparatus, device, medium and product for generating knowledge graph
CN113868383A (en) Question answering method and device executed by electronic equipment
CN109857838B (en) Method and apparatus for generating information
CN110990528A (en) Question answering method and device and electronic equipment
CN113344405B (en) Method, device, equipment, medium and product for generating information based on knowledge graph
CN111046146B (en) Method and device for generating information
CN108920602B (en) Method and apparatus for outputting information
CN115982466B (en) Method, device, equipment and storage medium for retrieving data
US20220283991A1 (en) Method and apparatus for sharing favorite

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