WO2022252636A1 - Artificial intelligence-based answer generation method and apparatus, device, and storage medium - Google Patents

Artificial intelligence-based answer generation method and apparatus, device, and storage medium Download PDF

Info

Publication number
WO2022252636A1
WO2022252636A1 PCT/CN2022/072187 CN2022072187W WO2022252636A1 WO 2022252636 A1 WO2022252636 A1 WO 2022252636A1 CN 2022072187 W CN2022072187 W CN 2022072187W WO 2022252636 A1 WO2022252636 A1 WO 2022252636A1
Authority
WO
WIPO (PCT)
Prior art keywords
sentence
similar
answer
replied
difference
Prior art date
Application number
PCT/CN2022/072187
Other languages
French (fr)
Chinese (zh)
Inventor
舒畅
万欣茹
张梓键
陈又新
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022252636A1 publication Critical patent/WO2022252636A1/en

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
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • G06F40/35Discourse or dialogue representation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the field of artificial intelligence, and in particular to an artificial intelligence-based answer generation method, device, equipment, and storage medium.
  • the present application provides an artificial intelligence-based answer generation method, device, device, and storage medium, which realizes giving more relevant and accurate answers in the case of limited user question information.
  • the present application provides a method for generating an answer based on artificial intelligence, the method for generating an answer includes:
  • the present application also provides an artificial intelligence-based answer generating device, the answer generating device comprising:
  • the sentence receiving module is used to receive the sentence to be replied, and input the sentence to be replied into the retrieval model
  • a similar sentence acquisition module used to obtain the retrieval model to filter similar sentences matching the sentences to be replied from the preset dialogue corpus, and obtain the answer sentences of the similar sentences in the dialogue corpus;
  • the difference keyword extraction module is used to extract the difference keywords between the similar sentence and the sentence to be replied based on the preset semantic alignment keyword extraction model, and obtain the difference keyword set;
  • a similar keyword extraction module is used to extract similar keywords of the answer sentence to obtain a similar keyword set
  • An answer generating module configured to input the difference keyword set and the similar keyword set into the trained generative question answering model, and output an answer.
  • the present application also provides a computer device, the computer device includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and execute the The computer program realizes the answer generation method as described above.
  • the present application further provides a storage medium, the storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the above answer generation method.
  • the answer generation method, device, computer equipment and storage medium disclosed in this application retrieve similar sentences from the user's sentences to be replied through the retrieval model, and obtain the answer sentences of similar sentences, further extract difference keywords for similar sentences, and extract Similar keywords, the difference keywords and similar keywords are used as the input of the generative model, which adds input information to the generative model. In this way, it is possible to overcome the generation model that gives safe and meaningless answers due to the limited information contained in the user's questions, and achieve more relevant and accurate answers in the case of limited information in the user's questions.
  • Fig. 1 is a schematic flowchart of an answer generation method provided by an embodiment of the present application
  • Fig. 2 is a network schematic diagram of the answer generation method provided by the embodiment of the present application.
  • FIG. 3 is a schematic block diagram of an answer generation device provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural block diagram of a computer device involved in an embodiment of the present application.
  • Baidu’s Xiaodu artificial intelligence assistant and Microsoft’s dialogue system Xiaoice are all focused on realizing the business scenario of man-machine dialogue.
  • the former uses a retrieval method to recall the user’s expected answer, while the latter uses a deep learning model.
  • Automate answer generation based on user questions.
  • Question answering systems based on retrieval methods are mostly used in intelligent question answering systems in specific fields (such as Taobao platform robot customer service). Such methods usually maintain a dialogue data database that can be used for retrieval in advance, and use the user's input questions as questions. Then use the sentence similarity calculation to find the question sentence that is most similar to the user's question sentence, and then output the corresponding answer as a response.
  • the question-answer pairs in the database have passed strict screening, so the answers returned to users are fluent in language and clear in expression.
  • the final answer is often irrelevant to the subject and the words are not expressive.
  • Question answering systems based on generative methods mostly use standard question and answer pairs as training data, and use generative models in natural language processing (usually the Encoder-Decoder framework) to train question answering systems. This method can automatically generate questions of the same height as user questions. However, due to the limited information contained in the user's questions, the results of the generative question answering model may tend to be safe answers, such as "okay”, “um”, etc. It's pointless and a waste of time.
  • this application proposes an answer generation method that combines the retrieval method and the generative method.
  • the formula method can generate more relevant answers based on the user's sentence. Firstly, the user's sentence is retrieved based on the retrieval method, and the similar sentence matching the user's sentence and the corresponding answer are obtained. Then extract difference keywords for all similar sentences and user sentences, extract similar keywords for all replies, and use the obtained difference keywords and similar keywords as the input of the generative method, and the final answer is output by the generative model. In this way, it is possible to generate more accurate and relevant answers when the information provided by the user's statement is limited.
  • Embodiments of the present application provide an artificial intelligence-based answer generation method, device, device, and storage medium.
  • the method for generating an answer can be applied to a server, and can also be applied to a chip in a specific product, such as a chip in an artificial intelligence device.
  • the retrieval model is used to add input information to the generation model based on the sentences to be replied, so that the answer given by the user is more accurate and relevant when the information given by the user is limited.
  • the server may be an independent server or a server cluster.
  • FIG. 1 is a schematic flowchart of an artificial intelligence-based answer generation method provided by an embodiment of the present application.
  • the answer generation method can be applied to the server to obtain more relevant and accurate answers to the user's sentence.
  • the answer generation method specifically includes steps S101 to S105.
  • the sentences to be replied include question sentences or non-question sentences; they can be in the form of speech or text, and when the sentences to be replied are in speech form, they need to be converted into text form first to be input into the retrieval model.
  • the sentence to be replied and the sentence in the preset dialogue corpus are input into the retrieval model, and the Jaccard similarity coefficient for characterizing the similarity between the sentence in the preset dialogue corpus and the sentence to be replied is generated; Obtaining the similar sentences matched with the sentence to be replied based on the Jaccard similarity coefficient screened out from the preset dialogue corpus by the retrieval model; wherein, the similar sentence is similar to the Jaccard similarity coefficient of the sentence to be replied greater than the first preset threshold and less than the second preset threshold.
  • the retrieval model After the sentences to be replied and the sentences in the preset dialogue prediction library are input into the retrieval model, the retrieval model generates a text similarity between the sentences in the preset dialogue corpus and the sentences to be replied to represent the sentences Jaccard similarity coefficient (Jaccard Similarity coefficient), and then judge whether the sentence is a similar sentence of the sentence to be replied according to the Jaccard similarity coefficient.
  • Jaccard similarity coefficient Jaccard Similarity coefficient
  • the retrieval model screens out the sentences whose Jaccard similarity coefficient value is greater than the first preset threshold and smaller than the second preset threshold in the preset dialogue corpus and the sentence to be replied, and selects the Jaccard similarity from the filtered results according to the requirements.
  • the preset number with the highest coefficient value is used as the final output similar sentences, and then the corresponding answer sentences of these similar sentences in the preset dialogue prediction library are also obtained, and the similar sentences output by the retrieval model and the corresponding answer sentences are one by one Correspond to form a similar question and answer pair.
  • the retrieval model screens out sentences in the preset dialogue corpus that have a Jaccard similarity coefficient greater than 0.5 and smaller than 0.9 with the sentence to be replied, and selects 3 sentences with the highest Jaccard similarity coefficients as similar sentences to output.
  • first preset threshold, the second preset threshold, and the preset number can be set according to actual applications, which is not specifically limited in this application.
  • the retrieval model can also be used to evaluate the text similarity between sentences based on the cosine similarity, so as to match similar sentences similar to the sentence to be replied.
  • the cosine similarity is to evaluate the similarity of two sentence vectors by calculating the angle between the two sentence vectors.
  • the preset dialogue corpus is a pre-maintained database containing dialogue sentences, including both question and answer sentences and answer sentences corresponding to the question and answer sentences.
  • the dialogue corpus can be based on the requirements of the application scenario, and can be a dialogue corpus that collects general daily conversations, or a dialogue corpus that collects specific application scenarios.
  • This application proposes a Semantic Alignment Keyword Extraction (SAKE) model for keyword extraction.
  • the semantic alignment keyword extraction model is based on the use of cross-attention (Cross-Attention) to calculate the attention matrix representing deep semantics, and extract keywords based on the attention matrix.
  • Cross-attention Cross-attention
  • the sentence to be replied is converted into the first vector
  • the similar sentence is converted into the second vector
  • the attention matrix is calculated according to the first vector and the second vector; the minimum value of the attention matrix is obtained to obtain the similar sentence and the waiting vector
  • the difference keywords of the reply sentence; the difference keywords are combined to obtain the difference keyword set.
  • the text sentence is firstly one-hot encoded to become a sparse matrix, and then the embedding layer is randomly initialized, the sparse matrix is transformed into a dense matrix through linear transformation, and the mutually independent one-hot vectors become A relational vector that considers the internal connection between words is proposed.
  • the sentence vector can also be generated based on a neural network language model (Nerual Network Language Model, NNLM).
  • NNLM Neural Network Language Model
  • ⁇ A is the sentence to be replied converted into the first vector
  • ⁇ B is the similar sentence converted into the second vector
  • d k is the normalization coefficient
  • the difference keyword formula is as follows:
  • i represents the row
  • j represents the column
  • L is a predetermined hyperparameter
  • the sentence to be replied is: Which is better, wine or white wine? Assume that the similar sentences obtained through the retrieval model are: Similar sentence 1: Is liquor better than wine? Similar sentence 2: Is there any wine that tastes better than liquor?
  • the difference keywords between similar statement 1 and the statement to be replied are: “more”, “and” and "which”.
  • the difference keywords between the similar statement 2 and the statement to be replied are: "wine”, "and", "which”. Take the union of the difference keywords to get the difference keyword set: ["more", “and”, "which", “wine”].
  • the first answer sentence in the answer sentences is converted into a first answer vector
  • the other answer sentences in the answer sentences are converted into a second answer vector
  • an attention matrix is calculated according to the first answer vector and the second answer vector.
  • the first answer sentence is the answer sentence corresponding to the similar sentence with the highest matching degree with the sentence to be replied.
  • the answer sentence corresponding to the similar sentence that best matches the sentence to be replied is used as a reference answer sentence, and other answer sentences need to be aligned with the reference answer sentence. Therefore, the reference answer sentence is converted into the first answer vector, other answer sentences in the answer sentence are converted into the second answer vector, and the attention matrix between other answer sentences and the reference answer sentence is calculated in sequence. Calculate the maximum value of the attention matrix to obtain similar keywords between the first answer sentence and other answer sentences in the answer sentence.
  • the similar keyword formula is as follows:
  • i represents the row
  • j represents the column
  • L is a predetermined hyperparameter, which represents the row and the largest L rows, corresponding to the extracted similar keywords.
  • the answer statement 1 is “I personally don't like drinking alcohol”
  • the answer statement 2 is “depending on personal taste, I prefer white wine”.
  • the similar keywords of answer statement 2 and answer statement 1 are: “personal”, “like” and “wine”. Therefore, the similar keyword set is: ["individual”, “like” and “wine”].
  • the keyword extraction model based on semantic alignment proposed in this application uses the attention matrix for normalized accumulation, realizing the consideration of deep semantic correlation and cumulative semantic characteristics in keyword extraction, so that the extracted keywords are more accurate.
  • the generation model includes a trained first generation model and a trained second generation model.
  • both the first generation model and the second generation model are based on the pre-trained language model BERT (Bidirectional Encoder Representation from Transformers), but they are trained based on different model parameters and training strategies.
  • the BERT model no longer uses the traditional one-way language model or the method of shallow splicing two one-way language models for pre-training, but uses a new masked language model (masked language model, MLM) to generate a deep two-way language characterization.
  • MLM masked language model
  • the BERT model uses MLM to pre-train bidirectional Transformers to generate deep bidirectional language representations. After pre-training, only need to add an additional output layer for fine-tuning (fine-tune), can achieve high-level performance in a variety of downstream tasks, and does not require task-specific structural modifications to the BERT model.
  • the network structure of the first generation model is: the first BERT model followed by the first fully connected layer and Softmax.
  • the training objective of the first generation model is to output a predicted ordered word set based on a given unordered word set. Specifically, input the unordered keyword set into the first BERT model, output the enhanced semantic vector of the word through the transformer encoder, connect the first fully connected layer and Softmax layer after the first BERT model, and output the predicted ordered keywords set. It should be noted that during the training process of the first generative model, the parameters of the first BERT model are not fine-tuned, but the parameters of the first fully connected layer are adjusted to obtain the trained first generative model.
  • the network structure of the second generation model is: the second BERT model followed by the second fully connected layer and Softmax.
  • the training objective of the second generation model is to output a predicted complete sentence based on the ordered keyword set.
  • the second generative model is based on contextual information and semantic understanding. In the output sentence, words not included in the keyword set can be obtained through prediction, and some words included in the keyword set can also be ignored. It should be noted that during the training process of the second generation model, the parameters of the second BERT model and the second fully connected layer need to be fine-tuned to obtain a trained second generation model.
  • the unordered keyword set obtained by taking the union of the difference keyword set and the similar keyword set is input into the trained first generative model to generate an ordered keyword set, where the ordered keyword set is equivalent to Combine discrete words into an incomplete sentence.
  • the ordered keyword set is input into the trained second generation model, and the second generation model outputs a complete sentence based on the ordered keyword set.
  • the predicted answer is output through a two-stage generative model, in which the first generative model predicts the location information to obtain an ordered discrete word set, and the second stage predicts the final generated answer sentence based on the ordered discrete word set, making the generated result more fluent.
  • an embodiment of the present application provides a schematic block diagram of an answer generation device, and the answer generation device may be configured in a server.
  • the answer generation device 400 includes: a sentence receiving module 401 , a similar sentence obtaining module 402 , a difference keyword extraction module 403 , a similar keyword extraction module 404 , and an answer generation module 405 .
  • the sentence receiving module 401 is used to receive the sentence to be replied, and input the sentence to be replied into the retrieval model;
  • the similar sentence obtaining module 402 is configured to obtain the similar sentence matched with the sentence to be replied selected from the preset dialogue corpus by the retrieval model, and obtain the answer sentence of the similar sentence in the dialogue corpus.
  • the difference keyword extraction module 403 is configured to extract the difference keywords between the similar sentence and the sentence to be replied based on a preset semantic alignment keyword extraction model to obtain a difference keyword set.
  • the similar keyword extraction module 404 is configured to extract similar keywords of the answer sentence to obtain a similar keyword set.
  • the answer generation module 405 is configured to input the difference keyword set and the similar keyword set into the trained generation model, and output an answer.
  • the above-mentioned apparatus can be realized in the form of a computer program, and the computer program can be run on the computer device as shown in FIG. 4 .
  • FIG. 4 is a schematic structural block diagram of a computer device provided by an embodiment of the present application.
  • the computer device may be a server.
  • the computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory may include a storage medium and an internal memory.
  • the storage medium may store operating systems and computer programs.
  • the computer program includes program instructions which, when executed, cause a processor to perform any one of the answer generation methods.
  • the processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
  • the internal memory provides an environment for running the computer program in the storage medium.
  • the processor can execute any answer generating method.
  • This network interface is used for network communication, such as sending assigned tasks, etc.
  • Those skilled in the art can understand that the structure shown in Figure 4 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation on the computer equipment to which the solution of this application is applied.
  • the specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
  • the processor may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the processor is used to run a computer program stored in the memory to implement the following steps:
  • the processor when the processor acquires similar sentences that match the sentences to be replied and is screened out by the retrieval model from a preset dialogue corpus, it is used to realize:
  • the sentence to be replied and the sentence in the preset dialogue corpus are input into the retrieval model, and the Jaccard similarity coefficient for characterizing the similarity between the sentence in the preset dialogue corpus and the sentence to be replied is generated;
  • the processor when the processor realizes the keyword extraction model based on the preset semantic alignment, extracts the difference keywords between the similar sentence and the sentence to be replied, and obtains the difference keyword set, it is used to realize:
  • the difference keywords are combined to obtain a difference keyword set.
  • the processor when used to calculate the attention matrix, it is used to realize:
  • ⁇ A is that the sentence to be replied is converted into the first vector, and ⁇ B is converted into the second vector for the similar sentence, and d k is a normalization coefficient;
  • the difference keyword formula is as follows:
  • i represents the row
  • j represents the column
  • L is a predetermined hyperparameter, which means seeking row and the smallest L rows, corresponding to the extracted difference keywords.
  • the processor when used to extract similar keywords of the answer sentence to obtain a similar keyword set, it is used to realize:
  • the first answer sentence is the answer sentence corresponding to the similar sentence with the highest matching degree with the sentence to be replied;
  • i represents the row
  • j represents the column
  • L is a predetermined hyperparameter, which means seeking the row and the largest L rows, corresponding to the extracted similar keywords.
  • the trained generative model includes a trained first generative model and a trained second generative model
  • the processor is used to implement the difference keyword set and the similar key
  • the word set is input to the trained generation model, and when outputting the answer, it is used to realize:
  • the trained generation model is obtained based on the pre-trained language model BERT.
  • Embodiments of the present application also provide a storage medium, the storage medium stores a computer program, the computer program includes program instructions, and the processor executes the program instructions to implement any Item answer generation method.
  • the storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as a hard disk or a memory of the computer device.
  • the storage medium may also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, Flash card (Flash Card), etc.
  • the storage medium may be non-volatile or volatile.

Abstract

The present application relates to the field of artificial intelligence, and in particular, to an artificial intelligence-based answer generation method and apparatus, a device, and a storage medium, which enable a generation model to generate a more relevant and accurate answer when information of a sentence to be answered of a user is limited. The artificial intelligence-based answer generation method comprises: receiving a sentence to be answered, and inputting said sentence into a retrieval model; acquiring similar sentences screened out by the retrieval model from a preset dialogue corpus and matching said sentence, and acquiring answer sentences of the similar sentences in the dialogue corpus; on the basis of a preset semantic alignment keyword extraction model, extracting difference keywords between the similar sentences and said sentence to obtain a difference keyword set; extracting similar keywords of the answer sentences to obtain a similar keyword set; and inputting the difference keyword set and the similar keyword set into a trained generation model, and outputting an answer. By means of artificial intelligence-based natural language processing, a more relevant and accurate answer is given when the information of a question of a user is limited in an intelligent dialogue.

Description

基于人工智能的回答生成方法、装置、设备及存储介质Answer generating method, device, equipment and storage medium based on artificial intelligence
本申请要求于2021年6月1日提交中国专利局、申请号为202110609412.5、发明名称为“基于人工智能的回答生成方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the China Patent Office on June 1, 2021, with the application number 202110609412.5, and the title of the invention is "Answer generation method, device, equipment and storage medium based on artificial intelligence", the entire content of which Incorporated in this application by reference.
技术领域technical field
本申请涉及人工智能领域,尤其涉及一种基于人工智能的回答生成方法、装置、设备及存储介质。The present application relates to the field of artificial intelligence, and in particular to an artificial intelligence-based answer generation method, device, equipment, and storage medium.
背景技术Background technique
随着社交媒体的不断发展和人工智能技术的不断进步,智能对话系统在当前社会扮演了越来越重要的角色。以生成式方法为基础的问答系统多以标准的问答对作为训练数据,使用自然语言处理中的生成式模型(通常是Encoder-Decoder框架)训练得到回答结果。基于生成式模型的方法能自动化生成同用户问题高度相关的回答,发明人意识到由于用户的问句所含信息有限,因此生成式模型的结果可能倾向于安全回答,如“好的”、“嗯”等,这对使用人机对话系统的用户来说是没有意义且浪费时间的。With the continuous development of social media and the continuous advancement of artificial intelligence technology, intelligent dialogue systems play an increasingly important role in the current society. Question answering systems based on generative methods mostly use standard question-answer pairs as training data, and use generative models (usually the Encoder-Decoder framework) in natural language processing to train to obtain answer results. The method based on the generative model can automatically generate answers that are highly relevant to the user's questions. The inventors realized that due to the limited information contained in the user's questions, the results of the generative model may tend to be safe answers, such as "OK", " Hmm" and so on, this is meaningless and a waste of time for users of human-computer dialogue systems.
发明内容Contents of the invention
本申请提供了一种基于人工智能的回答生成方法、装置、设备及存储介质,将,实现了在用户问句信息有限的情况下,给出更相关更准确的回答。The present application provides an artificial intelligence-based answer generation method, device, device, and storage medium, which realizes giving more relevant and accurate answers in the case of limited user question information.
第一方面,本申请提供了一种基于人工智能的回答生成方法,所述回答生成方法包括:In a first aspect, the present application provides a method for generating an answer based on artificial intelligence, the method for generating an answer includes:
接收待回复语句,将所述待回复语句输入检索模型;receiving the sentence to be replied, and inputting the sentence to be replied into the retrieval model;
获取所述检索模型从预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句,并获取所述相似语句在所述对话语料库中的回答语句;Obtaining the similar sentences matched with the sentence to be replied selected by the retrieval model from the preset dialog corpus, and obtaining the answer sentence of the similar sentence in the dialog corpus;
基于预设的语义对齐关键词提取模型,提取所述相似语句与所述待回复语句的差异关键词,得到差异关键词集集;Based on the preset semantic alignment keyword extraction model, extract the difference keywords between the similar sentence and the sentence to be replied, and obtain the difference keyword set;
提取所述回答语句的相似关键词,得到相似关键词集;Extracting similar keywords of the answer sentence to obtain a similar keyword set;
将所述差异关键词集和所述相似关键词集输入训练好的生成模型,输出回答。Input the difference keyword set and the similar keyword set into the trained generation model, and output the answer.
第二方面,本申请还提供了一种基于人工智能的回答生成装置,所述回答生成装置包括:In a second aspect, the present application also provides an artificial intelligence-based answer generating device, the answer generating device comprising:
语句接收模块,用于接收待回复语句,并将所述待回复语句输入检索式模型;The sentence receiving module is used to receive the sentence to be replied, and input the sentence to be replied into the retrieval model;
相似语句获取模块,用于获取所述检索式模型从预设的对话语料库中筛选出与待回复语句匹配的相似语句,并获取所述相似语句在所述对话语料库中的回答语句;A similar sentence acquisition module, used to obtain the retrieval model to filter similar sentences matching the sentences to be replied from the preset dialogue corpus, and obtain the answer sentences of the similar sentences in the dialogue corpus;
差异关键词提取模块,用于基于预设的语义对齐关键词提取模型,提取所述相似语句与待回复语句的差异关键词,得到差异关键词集;The difference keyword extraction module is used to extract the difference keywords between the similar sentence and the sentence to be replied based on the preset semantic alignment keyword extraction model, and obtain the difference keyword set;
相似关键词提取模块,用于提取所述回答语句的相似关键词,得到相似关键词集;A similar keyword extraction module is used to extract similar keywords of the answer sentence to obtain a similar keyword set;
回答生成模块,用于将所述差异关键词集和所述相似关键词集输入训练好的生成式问答模型,输出回答。An answer generating module, configured to input the difference keyword set and the similar keyword set into the trained generative question answering model, and output an answer.
第三方面,本申请还提供了一种计算机设备,所述计算机设备包括存储器和处理器;所述存储器用于存储计算机程序;所述处理器,用于执行所述计算机程序并在执行所述计算机程序时实现如上述的回答生成方法。In a third aspect, the present application also provides a computer device, the computer device includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and execute the The computer program realizes the answer generation method as described above.
第四方面,本申请还提供了一种存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如上述的回答生成方法。In a fourth aspect, the present application further provides a storage medium, the storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the above answer generation method.
本申请公开的回答生成方法、装置、计算机设备及存储介质,通过检索模型对用户的待回复语句检索相似语句,并获取相似语句的回答语句,进一步对相似语句提取差异关键词,对回答语句提取相似关键词,将差异关键词与相似关键词作为生成模型的输入,为生成模型增加了输入的信息。从而能够克服因用户的问句所含信息有限而导致的生成模型给出安全且没有意义的回答,实现了在用户问句信息有限的情况下,给出更相关更准确的回答。The answer generation method, device, computer equipment and storage medium disclosed in this application retrieve similar sentences from the user's sentences to be replied through the retrieval model, and obtain the answer sentences of similar sentences, further extract difference keywords for similar sentences, and extract Similar keywords, the difference keywords and similar keywords are used as the input of the generative model, which adds input information to the generative model. In this way, it is possible to overcome the generation model that gives safe and meaningless answers due to the limited information contained in the user's questions, and achieve more relevant and accurate answers in the case of limited information in the user's questions.
附图说明Description of drawings
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present application more clearly, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application. Ordinary technicians can also obtain other drawings based on these drawings on the premise of not paying creative work.
图1是本申请的实施例提供的回答生成方法的示意流程图;Fig. 1 is a schematic flowchart of an answer generation method provided by an embodiment of the present application;
图2是本申请的实施例提供的回答生成方法的网络示意图;Fig. 2 is a network schematic diagram of the answer generation method provided by the embodiment of the present application;
图3为本申请的实施例提供的回答生成装置的示意性框图;FIG. 3 is a schematic block diagram of an answer generation device provided by an embodiment of the present application;
图4为本申请的实施例涉及的一种计算机设备的结构示意性框图。FIG. 4 is a schematic structural block diagram of a computer device involved in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flow charts shown in the drawings are just illustrations, and do not necessarily include all contents and operations/steps, nor must they be performed in the order described. For example, some operations/steps can be decomposed, combined or partly combined, so the actual order of execution may be changed according to the actual situation.
应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should be understood that the terms used in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit the application. As used in this specification and the appended claims, the singular forms "a", "an" and "the" are intended to include plural referents unless the context clearly dictates otherwise.
还应当进理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联 列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term "and/or" used in the description of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations .
随着社交媒体的不断发展和人工智能技术的不断进步,智能对话系统在当前社会扮演了越来越重要的角色。如百度推出的小度人工智能助手、微软公司的对话系统小冰都是着力于实现人机对话这一业务场景,前者使用检索式的方法来召回用户期望的回答,而后者是通过深度学习模型根据用户的问题实现自动化的回答生成。With the continuous development of social media and the continuous advancement of artificial intelligence technology, intelligent dialogue systems play an increasingly important role in the current society. For example, Baidu’s Xiaodu artificial intelligence assistant and Microsoft’s dialogue system Xiaoice are all focused on realizing the business scenario of man-machine dialogue. The former uses a retrieval method to recall the user’s expected answer, while the latter uses a deep learning model. Automate answer generation based on user questions.
以检索式方法为基础的问答系统多应用于特定领域的智能问答系统(如淘宝平台机器人客服),此类方法通常预先维护一个可用于检索的对话语料数据库,将用户的输入问题作为问句,随后利用句子相似性计算找到与用户问句最相似的问句,随后将其对应的回答作为响应输出。数据库中的问答对通过了严格的筛选,因此返还给用户的回答是语言流畅、表达清晰。但是由于数据库规模以及语句相似性匹配方法的限制,最终的回答常常是主题无关、词不达意的。Question answering systems based on retrieval methods are mostly used in intelligent question answering systems in specific fields (such as Taobao platform robot customer service). Such methods usually maintain a dialogue data database that can be used for retrieval in advance, and use the user's input questions as questions. Then use the sentence similarity calculation to find the question sentence that is most similar to the user's question sentence, and then output the corresponding answer as a response. The question-answer pairs in the database have passed strict screening, so the answers returned to users are fluent in language and clear in expression. However, due to the limitations of the database scale and the sentence similarity matching method, the final answer is often irrelevant to the subject and the words are not expressive.
以生成式方法为基础的问答系统多以标准的问答对作为训练数据,使用自然语言处理中的生成式模型(通常是Encoder-Decoder框架)训练得到问答系统,此方法能自动化生成同用户问题高度相关的回答,但是由于用户的问句所含信息有限,因此生成式问答模型的结果可能会倾向于安全回答,如“好的”、“嗯”等,这对使用人机对话系统的消费者来说是没有意义且浪费时间的。Question answering systems based on generative methods mostly use standard question and answer pairs as training data, and use generative models in natural language processing (usually the Encoder-Decoder framework) to train question answering systems. This method can automatically generate questions of the same height as user questions. However, due to the limited information contained in the user's questions, the results of the generative question answering model may tend to be safe answers, such as "okay", "um", etc. It's pointless and a waste of time.
基于现有智能对话系统存在的缺陷和不足,本申请提出了将检索式方法和生成式方法相结合的回答生成方法,通过检索式方法基于用户的语句增加生成式模型的输入信息,从而使生成式方法能够基于用户的语句生成更相关的回答。首先基于检索式方法对用户的语句进行检索,得到与用户的语句匹配的相似语句和相似语句所对应的答复。然后对所有相似语句和用户的语句提取差异关键词,对所有答复提取相似关键词,并将得到的差异关键词和相似关键词作为生成式方法的输入,由生成式模型输出最终的回答。从而实现在用户的语句所提供的信息有限的情况下,生成更准确更相关的回答。Based on the defects and deficiencies of existing intelligent dialogue systems, this application proposes an answer generation method that combines the retrieval method and the generative method. The formula method can generate more relevant answers based on the user's sentence. Firstly, the user's sentence is retrieved based on the retrieval method, and the similar sentence matching the user's sentence and the corresponding answer are obtained. Then extract difference keywords for all similar sentences and user sentences, extract similar keywords for all replies, and use the obtained difference keywords and similar keywords as the input of the generative method, and the final answer is output by the generative model. In this way, it is possible to generate more accurate and relevant answers when the information provided by the user's statement is limited.
本申请的实施例提供了一种基于人工智能的回答生成方法、装置、设备及存储介质。其中,该回答生成方法可以应用于服务器中,也可以应用于具体产品中的芯片,例如应用于人工智能设备中的芯片。利用检索模型基于待回复语句给生成模型增加输入的信息,实现了在用户给出的信息有限的情况下给出的回答更准确更相关。其中,该服务器可以为独立的服务器,也可以为服务器集群。Embodiments of the present application provide an artificial intelligence-based answer generation method, device, device, and storage medium. Wherein, the method for generating an answer can be applied to a server, and can also be applied to a chip in a specific product, such as a chip in an artificial intelligence device. The retrieval model is used to add input information to the generation model based on the sentences to be replied, so that the answer given by the user is more accurate and relevant when the information given by the user is limited. Wherein, the server may be an independent server or a server cluster.
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。Some implementations of the present application will be described in detail below in conjunction with the accompanying drawings. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other.
请参阅图1,图1是本申请的实施例提供的一种基于人工智能的回答生成方法示意流程图。该回答生成方法可应用于服务器中,以获得与用户的语句更相关更准确的回答。Please refer to FIG. 1 . FIG. 1 is a schematic flowchart of an artificial intelligence-based answer generation method provided by an embodiment of the present application. The answer generation method can be applied to the server to obtain more relevant and accurate answers to the user's sentence.
如图1所示,该回答生成方法具体包括步骤S101至步骤S105。As shown in FIG. 1 , the answer generation method specifically includes steps S101 to S105.
S101、接收待回复语句,将所述待回复语句输入检索模型。S101. Receive a sentence to be replied, and input the sentence to be replied into a retrieval model.
其中待回复语句包括问句或非问句;可以为语音形式或文本形式,当待回复语句为语音形式时,需先将其转换为文本形式,以输入检索模型。The sentences to be replied include question sentences or non-question sentences; they can be in the form of speech or text, and when the sentences to be replied are in speech form, they need to be converted into text form first to be input into the retrieval model.
S102、获取所述检索模型从预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句,并获取所述相似语句在所述对话语料库中的回答语句。S102. Obtain the similar sentences selected by the retrieval model from the preset dialog corpus that match the sentence to be replied, and obtain the answer sentences of the similar sentences in the dialog corpus.
将所述待回复语句和所述预设的对话语料库中的语句输入至所述检索模型中,生成用于表征所述预设的对话语料库中的语句与待回复语句相似度的Jaccard相似系数;获取所述检索模型基于所述Jaccard相似系数从所述预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句;其中,所述相似语句与所述待回复语句的Jaccard相似系数大于第一预设阈值,且小于第二预设阈值。The sentence to be replied and the sentence in the preset dialogue corpus are input into the retrieval model, and the Jaccard similarity coefficient for characterizing the similarity between the sentence in the preset dialogue corpus and the sentence to be replied is generated; Obtaining the similar sentences matched with the sentence to be replied based on the Jaccard similarity coefficient screened out from the preset dialogue corpus by the retrieval model; wherein, the similar sentence is similar to the Jaccard similarity coefficient of the sentence to be replied greater than the first preset threshold and less than the second preset threshold.
在一些实施例中,将待回复语句和预设的对话预料库中的语句输入检索模型后,检索模型对预设的对话语料库中的语句和该待回复语句生成表征语句之间的文本相似度的Jaccard相似系数(Jaccard Similarity coefficient),进而根据该Jaccard相似系数来判断语句是否为待回复语句的相似语句。语句之间的Jaccard相似系数值越高,代表语句之间具有更高的相似度,匹配度更高。检索模型将预设的对话语料库中与待回复语句的Jaccard相似系数值大于第一预设阈值,且小于第二预设阈值的语句筛选出来,并根据需求从这个筛选出来的结果中选取Jaccard相似系数值最高的预设数量个作为最终输出的相似语句,进而将这些相似语句在预设的对话预料库中对应的回答语句也获取出来,将检索模型输出的相似语句和对应的回答语句一一对应起来,组成相似问答对。In some embodiments, after the sentences to be replied and the sentences in the preset dialogue prediction library are input into the retrieval model, the retrieval model generates a text similarity between the sentences in the preset dialogue corpus and the sentences to be replied to represent the sentences Jaccard similarity coefficient (Jaccard Similarity coefficient), and then judge whether the sentence is a similar sentence of the sentence to be replied according to the Jaccard similarity coefficient. The higher the Jaccard similarity coefficient value between sentences, the higher the similarity between sentences and the higher the matching degree. The retrieval model screens out the sentences whose Jaccard similarity coefficient value is greater than the first preset threshold and smaller than the second preset threshold in the preset dialogue corpus and the sentence to be replied, and selects the Jaccard similarity from the filtered results according to the requirements. The preset number with the highest coefficient value is used as the final output similar sentences, and then the corresponding answer sentences of these similar sentences in the preset dialogue prediction library are also obtained, and the similar sentences output by the retrieval model and the corresponding answer sentences are one by one Correspond to form a similar question and answer pair.
示例性的,检索模型将预设的对话语料库中与待回复语句Jaccard相似系数大于0.5小于0.9的语句筛选出来,并从中选择3个Jaccard相似系数最高的语句作为相似语句输出。Exemplarily, the retrieval model screens out sentences in the preset dialogue corpus that have a Jaccard similarity coefficient greater than 0.5 and smaller than 0.9 with the sentence to be replied, and selects 3 sentences with the highest Jaccard similarity coefficients as similar sentences to output.
需要说明的是,第一预设阈值和第二预设阈值、以及预设数量可根据实际应用进行设置,本申请对此不做具体限定。It should be noted that the first preset threshold, the second preset threshold, and the preset number can be set according to actual applications, which is not specifically limited in this application.
在另一些实施例中,检索模型还可以用于基于cosine相似度来评价语句之间的文本相似度,从而匹配出与待回复语句相似的相似语句。cosine相似度是通过计算两个语句向量之间的夹角,来评价两个语句向量的相似度。In some other embodiments, the retrieval model can also be used to evaluate the text similarity between sentences based on the cosine similarity, so as to match similar sentences similar to the sentence to be replied. The cosine similarity is to evaluate the similarity of two sentence vectors by calculating the angle between the two sentence vectors.
需要说明的是,预设的对话语料库为预先维护的包含对话语句的数据库,既包括问答语句,也包括与问答语句相应的回答语句。该对话语料库可以根据应用场景的需求,可以为收录通用日常对话的对话语料,也可以为收录特定应用场景相关的对话语料。It should be noted that the preset dialogue corpus is a pre-maintained database containing dialogue sentences, including both question and answer sentences and answer sentences corresponding to the question and answer sentences. The dialogue corpus can be based on the requirements of the application scenario, and can be a dialogue corpus that collects general daily conversations, or a dialogue corpus that collects specific application scenarios.
S103、基于预设的语义对齐关键词提取模型,提取所述相似语句与所述待回复语句的差异关键词,得到差异关键词集。S103. Based on the preset semantic alignment keyword extraction model, extract the difference keywords between the similar sentence and the sentence to be replied, and obtain a difference keyword set.
本申请提出了语义对齐关键词提取模型(Semantic Alignment Keyword Extraction,SAKE)用于关键词的提取。该语义对齐关键词提取模型,基于利用跨越注意力(Cross-Attention)计算表征深层语义的注意力矩阵,并基于注意力矩阵来提取关键词。This application proposes a Semantic Alignment Keyword Extraction (SAKE) model for keyword extraction. The semantic alignment keyword extraction model is based on the use of cross-attention (Cross-Attention) to calculate the attention matrix representing deep semantics, and extract keywords based on the attention matrix.
具体的,将待回复语句转化为第一向量,将相似语句转化为第二向量,并根据第一向量和第二向量计算注意力矩阵;对注意力矩阵求极小值,得到相似语句与待回复语句的差异关键词;将差异关键词取并集,得到差异关键词集。Specifically, the sentence to be replied is converted into the first vector, the similar sentence is converted into the second vector, and the attention matrix is calculated according to the first vector and the second vector; the minimum value of the attention matrix is obtained to obtain the similar sentence and the waiting vector The difference keywords of the reply sentence; the difference keywords are combined to obtain the difference keyword set.
首先,需要将文本语句转化为向量形式,语句向量化的方法有很多种。First of all, the text sentence needs to be converted into a vector form, and there are many methods for sentence vectorization.
在一些实施例中,首先将文本语句进行one-hot编码,成为稀疏矩阵,然后通过随机初 始化embedding层,通过线性变换将该稀疏矩阵变成密集矩阵,并且让相互独立的one-hot向量变成了考虑词与词之间的内在联系的关系向量。In some embodiments, the text sentence is firstly one-hot encoded to become a sparse matrix, and then the embedding layer is randomly initialized, the sparse matrix is transformed into a dense matrix through linear transformation, and the mutually independent one-hot vectors become A relational vector that considers the internal connection between words is proposed.
在另一些实施例中,还可以基于神经网络语言模型(Nerual Network Language Model,NNLM)生成语句向量。In other embodiments, the sentence vector can also be generated based on a neural network language model (Nerual Network Language Model, NNLM).
需要说明的是:所有相似语句均需向待回复语句对齐,因此将待回复语句转化为第一向量,其他相似语句转化为第二向量,依次计算每个相似语句与待回复语句之间的注意力矩阵。其中,注意力矩阵表示为:It should be noted that all similar sentences need to be aligned to the sentences to be replied, so the sentences to be replied are converted into the first vector, and other similar sentences are converted into the second vector, and the attention between each similar sentence and the sentence to be replied is calculated in turn. force matrix. Among them, the attention matrix is expressed as:
Figure PCTCN2022072187-appb-000001
Figure PCTCN2022072187-appb-000001
其中,ν A为所述待回复语句转化为第一向量,ν B为所述相似语句转化为第二向量,d k为归一化系数。 Wherein, ν A is the sentence to be replied converted into the first vector, ν B is the similar sentence converted into the second vector, and d k is the normalization coefficient.
通过对注意力矩阵求极小值,可得到在待回复语句中存在但在相似语句中不存在的词,为两者之间的差异关键词。其中,所述差异关键词公式如下:By calculating the minimum value of the attention matrix, the words that exist in the sentence to be replied but not in the similar sentence can be obtained, which are the difference keywords between the two. Wherein, the difference keyword formula is as follows:
Figure PCTCN2022072187-appb-000002
Figure PCTCN2022072187-appb-000002
其中,i表示所在行,j表示所在列,L为预先确定的超参数,
Figure PCTCN2022072187-appb-000003
表示求行和最小的L个行,对应提取出的差异关键词。
Among them, i represents the row, j represents the column, L is a predetermined hyperparameter,
Figure PCTCN2022072187-appb-000003
Indicates the row and the smallest L rows, corresponding to the extracted difference keywords.
对所有相似语句与待回复语句的差异关键词取并集,即得到差异关键词集。Take the union of the difference keywords of all similar sentences and the sentences to be replied, and obtain the difference keyword set.
示例性的,例如,待回复语句为:葡萄酒和白酒哪个更好喝?假设通过检索模型得到的相似语句为:相似语句1:白酒是不是比葡萄酒好喝呢?相似语句2:有比白酒更好喝的酒吗?相似语句1与待回复语句的差异关键词为:“更”“和”“哪个”。相似语句2与待回复语句的差异关键词为:“葡萄酒”“和”,“哪个”。将差异关键词取并集,得到差异关键词集为:【“更”“和”“哪个”“葡萄酒”】。Exemplarily, for example, the sentence to be replied is: Which is better, wine or white wine? Assume that the similar sentences obtained through the retrieval model are: Similar sentence 1: Is liquor better than wine? Similar sentence 2: Is there any wine that tastes better than liquor? The difference keywords between similar statement 1 and the statement to be replied are: "more", "and" and "which". The difference keywords between the similar statement 2 and the statement to be replied are: "wine", "and", "which". Take the union of the difference keywords to get the difference keyword set: ["more", "and", "which", "wine"].
S104、提取所述回答语句的相似关键词,得到相似关键词集。S104. Extract similar keywords of the answer sentence to obtain a similar keyword set.
具体的,将回答语句中的第一回答语句转化为第一回答向量,将回答语句中的其他回答语句转化为第二回答向量,并根据第一回答向量和第二回答向量计算注意力矩阵。其中,第一回答语句为与待回复语句匹配度最高的相似语句所对应的回答语句。Specifically, the first answer sentence in the answer sentences is converted into a first answer vector, the other answer sentences in the answer sentences are converted into a second answer vector, and an attention matrix is calculated according to the first answer vector and the second answer vector. Wherein, the first answer sentence is the answer sentence corresponding to the similar sentence with the highest matching degree with the sentence to be replied.
需要说明的是:将与待回复语句最匹配的相似语句对应的回答语句作为参照回答语句,其他回答语句均需向该参照回答语句对齐。因此将该参照回答语句转化为第一回答向量,将回答语句中的其他回答语句转化为第二回答向量,依次计算其他回答语句与该参照回答语句之间的注意力矩阵。对注意力矩阵求极大值,得到第一回答语句与回答语句中的其他回答语句的相似关键词。其中,所述相似关键词公式如下:It should be noted that: the answer sentence corresponding to the similar sentence that best matches the sentence to be replied is used as a reference answer sentence, and other answer sentences need to be aligned with the reference answer sentence. Therefore, the reference answer sentence is converted into the first answer vector, other answer sentences in the answer sentence are converted into the second answer vector, and the attention matrix between other answer sentences and the reference answer sentence is calculated in sequence. Calculate the maximum value of the attention matrix to obtain similar keywords between the first answer sentence and other answer sentences in the answer sentence. Wherein, the similar keyword formula is as follows:
其中,所述相似关键词公式如下:Wherein, the similar keyword formula is as follows:
Figure PCTCN2022072187-appb-000004
Figure PCTCN2022072187-appb-000004
其中,i表示所在行,j表示所在列,L为预先确定的超参数,表示求行和最大的L个行,对应提取出的相似关键词。Among them, i represents the row, j represents the column, and L is a predetermined hyperparameter, which represents the row and the largest L rows, corresponding to the extracted similar keywords.
将参照回答语句之外的所有其他回答语句和参照回答语句取相似关键词,并对所有相似关键词取并集,得到相似关键词集。All other answer sentences other than the reference answer sentence and the reference answer sentence are used to obtain similar keywords, and all similar keywords are combined to obtain a similar keyword set.
示例性的,例如,回答语句1为“我个人是不喜欢喝酒的”,回答语句2为“看个人品味,我更喜欢白酒”。回答语句2与回答语句1的相似关键词为:“个人”“喜欢”“酒”。因此相似关键词集为:【“个人”“喜欢”“酒”】。Exemplarily, for example, the answer statement 1 is "I personally don't like drinking alcohol", and the answer statement 2 is "depending on personal taste, I prefer white wine". The similar keywords of answer statement 2 and answer statement 1 are: "personal", "like" and "wine". Therefore, the similar keyword set is: ["individual", "like" and "wine"].
本申请提出的基于语义对齐关键词提取模型,利用注意力矩阵进行规范化累加,实现了在关键词提取中考虑深层次的语义相关性和累积的语义特性,从而使提取的关键词更加准确。The keyword extraction model based on semantic alignment proposed in this application uses the attention matrix for normalized accumulation, realizing the consideration of deep semantic correlation and cumulative semantic characteristics in keyword extraction, so that the extracted keywords are more accurate.
S105、将所述差异关键词集和所述相似关键词集输入训练好的生成模型,输出回答。生成模型包括训练好的第一生成模型和训练好的第二生成模型。S105. Input the difference keyword set and the similar keyword set into the trained generation model, and output an answer. The generation model includes a trained first generation model and a trained second generation model.
具体的,将差异关键词集和相似关键词集输入训练好的第一生成模型,通过预测差异关键词集和相似关键词集中的词语在语句中的位置,输出有序的关键词序列;将有序的关键词序列输入训练好的第二生成模型,输出回答。Specifically, input the difference keyword set and the similar keyword set into the trained first generation model, and output an ordered keyword sequence by predicting the position of the words in the difference keyword set and the similar keyword set in the sentence; The ordered keyword sequence is input into the trained second generation model, and the answer is output.
在本申请提供的实施例中,第一生成模型和第二生成模型都基于预训练语言模型BERT(Bidirectional Encoder Representation from Transformers),但基于不同的模型参数及训练策略对两者进行训练。BERT模型不再采用传统的单向语言模型或者把两个单向语言模型进行浅层拼接的方法进行预训练,而是采用新的掩码语言模型(masked language model,MLM)生成深度的双向语言表征。BERT模型采用MLM对双向的Transformers进行预训练,以生成深层的双向语言表征。预训练后,只需要添加一个额外的输出层进行微调(fine-tune),就可以在各种各样的下游任务中取得高水准的表现,而且不需要对BERT模型进行特定任务的结构修改。In the embodiment provided in this application, both the first generation model and the second generation model are based on the pre-trained language model BERT (Bidirectional Encoder Representation from Transformers), but they are trained based on different model parameters and training strategies. The BERT model no longer uses the traditional one-way language model or the method of shallow splicing two one-way language models for pre-training, but uses a new masked language model (masked language model, MLM) to generate a deep two-way language characterization. The BERT model uses MLM to pre-train bidirectional Transformers to generate deep bidirectional language representations. After pre-training, only need to add an additional output layer for fine-tuning (fine-tune), can achieve high-level performance in a variety of downstream tasks, and does not require task-specific structural modifications to the BERT model.
在本申请提供的实施例中,第一生成模型的网络结构为:第一BERT模型后接第一全连接层和Softmax。第一生成模型的训练目标是基于给定的无序词集,输出预测的有序词集。具体的,将无序的关键词集输入第一BERT模型,通过transformer encoder输出词语的增强语义向量,在第一BERT模型后接第一全连接层和Softmax层,输出预测的有序的关键词集。需要说明的是,在第一生成模型的训练过程中,不对第一BERT模型的参数进行微调,而是通过调整第一全连接层的参数来得到训练好的第一生成模型。In the embodiment provided in this application, the network structure of the first generation model is: the first BERT model followed by the first fully connected layer and Softmax. The training objective of the first generation model is to output a predicted ordered word set based on a given unordered word set. Specifically, input the unordered keyword set into the first BERT model, output the enhanced semantic vector of the word through the transformer encoder, connect the first fully connected layer and Softmax layer after the first BERT model, and output the predicted ordered keywords set. It should be noted that during the training process of the first generative model, the parameters of the first BERT model are not fine-tuned, but the parameters of the first fully connected layer are adjusted to obtain the trained first generative model.
在本申请提供的实施例中,第二生成模型的网络结构为:第二BERT模型后接第二全连接层和Softmax。第二生成模型的训练目标是基于有序的关键词集,输出预测的完整语句。第二生成模型基于上下文信息和语义的理解,在输出的语句中,可以通过预测得到关键词集中不包含的词语,也可以忽略一部分关键词集中包含的词语。需要说明的是,在第二生成模型的训练过程中,需对第二BERT模型的和第二全连接层的参数进行微调,来得到训练好的第二生成模型。In the embodiment provided in this application, the network structure of the second generation model is: the second BERT model followed by the second fully connected layer and Softmax. The training objective of the second generation model is to output a predicted complete sentence based on the ordered keyword set. The second generative model is based on contextual information and semantic understanding. In the output sentence, words not included in the keyword set can be obtained through prediction, and some words included in the keyword set can also be ignored. It should be noted that during the training process of the second generation model, the parameters of the second BERT model and the second fully connected layer need to be fine-tuned to obtain a trained second generation model.
首先,将差异关键词集和相似关键词集取并集得到的无序的关键词集输入训练好的第一生成模型,生成有序的关键词集,这里的有序的关键词集相当于将离散的词语组合成了一个 不完整的语句。其次,将该有序的关键词集输入训练好的第二生成模型,第二生成模型基于该有序的关键词集输出完整的语句。First, the unordered keyword set obtained by taking the union of the difference keyword set and the similar keyword set is input into the trained first generative model to generate an ordered keyword set, where the ordered keyword set is equivalent to Combine discrete words into an incomplete sentence. Secondly, the ordered keyword set is input into the trained second generation model, and the second generation model outputs a complete sentence based on the ordered keyword set.
通过两级生成模型输出预测的回答,其中第一生成模型预测位置信息得到有序的离散词集,第二阶段根据有序的离散词集预测最终生成的回答语句,使得生成的结果更加流畅。The predicted answer is output through a two-stage generative model, in which the first generative model predicts the location information to obtain an ordered discrete word set, and the second stage predicts the final generated answer sentence based on the ordered discrete word set, making the generated result more fluent.
本申请提供的回答生成方法,首先基于检索模型对用户的待回复语句检索相似语句,并获取相似语句的回答语句,进一步对相似语句提取差异关键词,对回答语句提取相似关键词,将差异关键词与相似关键词作为生成模型的输入,为生成模型增加了输入的信息。从而能够克服因用户的问句所含信息有限而导致的生成模型给出安全且没有意义的回答,实现了在用户问句信息有限的情况下,给出更相关更准确回答的结果。In the answer generation method provided by this application, firstly, based on the retrieval model, similar sentences are retrieved for the user's waiting sentences, and the answer sentences of the similar sentences are obtained, and the difference keywords are further extracted for the similar sentences, similar keywords are extracted for the answer sentences, and the difference keywords are extracted. Words and similar keywords are used as the input of the generative model, which adds input information to the generative model. In this way, it is possible to overcome the problem that the generative model gives safe and meaningless answers due to the limited information contained in the user's questions, and realize the result of giving more relevant and accurate answers in the case of limited information in the user's questions.
请参阅图3,本申请的实施例提供一种回答生成装置的示意性框图,该回答生成装置可以配置于服务器。Referring to FIG. 3 , an embodiment of the present application provides a schematic block diagram of an answer generation device, and the answer generation device may be configured in a server.
如图3所示,该回答生成装置400包括:语句接收模块401、相似语句获取模块402、差异关键词提取模块403、相似关键词提取模块404、回答生成模块405。As shown in FIG. 3 , the answer generation device 400 includes: a sentence receiving module 401 , a similar sentence obtaining module 402 , a difference keyword extraction module 403 , a similar keyword extraction module 404 , and an answer generation module 405 .
语句接收模块401,用于接收待回复语句,将所述待回复语句输入检索模型;The sentence receiving module 401 is used to receive the sentence to be replied, and input the sentence to be replied into the retrieval model;
相似语句获取模块402,用于获取所述检索模型从预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句,并获取所述相似语句在所述对话语料库中的回答语句。The similar sentence obtaining module 402 is configured to obtain the similar sentence matched with the sentence to be replied selected from the preset dialogue corpus by the retrieval model, and obtain the answer sentence of the similar sentence in the dialogue corpus.
差异关键词提取模块403,用于基于预设的语义对齐关键词提取模型,提取所述相似语句与所述待回复语句的差异关键词,得到差异关键词集。The difference keyword extraction module 403 is configured to extract the difference keywords between the similar sentence and the sentence to be replied based on a preset semantic alignment keyword extraction model to obtain a difference keyword set.
相似关键词提取模块404,用于提取所述回答语句的相似关键词,得到相似关键词集。The similar keyword extraction module 404 is configured to extract similar keywords of the answer sentence to obtain a similar keyword set.
回答生成模块405,用于将所述差异关键词集和所述相似关键词集输入训练好的生成模型,输出回答。The answer generation module 405 is configured to input the difference keyword set and the similar keyword set into the trained generation model, and output an answer.
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和各模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described device and each module can refer to the corresponding process in the foregoing method embodiment, which is not repeated here. repeat.
上述的装置可以实现为一种计算机程序的形式,该计算机程序可以在如图4所示的计算机设备上运行。The above-mentioned apparatus can be realized in the form of a computer program, and the computer program can be run on the computer device as shown in FIG. 4 .
请参阅图4,图4是本申请的实施例提供的一种计算机设备的结构示意性框图。该计算机设备可以是服务器。Referring to FIG. 4 , FIG. 4 is a schematic structural block diagram of a computer device provided by an embodiment of the present application. The computer device may be a server.
参阅图4,该计算机设备包括通过系统总线连接的处理器、存储器和网络接口,其中,存储器可以包括存储介质和内存储器。Referring to FIG. 4 , the computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory may include a storage medium and an internal memory.
存储介质可存储操作系统和计算机程序。该计算机程序包括程序指令,该程序指令被执行时,可使得处理器执行任意一种回答生成方法。The storage medium may store operating systems and computer programs. The computer program includes program instructions which, when executed, cause a processor to perform any one of the answer generation methods.
处理器用于提供计算和控制能力,支撑整个计算机设备的运行。The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
内存储器为存储介质中的计算机程序的运行提供环境,该计算机程序被处理器执行时,可使得处理器执行任意一种回答生成方法。The internal memory provides an environment for running the computer program in the storage medium. When the computer program is executed by the processor, the processor can execute any answer generating method.
该网络接口用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图4 中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。This network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that the structure shown in Figure 4 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation on the computer equipment to which the solution of this application is applied. The specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
应当理解的是,处理器可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that the processor may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Wherein, the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
其中,在一个实施例中,所述处理器用于运行存储在存储器中的计算机程序,以实现如下步骤:Wherein, in one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
接收待回复语句,将所述待回复语句输入检索模型;receiving the sentence to be replied, and inputting the sentence to be replied into the retrieval model;
获取所述检索模型从预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句,并获取所述相似语句在所述对话语料库中的回答语句;Obtaining the similar sentences matched with the sentence to be replied selected by the retrieval model from the preset dialog corpus, and obtaining the answer sentence of the similar sentence in the dialog corpus;
基于预设的语义对齐关键词提取模型对所述相似语句与所述待回复语句提取差异关键词,得到差异关键词集;Extracting difference keywords from the similar sentence and the sentence to be replied based on a preset semantic alignment keyword extraction model to obtain a difference keyword set;
对所述回答语句提取相似关键词,得到相似关键词集;Extracting similar keywords to the answer sentence to obtain a similar keyword set;
将所述差异关键词集和所述相似关键词集输入训练好的生成模型,输出回答。Input the difference keyword set and the similar keyword set into the trained generation model, and output the answer.
在一个实施例中,所述处理器在实现获取所述检索模型从预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句时,用于实现:In one embodiment, when the processor acquires similar sentences that match the sentences to be replied and is screened out by the retrieval model from a preset dialogue corpus, it is used to realize:
将所述待回复语句和所述预设的对话语料库中的语句输入至所述检索模型中,生成用于表征所述预设的对话语料库中的语句与待回复语句相似度的Jaccard相似系数;The sentence to be replied and the sentence in the preset dialogue corpus are input into the retrieval model, and the Jaccard similarity coefficient for characterizing the similarity between the sentence in the preset dialogue corpus and the sentence to be replied is generated;
获取所述检索模型基于所述Jaccard相似系数从所述预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句;其中,所述相似语句与所述待回复语句的Jaccard相似系数大于第一预设阈值,且小于第二预设阈值。Obtaining the similar sentences matched with the sentence to be replied based on the Jaccard similarity coefficient screened out from the preset dialogue corpus by the retrieval model; wherein, the similar sentence is similar to the Jaccard similarity coefficient of the sentence to be replied greater than the first preset threshold and less than the second preset threshold.
在一个实施例中,所述处理器在实现基于预设的语义对齐关键词提取模型,提取所述相似语句与所述待回复语句的差异关键词,得到差异关键词集时,用于实现:In one embodiment, when the processor realizes the keyword extraction model based on the preset semantic alignment, extracts the difference keywords between the similar sentence and the sentence to be replied, and obtains the difference keyword set, it is used to realize:
将所述待回复语句转化为第一向量,将相似语句转化为第二向量,并根据所述第一向量和第二向量计算注意力矩阵;Converting the sentence to be replied into a first vector, converting a similar sentence into a second vector, and calculating an attention matrix according to the first vector and the second vector;
对所述注意力矩阵求极小值,得到相似语句与待回复语句的差异关键词;Find the minimum value to described attention matrix, obtain the difference keyword of similar sentence and sentence to be replied;
将所述差异关键词取并集,得到差异关键词集。The difference keywords are combined to obtain a difference keyword set.
在一个实施例中,所述处理器在用于计算注意力矩阵时,用于实现:In one embodiment, when the processor is used to calculate the attention matrix, it is used to realize:
Figure PCTCN2022072187-appb-000005
Figure PCTCN2022072187-appb-000005
其中,ν A为所述待回复语句转化为第一向量,ν B为所述相似语句转化为第二向量,d k为归一化系数; Wherein, ν A is that the sentence to be replied is converted into the first vector, and ν B is converted into the second vector for the similar sentence, and d k is a normalization coefficient;
所述差异关键词公式如下:The difference keyword formula is as follows:
Figure PCTCN2022072187-appb-000006
Figure PCTCN2022072187-appb-000006
其中,i表示所在行,j表示所在列,L为预先确定的超参数,表示求
Figure PCTCN2022072187-appb-000007
行和最小的L个行,对应提取出的差异关键词。
Among them, i represents the row, j represents the column, and L is a predetermined hyperparameter, which means seeking
Figure PCTCN2022072187-appb-000007
row and the smallest L rows, corresponding to the extracted difference keywords.
在一个实施例中,所述处理器在用于提取所述回答语句的相似关键词,得到相似关键词集时,用于实现:In one embodiment, when the processor is used to extract similar keywords of the answer sentence to obtain a similar keyword set, it is used to realize:
将所述回答语句的第一回答语句转化为第一回答向量,将所述回答语句中的其他回答语句转化为第二回答向量,并根据所述第一回答向量和第二回答向量计算注意力矩阵;其中,所述第一回答语句为与所述待回复语句匹配度最高的相似语句所对应的回答语句;Convert the first answer sentence of the answer sentence into a first answer vector, convert other answer sentences in the answer sentence into a second answer vector, and calculate attention according to the first answer vector and the second answer vector A matrix; wherein, the first answer sentence is the answer sentence corresponding to the similar sentence with the highest matching degree with the sentence to be replied;
对所述注意力矩阵求极大值,得到所述第一回答语句与所述回答语句中的其他回答语句的相似关键词;Finding the maximum value of the attention matrix to obtain similar keywords between the first answer sentence and other answer sentences in the answer sentence;
将所有相似关键词取并集,得到相似关键词集;Take the union of all similar keywords to obtain a similar keyword set;
其中,所述相似关键词公式如下:Wherein, the similar keyword formula is as follows:
Figure PCTCN2022072187-appb-000008
Figure PCTCN2022072187-appb-000008
其中,i表示所在行,j表示所在列,L为预先确定的超参数,表示求行
Figure PCTCN2022072187-appb-000009
和最大的L个行,对应提取出的相似关键词。
Among them, i represents the row, j represents the column, and L is a predetermined hyperparameter, which means seeking the row
Figure PCTCN2022072187-appb-000009
and the largest L rows, corresponding to the extracted similar keywords.
在一个实施例中,所述训练好的生成模型包括训练好的第一生成模型和训练好的第二生成模型,所述处理器在用于实现将所述差异关键词集和所述相似关键词集输入训练好的生成模型,输出回答时,用于实现:In one embodiment, the trained generative model includes a trained first generative model and a trained second generative model, and the processor is used to implement the difference keyword set and the similar key The word set is input to the trained generation model, and when outputting the answer, it is used to realize:
将所述差异关键词集和所述相似关键词集输入所述训练好的第一生成模型,通过预测所述差异关键词集和相似关键词集中的词语在语句中的位置,输出有序的关键词序列;Input the difference keyword set and the similar keyword set into the trained first generation model, and output ordered keyword sequence;
将所述有序的关键词序列输入所述训练好的第二生成模型,输出回答。Input the ordered keyword sequence into the trained second generation model, and output an answer.
所述训练好的生成模型基于预训练语言模型BERT得到的。The trained generation model is obtained based on the pre-trained language model BERT.
本申请的实施例中还提供一种存储介质,所述存储介质存储有计算机程序,所述计算机程序中包括程序指令,所述处理器执行所述程序指令,实现本申请实施例提供的任一项回答生成方法。Embodiments of the present application also provide a storage medium, the storage medium stores a computer program, the computer program includes program instructions, and the processor executes the program instructions to implement any Item answer generation method.
其中,所述存储介质可以是前述实施例所述的计算机设备的内部存储单元,例如所述计算机设备的硬盘或内存。所述存储介质也可以是所述计算机设备的外部存储设备,例如所述计算机设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。所述存储介质可以是非易失性,也可以是易失性。Wherein, the storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as a hard disk or a memory of the computer device. The storage medium may also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, Flash card (Flash Card), etc. The storage medium may be non-volatile or volatile.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉 本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the application, but the scope of protection of the application is not limited thereto. Any person familiar with the technical field can easily think of various equivalents within the scope of the technology disclosed in the application. Modifications or replacements, these modifications or replacements shall be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims (20)

  1. 一种基于人工智能的回答生成方法,其中,包括:A method for generating answers based on artificial intelligence, including:
    接收待回复语句,将所述待回复语句输入检索模型;receiving the sentence to be replied, and inputting the sentence to be replied into the retrieval model;
    获取所述检索模型从预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句,并获取所述相似语句在所述对话语料库中的回答语句;Obtaining the similar sentences matched with the sentence to be replied selected by the retrieval model from the preset dialog corpus, and obtaining the answer sentence of the similar sentence in the dialog corpus;
    基于预设的语义对齐关键词提取模型,提取所述相似语句与所述待回复语句的差异关键词,得到差异关键词集;Based on the preset semantic alignment keyword extraction model, extract the difference keywords between the similar sentence and the sentence to be replied, and obtain the difference keyword set;
    提取所述回答语句的相似关键词,得到相似关键词集;Extracting similar keywords of the answer sentence to obtain a similar keyword set;
    将所述差异关键词集和所述相似关键词集输入训练好的生成模型,输出回答。Input the difference keyword set and the similar keyword set into the trained generation model, and output the answer.
  2. 根据权利要求1所述的回答生成方法,其中,所述获取所述检索模型从预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句,包括:The answer generating method according to claim 1, wherein said acquiring similar sentences matched with said sentences to be replied from a preset dialogue corpus screened by said retrieval model comprises:
    将所述待回复语句和所述预设的对话语料库中的语句输入至所述检索模型中,生成用于表征所述预设的对话语料库中的语句与待回复语句相似度的Jaccard相似系数;The sentence to be replied and the sentence in the preset dialogue corpus are input into the retrieval model, and the Jaccard similarity coefficient for characterizing the similarity between the sentence in the preset dialogue corpus and the sentence to be replied is generated;
    获取所述检索模型基于所述Jaccard相似系数从所述预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句;Obtaining the similar sentences matched with the sentence to be replied selected from the preset dialogue corpus based on the Jaccard similarity coefficient by the retrieval model;
    其中,所述相似语句与所述待回复语句的Jaccard相似系数大于第一预设阈值,且小于第二预设阈值。Wherein, the Jaccard similarity coefficient between the similar sentence and the sentence to be replied is greater than a first preset threshold and smaller than a second preset threshold.
  3. 根据权利要求1所述的回答生成方法,其中,所述基于预设的语义对齐关键词提取模型,提取所述相似语句与所述待回复语句的差异关键词,得到差异关键词集包括:The answer generation method according to claim 1, wherein the keyword extraction model based on the preset semantic alignment extracts the difference keywords between the similar sentence and the sentence to be replied, and obtains the difference keyword set comprising:
    将所述待回复语句转化为第一向量,将相似语句转化为第二向量,并根据所述第一向量和第二向量计算注意力矩阵;Converting the sentence to be replied into a first vector, converting a similar sentence into a second vector, and calculating an attention matrix according to the first vector and the second vector;
    对所述注意力矩阵求极小值,得到相似语句与待回复语句的差异关键词;Find the minimum value to described attention matrix, obtain the difference keyword of similar sentence and sentence to be replied;
    将所述差异关键词取并集,得到差异关键词集。The difference keywords are combined to obtain a difference keyword set.
  4. 根据权利要求3所述的回答生成方法,其中,所述注意力矩阵表示为:The answer generation method according to claim 3, wherein the attention matrix is expressed as:
    Figure PCTCN2022072187-appb-100001
    Figure PCTCN2022072187-appb-100001
    其中,ν A为所述待回复语句转化的第一向量,ν B为所述相似语句转化的第二向量,d k为归一化系数; Wherein, ν A is the first vector converted from the sentence to be replied, and ν B is the second vector converted from the similar sentence, and d k is a normalization coefficient;
    所述差异关键词公式如下:The difference keyword formula is as follows:
    Figure PCTCN2022072187-appb-100002
    Figure PCTCN2022072187-appb-100002
    其中,i表示所在行,j表示所在列,L为预先确定的超参数,
    Figure PCTCN2022072187-appb-100003
    表示求行和最小的L个行,对应提取出的差异关键词。
    Among them, i represents the row, j represents the column, L is a predetermined hyperparameter,
    Figure PCTCN2022072187-appb-100003
    Indicates the row and the smallest L rows, corresponding to the extracted difference keywords.
  5. 根据权利要求4所述的回答生成方法,其中,所述提取所述回答语句的相似关键词, 得到相似关键词集包括:The answer generating method according to claim 4, wherein said extracting similar keywords of said answer sentence, and obtaining a similar keyword set includes:
    将所述回答语句的第一回答语句转化为第一回答向量,将所述回答语句中的其他回答语句转化为第二回答向量,并根据所述第一回答向量和第二回答向量计算注意力矩阵;其中,所述第一回答语句为与所述待回复语句匹配度最高的相似语句所对应的回答语句;Convert the first answer sentence of the answer sentence into a first answer vector, convert other answer sentences in the answer sentence into a second answer vector, and calculate attention according to the first answer vector and the second answer vector A matrix; wherein, the first answer sentence is the answer sentence corresponding to the similar sentence with the highest matching degree with the sentence to be replied;
    对所述注意力矩阵求极大值,得到所述第一回答语句与所述回答语句中的其他回答语句的相似关键词;Finding the maximum value of the attention matrix to obtain similar keywords between the first answer sentence and other answer sentences in the answer sentence;
    将所有相似关键词取并集,得到相似关键词集;Take the union of all similar keywords to obtain a similar keyword set;
    其中,所述相似关键词公式如下:Wherein, the similar keyword formula is as follows:
    Figure PCTCN2022072187-appb-100004
    Figure PCTCN2022072187-appb-100004
    其中,i表示所在行,j表示所在列,L为预先确定的超参数,
    Figure PCTCN2022072187-appb-100005
    表示求行和最大的L个行,对应提取出的相似关键词。
    Among them, i represents the row, j represents the column, L is a predetermined hyperparameter,
    Figure PCTCN2022072187-appb-100005
    Indicates the row and the largest L rows, corresponding to the extracted similar keywords.
  6. 根据权利要求1所述的回答生成方法,其中,所述训练好的生成模型包括训练好的第一生成模型和训练好的第二生成模型;The answer generation method according to claim 1, wherein the trained generation model includes a trained first generation model and a trained second generation model;
    所述将所述差异关键词集和所述相似关键词集输入训练好的生成模型,输出回答,包括:The step of inputting the difference keyword set and the similar keyword set into the trained generation model, and outputting an answer includes:
    将所述差异关键词集和所述相似关键词集输入所述训练好的第一生成模型,通过预测所述差异关键词集和相似关键词集中的词语在语句中的位置,输出有序的关键词序列;Input the difference keyword set and the similar keyword set into the trained first generation model, and output ordered keyword sequence;
    将所述有序的关键词序列输入所述训练好的第二生成模型,输出回答。Input the ordered keyword sequence into the trained second generation model, and output an answer.
  7. 根据权利要求6所述的回答生成方法,其中,所述训练好的生成模型是基于预训练语言模型BERT得到的。The answer generation method according to claim 6, wherein the trained generation model is obtained based on a pre-trained language model BERT.
  8. 一种基于人工智能的回答生成装置,其中,所述装置包括:A device for generating answers based on artificial intelligence, wherein the device includes:
    语句接收模块,用于接收待回复语句,将所述待回复语句输入检索模型;The sentence receiving module is used to receive the sentence to be replied, and input the sentence to be replied into the retrieval model;
    相似语句获取模块,用于获取所述检索模型从预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句,并获取所述相似语句在所述对话语料库中的回答语句;A similar statement acquiring module, configured to acquire the similar statements matched with the statement to be replied selected by the retrieval model from the preset dialogue corpus, and acquire the answer statement of the similar statement in the dialogue corpus;
    差异关键词提取模块,用于基于预设的语义对齐关键词提取模型,提取所述相似语句与所述待回复语句的差异关键词,得到差异关键词集;The difference keyword extraction module is used to extract the difference keywords between the similar sentence and the sentence to be replied based on the preset semantic alignment keyword extraction model, and obtain the difference keyword set;
    相似关键词提取模块,用于提取所述回答语句的相似关键词,得到相似关键词集;A similar keyword extraction module is used to extract similar keywords of the answer sentence to obtain a similar keyword set;
    回答生成模块,用于将所述差异关键词集和所述相似关键词集输入训练好的生成模型,输出回答。An answer generation module, configured to input the difference keyword set and the similar keyword set into a trained generation model, and output an answer.
  9. 一种计算机设备,其中,所述计算机设备包括存储器和处理器;A computer device, wherein the computer device includes a memory and a processor;
    所述存储器用于存储计算机程序;The memory is used to store computer programs;
    所述处理器,用于执行所述计算机程序并在执行所述计算机程序时实现如下步骤:接收待回复语句,将所述待回复语句输入检索模型;The processor is configured to execute the computer program and implement the following steps when executing the computer program: receiving a sentence to be replied, and inputting the sentence to be replied into a retrieval model;
    获取所述检索模型从预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句,并获取所述相似语句在所述对话语料库中的回答语句;Obtaining the similar sentences matched with the sentence to be replied selected by the retrieval model from the preset dialog corpus, and obtaining the answer sentence of the similar sentence in the dialog corpus;
    基于预设的语义对齐关键词提取模型,提取所述相似语句与所述待回复语句的差异关键词,得到差异关键词集;Based on the preset semantic alignment keyword extraction model, extract the difference keywords between the similar sentence and the sentence to be replied, and obtain the difference keyword set;
    提取所述回答语句的相似关键词,得到相似关键词集;Extracting similar keywords of the answer sentence to obtain a similar keyword set;
    将所述差异关键词集和所述相似关键词集输入训练好的生成模型,输出回答。Input the difference keyword set and the similar keyword set into the trained generation model, and output the answer.
  10. 根据权利要求9所述的计算机设备,其中,所述处理器实现获取所述检索模型从预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句的步骤,包括:The computer device according to claim 9, wherein the processor realizes the step of obtaining the similar sentences matched with the sentence to be replied selected from the preset dialogue corpus by the retrieval model, including:
    将所述待回复语句和所述预设的对话语料库中的语句输入至所述检索模型中,生成用于表征所述预设的对话语料库中的语句与待回复语句相似度的Jaccard相似系数;The sentence to be replied and the sentence in the preset dialogue corpus are input into the retrieval model, and the Jaccard similarity coefficient for characterizing the similarity between the sentence in the preset dialogue corpus and the sentence to be replied is generated;
    获取所述检索模型基于所述Jaccard相似系数从所述预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句;Obtaining the similar sentences matched with the sentence to be replied selected from the preset dialogue corpus based on the Jaccard similarity coefficient by the retrieval model;
    其中,所述相似语句与所述待回复语句的Jaccard相似系数大于第一预设阈值,且小于第二预设阈值。Wherein, the Jaccard similarity coefficient between the similar sentence and the sentence to be replied is greater than a first preset threshold and smaller than a second preset threshold.
  11. 根据权利要求9所述的计算机设备,其中,所述处理器实现基于预设的语义对齐关键词提取模型,提取所述相似语句与所述待回复语句的差异关键词,得到差异关键词集的步骤,包括:The computer device according to claim 9, wherein the processor implements a preset semantic alignment keyword extraction model to extract the difference keywords between the similar sentence and the sentence to be replied, and obtain the difference keyword set steps, including:
    将所述待回复语句转化为第一向量,将相似语句转化为第二向量,并根据所述第一向量和第二向量计算注意力矩阵;Converting the sentence to be replied into a first vector, converting a similar sentence into a second vector, and calculating an attention matrix according to the first vector and the second vector;
    对所述注意力矩阵求极小值,得到相似语句与待回复语句的差异关键词;Find the minimum value to described attention matrix, obtain the difference keyword of similar sentence and sentence to be replied;
    将所述差异关键词取并集,得到差异关键词集。The difference keywords are combined to obtain a difference keyword set.
  12. 根据权利要求9所述的计算机设备,其中,所述处理器实现计算注意力矩阵的步骤,包括:The computer device according to claim 9, wherein said processor implements the step of calculating the attention matrix, comprising:
    所述注意力矩阵表示为:The attention matrix is expressed as:
    Figure PCTCN2022072187-appb-100006
    Figure PCTCN2022072187-appb-100006
    其中,ν A为所述待回复语句转化的第一向量,ν B为所述相似语句转化的第二向量,d k为归一化系数; Wherein, ν A is the first vector converted from the sentence to be replied, and ν B is the second vector converted from the similar sentence, and d k is a normalization coefficient;
    所述差异关键词公式如下:The difference keyword formula is as follows:
    Figure PCTCN2022072187-appb-100007
    Figure PCTCN2022072187-appb-100007
    其中,i表示所在行,j表示所在列,L为预先确定的超参数,
    Figure PCTCN2022072187-appb-100008
    表示求行和最小的L个行,对应提取出的差异关键词。
    Among them, i represents the row, j represents the column, L is a predetermined hyperparameter,
    Figure PCTCN2022072187-appb-100008
    Indicates the row and the smallest L rows, corresponding to the extracted difference keywords.
  13. 根据权利要求9所述的计算机设备,其中,所述处理器实现提取所述回答语句的相似关键词,得到相似关键词集的步骤,包括:The computer device according to claim 9, wherein said processor implements the step of extracting similar keywords of said answer sentence to obtain a similar keyword set, including:
    将所述回答语句的第一回答语句转化为第一回答向量,将所述回答语句中的其他回答语句转化为第二回答向量,并根据所述第一回答向量和第二回答向量计算注意力矩阵;其中, 所述第一回答语句为与所述待回复语句匹配度最高的相似语句所对应的回答语句;Convert the first answer sentence of the answer sentence into a first answer vector, convert other answer sentences in the answer sentence into a second answer vector, and calculate attention according to the first answer vector and the second answer vector A matrix; wherein, the first answer sentence is the answer sentence corresponding to the similar sentence with the highest matching degree with the sentence to be replied;
    对所述注意力矩阵求极大值,得到所述第一回答语句与所述回答语句中的其他回答语句的相似关键词;Finding the maximum value of the attention matrix to obtain similar keywords between the first answer sentence and other answer sentences in the answer sentence;
    将所有相似关键词取并集,得到相似关键词集;Take the union of all similar keywords to obtain a similar keyword set;
    其中,所述相似关键词公式如下:Wherein, the similar keyword formula is as follows:
    Figure PCTCN2022072187-appb-100009
    Figure PCTCN2022072187-appb-100009
    其中,i表示所在行,j表示所在列,L为预先确定的超参数,
    Figure PCTCN2022072187-appb-100010
    表示求行和最大的L个行,对应提取出的相似关键词。
    Among them, i represents the row, j represents the column, L is a predetermined hyperparameter,
    Figure PCTCN2022072187-appb-100010
    Indicates the row and the largest L rows, corresponding to the extracted similar keywords.
  14. 根据权利要求9所述的计算机设备,其中,所述训练好的生成模型包括训练好的第一生成模型和训练好的第二生成模型,所述处理器实现将所述差异关键词集和所述相似关键词集输入训练好的生成模型,输出回答的步骤,包括:The computer device according to claim 9, wherein the trained generation model includes a trained first generation model and a trained second generation model, and the processor realizes combining the difference keyword set and the The steps of inputting the trained generative model of the similar keyword set and outputting the answer include:
    将所述差异关键词集和所述相似关键词集输入所述训练好的第一生成模型,通过预测所述差异关键词集和相似关键词集中的词语在语句中的位置,输出有序的关键词序列;Input the difference keyword set and the similar keyword set into the trained first generation model, and output ordered keyword sequence;
    将所述有序的关键词序列输入所述训练好的第二生成模型,输出回答;Input the ordered keyword sequence into the trained second generation model, and output an answer;
    其中,所述训练好的生成模型是基于预训练语言模型BERT得到的。Wherein, the trained generation model is obtained based on the pre-trained language model BERT.
  15. 一种存储介质,其中,所述存储介质存储有计算机程序,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如下步骤:A storage medium, wherein the storage medium stores a computer program, the storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the following steps:
    接收待回复语句,将所述待回复语句输入检索模型;receiving the sentence to be replied, and inputting the sentence to be replied into the retrieval model;
    获取所述检索模型从预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句,并获取所述相似语句在所述对话语料库中的回答语句;Obtaining the similar sentences matched with the sentence to be replied selected by the retrieval model from the preset dialog corpus, and obtaining the answer sentence of the similar sentence in the dialog corpus;
    基于预设的语义对齐关键词提取模型,提取所述相似语句与所述待回复语句的差异关键词,得到差异关键词集;Based on the preset semantic alignment keyword extraction model, extract the difference keywords between the similar sentence and the sentence to be replied, and obtain the difference keyword set;
    提取所述回答语句的相似关键词,得到相似关键词集;Extracting similar keywords of the answer sentence to obtain a similar keyword set;
    将所述差异关键词集和所述相似关键词集输入训练好的生成模型,输出回答。Input the difference keyword set and the similar keyword set into the trained generation model, and output the answer.
  16. 根据权利要求15所述的存储介质,其中,所述处理器实现获取所述检索模型从预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句的步骤,包括:The storage medium according to claim 15, wherein the processor realizes the step of obtaining the similar sentences matched with the sentence to be replied selected from the preset dialogue corpus by the retrieval model, including:
    将所述待回复语句和所述预设的对话语料库中的语句输入至所述检索模型中,生成用于表征所述预设的对话语料库中的语句与待回复语句相似度的Jaccard相似系数;The sentence to be replied and the sentence in the preset dialogue corpus are input into the retrieval model, and the Jaccard similarity coefficient for characterizing the similarity between the sentence in the preset dialogue corpus and the sentence to be replied is generated;
    获取所述检索模型基于所述Jaccard相似系数从所述预设的对话语料库中筛选出的与所述待回复语句匹配的相似语句;Obtaining the similar sentences matched with the sentence to be replied selected from the preset dialogue corpus based on the Jaccard similarity coefficient by the retrieval model;
    其中,所述相似语句与所述待回复语句的Jaccard相似系数大于第一预设阈值,且小于第二预设阈值。Wherein, the Jaccard similarity coefficient between the similar sentence and the sentence to be replied is greater than a first preset threshold and smaller than a second preset threshold.
  17. 根据权利要求15所述的计算机设备,其中,所述处理器实现基于预设的语义对齐关键词提取模型,提取所述相似语句与所述待回复语句的差异关键词,得到差异关键词集的步 骤,包括:The computer device according to claim 15, wherein the processor implements a preset semantic alignment keyword extraction model to extract the difference keywords between the similar sentence and the sentence to be replied, and obtain the difference keyword set steps, including:
    将所述待回复语句转化为第一向量,将相似语句转化为第二向量,并根据所述第一向量和第二向量计算注意力矩阵;Converting the sentence to be replied into a first vector, converting a similar sentence into a second vector, and calculating an attention matrix according to the first vector and the second vector;
    对所述注意力矩阵求极小值,得到相似语句与待回复语句的差异关键词;Find the minimum value to described attention matrix, obtain the difference keyword of similar sentence and sentence to be replied;
    将所述差异关键词取并集,得到差异关键词集。The difference keywords are combined to obtain a difference keyword set.
  18. 根据权利要求15所述的计算机设备,其中,所述处理器实现计算注意力矩阵的步骤,包括:The computer device according to claim 15, wherein said processor implements the step of calculating an attention matrix, comprising:
    所述注意力矩阵表示为:The attention matrix is expressed as:
    Figure PCTCN2022072187-appb-100011
    Figure PCTCN2022072187-appb-100011
    其中,ν A为所述待回复语句转化的第一向量,ν B为所述相似语句转化的第二向量,d k为归一化系数; Wherein, ν A is the first vector converted from the sentence to be replied, and ν B is the second vector converted from the similar sentence, and d k is a normalization coefficient;
    所述差异关键词公式如下:The difference keyword formula is as follows:
    Figure PCTCN2022072187-appb-100012
    Figure PCTCN2022072187-appb-100012
    其中,i表示所在行,j表示所在列,L为预先确定的超参数,
    Figure PCTCN2022072187-appb-100013
    表示求行和最小的L个行,对应提取出的差异关键词。
    Among them, i represents the row, j represents the column, L is a predetermined hyperparameter,
    Figure PCTCN2022072187-appb-100013
    Indicates the row and the smallest L rows, corresponding to the extracted difference keywords.
  19. 根据权利要求15所述的计算机设备,其中,所述处理器实现提取所述回答语句的相似关键词,得到相似关键词集的步骤,包括:The computer device according to claim 15, wherein said processor implements the step of extracting similar keywords of said answer sentence to obtain a similar keyword set, including:
    将所述回答语句的第一回答语句转化为第一回答向量,将所述回答语句中的其他回答语句转化为第二回答向量,并根据所述第一回答向量和第二回答向量计算注意力矩阵;其中,所述第一回答语句为与所述待回复语句匹配度最高的相似语句所对应的回答语句;Convert the first answer sentence of the answer sentence into a first answer vector, convert other answer sentences in the answer sentence into a second answer vector, and calculate attention according to the first answer vector and the second answer vector A matrix; wherein, the first answer sentence is the answer sentence corresponding to the similar sentence with the highest matching degree with the sentence to be replied;
    对所述注意力矩阵求极大值,得到所述第一回答语句与所述回答语句中的其他回答语句的相似关键词;Finding the maximum value of the attention matrix to obtain similar keywords between the first answer sentence and other answer sentences in the answer sentence;
    将所有相似关键词取并集,得到相似关键词集;Take the union of all similar keywords to obtain a similar keyword set;
    其中,所述相似关键词公式如下:Wherein, the similar keyword formula is as follows:
    Figure PCTCN2022072187-appb-100014
    Figure PCTCN2022072187-appb-100014
    其中,i表示所在行,j表示所在列,L为预先确定的超参数,
    Figure PCTCN2022072187-appb-100015
    表示求行和最大的L个行,对应提取出的相似关键词。
    Among them, i represents the row, j represents the column, L is a predetermined hyperparameter,
    Figure PCTCN2022072187-appb-100015
    Indicates the row and the largest L rows, corresponding to the extracted similar keywords.
  20. 根据权利要求15所述的计算机设备,其中,所述训练好的生成模型包括训练好的第一生成模型和训练好的第二生成模型,所述处理器实现将所述差异关键词集和所述相似关键词集输入训练好的生成模型,输出回答的步骤,包括:The computer device according to claim 15, wherein the trained generation model includes a trained first generation model and a trained second generation model, and the processor realizes combining the difference keyword set and the The steps of inputting the trained generative model of the similar keyword set and outputting the answer include:
    将所述差异关键词集和所述相似关键词集输入所述训练好的第一生成模型,通过预测所 述差异关键词集和相似关键词集中的词语在语句中的位置,输出有序的关键词序列;Input the difference keyword set and the similar keyword set into the trained first generation model, and output ordered keyword sequence;
    将所述有序的关键词序列输入所述训练好的第二生成模型,输出回答;Input the ordered keyword sequence into the trained second generation model, and output an answer;
    其中,所述训练好的生成模型是基于预训练语言模型BERT得到的。Wherein, the trained generation model is obtained based on the pre-trained language model BERT.
PCT/CN2022/072187 2021-06-01 2022-01-14 Artificial intelligence-based answer generation method and apparatus, device, and storage medium WO2022252636A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110609412.5 2021-06-01
CN202110609412.5A CN113239169B (en) 2021-06-01 2021-06-01 Answer generation method, device, equipment and storage medium based on artificial intelligence

Publications (1)

Publication Number Publication Date
WO2022252636A1 true WO2022252636A1 (en) 2022-12-08

Family

ID=77136270

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/072187 WO2022252636A1 (en) 2021-06-01 2022-01-14 Artificial intelligence-based answer generation method and apparatus, device, and storage medium

Country Status (2)

Country Link
CN (1) CN113239169B (en)
WO (1) WO2022252636A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116843149A (en) * 2023-07-11 2023-10-03 深圳市深水水务咨询有限公司 Reservoir flood control scheduling method based on generation type learning
CN116860950A (en) * 2023-09-04 2023-10-10 北京市电通电话技术开发有限公司 Method and system for updating corpus of term conversation robot
CN117474043A (en) * 2023-12-27 2024-01-30 湖南三湘银行股份有限公司 Intelligent question-answering system based on training model

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113239169B (en) * 2021-06-01 2023-12-05 平安科技(深圳)有限公司 Answer generation method, device, equipment and storage medium based on artificial intelligence
CN113609275B (en) * 2021-08-24 2024-03-26 腾讯科技(深圳)有限公司 Information processing method, device, equipment and storage medium
CN113868398A (en) * 2021-10-14 2021-12-31 北京倍倾心智能科技中心(有限合伙) Dialogue data set, method for constructing security detection model, method for evaluating security of dialogue system, medium, and computing device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368042A (en) * 2020-02-13 2020-07-03 平安科技(深圳)有限公司 Intelligent question and answer method and device, computer equipment and computer storage medium
US20210034678A1 (en) * 2018-04-23 2021-02-04 Ntt Docomo, Inc. Dialogue server
CN112632252A (en) * 2020-12-25 2021-04-09 中电金信软件有限公司 Dialogue response method, dialogue response device, computer equipment and storage medium
CN112765306A (en) * 2020-12-30 2021-05-07 金蝶软件(中国)有限公司 Intelligent question answering method and device, computer equipment and storage medium
CN113239169A (en) * 2021-06-01 2021-08-10 平安科技(深圳)有限公司 Artificial intelligence-based answer generation method, device, equipment and storage medium

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9384678B2 (en) * 2010-04-14 2016-07-05 Thinkmap, Inc. System and method for generating questions and multiple choice answers to adaptively aid in word comprehension
JP2014021535A (en) * 2012-07-12 2014-02-03 Mitsubishi Electric Corp Related keyword string extraction device, related keyword string extraction method and device for searching interrelated sentence
CN107679225B (en) * 2017-10-20 2021-03-09 哈尔滨工业大学 Reply generation method based on keywords
CN109033221A (en) * 2018-06-29 2018-12-18 上海银赛计算机科技有限公司 Answer generation method, device and server
KR102137809B1 (en) * 2018-09-19 2020-07-24 네이버 주식회사 Method of providing automatic answer
CN111128135B (en) * 2018-10-15 2022-09-27 珠海格力电器股份有限公司 Voice communication method and device
CN110362651A (en) * 2019-06-11 2019-10-22 华南师范大学 Dialogue method, system, device and the storage medium that retrieval and generation combine
CN110457459B (en) * 2019-08-16 2022-04-08 达闼机器人有限公司 Dialog generation method, device, equipment and storage medium based on artificial intelligence
CN111177339B (en) * 2019-12-06 2023-07-25 百度在线网络技术(北京)有限公司 Dialogue generation method and device, electronic equipment and storage medium
CN111460081B (en) * 2020-03-30 2023-04-07 招商局金融科技有限公司 Answer generation method based on deep learning, electronic device and readable storage medium
CN111782767A (en) * 2020-06-30 2020-10-16 北京三快在线科技有限公司 Question answering method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210034678A1 (en) * 2018-04-23 2021-02-04 Ntt Docomo, Inc. Dialogue server
CN111368042A (en) * 2020-02-13 2020-07-03 平安科技(深圳)有限公司 Intelligent question and answer method and device, computer equipment and computer storage medium
CN112632252A (en) * 2020-12-25 2021-04-09 中电金信软件有限公司 Dialogue response method, dialogue response device, computer equipment and storage medium
CN112765306A (en) * 2020-12-30 2021-05-07 金蝶软件(中国)有限公司 Intelligent question answering method and device, computer equipment and storage medium
CN113239169A (en) * 2021-06-01 2021-08-10 平安科技(深圳)有限公司 Artificial intelligence-based answer generation method, device, equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116843149A (en) * 2023-07-11 2023-10-03 深圳市深水水务咨询有限公司 Reservoir flood control scheduling method based on generation type learning
CN116860950A (en) * 2023-09-04 2023-10-10 北京市电通电话技术开发有限公司 Method and system for updating corpus of term conversation robot
CN116860950B (en) * 2023-09-04 2023-11-14 北京市电通电话技术开发有限公司 Method and system for updating corpus of term conversation robot
CN117474043A (en) * 2023-12-27 2024-01-30 湖南三湘银行股份有限公司 Intelligent question-answering system based on training model
CN117474043B (en) * 2023-12-27 2024-04-02 湖南三湘银行股份有限公司 Intelligent question-answering system based on training model

Also Published As

Publication number Publication date
CN113239169B (en) 2023-12-05
CN113239169A (en) 2021-08-10

Similar Documents

Publication Publication Date Title
WO2022252636A1 (en) Artificial intelligence-based answer generation method and apparatus, device, and storage medium
US11740863B2 (en) Search and knowledge base question answering for a voice user interface
WO2020177282A1 (en) Machine dialogue method and apparatus, computer device, and storage medium
US20210142794A1 (en) Speech processing dialog management
WO2020147428A1 (en) Interactive content generation method and apparatus, computer device, and storage medium
US20190272269A1 (en) Method and system of classification in a natural language user interface
WO2019153522A1 (en) Intelligent interaction method, electronic device, and storage medium
WO2022095378A1 (en) Artificial-intelligence-based training method and apparatus, and computer device and storage medium
KR20210158344A (en) Machine learning system for digital assistants
WO2021190259A1 (en) Slot identification method and electronic device
CN110928994A (en) Similar case retrieval method, similar case retrieval device and electronic equipment
CN110741364A (en) Determining a state of an automated assistant dialog
WO2020244475A1 (en) Method and apparatus for language sequence labeling, storage medium, and computing device
WO2021114841A1 (en) User report generating method and terminal device
US10755177B1 (en) Voice user interface knowledge acquisition system
US20220261545A1 (en) Systems and methods for producing a semantic representation of a document
WO2021204017A1 (en) Text intent recognition method and apparatus, and related device
EP3620994A1 (en) Methods, apparatuses, devices, and computer-readable storage media for determining category of entity
WO2021063089A1 (en) Rule matching method, rule matching apparatus, storage medium and electronic device
KR20160147303A (en) Method for dialog management based on multi-user using memory capacity and apparatus for performing the method
US11170765B2 (en) Contextual multi-channel speech to text
WO2022022049A1 (en) Long difficult text sentence compression method and apparatus, computer device, and storage medium
Aattouri et al. Modeling of an artificial intelligence based enterprise callbot with natural language processing and machine learning algorithms
CN112307738A (en) Method and device for processing text
CN116775873A (en) Multi-mode dialogue emotion recognition method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22814689

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE