Intelligent question answering method, device, electronic device and computer readable storage medium

By performing word segmentation processing, entity extraction and semantic analysis on the query text input by the user, combined with query and answer weighted analysis of multiple business knowledge bases, the shortcomings of existing intelligent question-and-answer methods in query answers in a single knowledge base are solved, and the accuracy of intelligent question-and-answer is improved.

CN112632260BActive Publication Date: 2025-04-15PING AN SECURITIES CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011625530.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-30
Publication Date
2025-04-15
Estimated Expiration
2040-12-30

AI Technical Summary

Technical Problem

Existing intelligent Q&A methods query answers in a single business knowledge base, failing to identify the intent of the problem, resulting in low accuracy.

Method used

By receiving the query text input by the user, word segmentation processing and entity extraction are performed to obtain the problem entity; analyzing the intent characteristics of the query text based on the semantic analysis model; using the pre-constructed answer knowledge base to query the problem entity, and performing correlation calculation and weighted analysis on the answer text to generate the final answer.

Benefits of technology

Improves the accuracy of smart Q&A, providing more accurate and comprehensive answers by identifying question intentions and querying in multiple business knowledge bases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112632260B_ABST
    Figure CN112632260B_ABST
Patent Text Reader

Abstract

The present invention relates to big data technology, and discloses an intelligent question-answering method, comprising: receiving a query text, performing word segmentation processing and entity extraction processing on the query text to obtain a question entity; performing semantic analysis on the query text to obtain a question intention feature; using at least one pre-built answer knowledge base to query the question entity to obtain at least one set of answer text sets; performing relevance calculation and analysis on the answer texts in the answer text set to obtain a set of answer texts to be selected; using the question intention feature to perform weighted calculation and analysis on the answer texts to be selected in the answer text set to obtain a final answer text, and pushing the final answer text to a user. The present invention also relates to blockchain technology, and the answer knowledge base can be deployed in a blockchain. The present invention also proposes an intelligent question-answering device, an electronic device, and a computer-readable storage medium. The present invention can improve the accuracy of intelligent question-answering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data, and in particular to a method, device, electronic device and computer-readable storage medium for intelligent question answering. Background Art

[0002] With the rapid development of machine learning, deep learning and natural language, intelligent question answering has become the hottest research and application direction of artificial intelligence today, such as Apple's Siri, Tencent's robot platform, Amazon's Echo, Microsoft's Luis.AI, etc. However, the current intelligent question answering method only queries the answer in a single business knowledge base and does not identify the intention of the question, resulting in low accuracy of intelligent question answering. Summary of the invention

[0003] The present invention provides an intelligent question-answering method, device, electronic device and computer-readable storage medium, the main purpose of which is to improve the accuracy of intelligent question-answering.

[0004] To achieve the above object, the present invention provides an intelligent question-answering method, comprising:

[0005] Receive a query text input by a user, perform word segmentation and entity extraction on the query text, and obtain a question entity;

[0006] Performing semantic analysis on the query text based on a question semantic analysis model to obtain question intention features;

[0007] Using at least one pre-built answer knowledge base to query the question entity, obtaining at least one set of answer text sets;

[0008] Calculate and analyze the relevance of the answer texts in the at least one set of answer texts to obtain a set of answer texts to be selected;

[0009] The question intention feature is used to perform weighted calculation and analysis on the answer texts in the answer text set to obtain a final answer text, and the final answer text is pushed to the user.

[0010] Optionally, the performing word segmentation processing on the query text includes:

[0011] Field preset step: using a pre-built word segmentation dictionary to perform a word segmentation operation on the query text, wherein the number of characters contained in the largest word entry in the pre-built word segmentation dictionary is n, if the number of all characters in the query text is less than n, then the query text is used as a matching field, if the number of all characters in the query text is equal to or greater than n, then the first n characters of the query text are used as the matching field;

[0012] Word segmentation matching step: using the matching field to perform traversal matching in the word segmentation dictionary; if the word segmentation dictionary contains the same words as the matching field, it is determined that the match is successful, the matching field is separated from the query text, and the following sequential matching step is performed; if the word segmentation dictionary does not contain the same words as the matching field, the following field update step is performed;

[0013] Field update step: if the number of characters contained in the matching field is equal to 1, separate the matching field from the query text, and execute the following sequential matching step; if the number of characters contained in the matching field is greater than 1, remove the last character of the matching field, replace and update the matching field with the removed field, and return to the word segmentation matching step;

[0014] Sequential matching step: if the number of characters after the matching field in the query text is less than n, the matching field is replaced and updated with all the characters after the matching field in the query text, and the word segmentation matching step is returned; if the number of characters after the matching field in the query text is not less than n, the matching field is replaced and updated with the n characters in sequence after the matching field of the query text, and the word segmentation matching step is returned; if the number of characters after the matching field of the query text is equal to 0, the word segmentation processing is stopped.

[0015] Optionally, the calculating and analyzing the relevance of the answer texts in the at least one set of answer text sets to obtain the answer text set to be selected includes:

[0016] Convert the answer text in the answer text set into an answer text vector;

[0017] Convert the query text into a question text vector;

[0018] Calculating the relevance value between the answer text vector and the question text vector, and summing up all relevance values ​​to obtain a relevance text set;

[0019] Sorting the relevance values ​​in the relevance text set to obtain the maximum relevance value;

[0020] Selecting the answer text vector corresponding to the maximum relevance value in the answer text set, and using the answer text corresponding to the selected answer text vector as the answer text to be selected corresponding to the answer text set;

[0021] The answer texts to be selected are aggregated to obtain the answer text set to be selected.

[0022] Optionally, the step of performing weighted calculation and analysis on the answer texts in the answer text set using the question intention feature to obtain a final answer text includes:

[0023] Converting the question intention feature into a question intention feature vector;

[0024] Calculate the correlation value between the question intention feature vector and the answer text vector corresponding to each answer text to be selected, and obtain the correlation value of the answer text to be selected;

[0025] Calculate the total number of answer texts in the at least one set of answer texts;

[0026] Calculate the ratio of the number of answer texts in each of the at least one set of answer text sets to the total number of answer texts to obtain a weight for each set of answer text sets;

[0027] The answer text set weight corresponding to the answer text set where the answer text to be selected is located is multiplied by the answer text relevance corresponding to the answer text to be selected to obtain the answer text weight value;

[0028] Summarizing the text weight values ​​of the answers to be selected to obtain a text weight value set of the answers to be selected;

[0029] The answer text corresponding to the maximum answer text weight value in the answer text weight value set is selected as the final answer text.

[0030] Optionally, converting the query text into a question text vector includes:

[0031] Get the dimension window of the preset size;

[0032] Inputting the query text into the dimension window to generate a dimension query text;

[0033] The dimension query text is encoded using a preset encoding algorithm to generate the question text vector.

[0034] Optionally, converting the answer text in the answer text set into an answer text vector comprises:

[0035] Using a pre-trained word vector dictionary, obtain a word vector for each character contained in each answer text in the answer text set;

[0036] Calculate the arithmetic mean of the word vectors of all characters in each answer text as the answer text vector corresponding to each answer text.

[0037] In order to solve the above problems, the present invention further provides an intelligent question-answering device, the device comprising:

[0038] The entity extraction module is used to receive the query text input by the user, perform word segmentation and entity extraction on the query text, and obtain the question entity;

[0039] A semantic analysis module, used to perform semantic analysis on the query text based on a pre-built question semantic analysis model to obtain question intention features;

[0040] The answer screening module is used to use at least one pre-built answer knowledge base to query the question entity to obtain at least one set of answer texts; perform relevance calculation and analysis on the answer texts in the at least one set of answer texts to obtain a set of answer texts to be selected; use the question intention features to perform weighted calculation and analysis on the answer texts in the set of answer texts to obtain a final answer text, and push the final answer text to the user.

[0041] Optionally, the answer screening module calculates and analyzes the relevance of the answer texts in the at least one set of answer text sets to obtain a set of answer texts to be selected, including:

[0042] Answer text vector module: converting the answer text in the answer text set into an answer text vector;

[0043] Question text vector module: converts the query text into a question text vector;

[0044] Relevance text set module: calculates the relevance value between the answer text vector and the question text vector, and summarizes all relevance values ​​to obtain a relevance text set;

[0045] Maximum relevance value module: sorting the relevance values ​​in the relevance text set to obtain the maximum relevance value;

[0046] Answer text module for selection: selects the answer text vector corresponding to the maximum relevance value in the answer text set, and uses the answer text corresponding to the selected answer text vector as the answer text for selection corresponding to the answer text set;

[0047] Answer text set module: collects the answer texts to be selected to obtain the answer text set.

[0048] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0049] a memory storing at least one instruction; and

[0050] The processor executes the instructions stored in the memory to implement the intelligent question-answering method described above.

[0051] In order to solve the above problems, the present invention also provides a computer-readable storage medium, including a data storage area and a program storage area, the data storage area stores data created according to the use of the blockchain node, the program storage area stores a computer program, and the computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement the above-mentioned intelligent question and answer method.

[0052] The embodiment of the present invention performs word segmentation and entity extraction on the query text, eliminating the influence of irrelevant words in the query text on subsequent answer queries; performs semantic analysis on the query text to obtain question intent features, and uses the question intent features to more accurately screen answers; uses at least one pre-built answer knowledge base to query the question entity, making the question query more comprehensive and accurate; performs relevance calculation and analysis on the answer texts in the at least one group of answer text sets, uses the question intent features to perform weighted calculation and analysis on the candidate answer texts in the candidate answer text set, obtains the final answer text, and improves the accuracy of answer screening; queries the query text in different business answer knowledge bases, uses the question intent features to further screen the answers, and improves the accuracy of intelligent question and answer. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A schematic diagram of a flow chart of an intelligent question-answering method provided by an embodiment of the present invention;

[0054] Figure 2 A schematic diagram of a flow chart of word segmentation processing in an intelligent question-answering method provided in an embodiment of the present invention;

[0055] Figure 3 A schematic diagram of modules of an intelligent question-answering device provided by an embodiment of the present invention;

[0056] Figure 4 A schematic diagram of the internal structure of an electronic device for implementing an intelligent question-answering method provided by an embodiment of the present invention;

[0057] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0058] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0059] The present invention provides an intelligent question-answering method. Figure 1 FIG. 1 is a flow chart of an intelligent question-answering method provided by an embodiment of the present invention. The method can be executed by a device, and the device can be implemented by software and / or hardware.

[0060] In this embodiment, the intelligent question answering method includes:

[0061] S1. Receive a query text input by a user, perform word segmentation and entity extraction on the query text, and obtain a question entity;

[0062] In the embodiment of the present invention, the query text is a question that the user inputs, such as: "What is the weather like today?", "What is the interest rate for a three-year user deposit?", and the query text can be obtained through a text input module of a web page.

[0063] Furthermore, the embodiment of the present invention performs word segmentation processing and entity extraction processing on the query text to obtain question entities, wherein the word segmentation processing includes:

[0064] S10: performing a word segmentation operation on the query text using a pre-constructed word segmentation dictionary, wherein the number of characters contained in the largest word entry in the pre-constructed word segmentation dictionary is n;

[0065] S11: Determine whether the number of all characters in the query text is less than n;

[0066] S12: If the total number of characters in the query text is less than n, the query text is used as a matching field.

[0067] S13: If the number of all characters in the query text is equal to or greater than n, the first n characters of the query text are used as the matching fields;

[0068] S20: using the matching field to perform traversal matching in the word segmentation dictionary;

[0069] S21: Determine whether the word segmentation dictionary contains the same words as the matching field;

[0070] S22: If the word segmentation dictionary contains the same words as the matching field, it is determined that the match is successful, the matching field is separated from the query text, and S40 is executed;

[0071] S23: If the word segmentation dictionary does not contain the same word as the matching field, execute S30;

[0072] S30: Determine whether the number of characters contained in the matching field is greater than 1;

[0073] S31: if the number of characters contained in the matching field is equal to 1, separate the matching field from the query text, and execute S40;

[0074] S32: If the number of characters contained in the matching field is greater than 1, remove the last character of the matching field, replace and update the matching field with the removed field, and return to S20;

[0075] S40: Determine whether the number of characters after the matching field in the query text is equal to 0;

[0076] S41: If the number of characters after the matching field in the query text is not equal to 0, determine whether the number of characters after the matching field in the query text is less than n;

[0077] S411: If the number of characters after the matching field in the query text is less than n, the matching field is updated by replacing all characters after the matching field in the query text, and the process returns to S20;

[0078] S412: If the number of characters after the matching field in the query text is not less than n, the matching field is updated by replacing the n characters in sequence after the matching field in the query text, and the process returns to S20;

[0079] S42: If the number of characters after the query text matching field is equal to 0, stop the word segmentation process.

[0080] Through the above implementation, word segmentation is performed in a forward segmentation manner, and the word segmentation effect is more accurate and the word segmentation speed is faster.

[0081] Preferably, the entity extraction process in the embodiment of the present invention includes: using named entity recognition technology (Named Entity Recognition, referred to as NER) to identify the query text after the word segmentation processing to obtain the question entity. Among them, the named entity recognition technology can identify entities with specific meanings in the query text (such as names of people, places, names of institutions, proper nouns, etc.). For example: the query text after the word segmentation processing is "the president of the United States", "is", "who", and the query text is identified by the named entity recognition technology to obtain the question entity as "the president of the United States".

[0082] The word segmentation and entity extraction processes can eliminate meaningless words in the query text, thereby avoiding the influence of meaningless words on subsequent answer queries.

[0083] S2. Perform semantic analysis on the query text based on a pre-built question semantic analysis model to obtain question intention features;

[0084] In the embodiment of the present invention, the query text is semantically analyzed using a pre-built semantic analysis model to obtain the question intention feature. For example, if the query text is "What is the interest rate of a three-year user deposit?", the question intention feature of the query text is "deposit intention"; if the query text is "Which fund has the highest annualized interest rate", the question intention feature of the query text is "fund purchase intention".

[0085] Preferably, the semantic analysis model can be constructed using the BERT (Bidirectional Encoder Representations from Transformers) algorithm, using the historical user query text set as a training set and the labeled historical user query text set as a label set to complete the training of the semantic analysis model. The historical user query text set is a set of multiple historical user query texts.

[0086] The question intention feature is obtained by performing semantic analysis on the query text, and the answer can be screened more accurately using the question intention feature.

[0087] S3, querying the question entity using at least one pre-built answer knowledge base to obtain at least one set of answer text sets;

[0088] In the embodiment of the present invention, in order to ensure the accuracy of the answer, different answer knowledge bases are pre-built, such as a business answer knowledge base, wherein the business answer knowledge base is a database composed of business knowledge of limited business categories. For example, the financial industry covers multiple business categories, including: fund business, deposit business, investment business and other business fields. In the embodiment of the present invention, the knowledge related to the fund business is aggregated and stored in the database to obtain the fund business answer knowledge base, the knowledge related to the deposit is aggregated and stored in the database to obtain the deposit business answer knowledge base, and the knowledge related to the investment is aggregated and stored in the database to obtain the investment business answer knowledge base.

[0089] In another embodiment of the present invention, the answer knowledge base is composed of limited domain knowledge and can be deployed on a regional chain.

[0090] Furthermore, the question entity is queried using at least one pre-constructed answer knowledge base to obtain at least one set of answer text sets; taking the business answer knowledge base as an example, there are three pre-constructed business answer knowledge bases, namely, fund business answer knowledge base, deposit business answer knowledge base, and investment business answer knowledge base. The question entity is queried in these three business knowledge bases respectively to obtain multiple sets of business answer text sets, that is, the fund business answer text set is obtained by querying the fund business answer knowledge base, the deposit business answer text set is obtained by querying the deposit business answer knowledge base, and the investment business answer text set is obtained by querying the investment business answer knowledge base, for a total of 3 sets of business answer text sets.

[0091] S4, calculating and analyzing the relevance of the answer texts in the at least one set of answer texts to obtain a set of answer texts to be selected;

[0092] In the embodiment of the present invention, in order to screen out more accurate answers, the answer texts in the answer text set are converted into answer text vectors, and the query texts are converted into question text vectors.

[0093] Preferably, a pre-trained word vector dictionary is used to obtain the word vector of each character contained in each answer text in the answer text set; and the arithmetic mean of the word vectors of all characters in each answer text is calculated as the answer text vector corresponding to each answer text.

[0094] Furthermore, the calculation formula of the arithmetic mean is as follows:

[0095]

[0096] Among them, a1 to a n Represents the word vector of each character in each answer text, n represents the number of characters in the answer text, and W represents the answer text vector of the answer text.

[0097] Furthermore, a dimension window of a preset size is obtained; the query text is input into the dimension window to generate a dimension query text; and the dimension query text is encoded using a preset encoding algorithm to generate a question text vector.

[0098] For example, the dimensional window is a dimensional window of k*k, where k is a positive integer greater than or equal to 1.

[0099] Preferably, in this embodiment, the preset encoding algorithm may be a Huffman encoding algorithm.

[0100] Furthermore, the correlation value between the answer text vector and the question text vector is calculated, and all correlation values ​​are summarized to obtain a correlation text set; the correlation values ​​in the correlation text set are sorted to obtain a maximum correlation value; the answer text vector corresponding to the maximum correlation value is selected from the answer text set, and the answer text corresponding to the selected answer text vector is used as the answer text to be selected corresponding to the answer text set.

[0101] In detail, the correlation value may be calculated using the following formula:

[0102]

[0103] Among them, x i is the answer text vector, i is a positive integer, y is the question text vector, sim(x i ,) is the correlation value between the answer text vector and the question text vector.

[0104] Furthermore, the answer texts to be selected are summarized to obtain the answer text set to be selected.

[0105] S5. Use the question intention feature to perform weighted calculation and analysis on the answer texts in the answer text set to obtain a final answer text, and push the final answer text to the user.

[0106] In detail, in order to further screen the answers and ensure the accuracy of the answers, the embodiment of the present invention uses the question intention feature to perform weighted calculation and analysis on the answer texts in the answer text set, including:

[0107] S51, converting the question intention feature into a question intention feature vector;

[0108] S52, calculating the correlation value between the question intention feature vector and the answer text vector corresponding to each answer text to be selected, to obtain the correlation of the answer text to be selected;

[0109] S53, calculating the total number of answer texts in the at least one set of answer texts;

[0110] S54, calculating the ratio of the number of answer texts in each of the at least one set of answer text sets to the total number of answer texts, to obtain a weight of each set of answer text sets;

[0111] S55, multiplying the answer text set weight corresponding to the answer text set where the answer text to be selected is located by the answer text relevance corresponding to the answer text to be selected to obtain a weight value of the answer text to be selected, and summing up the answer text weight values ​​to obtain a weight value set of the answer text to be selected;

[0112] S56: Select the answer text corresponding to the maximum answer text weight value in the answer text weight value set as the final answer text.

[0113] Furthermore, the embodiment of the present invention pushes the final answer text to the user, and simultaneously obtains feedback information from the user on whether the final answer text is approved, and based on the feedback information, the data in the knowledge base is correspondingly updated to implement error correction processing on the knowledge base.

[0114] The embodiment of the present invention performs word segmentation and entity extraction on the query text, eliminating the influence of irrelevant words in the query text on subsequent answer queries; performs semantic analysis on the query text to obtain question intent features, and uses the question intent features to more accurately screen answers; uses at least one pre-built answer knowledge base to query the question entity, making the question query more comprehensive and accurate; performs relevance calculation and analysis on the answer texts in the at least one group of answer text sets, uses the question intent features to perform weighted calculation and analysis on the candidate answer texts in the candidate answer text set, obtains the final answer text, and improves the accuracy of answer screening; queries the query text in different business answer knowledge bases, uses the question intent features to further screen the answers, and improves the accuracy of intelligent question and answer.

[0115] like Figure 2 , which is a functional module diagram of the intelligent question-answering device of the present invention.

[0116] The intelligent question-answering device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the intelligent question-answering device may include an entity extraction module 101, a semantic analysis module 102, and an answer screening module 103. The module described in the present invention may also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, and is stored in the memory of the electronic device.

[0117] In this embodiment, the functions of each module / unit are as follows:

[0118] The entity extraction module 101 is used to receive a query text input by a user, perform word segmentation and entity extraction on the query text, and obtain question entities.

[0119] In the embodiment of the present invention, the query text is a question that the user inputs, such as: "What is the weather like today?", "What is the interest rate for a three-year user deposit?", and the query text can be obtained through a text input module of a web page.

[0120] Furthermore, the entity extraction module 101 of the embodiment of the present invention performs word segmentation processing and entity extraction processing on the query text to obtain question entities, wherein the entity extraction module 101 performs word segmentation processing by the following means:

[0121] Field preset step: using a pre-built word segmentation dictionary to perform a word segmentation operation on the query text, wherein the number of characters contained in the largest word entry in the pre-built word segmentation dictionary is n, if the number of all characters in the query text is less than n, then the query text is used as a matching field, if the number of all characters in the query text is equal to or greater than n, then the first n characters of the query text are used as the matching field;

[0122] Word segmentation matching step: using the matching field to perform traversal matching in the word segmentation dictionary; if the word segmentation dictionary contains the same words as the matching field, it is determined that the match is successful, the matching field is separated from the query text, and the following sequential matching step is performed; if the word segmentation dictionary does not contain the same words as the matching field, the following field update step is performed;

[0123] Field update step: if the number of characters contained in the matching field is equal to 1, separate the matching field from the query text, and execute the following sequential matching step; if the number of characters contained in the matching field is greater than 1, remove the last character of the matching field, replace and update the matching field with the removed field, and return to the word segmentation matching step;

[0124] Sequential matching step: if the number of characters after the matching field in the query text is less than n, the matching field is replaced and updated with all the characters after the matching field in the query text, and the word segmentation matching step is returned; if the number of characters after the matching field in the query text is not less than n, the matching field is replaced and updated with the n characters in sequence after the matching field of the query text, and the word segmentation matching step is returned; if the number of characters after the matching field of the query text is equal to 0, the word segmentation processing is stopped.

[0125] Through the above implementation, the entity extraction module 101 performs word segmentation in a forward segmentation manner, which makes the word segmentation effect more accurate and the word segmentation speed faster.

[0126] Preferably, the entity extraction processing performed by the entity extraction module 101 in the embodiment of the present invention includes: using named entity recognition technology (Named Entity Recognition, referred to as NER) to identify the query text after the word segmentation processing to obtain the question entity. Among them, the named entity recognition technology can identify entities with specific meanings in the query text (such as names of people, places, names of organizations, proper nouns, etc.). For example: the query text after the word segmentation processing is "the president of the United States", "is", "who", and the query text is identified by the named entity recognition technology to obtain the question entity as "the president of the United States".

[0127] The word segmentation and entity extraction processes can eliminate meaningless words in the query text, thereby avoiding the influence of meaningless words on subsequent answer queries.

[0128] The semantic analysis module 102 is used to perform semantic analysis on the query text based on a pre-built question semantic analysis model to obtain question intention features.

