CN113342948A - Intelligent question and answer method and device - Google Patents

Intelligent question and answer method and device Download PDF

Info

Publication number
CN113342948A
CN113342948A CN202110605639.2A CN202110605639A CN113342948A CN 113342948 A CN113342948 A CN 113342948A CN 202110605639 A CN202110605639 A CN 202110605639A CN 113342948 A CN113342948 A CN 113342948A
Authority
CN
China
Prior art keywords
question
professional
intelligent
answer
answering
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
CN202110605639.2A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110605639.2A priority Critical patent/CN113342948A/en
Publication of CN113342948A publication Critical patent/CN113342948A/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/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Animal Behavior & Ethology (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Medical Informatics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides an intelligent question-answering method and device, relates to the field of artificial intelligence, can also be used in the financial field, include: searching professional answers corresponding to the user questions in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model; and if the retrieval fails, acquiring an intelligent answer corresponding to the user question by using a pre-trained open field intelligent question-answering model. According to the method and the device, professional answers and intelligent answers corresponding to the user questions can be obtained by utilizing a pre-constructed model.

Description

Intelligent question and answer method and device
Technical Field
The application relates to the field of artificial intelligence, can be used in the field of finance, and particularly relates to an intelligent question answering method and device.
Background
Repeated solution of basic knowledge in each professional field is tedious work, and with the rapid development of artificial intelligence technology and deep learning technology, the work can be automatically completed by a machine to a certain extent. Compared with a general knowledge retrieval technology, the intelligent question answering technology can better meet the diversified and refined question asking requirements of the user and can more accurately capture the question asking intention of the user.
Traditional intelligent question answering is generally implemented by two ways: one is to construct a corpus in a question-answer pair manner, match the questions by calculating the similarity of the questions in the corpus, and then give the answers corresponding to the questions. The intelligent question-answering mode is simple, the system is easy to realize, and answers beyond the knowledge range of the corpus cannot be given. Another intelligent question-answering method is realized on the basis of a knowledge graph, relational entities contained in question-answering pairs are extracted into the knowledge graph, the knowledge graph is searched by identifying the entities in the questions, and then answers are generated. However, the construction of the knowledge graph by using the existing method often has certain difficulties, and the system is more complex to implement.
In addition, when the user's question is difficult to find a corresponding answer in both the corpus and the knowledge-graph, the above two methods will also fail.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides an intelligent question answering method and device, which can obtain professional answers and intelligent answers corresponding to user questions by utilizing a pre-constructed model.
In order to solve the technical problem, the application provides the following technical scheme:
in a first aspect, the present application provides an intelligent question answering method, including:
searching professional answers corresponding to the user questions in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model;
and if the retrieval fails, acquiring an intelligent answer corresponding to the user question by using a pre-trained open field intelligent question-answering model.
Further, before searching the professional answer corresponding to the user question in the pre-constructed professional domain knowledge graph by using the pre-trained entity recognition model, the method further comprises the following steps:
searching a brief answer corresponding to the user question in a pre-constructed professional field knowledge base; and if the retrieval fails, retrieving the professional answer corresponding to the user question in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model.
Further, the retrieving a brief answer corresponding to the user question from a pre-constructed professional domain knowledge base includes:
determining a question vector corresponding to the user question;
calculating the similarity between the question sentence vector and a preset sentence vector corresponding to each preset problem stored in the professional field knowledge base;
and taking the brief answer corresponding to the preset sentence vector with the maximum similarity as the brief answer corresponding to the user question.
Further, the step of training the entity recognition model in advance comprises:
and training a BERT machine learning model by using the professional field knowledge in the professional field knowledge base to obtain an entity recognition model.
Further, the step of pre-constructing the domain of expertise map comprises:
acquiring the quantity of the professional field knowledge and the answer satisfaction rate;
determining whether the amount of expertise satisfies a first threshold and the answer satisfaction rate satisfies a second threshold;
if the first threshold and the second threshold are both met, generating a knowledge graph triple corresponding to the professional field knowledge in the professional field knowledge base;
and constructing the professional domain knowledge graph by using the knowledge graph triples.
Further, the step of training the open field intelligent question-answering model in advance comprises the following steps:
inputting the obtained open field corpus as an initial training set into a long-short term memory neural network model for training to obtain an initial open field intelligent question-answer model;
and performing iterative training on the initial open field intelligent question-answering model by using the continuously updated open field corpus according to a preset time interval to obtain the open field intelligent question-answering model.
In a second aspect, the present application provides an intelligent question answering device, comprising:
the professional answer generating unit is used for searching professional answers corresponding to the user questions in a pre-constructed professional field knowledge graph by utilizing a pre-trained entity recognition model;
and the intelligent answer generating unit is used for acquiring the intelligent answer corresponding to the user question by utilizing a pre-trained open-field intelligent question-answer model when the retrieval is failed.
Further, the intelligent question answering device is further specifically configured to:
searching a brief answer corresponding to the user question in a pre-constructed professional field knowledge base; and if the retrieval fails, retrieving the professional answer corresponding to the user question in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model.
Further, intelligence device of asking for answering still includes:
a sentence vector determining unit, configured to determine a question vector corresponding to the user question;
the similarity determining unit is used for calculating the similarity between the question vectors and preset sentence vectors corresponding to all preset questions stored in the professional field knowledge base;
and the brief answer generating unit is used for taking the brief answer corresponding to the preset sentence vector with the maximum similarity as the brief answer corresponding to the user question.
Further, the intelligent question answering device is further specifically configured to:
and training a BERT machine learning model by using the professional field knowledge in the professional field knowledge base to obtain an entity recognition model.
Further, the intelligent question answering device further comprises:
the quantity and satisfaction rate acquisition unit is used for acquiring the quantity of the professional field knowledge and the answer satisfaction rate;
a threshold judgment unit configured to determine whether the amount of the professional field knowledge satisfies a first threshold and whether the answer satisfaction rate satisfies a second threshold;
a triplet generating unit, configured to generate a knowledge graph triplet corresponding to the professional domain knowledge in the professional domain knowledge base when the first threshold and the second threshold are both satisfied;
and the knowledge graph construction unit is used for constructing the professional field knowledge graph by using the knowledge graph triples.
Further, the intelligent question answering device further comprises:
the initial question-answering model generating unit is used for inputting the obtained open field corpus as an initial training set into the long-short term memory neural network model for training to obtain an initial open field intelligent question-answering model;
and the question-answer model generating unit is used for carrying out iterative training on the initial open field intelligent question-answer model by utilizing the continuously updated open field corpus according to a preset time interval to obtain the open field intelligent question-answer model.
In a third aspect, the present application provides an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the intelligent question-answering method when executing the program.
In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the intelligent question-answering method.
Aiming at the problems in the prior art, the intelligent question-answering method and the intelligent question-answering device can continuously collect user questions, arrange question-answer pairs, update the existing question-answering knowledge base, continuously discover and arrange question-answering entities, attributes and relationships in the process, construct a knowledge map, and finally replace the original system with an intelligent question-answering system based on the knowledge map, so that the accuracy of question-answering is improved, and the intelligent question-answering method and the intelligent question-answering device have the characteristics of high online speed, high growth and the like; for non-professional field questions provided by a user, an open field intelligent question-answering model trained based on an open corpus is adopted to provide answers, so that scene problems in the case of no-matching answers are overcome, and the answers are more vivid and humanized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of an intelligent question answering method in an embodiment of the present application;
FIG. 2 is a flow chart of retrieving a brief answer corresponding to a user's question in an embodiment of the present application;
FIG. 3 is a flowchart of the steps of pre-constructing a domain-of-expertise atlas in an embodiment of the application;
FIG. 4 is a flowchart illustrating the steps of pre-training an open-domain intelligent question-answering model in an embodiment of the present application;
FIG. 5 is a diagram illustrating one embodiment of the structure of an intelligent question answering device;
FIG. 6 is a second block diagram of an intelligent question answering device according to an embodiment of the present application;
FIG. 7 is a third block diagram of an intelligent question answering device in an embodiment of the present application;
FIG. 8 is a fourth block diagram of the intelligent question answering device in the embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device in an embodiment of the present application;
FIG. 10 is a schematic flow chart of a question-answering system in the field of expertise in the embodiment of the present application;
FIG. 11 is a schematic flow chart of an open-domain intelligent question-answering system in an embodiment of the present application;
FIG. 12 is a schematic flow chart of a domain of expertise knowledge-graph intelligent question-answering system in an embodiment of the present application;
fig. 13 is a schematic flow chart of a complete question answering system in the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the intelligent question answering method and device provided by the application can be used in the financial field and any field except the financial field, and the application field of the intelligent question answering method and device provided by the application is not limited.
Referring to fig. 1, in order to obtain professional answers and intelligent answers corresponding to user questions by using a pre-constructed model, the present application provides an intelligent question answering method, including:
s101: searching professional answers corresponding to the user questions in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model;
s102: and if the retrieval fails, acquiring an intelligent answer corresponding to the user question by using a pre-trained open field intelligent question-answer model.
It can be appreciated that the present application overcomes the shortcomings of the prior art and provides an intelligent question-answering method. The intelligent question-answering method can be realized by depending on an intelligent question-answering system aiming at professional field knowledge. In the initial stage of online of the system, considering that the construction of the professional field knowledge map and the open field intelligent question-answer model requires time accumulation to be relatively mature, the user can be provided with brief answers corresponding to the questions by retrieving the professional field knowledge question-answers stored in the professional field knowledge base.
Along with the continuous operation of the system, the accumulated professional field knowledge is more abundant, question and answer pairs stored in the system are also sorted, and the professional field knowledge base is continuously updated. On the basis, an entity recognition model and an open field intelligent question-answering model can be obtained through training by means of artificial intelligence and machine learning, a professional field knowledge graph is constructed, and finally professional answers corresponding to user questions are searched in the professional field knowledge graph by means of the entity recognition model. If the retrieval is failed, an intelligent answer corresponding to the user question can be obtained by using the open field intelligent question-answering model.
The system can provide brief answers, professional answers or intelligent answers corresponding to the user questions by adopting the method, and meets the requirements of the user for obtaining the answers corresponding to the user questions from the three different layers. The brief answer is a relatively brief and immature answer given by a question-answer pair based on a pre-constructed professional field knowledge base; the advantage of this answer mode is that it is fast and efficient. The professional answer is an answer given by searching a user question in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model; professional answers are more detailed professional than brief answers, and the professional answers required by the user can be given from a plurality of angles and depths. The intelligent answer means that when the system cannot give professional answers due to other limitations such as knowledge level, the answer corresponding to the user question is given by using a pre-trained open-field intelligent question-answer model; the intelligent answer is characterized by flexibility and humanization; although the intelligent answers cannot provide professional and effective answers for the user, the intelligent answers can enable the user to obtain a good question answering experience, and the answers are more vivid and interesting. The above process can be seen in fig. 13.
From the above description, the intelligent question-answering method provided by the application can continuously collect user questions, arrange question-answer pairs, update the existing question-answering knowledge base, continuously discover and arrange question-answering entities, attributes and relationships in the process, construct a knowledge graph, and finally replace the original system with an intelligent question-answering system based on the knowledge graph, so that the accuracy of question-answering is improved, and the intelligent question-answering method has the characteristics of high online speed, high growth and the like; for non-professional field questions provided by a user, an open field intelligent question-answering model trained based on an open corpus is adopted to provide answers, so that scene problems in the case of no-matching answers are overcome, and the answers are more vivid and humanized.
In one embodiment, before searching a professional answer corresponding to a user question in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model, the method further includes:
searching a brief answer corresponding to the user question in a pre-constructed professional field knowledge base; and if the retrieval fails, retrieving the professional answer corresponding to the user question in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model.
It is understood that the knowledge of each professional field can be collected to construct a professional field knowledge base in the early stage of system formation, so as to form question-answer pairs based on the professional field knowledge in the professional field knowledge base. The collection of the professional domain knowledge mainly comes from the daily questions of the user for the professional domain knowledge received by the system. Some users have high question-asking repeatability and need to answer repeatedly, and for such user questions, the system can define the question-answering pairs as the stored question-answering pairs.
The link can be carried out in a questionnaire investigation form, the questions of daily consultation acceptance of relevant practitioners in the professional field are collected through questionnaire investigation, and then the questions are merged and arranged to form a common question-answer pair with representative significance for subsequent retrieval and matching.
It should be noted that, since the number of the questions and answers stored in the professional domain knowledge base is limited, and the questions and answers are collected based on questionnaires and other forms, the answers provided by the professional domain knowledge base are often brief, and sometimes even the answers corresponding to the user questions cannot be given. At this time, it is necessary to search the professional answers corresponding to the user questions in the pre-constructed professional domain knowledge graph by using the pre-trained entity recognition model, or obtain the intelligent answers corresponding to the user questions by using the pre-trained open domain intelligent question-answering model, and a specific method is described in detail below. The above process can be seen in fig. 10. As can be seen from fig. 10, when the answer corresponding to the user question cannot be given, the method can be switched to the open-domain intelligent question-answering model to give an intelligent answer.
From the above description, the intelligent question-answering method provided by the application can search the brief answer corresponding to the user question in the pre-constructed professional domain knowledge base.
Referring to fig. 2, the search for a brief answer corresponding to a user question in a pre-constructed professional domain knowledge base includes:
s201: determining a question vector corresponding to a user question;
s202: calculating the similarity between the question vectors and preset sentence vectors corresponding to all preset questions stored in a professional field knowledge base;
s203: and taking the brief answer corresponding to the preset sentence vector with the maximum similarity as the brief answer corresponding to the user question.
It is understood that the embodiment of the application can search the short answer corresponding to the user question in the professional domain knowledge base. The specific method comprises the following steps:
firstly, segmenting words of texts asked by users and deleting stop words. Generally, word segmentation operation needs to be performed on the basis of a professional domain dictionary to improve the accuracy of word segmentation. The commonly used word segmentation algorithm includes a maximum matching method, a shortest path method, and the like, and the application is not limited thereto. A common method of deleting stop words is to simply delete meaningless words in a question sentence according to a common stop dictionary.
Secondly, extracting word vectors corresponding to the words after word segmentation. The word vector is a vector for representing the meaning of words obtained based on large-scale corpus training and can represent the similarity between words. That is, the vector distance between words with higher relevance is smaller, whereas the vector distance between words with lower relevance is larger. There are a number of open word vectors available in the industry. Among them, the more common includes open-source word2vec word vectors. Of course, word vectors can also be generated by self-training with tools such as Gensim using textual data relevant to the field.
And thirdly, calculating a sentence vector based on the word vector. The term vector can be simply averaged to obtain the sentence vector, and the term vector can also be weighted and averaged according to other information such as part of speech and the like to obtain the sentence vector, which is not limited in the present application. The method adopted in this step may be a weighted average of word vectors according to parts of speech or keywords, and the calculation formula is as follows:
Figure BDA0003094040790000081
wherein X is a sentence vector obtained by calculation, and XiIs the word vector in the sentence, n is the number of the word vector in the sentence, a is the weight of the keyword, b is the weight of the non-keyword. The specific method may be to extract keywords appearing in the question sentence by using TF-IDF or a predefined keyword table, where the weight of the keyword is generally greater than the weight of non-keywords, for example, the word vector of the keyword is multiplied by 1.2, the word vector of the non-keyword is multiplied by 1, all the word vectors in the sentence are weighted and then averaged, and the sentence vector can be obtained.
And fourthly, calculating cosine distances between the user questions and sentence vectors corresponding to the preset questions stored in the professional field knowledge base. The cosine distance can be used to characterize the cosine similarity. The calculation method includes a distance L1, a distance L2, a cosine distance, etc., wherein the cosine distance may be used in a preferred embodiment, which is not limited in the present application.
For example, L1 distance d1The calculation formula of (2) is as follows:
Figure BDA0003094040790000082
wherein, XiVector of questions, Y, for a useriThe sentence vector of the question sentence in the question-answer pair (i.e. the preset sentence vector corresponding to each preset question), n is the dimension of the sentence vector, and the L1 distance is the sum of the subtraction absolute values of the corresponding positions of the vectors.
L2 distance d2The calculation formula of (2) is as follows:
Figure BDA0003094040790000083
wherein, XiVector of questions, Y, for a useriThe sentence vectors of the question sentences in the question-answer pairs (namely the preset sentence vectors corresponding to all the preset questions) are obtained, n is the dimensionality of the sentence vectors, and the L2 distance is the square sum of the subtraction of the corresponding positions of the vectors and the root opening sign. The cosine distance is calculated as:
Figure BDA0003094040790000084
wherein, XiSentence vector of question sentences for asking questions of the user, YiIs the sentence vector of the question sentence in the question-answer pair. For example, if XiIs (1,1,1,1,0,0,0), YiIs (0,0,0,1,1,1,1), the calculation process is as follows:
Figure BDA0003094040790000091
fifthly, matching a preset question with the nearest question distance (usually cosine distance) of the user, and taking out the answer of the preset question as a brief answer.
And sixthly, if the distance between the user question and all the preset questions is larger than a preset threshold (generally, cosine distance), the matching fails. At the moment, an entity recognition model and a professional domain knowledge graph can be transferred to obtain professional answers; or switching to an open field intelligent question-answering model to obtain an intelligent answer; it may also be recorded for subsequent manual processing.
After the system gives a brief question-answer, the user may be asked to rate the answer, thus seeing if the brief answer matches the user's question.
From the above description, the intelligent question-answering method provided by the application can search the brief answer corresponding to the user question in the pre-constructed professional domain knowledge base.
In one embodiment, the step of pre-training the entity recognition model includes:
and training the BERT machine learning model by using the professional domain knowledge in the professional domain knowledge base to obtain an entity recognition model.
It is understood that training the entity recognition model may begin when the collected domain of expertise (also known as corpora) reaches a certain scale. The entity recognition model can be trained by adopting various methods, and the popular method is to manually label the entities in the sentences. The entity recognition can be realized by using a Long Short-Term Memory network (LSTM) and carrying out model training in a sequence labeling mode. With the development of natural language processing technology, pre-training language models such as bert (bidirectional Encoder expressions) machine learning models can be used for model training. The entity recognition model obtained through training is used for recognizing entities contained in user questions, and retrieval aiming at the user questions can be carried out in the professional domain knowledge map based on the entities and the relation between the entities. See below for examples of entities.
It should be noted that the collected corpus can be trained after reaching a certain scale, so that similar words can be conveniently sorted, semantic disambiguation is performed, and the retrieval accuracy is improved.
From the above description, the intelligent question-answering method provided by the application can be used for training the entity recognition model in advance.
Referring to fig. 3, the step of pre-constructing the domain of expertise map includes:
s301: acquiring the quantity of professional field knowledge and answer satisfaction rate;
s302: determining whether the amount of expertise satisfies a first threshold and the answer satisfaction rate satisfies a second threshold;
s303: if the first threshold and the second threshold are both met, generating a knowledge graph triple corresponding to the professional field knowledge in a professional field knowledge base;
s304: and constructing the professional field knowledge graph by using the knowledge graph triples.
It is understood that the embodiments of the present application may form the domain knowledge (also called question-answer pairs) in the domain knowledge base into the knowledge graph triples based on the above-mentioned user evaluation (corresponding to the answer satisfaction rate), that is, the natural language processing technology or manual extraction method is used to find the relationships between the entities therein and store the relationships in the triples. For example, if the question asked by the user is "what the flow of financial reimbursement is", the matching answer is "invoice holding, consumption records to manual reimbursement at financial department", and the three sets obtained from this answer are: ("financial reimbursement") - ("flow") - ("invoice, consumption record to financial department manual reimbursement"). The "financial reimbursement", "flow" and "invoice receipt, manual reimbursement from consumption record to financial department" are all entities.
The conditions of the questions and answers of the user are collected continuously, and the questions which do not exist in the question-answer pairs can be updated continuously, so that the questions confirmed by the user are subjected to entity extraction and triplet conversion storage continuously.
The accumulation of the amount of the knowledge in the professional field and the improvement of the answer satisfaction rate can be realized through the processes. If the quantity of the professional domain knowledge reaches the threshold value X1, the answer satisfaction rate also reaches the threshold value X2, and the answer satisfaction rate hardly rises within the preset time T, the accumulated professional domain knowledge is shown to meet the questioning requirements of the customers to a certain extent. At this time, the triples corresponding to the professional domain knowledge can be processed, and after manual alignment, the knowledge graph database is used for storing, so that the construction of the knowledge graph is completed.
It should be noted that, in an embodiment, the professional domain knowledge map may be used instead of answering the user question in a manner of finding the corresponding answer to the user question based on the question-answering. The above process can be seen in fig. 11.
From the above description, the intelligent question-answering method provided by the application can be used for constructing a professional domain knowledge graph in advance.
Referring to fig. 4, the step of training the open-domain intelligent question-answering model in advance includes:
s401: inputting the obtained open field corpus as an initial training set into a long-short term memory neural network model for training to obtain an initial open field intelligent question-answer model;
s402: and performing iterative training on the initial open field intelligent question-answering model by using the continuously updated open field corpus according to a preset time interval to obtain the open field intelligent question-answering model.
It can be understood that the embodiment of the present application can collect a large-scale open domain corpus as a data set for training an open domain intelligent question-answering model. Typically, the open-field corpus may include content such as scripts, novels, etc. that contain a large number of dialog scenes.
The contents are used as a data set for training the open field intelligent question-answering model and input into a sequence-to-sequence structure-based Long-Short-Term Memory network (LSTM), and the open field intelligent question-answering model can be obtained through training by using a conventional machine learning method.
It should be noted that, in consideration of sustainable updating of the open-domain corpus, the embodiment of the present application may further perform continuous iterative training on the open-domain intelligent question-answering model by using the continuously updated open-domain corpus according to a preset time interval until a preset stop condition is met, so as to obtain the continuously updated open-domain intelligent question-answering model.
When the system cannot give brief answers and professional answers corresponding to the user questions, namely the similarity between the user questions and the brief answers and between the user questions and the professional answers is larger than a preset threshold value, the intelligent answers corresponding to the user questions can be given by using an open field intelligent question-answering model.
In the actual use process, the dialogs in the script and the novel can be arranged or assisted by the manually written simulation dialogs to form the open-domain corpus required for training the open-domain intelligent question-answering model. After sequence to sequence training using long-short term memory networks, the open-domain intelligent question-answering model may have the ability to give the following output from the preceding inputs, with the linguistic style consistent with the training data. When the system can not give brief answers and professional answers corresponding to the user questions, the system can give intelligent answers to ensure the overall intelligence of the system. Such as a user asking a question "what do you all will? If the user's question is not located in the system's question-answer pair, and is not located in the domain-of-expertise map, the system may give a query such as "you can try on the tweet! And similar answers are given to reflect the overall intelligence of the system and improve the user experience. The above process can be seen in fig. 12.
As can be seen from the above description, the intelligent question-answering method provided by the application can pre-train the open-field intelligent question-answering model, and provide the intelligent answer corresponding to the user question by using the open-field intelligent question-answering model.
Based on the same inventive concept, the embodiment of the present application further provides an intelligent question answering device, which can be used for implementing the method described in the above embodiment, as described in the following embodiment. Because the principle of solving the problems of the intelligent question-answering device is similar to that of the intelligent question-answering method, the implementation of the intelligent question-answering device can refer to the implementation of a software performance benchmark-based determination method, and repeated parts are not described again. As used hereinafter, the term "unit" or "module" may be a combination of software and/or hardware that implements a predetermined function. While the system described in the embodiments below is preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
Referring to fig. 5, in order to obtain a professional answer and an intelligent answer corresponding to a user question using a pre-constructed model, the present application provides an intelligent question answering apparatus, including:
a professional answer generating unit 501, configured to retrieve, in a pre-constructed professional domain knowledge graph, a professional answer corresponding to a user question by using a pre-trained entity recognition model;
an intelligent answer generating unit 502, configured to obtain an intelligent answer corresponding to the user question by using a pre-trained open-domain intelligent question-and-answer model when the search fails.
In an embodiment, the intelligent question answering device is further specifically configured to:
searching a brief answer corresponding to the user question in a pre-constructed professional field knowledge base; and if the retrieval fails, retrieving the professional answer corresponding to the user question in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model.
Referring to fig. 6, the intelligent question answering device further includes:
a sentence vector determining unit 601, configured to determine a question vector corresponding to the user question;
a similarity determining unit 602, configured to calculate a similarity between the question vector and a preset sentence vector corresponding to each preset question stored in the professional domain knowledge base;
a brief answer generating unit 603, configured to use the brief answer corresponding to the preset sentence vector with the largest similarity as the brief answer corresponding to the user question.
In an embodiment, the intelligent question answering device is further specifically configured to:
and training a BERT machine learning model by using the professional field knowledge in the professional field knowledge base to obtain an entity recognition model.
Referring to fig. 7, the intelligent question answering device further includes:
a quantity and satisfaction rate obtaining unit 701 configured to obtain the quantity of the professional knowledge and an answer satisfaction rate;
a threshold judging unit 702 configured to determine whether the amount of the professional domain knowledge satisfies a first threshold and whether the answer satisfaction rate satisfies a second threshold;
a triple generating unit 703, configured to generate, when both the first threshold and the second threshold are satisfied, a knowledge graph triple corresponding to the professional domain knowledge in the professional domain knowledge base;
a knowledge graph constructing unit 704, configured to construct the professional domain knowledge graph by using the knowledge graph triples.
Referring to fig. 8, the intelligent question answering device further includes:
an initial question-answering model generating unit 801, configured to input the obtained open domain corpus as an initial training set into the long-short term memory neural network model for training, so as to obtain an initial open domain intelligent question-answering model;
the question-answer model generating unit 802 is configured to perform iterative training on the initial open-domain intelligent question-answer model by using a continuously updated open-domain corpus according to a preset time interval, so as to obtain the open-domain intelligent question-answer model.
In terms of hardware, in order to obtain professional answers and intelligent answers corresponding to user questions by using a pre-constructed model, the present application provides an embodiment of an electronic device for implementing all or part of contents in the intelligent question answering method, where the electronic device specifically includes the following contents:
a Processor (Processor), a Memory (Memory), a communication Interface (Communications Interface) and a bus; the processor, the memory and the communication interface complete mutual communication through the bus; the communication interface is used for realizing information transmission between the intelligent question answering device and relevant equipment such as a core service system, a user terminal, a relevant database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, and the like, but the embodiment is not limited thereto. In this embodiment, the logic controller may be implemented with reference to the embodiment of the intelligent question answering method and the embodiment of the intelligent question answering device in the embodiments, and the contents thereof are incorporated herein, and repeated descriptions are omitted.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), an in-vehicle device, a smart wearable device, and the like. Wherein, intelligence wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the intelligent question answering method may be executed on the electronic device side as described above, or all operations may be completed in the client device. The selection may be specifically performed according to the processing capability of the client device, the limitation of the user usage scenario, and the like. This is not a limitation of the present application. The client device may further include a processor if all operations are performed in the client device.
The client device may have a communication module (i.e., a communication unit), and may be in communication connection with a remote server to implement data transmission with the server. The server may include a server on the side of the task scheduling center, and in other implementation scenarios, the server may also include a server on an intermediate platform, for example, a server on a third-party server platform that is communicatively linked to the task scheduling center server. The server may include a single computer device, or may include a server cluster formed by a plurality of servers, or a server structure of a distributed apparatus.
Fig. 9 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 9, the electronic device 9600 can include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 9 is exemplary; other types of structures may also be used in addition to or in place of the structure to implement telecommunications or other functions.
In one embodiment, the smart question-answering method function may be integrated into the central processor 9100. The central processor 9100 may be configured to control as follows:
s101: searching professional answers corresponding to the user questions in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model;
s102: and if the retrieval fails, acquiring an intelligent answer corresponding to the user question by using a pre-trained open field intelligent question-answering model.
From the above description, the intelligent question-answering method provided by the application can continuously collect user questions, arrange question-answer pairs, update the existing question-answering knowledge base, continuously discover and arrange question-answering entities, attributes and relationships in the process, construct a knowledge graph, and finally replace the original system with an intelligent question-answering system based on the knowledge graph, so that the accuracy of question-answering is improved, and the intelligent question-answering method has the characteristics of high online speed, high growth and the like; for non-professional field questions provided by a user, an open field intelligent question-answering model trained based on an open corpus is adopted to provide answers, so that scene problems in the case of no-matching answers are overcome, and the answers are more vivid and humanized.
In another embodiment, the intelligent question-answering device may be configured separately from the central processor 9100, for example, the intelligent question-answering device of the data composite transmission device may be configured as a chip connected to the central processor 9100, and the function of the intelligent question-answering method is realized by the control of the central processor.
As shown in fig. 9, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 also does not necessarily include all of the components shown in fig. 9; in addition, the electronic device 9600 may further include components not shown in fig. 9, which may be referred to in the prior art.
As shown in fig. 9, a central processor 9100, sometimes referred to as a controller or operational control, can include a microprocessor or other processor device and/or logic device, which central processor 9100 receives input and controls the operation of the various components of the electronic device 9600.
The memory 9140 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information relating to the failure may be stored, and a program for executing the information may be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to realize information storage or processing, or the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. Power supply 9170 is used to provide power to electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, an LCD display, but is not limited thereto.
The memory 9140 can be a solid state memory, e.g., Read Only Memory (ROM), Random Access Memory (RAM), a SIM card, or the like. There may also be a memory that holds information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes called an EPROM or the like. The memory 9140 could also be some other type of device. Memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 being used for storing application programs and function programs or for executing a flow of operations of the electronic device 9600 by the central processor 9100.
The memory 9140 can also include a data store 9143, the data store 9143 being used to store data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers for the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, contact book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. The communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless lan module, may be disposed in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby implementing ordinary telecommunications functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100, thereby enabling recording locally through the microphone 9132 and enabling locally stored sounds to be played through the speaker 9131.
An embodiment of the present application further provides a computer-readable storage medium capable of implementing all the steps in the intelligent question answering method with a server or a client as an execution subject in the foregoing embodiments, where the computer-readable storage medium stores a computer program, and the computer program implements all the steps in the intelligent question answering method with a server or a client as an execution subject in the foregoing embodiments when executed by a processor, for example, the processor implements the following steps when executing the computer program:
s101: searching professional answers corresponding to the user questions in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model;
s102: and if the retrieval fails, acquiring an intelligent answer corresponding to the user question by using a pre-trained open field intelligent question-answering model.
From the above description, the intelligent question-answering method provided by the application can continuously collect user questions, arrange question-answer pairs, update the existing question-answering knowledge base, continuously discover and arrange question-answering entities, attributes and relationships in the process, construct a knowledge graph, and finally replace the original system with an intelligent question-answering system based on the knowledge graph, so that the accuracy of question-answering is improved, and the intelligent question-answering method has the characteristics of high online speed, high growth and the like; for non-professional field questions provided by a user, an open field intelligent question-answering model trained based on an open corpus is adopted to provide answers, so that scene problems in the case of no-matching answers are overcome, and the answers are more vivid and humanized.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, 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, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principle and the implementation mode of the invention are explained by applying specific embodiments in the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (11)

