WO2022068197A1 - Conversation generation method and apparatus, device, and readable storage medium - Google Patents

Conversation generation method and apparatus, device, and readable storage medium Download PDF

Info

Publication number
WO2022068197A1
WO2022068197A1 PCT/CN2021/091292 CN2021091292W WO2022068197A1 WO 2022068197 A1 WO2022068197 A1 WO 2022068197A1 CN 2021091292 W CN2021091292 W CN 2021091292W WO 2022068197 A1 WO2022068197 A1 WO 2022068197A1
Authority
WO
WIPO (PCT)
Prior art keywords
vector
reply
common sense
query
question
Prior art date
Application number
PCT/CN2021/091292
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 WO2022068197A1 publication Critical patent/WO2022068197A1/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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Definitions

  • the present application relates to the field of digital medical technology, and in particular, to a dialog generation method, apparatus, device, and readable storage medium.
  • the purpose of the present application is to provide a dialogue generation method, apparatus, device and readable storage medium, which can quickly and accurately form reply information in a remote consultation dialogue and improve user experience.
  • a dialog generation method comprising:
  • the preset first end-to-end memory network MemN2N model uses the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
  • the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
  • Each reply vector is converted into reply words separately, and all reply words are combined into reply information.
  • the present application also provides a dialogue generation device, the device comprising:
  • an acquisition module for acquiring question information, and converting the question information into a first query vector by using a preset first gate recursive unit GRU model
  • the questioning module is configured to use the preset first end-to-end memory network MemN2N model according to the first query vector to determine the common sense vector associated with the first query vector, and to determine the common sense vector associated with the first query vector according to the first query vector and all Describe the common sense vector to form the question vector;
  • the answering module is configured to convert the question vector into a plurality of second query vectors according to the question vector using a preset second gate recursive unit GRU model, and input each second query vector to the preset second terminal in turn end-to-end memory network MemN2N model to get multiple reply vectors;
  • the conversion module is used to convert each reply vector into reply words respectively, and combine all reply words into reply information.
  • the present application also provides a computer device, the computer device specifically includes: a memory, a processor, and a computer program stored in the memory and running on the processor, the processor executes the computer program. The following steps are implemented when the computer program is described:
  • the preset first end-to-end memory network MemN2N model uses the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
  • the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
  • Each reply vector is converted into reply words separately, and all reply words are combined into reply information.
  • the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program implements the following steps when executed by a processor:
  • the preset first end-to-end memory network MemN2N model uses the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
  • the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
  • Each reply vector is converted into reply words separately, and all reply words are combined into reply information.
  • the dialogue generation method, device, device and readable storage medium combine the MemN2N architecture of the end-to-end memory network with the GRU network to find out the common sense information related to it according to the question information, and comprehensively consider the question information and the common sense information
  • the reply message is determined.
  • the form of GRU+MemN2N is used to encode the question information.
  • the GRU network is used to replace the EmbeddingB in the MemN2N network, and the final hidden layer state of the GRU network is used. It is input into the MemN2N network as a query vector.
  • the form of GRU+MemN2N is also used to generate the answer information.
  • the application can quickly and accurately form reply information in the remote consultation dialogue, and improve user experience.
  • FIG. 1 is an optional schematic flowchart of a dialog generation method provided in Embodiment 1;
  • FIG. 2 is a schematic diagram of an optional composition structure of the dialogue generation device provided in Embodiment 2;
  • FIG. 3 is a schematic diagram of an optional hardware architecture of the computer device provided in the third embodiment.
  • An embodiment of the present application provides a dialog generation method, as shown in FIG. 1 , the method specifically includes the following steps:
  • Step S101 Obtain question information, and use a preset first GRU (Gate Recurrent Unit, gate recursive unit) model to convert the question information into a first query vector.
  • GRU Gate Recurrent Unit, gate recursive unit
  • step S101 includes:
  • Step A1 performing word segmentation processing on the question information, and forming a word sequence with multiple keywords obtained after the word segmentation processing; wherein, the word sequence includes N keywords;
  • Step A2 For a target keyword in the word sequence, according to the hidden influence factor of the keyword located before the target keyword in the word sequence to the target keyword, use the first gate a recursive unit GRU model, which calculates the hidden influence factor of the target keyword to the keyword located after the target keyword in the word sequence;
  • Step A3 Use the hidden influence factor calculated according to the last keyword in the word sequence as the first query vector u 1 corresponding to the question information.
  • Step S102 According to the first query vector, use a preset first MemN2N (End-to-end Memory Networks, end-to-end memory network) model to determine the common sense vector associated with the first query vector, and according to The first query vector and the common sense vector form a question vector.
  • first MemN2N End-to-end Memory Networks, end-to-end memory network
  • step S102 includes:
  • Step B1 In the first loop hop of the first end-to-end memory network MemN2N model, calculate the first query vector u 1 and the ith common sense head vector in the preset common sense head group respectively. correlation value p i of x i ;
  • p i Softmax((u 1 ) T * xi ), and T is a transposition function.
  • Step B2 Calculate the question sub-vector a 1 of the first cycle according to the correlation value p i of the ith common sense head vector x i and the ith common sense tail vector yi in the preset common sense tail group;
  • Step B3 adding the first query vector u 1 and the question vector a 1 to obtain the first query vector u 2 of the second cycle;
  • Step B4 Repeat steps B1 to B3 until the question sub-vector a M of the Mth cycle is calculated;
  • Step B5 Use the question sub-vector a M of the Mth cycle as the question vector.
  • the method also includes:
  • Step C1 obtaining a common sense information base; wherein, the common sense information base includes a plurality of common sense information represented in the form of knowledge triples, and the common sense information includes: a head, a relation part, and a tail;
  • the knowledge triple form represents bits (h: cat, r: belongs to, t: animal), where h represents the head, t represents the tail, and r represents the difference between the head and the tail.
  • Step C2 Convert the head in each common sense information into a common sense head vector by presetting the first hidden layer matrix EmbeddingA, thereby forming a common sense head group;
  • Step C3 By presetting the second hidden layer matrix EmbeddingC, the tail in each common sense information is converted into a common sense tail vector, thereby forming a common sense tail group;
  • Step C4 Establish a correspondence between the common sense head vector and the common sense tail vector according to the relationship part in each common sense information.
  • this embodiment uses the form of GRU+MemN2N to encode the question information, and for the question information input by the user, the GRU network is used to replace the EmbeddingB in the MemN2N network, and the The final hidden layer state of the GRU network is input into the MemN2N network as a query vector.
  • the entire MemN2N network is superimposed by multiple hops. In each hop, the correlation between the query vector and each common sense information in the Memory is calculated separately.
  • the Encoder is implemented by using GRU+MemN2N, and on the premise that the complete question information is extracted by using the GRU, common sense information that is highly correlated with the entire question information can continue to be added, avoiding the search for a single entity word. information bias.
  • the common sense information of Memory is calculated in the form of weighted sum, which avoids selecting a single knowledge triplet as compensation information, making the acquired common sense information more comprehensive.
  • Step S103 According to the question vector, use the preset second gate recursive unit GRU model to convert the question vector into a plurality of second query vectors, and input each second query vector into the preset second end-to-end in sequence. memory network in the MemN2N model to obtain multiple reply vectors.
  • step S103 includes:
  • Step D1 Use the question vector as the hidden influence factor h 0 of the first layer, and input the preset starting character vector s 0 into the second gate recursive unit GRU model to obtain the output vector s 1 and transfer to The hidden influence factor h 1 of the second layer;
  • Step D2 Inputting the output vector s 1 as a second query vector into the second end-to-end memory network MemN2N model to obtain a reply vector r 1 ;
  • step D2 includes:
  • Step D21 In the first loop hop of the second end-to-end memory network MemN2N model, calculate the second query vector s 1 and the i-th reply header vector in the preset reply header group respectively. the correlation value p i of k i ;
  • p i Softmax((s 1 ) T k i ), T is the transpose function
  • Step D22 Calculate the reply sub-vector o 1 of the first cycle according to the correlation value p i of the ith reply head vector ki and the ith reply tail vector li in the preset reply tail group;
  • o 1 ⁇ i p i l i ;
  • Step D23 adding the second query vector s 1 and the reply sub-vector o 1 of the first loop to obtain the second query vector s 2 of the second loop hop;
  • Step D24 Repeat steps D21 to D23 until the question sub-vector o N of the Nth loop hop is calculated;
  • Step D25 Use the question sub-vector o N of the Nth cycle as the reply vector r 1 .
  • the method also includes:
  • Step E1 obtaining a reply information base; wherein, the reply information base includes a plurality of reply information represented in the form of knowledge triples, and the reply information includes: a head, a relation part and a tail;
  • Step E2 Converting the header in each reply message into a reply header vector through a preset conversion and embedding the TransE algorithm, thereby forming a reply header group;
  • Step E3 Converting the tail in each reply message into a reply tail vector through a preset transformation and embedding the TransE algorithm, thereby forming a reply tail group;
  • Step E4 Establish a corresponding relationship between the reply head vector and the reply tail vector according to the relationship part in each reply information.
  • Step D3 Re-input the output vector s 1 and the hidden influence factor h 1 of the second layer into the second gate recursive unit GRU model to obtain the output vector s 2 and the hidden influence factor passed to the third layer h 2 , and re-input the output vector s 2 into the second end-to-end memory network MemN2N model to obtain a reply vector r 2 , and so on until the output of the second gate recursive unit GRU model
  • the vector is the default end character vector.
  • Step S104 Convert each reply vector into reply words respectively, and combine all reply words into reply information.
  • step S104 includes:
  • the reply word wi corresponding to the reply vector ri is obtained according to the following formula:
  • W is a preset matrix containing multiple reply words, and the word with the largest P value in the calculated matrix W is used as the reply word wi corresponding to ri .
  • the process of decoding the Decoder the process of decoding the question vector into the reply information, the form of GRU+MemN2N is also used to generate the reply information; the initial hidden layer state of the GRU network is the output of the Encoder part.
  • the TransE algorithm is used to complete the encoding of knowledge triples, instead of Embedding A and Embedding C in the MemoryN2N model.
  • the Decoder part uses each hidden state of the GRU as the query vector query of MemN2N.
  • the implementation of the Decoder part avoids the distinction between entity words and common words when generating a reply, so that all reply words can be obtained according to the vocabulary.
  • this patent uses the idea of Kay Value Memory Network to distinguish the similarity calculation part of Memory and query from the weighted and output part, so that the query is closer to the head entity in the knowledge triplet, and the output is closer to the knowledge The tail entities in the triplet are closer, reducing the repetition rate of the model to generate responses and questions.
  • An embodiment of the present application provides a dialogue generation device, as shown in FIG. 2 , the device specifically includes the following components:
  • the obtaining module 201 is used for obtaining question information, and utilizes the preset first gate recursive unit GRU model to convert the question information into a first query vector;
  • the questioning module 202 is configured to use a preset first end-to-end memory network MemN2N model according to the first query vector to determine a common sense vector associated with the first query vector, and to determine the common sense vector associated with the first query vector according to the first query vector and the common sense vector forms a questioning vector;
  • the answering module 203 is configured to convert the question vector into a plurality of second query vectors according to the question vector using a preset second gate recursive unit GRU model, and input each second query vector into a preset second query vector in sequence. end-to-end memory network MemN2N model to get multiple reply vectors;
  • the conversion module 204 is configured to convert each reply vector into reply words respectively, and combine all reply words into reply information.
  • the acquisition module 201 is used for:
  • the question information is subjected to word segmentation processing, and a plurality of keywords obtained after the word segmentation processing is formed into a word sequence; for a target keyword in the word sequence, according to the word sequence located before the target keyword The hidden influence factor of the keyword passed to the target keyword, using the first gate recursive unit GRU model to calculate the target keyword passed to the key word sequence located after the target keyword The hidden influence factor of the word; the hidden influence factor calculated according to the last keyword in the word sequence is used as the first query vector u 1 corresponding to the question information.
  • questioning module 202 is specifically used for:
  • the correlation between the first query vector u 1 and the ith common sense head vector x i in the preset common sense head group is calculated respectively.
  • degree value p i according to the correlation degree value p i of the ith common sense head vector x i and the ith common sense tail vector y i in the preset common sense tail group, calculate the question sub-vector a 1 of the first cycle ;
  • the question sub-vector a 2 of 2 cycles and the first query vector u 3 of the third cycle, and so on, until the question sub-vector a M of the M-th cycle is calculated;
  • the vector a M serves as the question vector.
  • the device also includes:
  • the processing module is used to obtain a common sense information base; wherein, the common sense information base includes a plurality of common sense information represented in the form of knowledge triples, and the common sense information includes: a head, a relationship part and a tail; A hidden layer matrix converts the head in each common sense information into a common sense head vector, thereby forming a common sense head group; the second hidden layer matrix is preset to convert the tail in each common sense information into a common sense tail vector , so as to form a common sense tail group; establish the corresponding relationship between the common sense head vector and the common sense tail vector according to the relationship part in each common sense information.
  • reply module 203 is specifically used for:
  • the question vector is used as the hidden influence factor h 0 of the first layer, and the preset starting character vector s 0 is input into the second gate recursive unit GRU model to obtain the output vector s 1 and pass to the second layer.
  • the hidden impact factor h 1 of The hidden influence factor h 1 of the second layer is re-input into the second gate recursive unit GRU model to obtain the output vector s 2 and the hidden influence factor h 2 passed to the third layer, and the output vector s 2 is re-input Input into the second end-to-end memory network MemN2N model to obtain a reply vector r 2 , and so on, until the output vector of the second gate recursive unit GRU model is the preset end character vector.
  • the reply module 203 implements the step of inputting the output vector s 1 as the second query vector into the second end-to-end memory network MemN2N model to obtain the reply vector r 1 , it specifically includes:
  • the correlation between the second query vector s 1 and the ith reply header vector ki in the preset reply header group is calculated respectively degree value p i ; according to the correlation degree value p i of the i-th reply head vector ki and the i -th reply tail vector li in the preset reply tail group, calculate the reply sub-vector o 1 of the first cycle ; Add the second query vector s 1 and the reply sub-vector o 1 of the first cycle to obtain the second query vector s 2 of the second cycle; According to the second query vector s 2 of the second cycle Recalculate the reply sub-vector o 2 of the 2nd cycle and the second query vector s 3 of the 3rd cycle, and so on, until the reply sub-vector o N of the Nth cycle is calculated; The circular reply sub-vector o N is taken as the reply vector r 1 .
  • processing module is also used for:
  • the reply information base includes a plurality of reply information represented in the form of knowledge triples, and the reply information includes: a head, a relation part and a tail;
  • the head in each reply message is converted into a reply head vector, thereby forming a reply head group;
  • the tail in each reply message is converted into a reply tail vector by the preset transformation and embedded TransE algorithm, thereby forming a reply tail group; according to each reply tail group;
  • the relation part in each reply information establishes the correspondence between the reply head vector and the reply tail vector.
  • This embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including independent servers, or A server cluster composed of multiple servers), etc.
  • the computer device 30 in this embodiment at least includes but is not limited to: a memory 301 and a processor 302 that can be communicatively connected to each other through a system bus.
  • FIG. 3 only shows the computer device 30 having components 301-302, but it should be understood that implementation of all of the illustrated components is not required, and more or fewer components may be implemented instead.
  • the memory 301 (that is, a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (eg, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc.
  • the memory 301 may be an internal storage unit of the computer device 30 , such as a hard disk or a memory of the computer device 30 .
  • the memory 301 may also be an external storage device of the computer device 30, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc.
  • the memory 301 may also include both the internal storage unit of the computer device 30 and its external storage device.
  • the memory 301 is generally used to store the operating system and various application software installed on the computer device 30 .
  • the memory 301 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 302 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips.
  • the processor 302 is typically used to control the overall operation of the computer device 30 .
  • the processor 302 is configured to execute the program of the dialogue generation method stored in the processor 302, and the following steps are implemented when the program of the dialogue generation method is executed:
  • the preset first end-to-end memory network MemN2N model uses the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
  • the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
  • Each reply vector is converted into reply words separately, and all reply words are combined into reply information.
  • This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), only Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Programmable Read-Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disc, Server, App Store, etc., the computer-readable storage medium It can be non-volatile or volatile, and a computer program is stored thereon, and when the computer program is executed by the processor, the following method steps are implemented:
  • the preset first end-to-end memory network MemN2N model uses the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
  • the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
  • Each reply vector is converted into reply words separately, and all reply words are combined into reply information.

Landscapes

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

Abstract

A conversation generation method and apparatus, a device, and a readable storage medium, relating to the technical field of digital treatment. The method comprises: obtaining questioning information, and converting the questioning information into a first query vector by using a preset first gate recurrent unit (GRU) model (S101); according to the first query vector, determining, by using a preset first end-to-end memory network (MemN2N) model, a common sense vector associated with the first query vector, and forming a questioning vector according to the first query vector and the common sense vector (S102); according to the questioning vector, converting the questioning vector into multiple second query vectors by using a preset second GRU model, and sequentially inputting the second query vectors into a preset second MemN2N model to obtain multiple response vectors (S103); and respectively converting the response vectors into response words, and combining all the response words into response information (S104). According to the method, response information can be quickly and accurately formed in a teleconsultation conversation, such that user experience is improved.

Description

一种对话生成方法、装置、设备及可读存储介质A dialogue generation method, apparatus, device and readable storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请申明享有2020年09月30日递交的申请号为202011059826.7、名称为“一种对话生成方法、装置、设备及可读存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。This application declares that it enjoys the priority of the Chinese patent application with the application number 202011059826.7 and the title of "A Method, Apparatus, Equipment and Readable Storage Medium for Dialog Generation" filed on September 30, 2020, and the overall content of the Chinese patent application Incorporated herein by reference.
技术领域technical field
本申请涉及数字医疗技术领域,特别涉及一种对话生成方法、装置、设备及可读存储介质。The present application relates to the field of digital medical technology, and in particular, to a dialog generation method, apparatus, device, and readable storage medium.
背景技术Background technique
随着人工智能的不断发展,人机对话越来越多的被应用到各种场景;例如,人工客服场景,通过识别用户输入的提问信息,形成与该提问信息对应的答复信息,从而减少人力成本;但是,发明人意识到传统的开放域人机对话系统如果对用户提问的背景知识、相关常识信息缺乏理解,仅仅从对话数据出发,将会产生普遍的、缺乏有效信息的回答,而且可能会对答复信息的可读性产生影响。此外,如何快速、准确的根据用户提问信息形成答复信息成为本领域技术人员亟需解决的技术问题。With the continuous development of artificial intelligence, more and more human-machine dialogues are applied to various scenarios; for example, in manual customer service scenarios, by identifying the question information input by the user, the response information corresponding to the question information is formed, thereby reducing manpower However, the inventor realizes that if the traditional open-domain human-machine dialogue system lacks understanding of the background knowledge and relevant common sense information of the user's question, and only starts from the dialogue data, it will produce a general answer that lacks effective information, and may Will have an impact on the readability of the reply message. In addition, how to quickly and accurately form reply information according to the user's question information has become a technical problem that those skilled in the art need to solve urgently.
发明内容SUMMARY OF THE INVENTION
本申请的目的在于提供一种对话生成方法、装置、设备及可读存储介质,能够快速、准确地在远程会诊对话中形成答复信息,提高用户体验度。The purpose of the present application is to provide a dialogue generation method, apparatus, device and readable storage medium, which can quickly and accurately form reply information in a remote consultation dialogue and improve user experience.
根据本申请的一个方面,提供了一种对话生成方法,所述方法包括:According to one aspect of the present application, there is provided a dialog generation method, the method comprising:
获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量;Obtain question information, and utilize the preset first gate recursive unit GRU model to convert the question information into a first query vector;
根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量;According to the first query vector, use the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量;According to the question vector, the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
分别将各个答复向量转化为答复词,并将所有答复词组合为答复信息。Each reply vector is converted into reply words separately, and all reply words are combined into reply information.
为了实现上述目的,本申请还提供一种对话生成装置,所述装置包括:In order to achieve the above purpose, the present application also provides a dialogue generation device, the device comprising:
获取模块,用于获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量;an acquisition module for acquiring question information, and converting the question information into a first query vector by using a preset first gate recursive unit GRU model;
提问模块,用于根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量;The questioning module is configured to use the preset first end-to-end memory network MemN2N model according to the first query vector to determine the common sense vector associated with the first query vector, and to determine the common sense vector associated with the first query vector according to the first query vector and all Describe the common sense vector to form the question vector;
答复模块,用于根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量;The answering module is configured to convert the question vector into a plurality of second query vectors according to the question vector using a preset second gate recursive unit GRU model, and input each second query vector to the preset second terminal in turn end-to-end memory network MemN2N model to get multiple reply vectors;
转化模块,用于分别将各个答复向量转化为答复词,并将所有答复词组合为答复信息。The conversion module is used to convert each reply vector into reply words respectively, and combine all reply words into reply information.
为了实现上述目的,本申请还提供一种计算机设备,该计算机设备具体包括:存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In order to achieve the above object, the present application also provides a computer device, the computer device specifically includes: a memory, a processor, and a computer program stored in the memory and running on the processor, the processor executes the computer program. The following steps are implemented when the computer program is described:
获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询 向量;Obtain question information, and utilize the preset first gate recursive unit GRU model to convert the question information into the first query vector;
根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量;According to the first query vector, use the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量;According to the question vector, the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
分别将各个答复向量转化为答复词,并将所有答复词组合为答复信息。Each reply vector is converted into reply words separately, and all reply words are combined into reply information.
为了实现上述目的,本申请还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In order to achieve the above purpose, the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program implements the following steps when executed by a processor:
获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量;Obtain question information, and utilize the preset first gate recursive unit GRU model to convert the question information into a first query vector;
根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量;According to the first query vector, use the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量;According to the question vector, the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
分别将各个答复向量转化为答复词,并将所有答复词组合为答复信息。Each reply vector is converted into reply words separately, and all reply words are combined into reply information.
本申请提供的对话生成方法、装置、设备及可读存储介质,将端到端记忆网络MemN2N架构与GRU网络结合起来以根据提问信息查找出与其相关的常识信息,并综合考虑提问信息与常识信息确定出答复信息。在将提问信息编码为提问向量的过程中,采用了GRU+MemN2N的形式对提问信息进行编码,针对用户输入的提问信息,使用GRU网络代替MemN2N网络中的EmbeddingB,将GRU网络最终的隐层状态作为查询向量输入MemN2N网络中。在将提问向量解码为答复信息的过程中,同样采用了GRU+MemN2N的形式实现答复信息的生成。本申请能够快速、准确地在远程会诊对话中形成答复信息,提高用户体验度。The dialogue generation method, device, device and readable storage medium provided by this application combine the MemN2N architecture of the end-to-end memory network with the GRU network to find out the common sense information related to it according to the question information, and comprehensively consider the question information and the common sense information The reply message is determined. In the process of encoding the question information into the question vector, the form of GRU+MemN2N is used to encode the question information. For the question information input by the user, the GRU network is used to replace the EmbeddingB in the MemN2N network, and the final hidden layer state of the GRU network is used. It is input into the MemN2N network as a query vector. In the process of decoding the question vector into answer information, the form of GRU+MemN2N is also used to generate the answer information. The application can quickly and accurately form reply information in the remote consultation dialogue, and improve user experience.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are for purposes of illustrating preferred embodiments only and are not to be considered limiting of the application. Also, the same components are denoted by the same reference numerals throughout the drawings. In the attached image:
图1为实施例一提供的对话生成方法的一种可选的流程示意图;FIG. 1 is an optional schematic flowchart of a dialog generation method provided in Embodiment 1;
图2为实施例二提供的对话生成装置的一种可选的组成结构示意图;FIG. 2 is a schematic diagram of an optional composition structure of the dialogue generation device provided in Embodiment 2;
图3为实施例三提供的计算机设备的一种可选的硬件架构示意图。FIG. 3 is a schematic diagram of an optional hardware architecture of the computer device provided in the third embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
实施例一Example 1
本申请实施例提供了一种对话生成方法,如图1所示,该方法具体包括以下步骤:An embodiment of the present application provides a dialog generation method, as shown in FIG. 1 , the method specifically includes the following steps:
步骤S101:获取提问信息,并利用预设第一GRU(Gate Recurrent Unit,门递归单元)模型将所述提问信息转化为第一查询向量。Step S101: Obtain question information, and use a preset first GRU (Gate Recurrent Unit, gate recursive unit) model to convert the question information into a first query vector.
具体的,步骤S101,包括:Specifically, step S101 includes:
步骤A1:对所述提问信息进行分词处理,并将分词处理后得到的多个关键词形成词序列;其中,所述词序列包括N个关键词;Step A1: performing word segmentation processing on the question information, and forming a word sequence with multiple keywords obtained after the word segmentation processing; wherein, the word sequence includes N keywords;
步骤A2:针对所述词序列中的一个目标关键词,根据所述词序列中位于所述目标关键词前一个的关键词传递给所述目标关键词的隐藏影响因子,利用所述第一门递归单元GRU 模型,计算出所述目标关键词传递给所述词序列中位于所述目标关键词后一个的关键词的隐藏影响因子;Step A2: For a target keyword in the word sequence, according to the hidden influence factor of the keyword located before the target keyword in the word sequence to the target keyword, use the first gate a recursive unit GRU model, which calculates the hidden influence factor of the target keyword to the keyword located after the target keyword in the word sequence;
步骤A3:将根据所述词序列中的最后一个关键词计算出的隐藏影响因子作为与所述提问信息对应的第一查询向量u 1Step A3: Use the hidden influence factor calculated according to the last keyword in the word sequence as the first query vector u 1 corresponding to the question information.
步骤S102:根据所述第一查询向量,利用预设第一MemN2N(End-to-end Memory Networks,端到端记忆网络)模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量。Step S102: According to the first query vector, use a preset first MemN2N (End-to-end Memory Networks, end-to-end memory network) model to determine the common sense vector associated with the first query vector, and according to The first query vector and the common sense vector form a question vector.
具体的,步骤S102,包括:Specifically, step S102 includes:
步骤B1:在所述第一端到端记忆网络MemN2N模型的第1个循环hop中,分别计算所述第一查询向量u 1与预设的常识头部组中的第i个常识头部向量x i的相关度值p iStep B1: In the first loop hop of the first end-to-end memory network MemN2N model, calculate the first query vector u 1 and the ith common sense head vector in the preset common sense head group respectively. correlation value p i of x i ;
其中,p i=Softmax((u 1) T*x i),T为转置函数。 Wherein, p i =Softmax((u 1 ) T * xi ), and T is a transposition function.
步骤B2:根据第i个常识头部向量x i的相关度值p i与预设的常识尾部组中的第i个常识尾部向量y i计算出第1个循环的提问子向量a 1Step B2: Calculate the question sub-vector a 1 of the first cycle according to the correlation value p i of the ith common sense head vector x i and the ith common sense tail vector yi in the preset common sense tail group;
其中,a 1=∑ ip iy iwhere a 1 =∑ i p i y i .
步骤B3:将所述第一查询向量u 1与所述提问向量a 1相加得到第2个循环的第一查询向量u 2Step B3: adding the first query vector u 1 and the question vector a 1 to obtain the first query vector u 2 of the second cycle;
步骤B4:重复执行步骤B1至步骤B3,直至计算出第M个循环的提问子向量a MStep B4: Repeat steps B1 to B3 until the question sub-vector a M of the Mth cycle is calculated;
步骤B5:将所述第M个循环的提问子向量a M作为所述提问向量。 Step B5: Use the question sub-vector a M of the Mth cycle as the question vector.
进一步的,所述方法还包括:Further, the method also includes:
步骤C1:获取常识信息库;其中,所述常识信息库包括多个以知识三元组形式表示的常识信息,且所述常识信息包括:头部、关系部和尾部;Step C1: obtaining a common sense information base; wherein, the common sense information base includes a plurality of common sense information represented in the form of knowledge triples, and the common sense information includes: a head, a relation part, and a tail;
以“猫是一种动物”为例,知识三元组形式表示位(h:猫,r:属于,t:动物),其中,h表示头部、t表示尾部、r表示头部与尾部的关系部。Taking "a cat is an animal" as an example, the knowledge triple form represents bits (h: cat, r: belongs to, t: animal), where h represents the head, t represents the tail, and r represents the difference between the head and the tail. Relations Department.
步骤C2:通过预设第一隐含层矩阵EmbeddingA将每个常识信息中的头部转化为常识头部向量,从而形成常识头部组;Step C2: Convert the head in each common sense information into a common sense head vector by presetting the first hidden layer matrix EmbeddingA, thereby forming a common sense head group;
步骤C3:通过预设第二隐含层矩阵EmbeddingC将每个常识信息中的尾部转化为常识尾部向量,从而形成常识尾部组;Step C3: By presetting the second hidden layer matrix EmbeddingC, the tail in each common sense information is converted into a common sense tail vector, thereby forming a common sense tail group;
步骤C4:根据每个常识信息中的关系部建立常识头部向量与常识尾部向量的对应关系。Step C4: Establish a correspondence between the common sense head vector and the common sense tail vector according to the relationship part in each common sense information.
在编码Encoder过程中,即将提问信息编码为提问向量的过程,本实施例采用了GRU+MemN2N的形式对提问信息进行编码,针对用户输入的提问信息,使用GRU网络代替MemN2N网络中的EmbeddingB,将GRU网络最终的隐层状态作为查询向量输入MemN2N网络中。整个MemN2N网络由多个hop叠加,在每个hop中,分别计算查询向量与Memory中各个常识信息的相关程度。在本实施例中,使用GRU+MemN2N实现了Encoder,可以在利用GRU提取到完整的提问信息的前提下,继续附加与整个提问信息关联性高的常识信息,避免了针对单个实体词进行检索造成的信息偏差。此外,Memory的常识信息以加权和的形式进行计算,避免了选择单一知识三元组作为补偿信息,使得获取到的常识信息更加全面。In the process of encoding the Encoder, the process of encoding the question information into a question vector, this embodiment uses the form of GRU+MemN2N to encode the question information, and for the question information input by the user, the GRU network is used to replace the EmbeddingB in the MemN2N network, and the The final hidden layer state of the GRU network is input into the MemN2N network as a query vector. The entire MemN2N network is superimposed by multiple hops. In each hop, the correlation between the query vector and each common sense information in the Memory is calculated separately. In this embodiment, the Encoder is implemented by using GRU+MemN2N, and on the premise that the complete question information is extracted by using the GRU, common sense information that is highly correlated with the entire question information can continue to be added, avoiding the search for a single entity word. information bias. In addition, the common sense information of Memory is calculated in the form of weighted sum, which avoids selecting a single knowledge triplet as compensation information, making the acquired common sense information more comprehensive.
步骤S103:根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量。Step S103: According to the question vector, use the preset second gate recursive unit GRU model to convert the question vector into a plurality of second query vectors, and input each second query vector into the preset second end-to-end in sequence. memory network in the MemN2N model to obtain multiple reply vectors.
具体的,步骤S103,包括:Specifically, step S103 includes:
步骤D1:将所述提问向量作为第一层的隐藏影响因子h 0、以及将预设开始字符向量s 0输入到所述第二门递归单元GRU模型中,以得到输出向量s 1和传递到第二层的隐藏影响因子h 1Step D1: Use the question vector as the hidden influence factor h 0 of the first layer, and input the preset starting character vector s 0 into the second gate recursive unit GRU model to obtain the output vector s 1 and transfer to The hidden influence factor h 1 of the second layer;
其中,(s 1,h 1)=GRU(s 0,h 0)。 where (s 1 , h 1 )=GRU(s 0 , h 0 ).
步骤D2:将所述输出向量s 1作为第二查询向量输入到所述第二端到端记忆网络MemN2N 模型中,以得到答复向量r 1Step D2: Inputting the output vector s 1 as a second query vector into the second end-to-end memory network MemN2N model to obtain a reply vector r 1 ;
进一步的,步骤D2,包括:Further, step D2 includes:
步骤D21:在所述第二端到端记忆网络MemN2N模型的第1个循环hop中,分别计算所述第二查询向量s 1与预设的答复头部组中的第i个答复头部向量k i的相关度值p iStep D21: In the first loop hop of the second end-to-end memory network MemN2N model, calculate the second query vector s 1 and the i-th reply header vector in the preset reply header group respectively. the correlation value p i of k i ;
其中,p i=Softmax((s 1) Tk i),T为转置函数; Wherein, p i =Softmax((s 1 ) T k i ), T is the transpose function;
步骤D22:根据第i个答复头部向量k i的相关度值p i与预设的答复尾部组中的第i个答复尾部向量l i计算出第1个循环的答复子向量o 1Step D22: Calculate the reply sub-vector o 1 of the first cycle according to the correlation value p i of the ith reply head vector ki and the ith reply tail vector li in the preset reply tail group;
其中,o 1=∑ ip il iWherein, o 1 =∑ i p i l i ;
步骤D23:将所述第二查询向量s 1与第1个循环的答复子向量o 1相加得到第2个循环hop的第二查询向量s 2Step D23: adding the second query vector s 1 and the reply sub-vector o 1 of the first loop to obtain the second query vector s 2 of the second loop hop;
步骤D24:重复执行步骤D21至步骤D23,直至计算出第N个循环hop的提问子向量o NStep D24: Repeat steps D21 to D23 until the question sub-vector o N of the Nth loop hop is calculated;
步骤D25:将所述第N个循环的提问子向量o N作为答复向量r 1Step D25: Use the question sub-vector o N of the Nth cycle as the reply vector r 1 .
更进一步的,所述方法还包括:Further, the method also includes:
步骤E1:获取答复信息库;其中,所述答复信息库包括多个以知识三元组形式表示的答复信息,且所述答复信息包括:头部、关系部和尾部;Step E1: obtaining a reply information base; wherein, the reply information base includes a plurality of reply information represented in the form of knowledge triples, and the reply information includes: a head, a relation part and a tail;
步骤E2:通过预设转换嵌入TransE算法将每个答复信息中的头部转化为答复头部向量,从而形成答复头部组;Step E2: Converting the header in each reply message into a reply header vector through a preset conversion and embedding the TransE algorithm, thereby forming a reply header group;
步骤E3:通过预设转换嵌入TransE算法将每个答复信息中的尾部转化为答复尾部向量,从而形成答复尾部组;Step E3: Converting the tail in each reply message into a reply tail vector through a preset transformation and embedding the TransE algorithm, thereby forming a reply tail group;
其中,k=(h,r,t)=MLP(TransE(h,r,t));Wherein, k=(h,r,t)=MLP(TransE(h,r,t));
k i=h;l i=t。 k i =h; l i =t.
步骤E4:根据每个答复信息中的关系部建立答复头部向量与答复尾部向量的对应关系。Step E4: Establish a corresponding relationship between the reply head vector and the reply tail vector according to the relationship part in each reply information.
步骤D3:将所述输出向量s 1和第二层的隐藏影响因子h 1重新输入到所述第二门递归单元GRU模型中,以得到输出向量s 2和传递到第三层的隐藏影响因子h 2,并将所述输出向量s 2重新输入到所述第二端到端记忆网络MemN2N模型中,以得到答复向量r 2,以此类推,直至所述第二门递归单元GRU模型的输出向量为预设结束字符向量。 Step D3: Re-input the output vector s 1 and the hidden influence factor h 1 of the second layer into the second gate recursive unit GRU model to obtain the output vector s 2 and the hidden influence factor passed to the third layer h 2 , and re-input the output vector s 2 into the second end-to-end memory network MemN2N model to obtain a reply vector r 2 , and so on until the output of the second gate recursive unit GRU model The vector is the default end character vector.
步骤S104:分别将各个答复向量转化为答复词,并将所有答复词组合为答复信息。Step S104: Convert each reply vector into reply words respectively, and combine all reply words into reply information.
具体的,步骤S104,包括:Specifically, step S104 includes:
按照如下公式得到与答复向量r i对应的答复词w iThe reply word wi corresponding to the reply vector ri is obtained according to the following formula:
P(r i=w i)=softmax(Wr i); P(r i = wi )=softmax(Wr i );
其中,W为预设包含多个答复词的矩阵,将计算出的所述矩阵W中的P值最大的词作为与r i对应的答复词w iWherein, W is a preset matrix containing multiple reply words, and the word with the largest P value in the calculated matrix W is used as the reply word wi corresponding to ri .
在解码Decoder过程中,即将提问向量解码为答复信息的过程,同样采用了GRU+MemN2N的形式实现答复信息的生成;GRU网络的初始隐层状态为Encoder部分的输出。针对Memory,不同于Encoder部分,利用TransE算法完成对知识三元组的编码,代替MemoryN2N模型中的Embedding A与Embedding C。此外,不同于Encoder中将GRU网络最后一个时刻的输出作为MemN2N的输入,Decoder部分将GRU的每一个隐藏状态hidden state作为MemN2N的查询向量query。In the process of decoding the Decoder, the process of decoding the question vector into the reply information, the form of GRU+MemN2N is also used to generate the reply information; the initial hidden layer state of the GRU network is the output of the Encoder part. For Memory, different from the Encoder part, the TransE algorithm is used to complete the encoding of knowledge triples, instead of Embedding A and Embedding C in the MemoryN2N model. In addition, unlike the Encoder, which uses the output of the last moment of the GRU network as the input of MemN2N, the Decoder part uses each hidden state of the GRU as the query vector query of MemN2N.
在本实施例中,Decoder部分的实现避免了生成回复时,实体词与普通词的区分,使得所有的回复单词都能够根据词汇表获得。此外,本专利借助了Kay Value Memory Network的思想,将Memory与query的相似度计算部分,与加权和输出部分进行区分,使得query与知识三元组中的头部实体更加接近,而输出与知识三元组中的尾部实体更加接近,降低模型产生回复与提问的重复率。In this embodiment, the implementation of the Decoder part avoids the distinction between entity words and common words when generating a reply, so that all reply words can be obtained according to the vocabulary. In addition, this patent uses the idea of Kay Value Memory Network to distinguish the similarity calculation part of Memory and query from the weighted and output part, so that the query is closer to the head entity in the knowledge triplet, and the output is closer to the knowledge The tail entities in the triplet are closer, reducing the repetition rate of the model to generate responses and questions.
实施例二Embodiment 2
本申请实施例提供了一种对话生成装置,如图2所示,该装置具体包括以下组成部分:An embodiment of the present application provides a dialogue generation device, as shown in FIG. 2 , the device specifically includes the following components:
获取模块201,用于获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量;The obtaining module 201 is used for obtaining question information, and utilizes the preset first gate recursive unit GRU model to convert the question information into a first query vector;
提问模块202,用于根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量;The questioning module 202 is configured to use a preset first end-to-end memory network MemN2N model according to the first query vector to determine a common sense vector associated with the first query vector, and to determine the common sense vector associated with the first query vector according to the first query vector and the common sense vector forms a questioning vector;
答复模块203,用于根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量;The answering module 203 is configured to convert the question vector into a plurality of second query vectors according to the question vector using a preset second gate recursive unit GRU model, and input each second query vector into a preset second query vector in sequence. end-to-end memory network MemN2N model to get multiple reply vectors;
转化模块204,用于分别将各个答复向量转化为答复词,并将所有答复词组合为答复信息。The conversion module 204 is configured to convert each reply vector into reply words respectively, and combine all reply words into reply information.
具体的,获取模块201,用于:Specifically, the acquisition module 201 is used for:
对所述提问信息进行分词处理,并将分词处理后得到的多个关键词形成词序列;针对所述词序列中的一个目标关键词,根据所述词序列中位于所述目标关键词前一个的关键词传递给所述目标关键词的隐藏影响因子,利用所述第一门递归单元GRU模型,计算出所述目标关键词传递给所述词序列中位于所述目标关键词后一个的关键词的隐藏影响因子;将根据所述词序列中的最后一个关键词计算出的隐藏影响因子作为与所述提问信息对应的第一查询向量u 1The question information is subjected to word segmentation processing, and a plurality of keywords obtained after the word segmentation processing is formed into a word sequence; for a target keyword in the word sequence, according to the word sequence located before the target keyword The hidden influence factor of the keyword passed to the target keyword, using the first gate recursive unit GRU model to calculate the target keyword passed to the key word sequence located after the target keyword The hidden influence factor of the word; the hidden influence factor calculated according to the last keyword in the word sequence is used as the first query vector u 1 corresponding to the question information.
进一步的,提问模块202,具体用于:Further, the questioning module 202 is specifically used for:
在所述第一端到端记忆网络MemN2N模型的第1个循环中,分别计算所述第一查询向量u 1与预设的常识头部组中的第i个常识头部向量x i的相关度值p i;根据第i个常识头部向量x i的相关度值p i与预设的常识尾部组中的第i个常识尾部向量y i计算出第1个循环的提问子向量a 1;将所述第一查询向量u 1与所述提问向量a 1相加得到第2个循环的第一查询向量u 2;根据所述第2个循环的第一查询向量u 2重新计算出第2个循环的提问子向量a 2以及第3个循环的第一查询向量u 3,以此类推,直至计算出第M个循环的提问子向量a M;将所述第M个循环的提问子向量a M作为所述提问向量。 In the first cycle of the first end-to-end memory network MemN2N model, the correlation between the first query vector u 1 and the ith common sense head vector x i in the preset common sense head group is calculated respectively. degree value p i ; according to the correlation degree value p i of the ith common sense head vector x i and the ith common sense tail vector y i in the preset common sense tail group, calculate the question sub-vector a 1 of the first cycle ; Add the first query vector u 1 and the question vector a 1 to obtain the first query vector u 2 of the second cycle; Recalculate the first query vector u 2 of the second cycle according to the first query vector u 2 of the second cycle The question sub-vector a 2 of 2 cycles and the first query vector u 3 of the third cycle, and so on, until the question sub-vector a M of the M-th cycle is calculated; The vector a M serves as the question vector.
进一步的,所述装置还包括:Further, the device also includes:
处理模块,用于获取常识信息库;其中,所述常识信息库包括多个以知识三元组形式表示的常识信息,且所述常识信息包括:头部、关系部和尾部;通过预设第一隐含层矩阵将每个常识信息中的头部转化为常识头部向量,从而形成常识头部组;通过预设第二隐含层矩阵将每个常识信息中的尾部转化为常识尾部向量,从而形成常识尾部组;根据每个常识信息中的关系部建立常识头部向量与常识尾部向量的对应关系。The processing module is used to obtain a common sense information base; wherein, the common sense information base includes a plurality of common sense information represented in the form of knowledge triples, and the common sense information includes: a head, a relationship part and a tail; A hidden layer matrix converts the head in each common sense information into a common sense head vector, thereby forming a common sense head group; the second hidden layer matrix is preset to convert the tail in each common sense information into a common sense tail vector , so as to form a common sense tail group; establish the corresponding relationship between the common sense head vector and the common sense tail vector according to the relationship part in each common sense information.
进一步的,答复模块203,具体用于:Further, the reply module 203 is specifically used for:
将所述提问向量作为第一层的隐藏影响因子h 0、以及将预设开始字符向量s 0输入到所述第二门递归单元GRU模型中,以得到输出向量s 1和传递到第二层的隐藏影响因子h 1;将所述输出向量s 1作为第二查询向量输入到所述第二端到端记忆网络MemN2N模型中,以得到答复向量r 1;将所述输出向量s 1和第二层的隐藏影响因子h 1重新输入到所述第二门递归单元GRU模型中,以得到输出向量s 2和传递到第三层的隐藏影响因子h 2,并将所述输出向量s 2重新输入到所述第二端到端记忆网络MemN2N模型中,以得到答复向量r 2,以此类推,直至所述第二门递归单元GRU模型的输出向量为预设结束字符向量。 The question vector is used as the hidden influence factor h 0 of the first layer, and the preset starting character vector s 0 is input into the second gate recursive unit GRU model to obtain the output vector s 1 and pass to the second layer. The hidden impact factor h 1 of The hidden influence factor h 1 of the second layer is re-input into the second gate recursive unit GRU model to obtain the output vector s 2 and the hidden influence factor h 2 passed to the third layer, and the output vector s 2 is re-input Input into the second end-to-end memory network MemN2N model to obtain a reply vector r 2 , and so on, until the output vector of the second gate recursive unit GRU model is the preset end character vector.
进一步的,答复模块203在实现所述将所述输出向量s 1作为第二查询向量输入到所述第二端到端记忆网络MemN2N模型中,以得到答复向量r 1的步骤时,具体包括: Further, when the reply module 203 implements the step of inputting the output vector s 1 as the second query vector into the second end-to-end memory network MemN2N model to obtain the reply vector r 1 , it specifically includes:
在所述第二端到端记忆网络MemN2N模型的第1个循环中,分别计算所述第二查询向量s 1与预设的答复头部组中的第i个答复头部向量k i的相关度值p i;根据第i个答复头部向量k i的相关度值p i与预设的答复尾部组中的第i个答复尾部向量l i计算出第1个循环的答 复子向量o 1;将所述第二查询向量s 1与第1个循环的答复子向量o 1相加得到第2个循环的第二查询向量s 2;根据所述第2个循环的第二查询向量s 2重新计算出第2个循环的答复子向量o 2以及第3个循环的第二查询向量s 3,以此类推,直至计算出第N个循环的答复子向量o N;将所述第N个循环的答复子向量o N作为答复向量r 1In the first cycle of the second end-to-end memory network MemN2N model, the correlation between the second query vector s 1 and the ith reply header vector ki in the preset reply header group is calculated respectively degree value p i ; according to the correlation degree value p i of the i-th reply head vector ki and the i -th reply tail vector li in the preset reply tail group, calculate the reply sub-vector o 1 of the first cycle ; Add the second query vector s 1 and the reply sub-vector o 1 of the first cycle to obtain the second query vector s 2 of the second cycle; According to the second query vector s 2 of the second cycle Recalculate the reply sub-vector o 2 of the 2nd cycle and the second query vector s 3 of the 3rd cycle, and so on, until the reply sub-vector o N of the Nth cycle is calculated; The circular reply sub-vector o N is taken as the reply vector r 1 .
更进一步的,所述处理模块,还用于:Further, the processing module is also used for:
获取答复信息库;其中,所述答复信息库包括多个以知识三元组形式表示的答复信息,且所述答复信息包括:头部、关系部和尾部;通过预设转换嵌入TransE算法将每个答复信息中的头部转化为答复头部向量,从而形成答复头部组;通过预设转换嵌入TransE算法将每个答复信息中的尾部转化为答复尾部向量,从而形成答复尾部组;根据每个答复信息中的关系部建立答复头部向量与答复尾部向量的对应关系。Obtain a reply information base; wherein, the reply information base includes a plurality of reply information represented in the form of knowledge triples, and the reply information includes: a head, a relation part and a tail; The head in each reply message is converted into a reply head vector, thereby forming a reply head group; the tail in each reply message is converted into a reply tail vector by the preset transformation and embedded TransE algorithm, thereby forming a reply tail group; according to each reply tail group; The relation part in each reply information establishes the correspondence between the reply head vector and the reply tail vector.
实施例三Embodiment 3
本实施例还提供一种计算机设备,如可以执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。如图3所示,本实施例的计算机设备30至少包括但不限于:可通过系统总线相互通信连接的存储器301、处理器302。需要指出的是,图3仅示出了具有组件301-302的计算机设备30,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。This embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including independent servers, or A server cluster composed of multiple servers), etc. As shown in FIG. 3 , the computer device 30 in this embodiment at least includes but is not limited to: a memory 301 and a processor 302 that can be communicatively connected to each other through a system bus. It should be noted that FIG. 3 only shows the computer device 30 having components 301-302, but it should be understood that implementation of all of the illustrated components is not required, and more or fewer components may be implemented instead.
本实施例中,存储器301(即可读存储介质)包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器301可以是计算机设备30的内部存储单元,例如该计算机设备30的硬盘或内存。在另一些实施例中,存储器301也可以是计算机设备30的外部存储设备,例如该计算机设备30上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器301还可以既包括计算机设备30的内部存储单元也包括其外部存储设备。在本实施例中,存储器301通常用于存储安装于计算机设备30的操作系统和各类应用软件。此外,存储器301还可以用于暂时地存储已经输出或者将要输出的各类数据。In this embodiment, the memory 301 (that is, a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (eg, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc. In some embodiments, the memory 301 may be an internal storage unit of the computer device 30 , such as a hard disk or a memory of the computer device 30 . In other embodiments, the memory 301 may also be an external storage device of the computer device 30, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc. Of course, the memory 301 may also include both the internal storage unit of the computer device 30 and its external storage device. In this embodiment, the memory 301 is generally used to store the operating system and various application software installed on the computer device 30 . In addition, the memory 301 can also be used to temporarily store various types of data that have been output or will be output.
处理器302在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器302通常用于控制计算机设备30的总体操作。In some embodiments, the processor 302 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 302 is typically used to control the overall operation of the computer device 30 .
具体的,在本实施例中,处理器302用于执行处理器302中存储的对话生成方法的程序,所述对话生成方法的程序被执行时实现如下步骤:Specifically, in this embodiment, the processor 302 is configured to execute the program of the dialogue generation method stored in the processor 302, and the following steps are implemented when the program of the dialogue generation method is executed:
获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量;Obtain question information, and utilize the preset first gate recursive unit GRU model to convert the question information into a first query vector;
根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量;According to the first query vector, use the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量;According to the question vector, the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
分别将各个答复向量转化为答复词,并将所有答复词组合为答复信息。Each reply vector is converted into reply words separately, and all reply words are combined into reply information.
上述方法步骤的具体实施例过程可参见第一实施例,本实施例在此不再重复赘述。For the specific embodiment process of the above method steps, reference may be made to the first embodiment, which will not be repeated in this embodiment.
实施例四Embodiment 4
本实施例还提供一种计算机可读存储介质,如闪存、硬盘、多媒体卡、卡型存储器(例 如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,所述计算机可读存储介质可以是非易失性,也可以是易失性,其上存储有计算机程序,所述计算机程序被处理器执行时实现如下方法步骤:This embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), only Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Programmable Read-Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disc, Server, App Store, etc., the computer-readable storage medium It can be non-volatile or volatile, and a computer program is stored thereon, and when the computer program is executed by the processor, the following method steps are implemented:
获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量;Obtain question information, and utilize the preset first gate recursive unit GRU model to convert the question information into a first query vector;
根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量;According to the first query vector, use the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量;According to the question vector, the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
分别将各个答复向量转化为答复词,并将所有答复词组合为答复信息。Each reply vector is converted into reply words separately, and all reply words are combined into reply information.
上述方法步骤的具体实施例过程可参见第一实施例,本实施例在此不再重复赘述。For the specific embodiment process of the above method steps, reference may be made to the first embodiment, which will not be repeated in this embodiment.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present application, or directly or indirectly applied in other related technical fields , are similarly included within the scope of patent protection of this application.

Claims (20)

  1. 一种对话生成方法,其中,所述方法包括:A dialogue generation method, wherein the method comprises:
    获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量;Obtain question information, and utilize the preset first gate recursive unit GRU model to convert the question information into a first query vector;
    根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量;According to the first query vector, use the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
    根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量;According to the question vector, the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
    分别将各个答复向量转化为答复词,并将所有答复词组合为答复信息。Each reply vector is converted into reply words separately, and all reply words are combined into reply information.
  2. 根据权利要求1所述的对话生成方法,其中,所述获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量,包括:The dialogue generation method according to claim 1, wherein the acquiring question information and converting the question information into a first query vector by using a preset first gate recursive unit GRU model, comprising:
    对所述提问信息进行分词处理,并将分词处理后得到的多个关键词形成词序列;Perform word segmentation processing on the question information, and form a word sequence with a plurality of keywords obtained after the word segmentation processing;
    针对所述词序列中的一个目标关键词,根据所述词序列中位于所述目标关键词前一个的关键词传递给所述目标关键词的隐藏影响因子,利用所述第一门递归单元GRU模型,计算出所述目标关键词传递给所述词序列中位于所述目标关键词后一个的关键词的隐藏影响因子;For a target keyword in the word sequence, according to the hidden influence factor of the keyword located before the target keyword in the word sequence transmitted to the target keyword, the first recursive unit GRU is used. The model calculates the hidden influence factor of the target keyword transmitted to the keyword located after the target keyword in the word sequence;
    将根据所述词序列中的最后一个关键词计算出的隐藏影响因子作为与所述提问信息对应的第一查询向量u 1The hidden influence factor calculated according to the last keyword in the word sequence is used as the first query vector u 1 corresponding to the question information.
  3. 根据权利要求2所述的对话生成方法,其中,所述根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量,包括:The dialogue generation method according to claim 2, wherein the common sense vector associated with the first query vector is determined by using a preset first end-to-end memory network MemN2N model according to the first query vector, and form a question vector according to the first query vector and the common sense vector, including:
    在所述第一端到端记忆网络MemN2N模型的第1个循环中,分别计算所述第一查询向量u 1与预设的常识头部组中的第i个常识头部向量x i的相关度值p iIn the first cycle of the first end-to-end memory network MemN2N model, the correlation between the first query vector u 1 and the ith common sense head vector x i in the preset common sense head group is calculated respectively. degree value p i ;
    根据第i个常识头部向量x i的相关度值p i与预设的常识尾部组中的第i个常识尾部向量y i计算出第1个循环的提问子向量a 1According to the correlation value pi of the ith common sense head vector x i and the ith common sense tail vector yi in the preset common sense tail group, calculate the question sub-vector a 1 of the first cycle;
    将所述第一查询向量u 1与所述提问向量a 1相加得到第2个循环的第一查询向量u 2adding the first query vector u 1 and the question vector a 1 to obtain the first query vector u 2 of the second cycle;
    根据所述第2个循环的第一查询向量u 2重新计算出第2个循环的提问子向量a 2以及第3个循环的第一查询向量u 3,以此类推,直至计算出第M个循环的提问子向量a MAccording to the first query vector u 2 of the second cycle, the question sub-vector a 2 of the second cycle and the first query vector u 3 of the third cycle are recalculated, and so on until the M-th cycle is calculated. cyclic question sub-vector a M ;
    将所述第M个循环的提问子向量a M作为所述提问向量。 The question sub-vector a M of the M-th cycle is used as the question vector.
  4. 根据权利要求3所述的对话生成方法,其中,所述方法还包括:The dialogue generation method of claim 3, wherein the method further comprises:
    获取常识信息库;其中,所述常识信息库包括多个以知识三元组形式表示的常识信息,且所述常识信息包括:头部、关系部和尾部;Obtaining a common sense information base; wherein, the common sense information base includes a plurality of common sense information represented in the form of knowledge triples, and the common sense information includes: a head, a relation part, and a tail;
    通过预设第一隐含层矩阵将每个常识信息中的头部转化为常识头部向量,从而形成常识头部组;By presetting the first hidden layer matrix, the head in each common sense information is converted into a common sense head vector, thereby forming a common sense head group;
    通过预设第二隐含层矩阵将每个常识信息中的尾部转化为常识尾部向量,从而形成常识尾部组;By presetting the second hidden layer matrix, the tail in each common sense information is converted into a common sense tail vector, thereby forming a common sense tail group;
    根据每个常识信息中的关系部建立常识头部向量与常识尾部向量的对应关系。The corresponding relationship between the common sense head vector and the common sense tail vector is established according to the relationship part in each common sense information.
  5. 根据权利要求1所述的对话生成方法,其中,所述根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量,包括:The dialogue generation method according to claim 1, wherein, according to the question vector, the question vector is converted into a plurality of second query vectors by using a preset second gate recursive unit GRU model, and each second query vector is converted into a plurality of second query vectors. The query vectors are sequentially input into the preset second end-to-end memory network MemN2N model to obtain multiple reply vectors, including:
    将所述提问向量作为第一层的隐藏影响因子h 0、以及将预设开始字符向量s 0输入到所述第二门递归单元GRU模型中,以得到输出向量s 1和传递到第二层的隐藏影响因子h 1The question vector is used as the hidden influence factor h 0 of the first layer, and the preset starting character vector s 0 is input into the second gate recursive unit GRU model to obtain the output vector s 1 and pass to the second layer. The hidden impact factor h 1 of ;
    将所述输出向量s 1作为第二查询向量输入到所述第二端到端记忆网络MemN2N模型中,以得到答复向量r 1inputting the output vector s 1 into the second end-to-end memory network MemN2N model as a second query vector to obtain a reply vector r 1 ;
    将所述输出向量s 1和第二层的隐藏影响因子h 1重新输入到所述第二门递归单元GRU模型中,以得到输出向量s 2和传递到第三层的隐藏影响因子h 2,并将所述输出向量s 2重新输入到所述第二端到端记忆网络MemN2N模型中,以得到答复向量r 2,以此类推,直至所述第二门递归单元GRU模型的输出向量为预设结束字符向量。 Re-input the output vector s 1 and the hidden influence factor h 1 of the second layer into the second gate recursive unit GRU model to obtain the output vector s 2 and the hidden influence factor h 2 passed to the third layer, and re-input the output vector s 2 into the second end-to-end memory network MemN2N model to obtain a reply vector r 2 , and so on, until the output vector of the second gate recursive unit GRU model is the Let the ending character vector.
  6. 根据权利要求5所述的对话生成方法,其中,所述将所述输出向量s 1作为第二查询向量输入到所述第二端到端记忆网络MemN2N模型中,以得到答复向量r 1,包括: The dialogue generation method according to claim 5, wherein the inputting the output vector s 1 as a second query vector into the second end-to-end memory network MemN2N model to obtain a reply vector r 1 , comprising: :
    在所述第二端到端记忆网络MemN2N模型的第1个循环中,分别计算所述第二查询向量s 1与预设的答复头部组中的第i个答复头部向量k i的相关度值p iIn the first cycle of the second end-to-end memory network MemN2N model, the correlation between the second query vector s 1 and the ith reply header vector ki in the preset reply header group is calculated respectively degree value p i ;
    根据第i个答复头部向量k i的相关度值p i与预设的答复尾部组中的第i个答复尾部向量l i计算出第1个循环的答复子向量o 1Calculate the reply sub-vector o 1 of the first cycle according to the correlation value p i of the ith reply head vector ki and the i th reply tail vector li in the preset reply tail group;
    将所述第二查询向量s 1与第1个循环的答复子向量o 1相加得到第2个循环的第二查询向量s 2adding the second query vector s 1 and the reply sub-vector o 1 of the first cycle to obtain the second query vector s 2 of the second cycle;
    根据所述第2个循环的第二查询向量s 2重新计算出第2个循环的答复子向量o 2以及第3个循环的第二查询向量s 3,以此类推,直至计算出第N个循环的答复子向量o NThe reply sub-vector o 2 of the second cycle and the second query vector s 3 of the third cycle are recalculated according to the second query vector s 2 of the second cycle, and so on until the Nth cycle is calculated. cyclic reply subvector o N ;
    将所述第N个循环的答复子向量o N作为答复向量r 1Take the reply sub-vector o N of the Nth cycle as the reply vector r 1 .
  7. 根据权利要求6所述的对话生成方法,其中,所述方法还包括:The dialogue generation method of claim 6, wherein the method further comprises:
    获取答复信息库;其中,所述答复信息库包括多个以知识三元组形式表示的答复信息,且所述答复信息包括:头部、关系部和尾部;obtaining a reply information base; wherein the reply information base includes a plurality of reply information represented in the form of knowledge triples, and the reply information includes: a head, a relation part and a tail;
    通过预设转换嵌入TransE算法将每个答复信息中的头部转化为答复头部向量,从而形成答复头部组;The head in each reply message is converted into a reply head vector by a preset conversion and embedded TransE algorithm, thereby forming a reply head group;
    通过预设转换嵌入TransE算法将每个答复信息中的尾部转化为答复尾部向量,从而形成答复尾部组;The tail in each reply message is converted into a reply tail vector by the preset transformation and embedded TransE algorithm, thereby forming a reply tail group;
    根据每个答复信息中的关系部建立答复头部向量与答复尾部向量的对应关系。The correspondence between the reply head vector and the reply tail vector is established according to the relation part in each reply information.
  8. 一种对话生成装置,其中,所述装置包括:A dialogue generation device, wherein the device comprises:
    获取模块,用于获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量;an acquisition module for acquiring question information, and converting the question information into a first query vector by using a preset first gate recursive unit GRU model;
    提问模块,用于根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量;The questioning module is configured to use the preset first end-to-end memory network MemN2N model according to the first query vector to determine the common sense vector associated with the first query vector, and to determine the common sense vector associated with the first query vector according to the first query vector and all Describe the common sense vector to form the question vector;
    答复模块,用于根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量;The answering module is configured to convert the question vector into a plurality of second query vectors according to the question vector using a preset second gate recursive unit GRU model, and input each second query vector to the preset second terminal in turn end-to-end memory network MemN2N model to get multiple reply vectors;
    转化模块,用于分别将各个答复向量转化为答复词,并将所有答复词组合为答复信息。The conversion module is used to convert each reply vector into reply words respectively, and combine all reply words into reply information.
  9. 一种计算机设备,所述计算机设备包括:存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现以下步骤:A computer device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program :
    获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量;Obtain question information, and utilize the preset first gate recursive unit GRU model to convert the question information into a first query vector;
    根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量;According to the first query vector, use the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
    根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量;According to the question vector, the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
    分别将各个答复向量转化为答复词,并将所有答复词组合为答复信息。Each reply vector is converted into reply words separately, and all reply words are combined into reply information.
  10. 根据权利要求9所述的计算机设备,其中,所述处理器执行所述计算机程序以实 现所述获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量时,包括:The computer device according to claim 9, wherein the processor executes the computer program to realize the acquisition of question information, and converts the question information into a first query by using a preset first gate recursive unit GRU model When a vector, include:
    对所述提问信息进行分词处理,并将分词处理后得到的多个关键词形成词序列;Perform word segmentation processing on the question information, and form a word sequence with a plurality of keywords obtained after the word segmentation processing;
    针对所述词序列中的一个目标关键词,根据所述词序列中位于所述目标关键词前一个的关键词传递给所述目标关键词的隐藏影响因子,利用所述第一门递归单元GRU模型,计算出所述目标关键词传递给所述词序列中位于所述目标关键词后一个的关键词的隐藏影响因子;For a target keyword in the word sequence, according to the hidden influence factor transmitted to the target keyword by the keyword located before the target keyword in the word sequence, the first recursive unit GRU is used. The model calculates the hidden influence factor of the target keyword to the keyword located after the target keyword in the word sequence;
    将根据所述词序列中的最后一个关键词计算出的隐藏影响因子作为与所述提问信息对应的第一查询向量u 1The hidden influence factor calculated according to the last keyword in the word sequence is used as the first query vector u 1 corresponding to the question information.
  11. 根据权利要求10所述的计算机设备,其中,所述处理器执行所述计算机程序以实现所述根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量时,包括:The computer device according to claim 10, wherein the processor executes the computer program to realize the determination of the correlation with the predetermined first end-to-end memory network MemN2N model according to the first query vector. When the common sense vector associated with the first query vector is described, and the question vector is formed according to the first query vector and the common sense vector, it includes:
    在所述第一端到端记忆网络MemN2N模型的第1个循环中,分别计算所述第一查询向量u 1与预设的常识头部组中的第i个常识头部向量x i的相关度值p iIn the first cycle of the first end-to-end memory network MemN2N model, the correlation between the first query vector u 1 and the ith common sense head vector x i in the preset common sense head group is calculated respectively. degree value p i ;
    根据第i个常识头部向量x i的相关度值p i与预设的常识尾部组中的第i个常识尾部向量y i计算出第1个循环的提问子向量a 1According to the correlation value pi of the ith common sense head vector x i and the ith common sense tail vector yi in the preset common sense tail group, calculate the question sub-vector a 1 of the first cycle;
    将所述第一查询向量u 1与所述提问向量a 1相加得到第2个循环的第一查询向量u 2adding the first query vector u 1 and the question vector a 1 to obtain the first query vector u 2 of the second cycle;
    根据所述第2个循环的第一查询向量u 2重新计算出第2个循环的提问子向量a 2以及第3个循环的第一查询向量u 3,以此类推,直至计算出第M个循环的提问子向量a MAccording to the first query vector u 2 of the second cycle, the question sub-vector a 2 of the second cycle and the first query vector u 3 of the third cycle are recalculated, and so on until the M-th cycle is calculated. cyclic question sub-vector a M ;
    将所述第M个循环的提问子向量a M作为所述提问向量。 The question sub-vector a M of the M-th cycle is used as the question vector.
  12. 根据权利要求11所述的计算机设备,其中,所述处理器执行所述计算机程序时还实现以下步骤:The computer device according to claim 11, wherein the processor further implements the following steps when executing the computer program:
    获取常识信息库;其中,所述常识信息库包括多个以知识三元组形式表示的常识信息,且所述常识信息包括:头部、关系部和尾部;Obtaining a common sense information base; wherein, the common sense information base includes a plurality of common sense information represented in the form of knowledge triples, and the common sense information includes: a head, a relation part, and a tail;
    通过预设第一隐含层矩阵将每个常识信息中的头部转化为常识头部向量,从而形成常识头部组;By presetting the first hidden layer matrix, the head in each common sense information is converted into a common sense head vector, thereby forming a common sense head group;
    通过预设第二隐含层矩阵将每个常识信息中的尾部转化为常识尾部向量,从而形成常识尾部组;By presetting the second hidden layer matrix, the tail in each common sense information is converted into a common sense tail vector, thereby forming a common sense tail group;
    根据每个常识信息中的关系部建立常识头部向量与常识尾部向量的对应关系。The correspondence between the common sense head vector and the common sense tail vector is established according to the relationship part in each common sense information.
  13. 根据权利要求9所述的计算机设备,其中,所述处理器执行所述计算机程序以实现所述根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量时,包括:The computer device according to claim 9, wherein the processor executes the computer program to realize the conversion of the question vector into a plurality of The second query vector, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to obtain multiple reply vectors, including:
    将所述提问向量作为第一层的隐藏影响因子h 0、以及将预设开始字符向量s 0输入到所述第二门递归单元GRU模型中,以得到输出向量s 1和传递到第二层的隐藏影响因子h 1The question vector is used as the hidden influence factor h 0 of the first layer, and the preset starting character vector s 0 is input into the second gate recursive unit GRU model to obtain the output vector s 1 and pass to the second layer. The hidden impact factor h 1 of ;
    将所述输出向量s 1作为第二查询向量输入到所述第二端到端记忆网络MemN2N模型中,以得到答复向量r 1inputting the output vector s 1 into the second end-to-end memory network MemN2N model as a second query vector to obtain a reply vector r 1 ;
    将所述输出向量s 1和第二层的隐藏影响因子h 1重新输入到所述第二门递归单元GRU模型中,以得到输出向量s 2和传递到第三层的隐藏影响因子h 2,并将所述输出向量s 2重新输入到所述第二端到端记忆网络MemN2N模型中,以得到答复向量r 2,以此类推,直至所述第二门递归单元GRU模型的输出向量为预设结束字符向量。 Re-input the output vector s 1 and the hidden influence factor h 1 of the second layer into the second gate recursive unit GRU model to obtain the output vector s 2 and the hidden influence factor h 2 passed to the third layer, and re-input the output vector s 2 into the second end-to-end memory network MemN2N model to obtain a reply vector r 2 , and so on, until the output vector of the second gate recursive unit GRU model is the Let the ending character vector.
  14. 根据权利要求13所述的计算机设备,其中,所述处理器执行所述计算机程序以实现所述将所述输出向量s 1作为第二查询向量输入到所述第二端到端记忆网络MemN2N模型中,以得到答复向量r 1时,包括: 14. The computer device of claim 13, wherein the processor executes the computer program to implement the input of the output vector s 1 as a second query vector to the second end-to-end memory network MemN2N model , to get the reply vector r1 , including:
    在所述第二端到端记忆网络MemN2N模型的第1个循环中,分别计算所述第二查询向量s 1与预设的答复头部组中的第i个答复头部向量k i的相关度值p iIn the first cycle of the second end-to-end memory network MemN2N model, the correlation between the second query vector s 1 and the ith reply header vector ki in the preset reply header group is calculated respectively degree value p i ;
    根据第i个答复头部向量k i的相关度值p i与预设的答复尾部组中的第i个答复尾部向量l i计算出第1个循环的答复子向量o 1Calculate the reply sub-vector o 1 of the first cycle according to the correlation value p i of the ith reply head vector ki and the i th reply tail vector li in the preset reply tail group;
    将所述第二查询向量s 1与第1个循环的答复子向量o 1相加得到第2个循环的第二查询向量s 2adding the second query vector s 1 and the reply sub-vector o 1 of the first cycle to obtain the second query vector s 2 of the second cycle;
    根据所述第2个循环的第二查询向量s 2重新计算出第2个循环的答复子向量o 2以及第3个循环的第二查询向量s 3,以此类推,直至计算出第N个循环的答复子向量o NThe reply sub-vector o 2 of the second cycle and the second query vector s 3 of the third cycle are recalculated according to the second query vector s 2 of the second cycle, and so on until the Nth cycle is calculated. cyclic reply subvector o N ;
    将所述第N个循环的答复子向量o N作为答复向量r 1Take the reply sub-vector o N of the Nth cycle as the reply vector r 1 .
  15. 根据权利要求14所述的计算机设备,其中,所述处理器执行所述计算机程序时还实现以下步骤:The computer device of claim 14, wherein the processor further implements the following steps when executing the computer program:
    获取答复信息库;其中,所述答复信息库包括多个以知识三元组形式表示的答复信息,且所述答复信息包括:头部、关系部和尾部;obtaining a reply information base; wherein, the reply information base includes a plurality of reply information represented in the form of knowledge triples, and the reply information includes: a head, a relation part and a tail;
    通过预设转换嵌入TransE算法将每个答复信息中的头部转化为答复头部向量,从而形成答复头部组;The head in each reply message is converted into a reply head vector by the preset conversion and embedded TransE algorithm, thereby forming a reply head group;
    通过预设转换嵌入TransE算法将每个答复信息中的尾部转化为答复尾部向量,从而形成答复尾部组;The tail in each reply message is converted into a reply tail vector by the preset transformation and embedded TransE algorithm, thereby forming a reply tail group;
    根据每个答复信息中的关系部建立答复头部向量与答复尾部向量的对应关系。The correspondence between the reply head vector and the reply tail vector is established according to the relation part in each reply information.
  16. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现以下步骤:A computer-readable storage medium on which a computer program is stored, wherein the computer program implements the following steps when executed by a processor:
    获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量;Obtain question information, and utilize the preset first gate recursive unit GRU model to convert the question information into a first query vector;
    根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量;According to the first query vector, use the preset first end-to-end memory network MemN2N model to determine the common sense vector associated with the first query vector, and form a question according to the first query vector and the common sense vector vector;
    根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量;According to the question vector, the question vector is converted into a plurality of second query vectors by using the preset second gate recursive unit GRU model, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to get multiple reply vectors;
    分别将各个答复向量转化为答复词,并将所有答复词组合为答复信息。Each reply vector is converted into reply words separately, and all reply words are combined into reply information.
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时以实现所述获取提问信息,并利用预设第一门递归单元GRU模型将所述提问信息转化为第一查询向量时,包括:The computer-readable storage medium according to claim 16, wherein the computer program is executed by the processor to realize the obtaining of the question information, and use a preset first gate recursive unit GRU model to convert the question information into The first query vector includes:
    对所述提问信息进行分词处理,并将分词处理后得到的多个关键词形成词序列;Perform word segmentation processing on the question information, and form a word sequence with a plurality of keywords obtained after the word segmentation processing;
    针对所述词序列中的一个目标关键词,根据所述词序列中位于所述目标关键词前一个的关键词传递给所述目标关键词的隐藏影响因子,利用所述第一门递归单元GRU模型,计算出所述目标关键词传递给所述词序列中位于所述目标关键词后一个的关键词的隐藏影响因子;For a target keyword in the word sequence, according to the hidden influence factor transmitted to the target keyword by the keyword located before the target keyword in the word sequence, the first recursive unit GRU is used. The model calculates the hidden influence factor of the target keyword to the keyword located after the target keyword in the word sequence;
    将根据所述词序列中的最后一个关键词计算出的隐藏影响因子作为与所述提问信息对应的第一查询向量u 1The hidden influence factor calculated according to the last keyword in the word sequence is used as the first query vector u 1 corresponding to the question information.
  18. 根据权利要求17所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时以实现所述根据所述第一查询向量,利用预设第一端到端记忆网络MemN2N模型,确定出与所述第一查询向量关联的常识向量,并根据所述第一查询向量和所述常识向量形成提问向量时,包括:The computer-readable storage medium according to claim 17, wherein, when the computer program is executed by the processor, the computer program is executed to realize the determination according to the first query vector by using a preset first end-to-end memory network MemN2N model. When generating a common sense vector associated with the first query vector, and forming a question vector according to the first query vector and the common sense vector, including:
    在所述第一端到端记忆网络MemN2N模型的第1个循环中,分别计算所述第一查询向量u 1与预设的常识头部组中的第i个常识头部向量x i的相关度值p iIn the first cycle of the first end-to-end memory network MemN2N model, the correlation between the first query vector u 1 and the ith common sense head vector x i in the preset common sense head group is calculated respectively. degree value p i ;
    根据第i个常识头部向量x i的相关度值p i与预设的常识尾部组中的第i个常识尾部向 量y i计算出第1个循环的提问子向量a 1According to the correlation value pi of the ith common sense head vector x i and the ith common sense tail vector yi in the preset common sense tail group, calculate the question sub-vector a 1 of the first cycle;
    将所述第一查询向量u 1与所述提问向量a 1相加得到第2个循环的第一查询向量u 2adding the first query vector u 1 and the question vector a 1 to obtain the first query vector u 2 of the second cycle;
    根据所述第2个循环的第一查询向量u 2重新计算出第2个循环的提问子向量a 2以及第3个循环的第一查询向量u 3,以此类推,直至计算出第M个循环的提问子向量a MAccording to the first query vector u 2 of the second cycle, the question sub-vector a 2 of the second cycle and the first query vector u 3 of the third cycle are recalculated, and so on until the M-th cycle is calculated. cyclic question sub-vector a M ;
    将所述第M个循环的提问子向量a M作为所述提问向量。 The question sub-vector a M of the M-th cycle is used as the question vector.
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时还实现以下步骤:The computer-readable storage medium of claim 18, wherein the computer program, when executed by the processor, further implements the following steps:
    获取常识信息库;其中,所述常识信息库包括多个以知识三元组形式表示的常识信息,且所述常识信息包括:头部、关系部和尾部;Obtaining a common sense information base; wherein, the common sense information base includes a plurality of common sense information represented in the form of knowledge triples, and the common sense information includes: a head, a relation part, and a tail;
    通过预设第一隐含层矩阵将每个常识信息中的头部转化为常识头部向量,从而形成常识头部组;By presetting the first hidden layer matrix, the head in each common sense information is converted into a common sense head vector, thereby forming a common sense head group;
    通过预设第二隐含层矩阵将每个常识信息中的尾部转化为常识尾部向量,从而形成常识尾部组;By presetting the second hidden layer matrix, the tail in each common sense information is converted into a common sense tail vector, thereby forming a common sense tail group;
    根据每个常识信息中的关系部建立常识头部向量与常识尾部向量的对应关系。The corresponding relationship between the common sense head vector and the common sense tail vector is established according to the relationship part in each common sense information.
  20. 根据权利要求16所述的计算机可读存储介质,其中,所述计算机程序被处理器执行时以实现所述根据所述提问向量,利用预设第二门递归单元GRU模型将所述提问向量转化为多个第二查询向量,并将各个第二查询向量依次输入到预设第二端到端记忆网络MemN2N模型中,以得到多个答复向量时,包括:The computer-readable storage medium according to claim 16, wherein the computer program is executed by the processor to realize the transformation of the question vector according to the question vector using a preset second gate recursive unit GRU model is multiple second query vectors, and each second query vector is sequentially input into the preset second end-to-end memory network MemN2N model to obtain multiple reply vectors, including:
    将所述提问向量作为第一层的隐藏影响因子h 0、以及将预设开始字符向量s 0输入到所述第二门递归单元GRU模型中,以得到输出向量s 1和传递到第二层的隐藏影响因子h 1The question vector is used as the hidden influence factor h 0 of the first layer, and the preset starting character vector s 0 is input into the second gate recursive unit GRU model to obtain the output vector s 1 and pass to the second layer. The hidden impact factor h 1 of ;
    将所述输出向量s 1作为第二查询向量输入到所述第二端到端记忆网络MemN2N模型中,以得到答复向量r 1inputting the output vector s 1 into the second end-to-end memory network MemN2N model as a second query vector to obtain a reply vector r 1 ;
    将所述输出向量s 1和第二层的隐藏影响因子h 1重新输入到所述第二门递归单元GRU模型中,以得到输出向量s 2和传递到第三层的隐藏影响因子h 2,并将所述输出向量s 2重新输入到所述第二端到端记忆网络MemN2N模型中,以得到答复向量r 2,以此类推,直至所述第二门递归单元GRU模型的输出向量为预设结束字符向量。 Re-input the output vector s 1 and the hidden influence factor h 1 of the second layer into the second gate recursive unit GRU model to obtain the output vector s 2 and the hidden influence factor h 2 passed to the third layer, and re-input the output vector s 2 into the second end-to-end memory network MemN2N model to obtain a reply vector r 2 , and so on, until the output vector of the second gate recursive unit GRU model is the Let the ending character vector.
PCT/CN2021/091292 2020-09-30 2021-04-30 Conversation generation method and apparatus, device, and readable storage medium WO2022068197A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011059826.7A CN112199482B (en) 2020-09-30 2020-09-30 Dialogue generation method, device, equipment and readable storage medium
CN202011059826.7 2020-09-30

Publications (1)

Publication Number Publication Date
WO2022068197A1 true WO2022068197A1 (en) 2022-04-07

Family

ID=74007267

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/091292 WO2022068197A1 (en) 2020-09-30 2021-04-30 Conversation generation method and apparatus, device, and readable storage medium

Country Status (2)

Country Link
CN (1) CN112199482B (en)
WO (1) WO2022068197A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199482B (en) * 2020-09-30 2023-07-21 平安科技(深圳)有限公司 Dialogue generation method, device, equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109840255A (en) * 2019-01-09 2019-06-04 平安科技(深圳)有限公司 Reply document creation method, device, equipment and storage medium
CN110377719A (en) * 2019-07-25 2019-10-25 广东工业大学 Medical answering method and device
US20200004822A1 (en) * 2018-06-30 2020-01-02 Wipro Limited Method and device for extracting attributes associated with centre of interest from natural language sentences
CN111143530A (en) * 2019-12-24 2020-05-12 平安健康保险股份有限公司 Intelligent answering method and device
CN112199482A (en) * 2020-09-30 2021-01-08 平安科技(深圳)有限公司 Dialog generation method, device, equipment and readable storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106844368B (en) * 2015-12-03 2020-06-16 华为技术有限公司 Method for man-machine conversation, neural network system and user equipment
US10692099B2 (en) * 2016-04-11 2020-06-23 International Business Machines Corporation Feature learning on customer journey using categorical sequence data
CN111414460B (en) * 2019-02-03 2024-01-19 北京邮电大学 Multi-round dialogue management method and device combining memory storage and neural network
CN110704588B (en) * 2019-09-04 2023-05-30 平安科技(深圳)有限公司 Multi-round dialogue semantic analysis method and system based on long-short-term memory network
CN111291534A (en) * 2020-02-03 2020-06-16 苏州科技大学 Global coding method for automatic summarization of Chinese long text
CN111400468B (en) * 2020-03-11 2022-07-15 思必驰科技股份有限公司 Conversation state tracking system and method, man-machine conversation device and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200004822A1 (en) * 2018-06-30 2020-01-02 Wipro Limited Method and device for extracting attributes associated with centre of interest from natural language sentences
CN109840255A (en) * 2019-01-09 2019-06-04 平安科技(深圳)有限公司 Reply document creation method, device, equipment and storage medium
CN110377719A (en) * 2019-07-25 2019-10-25 广东工业大学 Medical answering method and device
CN111143530A (en) * 2019-12-24 2020-05-12 平安健康保险股份有限公司 Intelligent answering method and device
CN112199482A (en) * 2020-09-30 2021-01-08 平安科技(深圳)有限公司 Dialog generation method, device, equipment and readable storage medium

Also Published As

Publication number Publication date
CN112199482B (en) 2023-07-21
CN112199482A (en) 2021-01-08

Similar Documents

Publication Publication Date Title
CN110019471B (en) Generating text from structured data
CN110347799B (en) Language model training method and device and computer equipment
WO2020048292A1 (en) Method and apparatus for generating network representation of neural network, storage medium, and device
CN112329465A (en) Named entity identification method and device and computer readable storage medium
BR112019014822A2 (en) NEURAL NETWORKS FOR ATTENTION-BASED SEQUENCE TRANSDUCTION
CN110929515A (en) Reading understanding method and system based on cooperative attention and adaptive adjustment
WO2021212601A1 (en) Image-based writing assisting method and apparatus, medium, and device
CN111460800B (en) Event generation method, device, terminal equipment and storage medium
CN110619124B (en) Named entity identification method and system combining attention mechanism and bidirectional LSTM
CN112084301B (en) Training method and device for text correction model, text correction method and device
WO2020192307A1 (en) Answer extraction method and apparatus based on deep learning, and computer device and storage medium
JP2021033995A (en) Text processing apparatus, method, device, and computer-readable storage medium
AU2019270109B2 (en) Chapter-level text translation method and device
CN111814489A (en) Spoken language semantic understanding method and system
CN116069931A (en) Hierarchical label text classification method, system, equipment and storage medium
CN112560456A (en) Generation type abstract generation method and system based on improved neural network
WO2022068197A1 (en) Conversation generation method and apparatus, device, and readable storage medium
WO2023108981A1 (en) Method and apparatus for training text generation model, and storage medium and computer device
CN115906815A (en) Error correction method and device for modifying one or more types of wrong sentences
CN112837673B (en) Speech synthesis method, device, computer equipment and medium based on artificial intelligence
CN113420869B (en) Translation method based on omnidirectional attention and related equipment thereof
JP6633556B2 (en) Acoustic model learning device, speech recognition device, acoustic model learning method, speech recognition method, and program
CN112364602B (en) Multi-style text generation method, device, equipment and readable storage medium
CN112509559B (en) Audio recognition method, model training method, device, equipment and storage medium
WO2022257468A1 (en) Method and apparatus for updating dialogue management system, and computer device and storage medium

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: 21873860

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21873860

Country of ref document: EP

Kind code of ref document: A1