[0129] In the embodiment of the present invention, the semantic analysis module 102 uses a pre-built semantic analysis model to perform semantic analysis on the query text to obtain the question intention feature. For example, if the query text is "What is the interest rate of a three-year user deposit?", the question intention feature of the query text is "deposit intention"; if the query text is "Which fund has the highest annualized interest rate", the question intention feature of the query text is "fund purchase intention".

[0130] Preferably, the semantic analysis model can be constructed using the BERT (Bidirectional Encoder Representations from Transformers) algorithm, using the historical user query text set as a training set and the labeled historical user query text set as a label set to complete the training of the semantic analysis model. The historical user query text set is a set of multiple historical user query texts.

[0131] The question intention feature is obtained by performing semantic analysis on the query text, and the answer can be screened more accurately using the question intention feature.

[0132] The answer screening module 103 is used to use at least one pre-built answer knowledge base to query the question entity to obtain at least one set of answer texts; perform relevance calculation and analysis on the answer texts in the at least one set of answer texts to obtain a set of answer texts to be selected; use the question intention features to perform weighted calculation and analysis on the answer texts in the set of answer texts to be selected to obtain a final answer text, and push the final answer text to the user.

[0133] In the embodiment of the present invention, in order to ensure the accuracy of the answer, the answer screening module 103 pre-builds different answer knowledge bases, such as a business answer knowledge base, wherein the business answer knowledge base is a database composed of business knowledge of limited business categories. For example, the financial industry covers multiple business categories, including: fund business, deposit business, investment business and other business fields. In the embodiment of the present invention, the knowledge related to the fund business is aggregated and stored in the database to obtain the fund business answer knowledge base, the knowledge related to the deposit is aggregated and stored in the database to obtain the deposit business answer knowledge base, and the knowledge related to the investment is aggregated and stored in the database to obtain the investment business answer knowledge base.

[0134] In another embodiment of the present invention, the answer knowledge base is composed of limited domain knowledge and can be deployed on a regional chain.

[0135] Furthermore, the answer screening module 103 uses at least one pre-constructed answer knowledge base to query the question entity to obtain at least one set of answer text sets; taking the business answer knowledge base as an example, there are three pre-constructed business answer knowledge bases, namely, a fund business answer knowledge base, a deposit business answer knowledge base, and an investment business answer knowledge base. The question entity is queried in these three business knowledge bases respectively to obtain multiple sets of business answer text sets, that is, the fund business answer text set is obtained by querying the fund business answer knowledge base, the deposit business answer text set is obtained by querying the deposit business answer knowledge base, and the investment business answer text set is obtained by querying the investment business answer knowledge base, for a total of 3 sets of business answer text sets.

[0136] In the embodiment of the present invention, in order to filter out more accurate answers, the answer screening module 103 converts the answer text in the answer text set into an answer text vector, and converts the query text into a question text vector.

[0137] Preferably, the answer screening module 103 obtains the answer text vector by the following means:

[0138] Using a pre-trained word vector dictionary, obtain a word vector for each character contained in each answer text in the answer text set;

[0139] Calculate the arithmetic mean of the word vectors of all characters in each answer text as the answer text vector corresponding to each answer text.

[0140] Furthermore, the calculation formula of the arithmetic mean is as follows:

[0141]

[0142] Among them, a1 to a nRepresents the word vector of each character in each answer text, n represents the number of characters in the answer text, and W represents the answer text vector of the answer text.

[0143] Furthermore, the answer screening module 103 obtains the question text vector by the following means:

[0144] Get the dimension window of the preset size;

[0145] Inputting the query text into the dimension window to generate a dimension query text;

[0146] The dimension query text is encoded using a preset encoding algorithm to generate a question text vector.

[0147] For example, the dimensional window is a dimensional window of k*k, where k is a positive integer greater than or equal to 1.

[0148] Preferably, in this embodiment, the preset encoding algorithm may be a Huffman encoding algorithm.

[0149] Furthermore, the answer screening module 103 obtains the answer text to be selected by the following means:

[0150] Calculating the relevance value between the answer text vector and the question text vector, and summing up all relevance values ​​to obtain a relevance text set;

[0151] Sorting the relevance values ​​in the relevance text set to obtain the maximum relevance value;

[0152] The answer text vector corresponding to the maximum relevance value is selected from the answer text set, and the answer text corresponding to the selected answer text vector is used as the answer text to be selected corresponding to the answer text set.

[0153] In detail, the correlation value may be calculated using the following formula:

[0154]

[0155] Among them, x i is the answer text vector, i is a positive integer, y is the question text vector, sim(x i ,) is the correlation value between the answer text vector and the question text vector.

[0156] Furthermore, the answer screening module 103 collects the answer texts to be selected to obtain the answer text set to be selected.