1. An intelligent question answering method is characterized by comprising the following steps:
searching professional answers corresponding to the user questions in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model;
and if the retrieval fails, acquiring an intelligent answer corresponding to the user question by using a pre-trained open field intelligent question-answering model.
2. The intelligent question-answering method according to claim 1, before searching professional answers corresponding to the user questions in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model, further comprising:
searching a brief answer corresponding to the user question in a pre-constructed professional field knowledge base; and if the retrieval fails, retrieving the professional answer corresponding to the user question in a pre-constructed professional domain knowledge graph by using a pre-trained entity recognition model.
3. The intelligent question-answering method according to claim 2, wherein the retrieving of the brief answer corresponding to the user question from a pre-constructed professional domain knowledge base comprises:
determining a question vector corresponding to the user question;
calculating the similarity between the question sentence vector and a preset sentence vector corresponding to each preset problem stored in the professional field knowledge base;
and taking the brief answer corresponding to the preset sentence vector with the maximum similarity as the brief answer corresponding to the user question.
4. The intelligent question answering method according to claim 3, wherein the determining of the question vector corresponding to the user question comprises:
performing word segmentation processing on the text corresponding to the user question;
extracting word vectors corresponding to all vocabularies in the text after word segmentation;
and carrying out weighted average calculation on the word vector to obtain the question vector.
5. The intelligent question-answering method according to claim 2, wherein the step of pre-training the entity recognition model comprises:
and training a BERT machine learning model by using the professional field knowledge in the professional field knowledge base to obtain an entity recognition model.
6. The intelligent question-answering method according to claim 5, wherein the step of pre-constructing a domain-of-expertise map comprises:
acquiring the quantity of the professional field knowledge and the answer satisfaction rate;
determining whether the amount of expertise satisfies a first threshold and the answer satisfaction rate satisfies a second threshold;
if the first threshold and the second threshold are both met, generating a knowledge graph triple corresponding to the professional field knowledge in the professional field knowledge base;
and constructing the professional domain knowledge graph by using the knowledge graph triples.
7. The intelligent question-answering method according to claim 1, wherein the step of training an open-field intelligent question-answering model in advance comprises:
inputting the obtained open field corpus as an initial training set into a long-short term memory neural network model for training to obtain an initial open field intelligent question-answer model;
and performing iterative training on the initial open field intelligent question-answering model by using the continuously updated open field corpus according to a preset time interval to obtain the open field intelligent question-answering model.
8. An intelligent question answering device, comprising:
the professional answer generating unit is used for searching professional answers corresponding to the user questions in a pre-constructed professional field knowledge graph by utilizing a pre-trained entity recognition model;
and the intelligent answer generating unit is used for acquiring the intelligent answer corresponding to the user question by utilizing a pre-trained open-field intelligent question-answer model when the retrieval is failed.
9. The intelligent question answering device according to claim 8, characterized by further comprising:
the quantity and satisfaction rate acquisition unit is used for acquiring the quantity of the professional field knowledge and the answer satisfaction rate;
a threshold judgment unit configured to determine whether the amount of the professional field knowledge satisfies a first threshold and whether the answer satisfaction rate satisfies a second threshold;
a triplet generating unit, configured to generate a knowledge graph triplet corresponding to the professional domain knowledge in the professional domain knowledge base when the first threshold and the second threshold are both satisfied;
and the knowledge graph construction unit is used for constructing the professional field knowledge graph by using the knowledge graph triples.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the steps of the intelligent question answering method according to any one of claims 1 to 7 are implemented when the processor executes the program.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the intelligent question-answering method according to any one of claims 1 to 7.
CN202110605639.2A 2021-05-31 2021-05-31 Intelligent question and answer method and device Pending CN113342948A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110605639.2A CN113342948A (en) 2021-05-31 2021-05-31 Intelligent question and answer method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110605639.2A CN113342948A (en) 2021-05-31 2021-05-31 Intelligent question and answer method and device

Publications (1)

Publication Number Publication Date
CN113342948A true CN113342948A (en) 2021-09-03

Family

ID=77473704

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110605639.2A Pending CN113342948A (en) 2021-05-31 2021-05-31 Intelligent question and answer method and device

Country Status (1)

Country Link
CN (1) CN113342948A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114610860A (en) * 2022-05-07 2022-06-10 荣耀终端有限公司 Question answering method and system
CN114697280A (en) * 2022-03-01 2022-07-01 西安博纳吉生物科技有限公司 Instant messaging method for preset content
CN115203356A (en) * 2022-06-15 2022-10-18 延边大学 Method for constructing question-answer library in professional field, question-answer method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114697280A (en) * 2022-03-01 2022-07-01 西安博纳吉生物科技有限公司 Instant messaging method for preset content
CN114610860A (en) * 2022-05-07 2022-06-10 荣耀终端有限公司 Question answering method and system
CN114610860B (en) * 2022-05-07 2022-09-27 荣耀终端有限公司 Question answering method and system
CN115203356A (en) * 2022-06-15 2022-10-18 延边大学 Method for constructing question-answer library in professional field, question-answer method and system
CN115203356B (en) * 2022-06-15 2024-06-04 延边大学 Professional field question-answering library construction method, question-answering method and system