[0157] In detail, in order to further screen the answers and ensure the accuracy of the answers, the answer screening module 103 of the embodiment of the present invention uses the question intention feature to perform weighted calculation and analysis on the answer texts in the answer text set by the following means, including:

[0158] Converting the question intention feature into a question intention feature vector;

[0159] Calculate the correlation value between the question intention feature vector and the answer text vector corresponding to each answer text to be selected, and obtain the correlation value of the answer text to be selected;

[0160] Calculate the total number of answer texts in the at least one set of answer texts;

[0161] Calculate the ratio of the number of answer texts in each of the at least one set of answer text sets to the total number of answer texts to obtain a weight for each set of answer text sets;

[0162] The answer text set weight corresponding to the answer text set where the answer text to be selected is located is multiplied by the answer text relevance corresponding to the answer text to be selected to obtain the answer text weight value to be selected, and the answer text weight values ​​to be selected are summarized to obtain the answer text weight value set to be selected;

[0163] The answer text corresponding to the maximum answer text weight value in the answer text weight value set is selected as the final answer text.

[0164] Furthermore, the answer screening module 103 of the embodiment of the present invention pushes the final answer text to the user, and obtains feedback information from the user on whether the user approves the final answer text, and updates the data in the knowledge base accordingly based on the feedback information, thereby realizing error correction processing on the knowledge base.

[0165] The entity extraction module 101 described in the embodiment of the present invention performs word segmentation and entity extraction processing on the query text, eliminating the influence of irrelevant words in the query text on subsequent answer queries; the semantic analysis module 102 performs semantic analysis on the query text to obtain question intent features, and the question intent features can be used to more accurately screen answers; the answer screening module 103 uses at least one pre-built answer knowledge base to query the question entity, making the question query more comprehensive and more accurate; the answer screening module 103 calculates and analyzes the relevance of the answer texts in the at least one group of answer text sets, and the answer screening module 103 uses the question intent features to perform weighted calculation and analysis on the candidate answer texts in the candidate answer text set to obtain the final answer text, thereby improving the accuracy of answer screening; the query text is queried in different business answer knowledge bases, and the answer is further screened using the question intent features, thereby improving the accuracy of intelligent question and answering.

[0166] like Figure 3 , which is a schematic diagram of the structure of an electronic device for implementing the intelligent question-answering method of the present invention.

[0167] The electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an intelligent question-answering program.

[0168] Among them, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 11 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of the intelligent question-answering program, etc., but also can be used to temporarily store data that has been output or is to be output.

[0169] The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules (such as intelligent question-answering programs, etc.) stored in the memory 11, and calls data stored in the memory 11 to execute various functions of the electronic device 1 and process data.

[0170] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.

[0171] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0172] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0173] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0174] Optionally, the electronic device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0175] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0176] The intelligent question-answering program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0177] Receive a query text input by a user, perform word segmentation and entity extraction on the query text, and obtain a question entity;

[0178] Performing semantic analysis on the query text based on a pre-built question semantic analysis model to obtain question intention features;

[0179] Using at least one pre-built answer knowledge base to query the question entity, obtaining at least one set of answer text sets;

[0180] Calculate and analyze the relevance of the answer texts in the at least one set of answer texts to obtain a set of answer texts to be selected;

[0181] The question intention feature is used to perform weighted calculation and analysis on the answer texts in the answer text set to obtain a final answer text, and the final answer text is pushed to the user.

[0182] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0183] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0184] Furthermore, the computer-usable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0185] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0186] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0187] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0188] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0189] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0190] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0191] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.

[0192] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. An intelligent question-answering method, characterized in that: The method comprises: Receive a query text input by a user, perform word segmentation and entity extraction on the query text, and obtain a question entity; Performing semantic analysis on the query text based on a pre-built question semantic analysis model to obtain question intention features; Using at least one pre-built answer knowledge base to query the question entity, obtaining at least one set of answer text sets; Calculate and analyze the relevance of the answer texts in the at least one set of answer texts to obtain a set of answer texts to be selected; Using the question intention feature, weighted calculation and analysis are performed on the answer texts in the answer text set to obtain a final answer text, and the final answer text is pushed to the user; The word segmentation processing of the query text includes: Field preset step: using a pre-built word segmentation dictionary to perform a word segmentation operation on the query text, wherein the number of characters contained in the largest word entry in the pre-built word segmentation dictionary is n, if the number of all characters in the query text is less than n, then the query text is used as a matching field, if the number of all characters in the query text is equal to or greater than n, then the first n characters of the query text are used as the matching field; Word segmentation matching step: using the matching field to perform traversal matching in the word segmentation dictionary; if the word segmentation dictionary contains the same words as the matching field, it is determined that the match is successful, the matching field is separated from the query text, and the following sequential matching step is performed; if the word segmentation dictionary does not contain the same words as the matching field, the following field update step is performed; Field update step: if the number of characters contained in the matching field is equal to 1, separate the matching field from the query text, and execute the following sequential matching step; if the number of characters contained in the matching field is greater than 1, remove the last character of the matching field, replace and update the matching field with the removed field, and return to the word segmentation matching step; Sequential matching step: if the number of characters after the matching field in the query text is less than n, the matching field is replaced and updated with all the characters after the matching field in the query text, and the word segmentation matching step is returned; if the number of characters after the matching field in the query text is not less than n, the matching field is replaced and updated with the n characters in sequence after the matching field of the query text, and the word segmentation matching step is returned; if the number of characters after the matching field of the query text is equal to 0, the word segmentation processing is stopped.