Similar Documents

Publication Publication Date Title
US10733197B2 (en) Method and apparatus for providing information based on artificial intelligence
WO2022095380A1 (en) Ai-based virtual interaction model generation method and apparatus, computer device and storage medium
CN109271493A (en) A kind of language text processing method, device and storage medium
CN113342948A (en) Intelligent question and answer method and device
CN111833853B (en) Voice processing method and device, electronic equipment and computer readable storage medium
CN111708869B (en) Processing method and device for man-machine conversation
CN103970791B (en) A kind of method, apparatus for recommending video from video library
CN112633003A (en) Address recognition method and device, computer equipment and storage medium
CN110473537A (en) Control method, device, equipment and the storage medium of voice technical ability
US10565317B1 (en) Apparatus for improving responses of automated conversational agents via determination and updating of intent
CN109978139B (en) Method, system, electronic device and storage medium for automatically generating description of picture
CN111159358A (en) Multi-intention recognition training and using method and device
CN116501960B (en) Content retrieval method, device, equipment and medium
CN109460503A (en) Answer input method, device, storage medium and electronic equipment
CN111767394A (en) Abstract extraction method and device based on artificial intelligence expert system
CN111382231A (en) Intention recognition system and method
CN114783421A (en) Intelligent recommendation method and device, equipment and medium
CN113505198A (en) Keyword-driven generating type dialogue reply method and device and electronic equipment
WO2020052061A1 (en) Method and device for processing information
CN112307048A (en) Semantic matching model training method, matching device, equipment and storage medium
CN115510194A (en) Question and answer sentence retrieval method and device, electronic equipment and storage medium
CN111444321B (en) Question answering method, device, electronic equipment and storage medium
CN114817478A (en) Text-based question and answer method and device, computer equipment and storage medium
CN111931503B (en) Information extraction method and device, equipment and computer readable storage medium
CN117648420A (en) Intelligent customer service question-answering method and system based on large language 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