2. The intelligent question-answering method according to claim 1, characterized in that: The calculation and analysis of the relevance of the answer texts in the at least one set of answer text sets to obtain the answer text set to be selected comprises: Convert the answer text in the answer text set into an answer text vector; Convert the query text into a question text vector; Calculating the relevance value between the answer text vector and the question text vector, and summing up all relevance values ​​to obtain a relevance text set; Sorting the relevance values ​​in the relevance text set to obtain the maximum relevance value; Selecting the answer text vector corresponding to the maximum relevance value in the answer text set, and using the answer text corresponding to the selected answer text vector as the answer text to be selected corresponding to the answer text set; The answer texts to be selected are aggregated to obtain the answer text set to be selected.

3. The intelligent question-answering method according to claim 2, characterized in that: The step of using the question intention feature to perform weighted calculation and analysis on the answer texts in the answer text set to obtain the final answer text includes: Converting the question intention feature into a question intention feature vector; Calculate the correlation value between the question intention feature vector and the answer text vector corresponding to each answer text to be selected, and obtain the correlation value of the answer text to be selected; Calculate the total number of answer texts in the at least one set of answer texts; Calculate the ratio of the number of answer texts in each of the at least one set of answer text sets to the total number of answer texts to obtain a weight for each set of answer text sets; The answer text set weight corresponding to the answer text set where the answer text to be selected is located is multiplied by the answer text relevance corresponding to the answer text to be selected to obtain the answer text weight value; Summarizing the text weight values ​​of the answers to be selected to obtain a text weight value set of the answers to be selected; The answer text corresponding to the maximum answer text weight value in the answer text weight value set is selected as the final answer text.

4. The intelligent question-answering method according to claim 2, characterized in that: The step of converting the query text into a question text vector comprises: Get the dimension window of the preset size; Inputting the query text into the dimension window to generate a dimension query text; The dimension query text is encoded using a preset encoding algorithm to generate the question text vector.

5. The intelligent question-answering method according to claim 2, characterized in that: The step of converting the answer text in the answer text set into an answer text vector comprises: Using a pre-trained word vector dictionary, obtain a word vector for each character contained in each answer text in the answer text set; Calculate the arithmetic mean of the word vectors of all characters in each answer text as the answer text vector corresponding to each answer text.

6. An intelligent question-answering device, used to implement the intelligent question-answering method according to any one of claims 1 to 5, characterized in that: The device comprises: The entity extraction module is used to receive the query text input by the user, perform word segmentation and entity extraction on the query text, and obtain the question entity; A semantic analysis module, used to perform semantic analysis on the query text based on a pre-built question semantic analysis model to obtain question intention features; The answer screening module is used to use at least one pre-built answer knowledge base to query the question entity to obtain at least one set of answer texts; perform relevance calculation and analysis on the answer texts in the at least one set of answer texts to obtain a set of answer texts to be selected; use the question intention features to perform weighted calculation and analysis on the answer texts in the set of answer texts to obtain a final answer text, and push the final answer text to the user.

7. The intelligent question-answering device according to claim 6, characterized in that: The answer screening module calculates and analyzes the relevance of the answer texts in the at least one set of answer text sets by the following means to obtain a set of answer texts to be selected, including: Convert the answer text in the answer text set into an answer text vector; Convert the query text into a question text vector; Calculating the relevance value between the answer text vector and the question text vector, and summing up all relevance values ​​to obtain a relevance text set; Sorting the relevance values ​​in the relevance text set to obtain the maximum relevance value; Selecting the answer text vector corresponding to the maximum relevance value in the answer text set, and using the answer text corresponding to the selected answer text vector as the answer text to be selected corresponding to the answer text set; The answer texts to be selected are aggregated to obtain the answer text set to be selected.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the intelligent question and answer method as described in any one of claims 1 to 5.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the intelligent question-answering method as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Automatic question-answering system and method

    CN104598445A