WO2021068490A1 - Reply message generation method and apparatus, computer device and storage medium - Google Patents

Reply message generation method and apparatus, computer device and storage medium Download PDF

Info

Publication number
WO2021068490A1
WO2021068490A1 PCT/CN2020/087818 CN2020087818W WO2021068490A1 WO 2021068490 A1 WO2021068490 A1 WO 2021068490A1 CN 2020087818 W CN2020087818 W CN 2020087818W WO 2021068490 A1 WO2021068490 A1 WO 2021068490A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
target
user
phrase
synonymous
Prior art date
Application number
PCT/CN2020/087818
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 WO2021068490A1 publication Critical patent/WO2021068490A1/en

Links

Images

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/26Speech to text systems
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/06Creation of reference templates; Training of speech recognition systems, e.g. adaptation to the characteristics of the speaker's voice
    • G10L15/063Training
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/08Speech classification or search
    • G10L15/16Speech classification or search using artificial neural networks
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/22Procedures used during a speech recognition process, e.g. man-machine dialogue
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/28Constructional details of speech recognition systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/02User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail using automatic reactions or user delegation, e.g. automatic replies or chatbot-generated messages
    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10LSPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
    • G10L15/00Speech recognition
    • G10L15/22Procedures used during a speech recognition process, e.g. man-machine dialogue
    • G10L2015/223Execution procedure of a spoken command

Definitions

  • This application relates to the field of artificial intelligence technology, in particular to a method, device, computer equipment, and storage medium for generating a reply message.
  • customer service methods have gradually developed into online online customer service methods. Through the customer service system, communication and exchanges between merchants and customers can be facilitated.
  • the response mode of the customer service system can be divided into manual response mode and automatic response mode.
  • Sexual response, that is, the traditional automatic response mode has the problem of low information recognition accuracy.
  • a method for generating a reply message comprising:
  • a phrase is selected from each synonymous phrase set, and the selected phrases are combined to generate a reply message.
  • a reply message generating device comprising:
  • a user information obtaining module configured to receive voice messages input by a target user in real time, and obtain the identity of the target user according to the voice information;
  • the personality classification result acquisition module is used to acquire the relationship between the preset identity identifier and the personality classification result, and obtain the personality classification target corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result result;
  • Candidate message generating module for extracting target keywords contained in the voice message, and generating a response candidate message according to the target keywords and the personality classification target result;
  • a candidate message processing module configured to obtain the sentence structure of the reply candidate message, and split the reply candidate message according to the sentence structure to obtain multiple phrases;
  • the synonym acquisition module is used to acquire the synonym corresponding to each phrase from the preset thesaurus, and obtain the synonymous phrase set corresponding to each phrase;
  • the reply message generating module is used to select a phrase from each synonymous phrase set according to the sentence structure of the reply candidate message, and combine the selected phrases to generate a reply message.
  • a computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when the processor executes the computer program:
  • a phrase is selected from each synonymous phrase set, and the selected phrases are combined to generate a reply message.
  • a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
  • a phrase is selected from each synonymous phrase set, and the selected phrases are combined to generate a reply message.
  • the foregoing reply message generation method, device, computer equipment and storage medium integrate the personality classification target results and the dimensions of the keywords in the voice message to generate reply candidate messages; on the other hand, the reply candidate messages are split and processed to obtain Multiple phrases, get the synonyms corresponding to each phrase, get the synonymous phrase set corresponding to each phrase, combine the phrases in each synonymous phrase set to generate a reply message, so that the final reply message obtained integrates multiple dimensional considerations.
  • the accuracy of information recognition can be improved, and the form of reply messages can be enriched, and the flexibility of reply can be improved.
  • Figure 1 is an application environment diagram of a method for generating a reply message in an embodiment
  • Figure 2 is a schematic flowchart of a method for generating a reply message in an embodiment
  • FIG. 3 is a schematic flowchart of a step of generating a reply message in an embodiment
  • Figure 4 is a structural block diagram of an apparatus for generating a reply message in an embodiment
  • Fig. 5 is an internal structure diagram of a computer device in an embodiment.
  • the method for generating a reply message provided in this application can be applied to the application environment as shown in FIG. 1.
  • the user terminal 102 communicates with the server 104 through the network.
  • the server 104 receives the voice message input by the target user from the user terminal 102 in real time, and obtains the identity of the target user according to the voice message.
  • the user terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, and tablet computers.
  • the server 104 may be implemented by an independent server or a server cluster composed of multiple servers.
  • a method for generating a reply message is provided. Taking the method applied to the server in FIG. 1 as an example for description, the method includes the following steps:
  • Step 202 Receive the voice message input by the target user in real time, and obtain the identity of the target user according to the voice information.
  • the voice message may be sent by a user through a user terminal for consulting on a business of interest.
  • the target user refers to a user who has a business consulting requirement and sends a voice message.
  • a user can download a financial application program on the user terminal, and then enter a financial voice message in the chat box loaded by the application program.
  • User identification is used to identify different users.
  • Step 204 Obtain the relationship between the preset identity identifier and the personality classification result, and obtain the personality classification target result corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result.
  • the preset relationship between the identity identifier and the personality classification result before obtaining the personality classification target result corresponding to the identity identifier of the target user, it also includes: sending a personality test question to the user terminal, and receiving feedback from different user terminals on the personality test question And the corresponding identity identification; according to the feedback on the personality test questions and the predetermined personality classification rules, the personality classification results corresponding to different identification identifications are obtained; according to the personality classification results corresponding to the different identification identifications, the preset identification identification and personality classification results are generated Relationship. For example, users can be divided into talkative and brief, extroverted and introverted, professional and non-professional, and so on.
  • Step 206 Extract the target keywords contained in the voice message, and generate response candidate messages according to the target keywords and the personality classification target results.
  • the voice message can be converted into a text message through automatic voice recognition technology, and the key words of the text message can be obtained through the trained natural language understanding model.
  • ASR Automatic Speech Recognition, automatic speech recognition
  • NLU Natural Language Understanding
  • models such as neural network models, use previous text data for training to classify input text data into various intents. If the voice message is a voice message, such as data from a phone or microphone, the original voice data is converted into text through automatic voice recognition. In addition, by analyzing the voice message, the emotional state of the user can be inferred. If it is a text message, the keywords are directly obtained through the trained natural language understanding model.
  • the preset database stores keywords and answers corresponding to the keywords. Search in the database according to the extracted keywords to obtain the answers corresponding to the extracted keywords; the comprehensive personality classification target results and the answers corresponding to the extracted keywords are generated Reply to candidate messages.
  • the answer candidate message includes the answer corresponding to the extracted keyword plus some emoticons, or the answer corresponding to the keyword is organized in a formal sentence as the answer candidate message.
  • Step 208 Obtain the sentence structure of the reply candidate message, and split the reply candidate message according to the sentence structure to obtain multiple phrases.
  • the reply candidate message Take “what is the current number of money owed to banks you are required to pay back?" as the reply candidate message, and obtain the sentence structure of the reply candidate message, such as subject-predicate structure, subject-predicate-object structure, subject-predicate-object structure, subject-predicate structure, subject The predicate-object-complement structure, etc., split the response candidate message according to the sentence structure, and obtain multiple different phrases such as what is the current number of, money owed to banks, you, are required to pay back, etc.
  • sentence structure of the reply candidate message such as subject-predicate structure, subject-predicate-object structure, subject-predicate-object structure, subject-predicate structure, subject The predicate-object-complement structure, etc.
  • Step 210 Obtain synonyms corresponding to each phrase from a preset thesaurus, and obtain a synonymous phrase set corresponding to each phrase.
  • search for replacement phrases/synonym phrases for each phrase from the preset corpus and get the synonymous phrase set corresponding to each phrase as ⁇ how many
  • Step 212 According to the sentence structure of the reply candidate message, a phrase is selected from each synonymous phrase set, and the selected phrases are merged to generate a reply message.
  • the reply candidate message is: "what is the current number of money owed to banks you are required to pay back?" to obtain the sentence structure of the reply candidate message, and split the reply candidate message according to the sentence structure, Obtain multiple different phrases such as what is the current number of, money owed to banks, you, are required to pay back, etc., and search for the replacement phrase/synonym phrase of each phrase from the preset corpus to obtain the synonymous phrase corresponding to each phrase Collection ⁇ how many
  • a phrase is selected from each synonymous phrase set, and the selected phrases are merged to generate a processed reply message with the same content as the reply candidate message but different wording. Specifically, it can be:
  • the above method for generating reply messages integrates multiple dimensions such as the user’s language model, personality classification target results, and keywords in the voice message to generate reply candidate messages; on the other hand, the reply candidate messages are split and processed to obtain multiple Get the synonym corresponding to each phrase, get the synonymous phrase set corresponding to each phrase, combine the phrases in each synonymous phrase set to generate a reply message, so that the final reply message not only integrates multiple dimensional considerations,
  • the accuracy of information recognition can be improved, and the form of reply messages can be enriched, and the flexibility of reply can be improved.
  • a phrase is selected from each synonymous phrase set, and the selected phrases are merged to generate the reply message before further including: 302.
  • Number each synonymous phrase set in sequence and determine the synonymous grammatical structure according to the current grammatical structure of the reply candidate message;
  • step 304 determine the synonymous grammatical structure according to the sequence of each synonymous phrase set in the synonymous grammatical structure Corresponding sentence structure;
  • select a phrase from each synonymous phrase set separately merge the selected phrases to generate a reply message, including: step 306, corresponding from the synonymous grammatical structure Select a sentence structure in the sentence structure, select a phrase from each synonymous phrase set to combine according to the selected sentence structure, perform grammatical correction on the combined sentence, and generate a reply message.
  • search for the replacement phrase/synonym phrase of each phrase from the preset corpus obtain the synonymous phrase set corresponding to each phrase, and number the synonymous phrase set in order to obtain: [1] ⁇ how many
  • obtain the current grammatical structure of the reply candidate message search in the grammar library according to the current grammatical structure of the reply candidate message, and obtain all the selectable synonymous grammatical structures of the reply candidate message, and determine the number of a single grammatical structure and synonymous phrase set
  • the sentence structure of the reply candidate message The details can be as follows: 1): "[1][2]you[3]"?
  • sentence structure 5 As an example, by selecting the synonymous phrase set 1_1, 2_2, 3_3, the sentence obtained is:
  • the reply message generation method further includes: performing language pattern recognition on the voice message based on the written language vocabulary to obtain the language pattern of the target user; generating the reply candidate message according to the target keywords and personality classification target results, including: The target user’s language model, personality classification target result, and preset demand classification model are used to obtain the user’s demand type.
  • the demand classification model is a neural network model that has been trained to solve the user’s demand type; Set the keyword-answer correspondence relationship to search to obtain the target answer corresponding to the target keyword; generate a response candidate message according to the user's demand type and the target answer. In this way, the response candidate message is generated from multiple dimensions to ensure its comprehensiveness.
  • the robot module in the server can be called to detect the written vocabulary contained in the voice message; when the written vocabulary contained in the voice message is less than a preset threshold, the user’s language mode is obtained as an informal language mode; when the voice message contains When the written language vocabulary of is greater than or equal to the preset threshold, the user's language mode is obtained as a formal language mode.
  • Pre-set rules If the number of written words in the voice message is less than the threshold, it is determined that the user language mode belongs to the informal language mode L1; if the number of written words in the voice message is greater than or equal to the threshold, it is determined that the user language mode belongs to the formal language mode L2.
  • the user's language mode can be determined. If the user uses spoken short sentences (such as "yo”, “hi”, "yup"), it is judged as an informal language mode. If the user uses the sentence structure of the written language, such as "good morning”, “good afternoon” and longer written sentence substructures, it is judged as a formal language mode.
  • a candidate reply message is generated. For example, a user habitually checks the bank balance at a certain time of the day. After learning this mode, the robot R can actively send data without the user's request.
  • the chatbot module of a formal role can suggest that the user set aside some money for long-term savings after receiving a monthly salary; chatbots in an informal role may also make similar suggestions. Over time, you can evaluate which role can more effectively achieve the user's financial goals.
  • the consumption can be presented as a pie chart, list or bar chart. If users prefer informal chatbots, these charts may be animated and cartoonized with "cute" artwork. However, if users prefer formal chatbots, then this representation is more likely to be concise, static, and commercial.
  • the training of the neural network model includes: obtaining sample data.
  • the sample data includes the language pattern of the sample user, the corresponding personality classification result and the corresponding demand type; the language pattern of the sample user and the corresponding personality classification result are input into the neural network model for processing Train to obtain the training result; compare the training result with the corresponding demand type of the sample user, adjust the parameters of the neural network model until the training result meets the preset conditions, and obtain the trained neural network model for solving the user demand type.
  • the preset database stores keywords and the answers corresponding to the keywords. According to the extracted target keywords, search in the database to obtain the answers corresponding to the extracted target keywords; comprehensive user’s needs types and the extracted target keywords correspond to Answer, generate reply candidate message. If the financial robot module is a chat robot model corresponding to the "official" role, it will respond with a lengthy formal sentence. If the financial robot module is a chat robot model corresponding to an "informal" role, a shorter colloquial sentence is used to respond, and emojis can also be used.
  • Robot R_f "Good morning Jacob, what can I do for you today?"
  • the robot module uses “formal” and “informal” chatbot roles, and there may be more and more personas, such as “happy”, “business”, “childish”, “scolding”, “old man” , “Wise”, “carefree” and so on.
  • a reply message generation device including: user information acquisition module 402, personality classification result acquisition module 404, candidate message generation module 406, candidate message processing module 408, synonym acquisition Module 410 and reply message generating module 412.
  • the user information obtaining module is used to receive the voice message input by the target user in real time, and obtain the identity of the target user according to the voice message.
  • the personality classification result acquisition module is used to acquire the relationship between the preset identity identifier and the personality classification result, and obtain the personality classification target result corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result.
  • the candidate message generating module is used to extract the target keywords contained in the voice message, and generate the reply candidate message according to the target keywords and the character classification target result.
  • the candidate message processing module is used to obtain the sentence structure of the reply candidate message, and split the reply candidate message according to the sentence structure to obtain multiple phrases.
  • the synonym acquisition module is used to acquire the synonyms corresponding to each phrase from the preset thesaurus, and obtain the synonymous phrase set corresponding to each phrase.
  • the reply message generation module is used to select a phrase from each synonymous phrase set according to the sentence structure of the reply candidate message, and combine the selected phrases to generate a reply message.
  • the reply message generation module further includes a sentence pattern determination module, which is used to sequentially number each synonymous phrase set, and determine the synonymous grammatical structure of the reply candidate message according to the current grammatical structure of the reply candidate message;
  • the sequence of the synonymous phrase set in the synonymous grammatical structure determines the sentence structure corresponding to the synonymous grammatical structure;
  • the reply message generation module is used to select a sentence structure from the syntactic structure corresponding to the synonymous grammatical structure. Select a phrase from each synonymous phrase set to combine the sentence structure of, and make grammatical corrections to the combined sentence to generate a reply message.
  • the personality classification result acquisition module also includes a corresponding relationship establishment module, which is used to send personality test questions to the user terminal, and receive feedback on the personality test questions from different user terminals and the corresponding identification; according to the personality test Question feedback and predetermined personality classification rules to obtain the personality classification results of different identities; according to the personality classification results corresponding to the different identities, the relationship between the preset identity identification and the personality classification results is generated.
  • a corresponding relationship establishment module which is used to send personality test questions to the user terminal, and receive feedback on the personality test questions from different user terminals and the corresponding identification; according to the personality test Question feedback and predetermined personality classification rules to obtain the personality classification results of different identities; according to the personality classification results corresponding to the different identities, the relationship between the preset identity identification and the personality classification results is generated.
  • the reply message generating device further includes a language pattern acquisition module, which is used to perform language pattern recognition on the voice message based on the written language vocabulary to obtain the language pattern of the target user; the candidate message generation module is used to generate the language pattern of the target user according to the language pattern of the target user.
  • a language pattern acquisition module which is used to perform language pattern recognition on the voice message based on the written language vocabulary to obtain the language pattern of the target user
  • the candidate message generation module is used to generate the language pattern of the target user according to the language pattern of the target user.
  • Personality classification target results and preset demand classification model to obtain the user's demand type, where the demand classification model is a neural network model that has been trained to solve the user's demand type; according to the target keyword in the preset keyword- Search in the answer correspondence relationship to obtain the target answer corresponding to the target keyword; generate a response candidate message according to the user's demand type and target answer.
  • the language mode acquisition module is also used to obtain the user’s language mode as an informal language mode when the written language vocabulary contained in the voice message is less than a preset threshold; when the written language vocabulary contained in the voice message is greater than or equal to the predetermined threshold, When the threshold is set, the user's language mode is obtained as the official language mode.
  • the candidate message generation module also includes a model building module before it is used to obtain sample data.
  • the sample data includes the language mode of the sample user, the corresponding personality classification result, and the corresponding demand type; the language mode of the sample user and The corresponding personality classification results are input to the neural network model for training, and the training results are obtained; the training results are compared with the corresponding types of needs of the sample users, and the parameters of the neural network model are adjusted until the training results meet the preset conditions, and the trained users are obtained.
  • Neural network model for solving the types of user needs.
  • Each module in the above reply message generating device can be implemented in whole or in part by software, hardware or a combination thereof.
  • the above modules can be embedded in the form of hardware or independent of the processor in the computer device, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 5.
  • the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, a computer program, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the database of the computer equipment is used to store data such as the relationship between the identity identifier and the personality classification result, and reply messages.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for generating a reply message is realized.
  • FIG. 5 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
  • a computer device including a memory and a processor, the memory stores a computer program, and the processor implements the steps of the reply message generation method in any embodiment when the computer program is executed.
  • the method for generating a reply message mainly includes: receiving voice information input by a target user in real time, and obtaining the identity of the target user according to the voice information; obtaining the relationship between the preset identity and the result of personality classification, and obtaining the relationship between the preset identity and the personality classification result according to the prediction.
  • a candidate reply message is generated; the sentence structure of the candidate reply message is obtained, and the candidate reply message is split according to the sentence structure to obtain a plurality of phrases; each of the above-mentioned phrases is obtained from the preset thesaurus Synonyms corresponding to the phrase, obtain the synonymous phrase set corresponding to each phrase; according to the sentence structure of the reply candidate message, select a phrase from each synonymous phrase set, and combine the selected phrases To generate a reply message.
  • a computer-readable storage medium is provided.
  • the computer-readable storage medium may be non-volatile or volatile, and a computer program is stored thereon.
  • the method for generating a reply message mainly includes: receiving voice information input by a target user in real time, and obtaining the identity of the target user according to the voice information; obtaining the relationship between the preset identity and the result of personality classification, and obtaining the relationship between the preset identity and the personality classification result according to the prediction.
  • a candidate reply message is generated; the sentence structure of the candidate reply message is obtained, and the candidate reply message is split according to the sentence structure to obtain a plurality of phrases; each of the above-mentioned phrases is obtained from the preset thesaurus Synonyms corresponding to the phrase, obtain the synonymous phrase set corresponding to each phrase; according to the sentence structure of the reply candidate message, select a phrase from each synonymous phrase set, and combine the selected phrases To generate a reply message.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Evolutionary Computation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

The present application relates to the technical field of artificial intelligence, is applied to the financial industry, and relates in particular to a reply message generation method and apparatus, a computer device and a storage medium. The method in one embodiment comprises: receiving in real time a voice message inputted by a target user, and acquiring an identity identification of the target user according to the voice message; obtaining a personality classification target result according to a preset relationship between identity identifications and personality classification results; extracting a target keyword contained in the voice message, and generating a reply candidate message according to the target keyword and the personality classification target result; acquiring the sentence structure of the reply candidate message, splitting the reply candidate message according to the sentence structure to obtain a plurality of phrases, and acquiring from a preset synonym library a synonym corresponding to each phrase so as to obtain a synonymous phrase set corresponding to each phrase; and according to the sentence structure of the reply candidate message, selecting one phrase from each synonymous phrase set and combining the various selected phrases to generate a reply message.

Description

答复消息生成方法、装置、计算机设备和存储介质Reply message generating method, device, computer equipment and storage medium
本申请要求于2019年10月12日提交中国专利局、申请号为201910968475.2,发明名称为“答复消息生成方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on October 12, 2019, the application number is 201910968475.2, and the invention title is "response message generation method, device, computer equipment and storage medium", the entire content of which is incorporated by reference Incorporated in this application.
技术领域Technical field
本申请涉及人工智能技术领域,特别是涉及一种答复消息生成方法、装置、计算机设备和存储介质。This application relates to the field of artificial intelligence technology, in particular to a method, device, computer equipment, and storage medium for generating a reply message.
背景技术Background technique
随着互联网技术的发展,越来越多的用户通过互联网获取所需信息,因此,客户服务方式逐渐发展为网络在线客服方式。通过客服系统,可以方便商家与客户之间的沟通和交流。With the development of Internet technology, more and more users obtain required information through the Internet. Therefore, customer service methods have gradually developed into online online customer service methods. Through the customer service system, communication and exchanges between merchants and customers can be facilitated.
客服系统的应答模式可以分为人工应答模式和自动应答模式,发明人意识到,传统的自动应答模式都是模板化的答复,无法精准识别用户的咨询信息,从而根据用户的咨询需求做出适应性的应答,即传统的自动应答模式存在信息识别准确率低的问题。The response mode of the customer service system can be divided into manual response mode and automatic response mode. The inventor realized that the traditional automatic response mode is a templated response, which cannot accurately identify the user's consulting information, so as to adapt to the user's consulting needs. Sexual response, that is, the traditional automatic response mode has the problem of low information recognition accuracy.
发明内容Summary of the invention
基于此,有必要针对上述技术问题,提供一种能够提高信息识别准确率的答复消息生成方法、装置、计算机设备和存储介质。Based on this, it is necessary to provide a response message generation method, device, computer equipment, and storage medium that can improve the accuracy of information recognition in response to the above technical problems.
一种答复消息生成方法,所述方法包括:A method for generating a reply message, the method comprising:
实时接收目标用户输入的语音消息,并根据所述语音信息获取所述目标用户的身份标识;Receiving the voice message input by the target user in real time, and obtaining the identity of the target user according to the voice information;
获取预设的身份标识与性格分类结果的关系,根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果;Acquiring the relationship between the preset identity identifier and the personality classification result, and obtaining the personality classification target result corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result;
提取所述语音消息中的目标关键词,根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息;Extracting target keywords in the voice message, and generating response candidate messages according to the target keywords and the personality classification target results;
获取所述答复候选消息的句式结构,根据所述句式结构对所述答复候选消息进行拆分处理,得到多个短语;Acquiring the sentence structure of the candidate reply message, and splitting the candidate reply message according to the sentence structure to obtain multiple phrases;
从预设同义词库中获取各所述短语对应的同义词,得到所述各个短语对应的同义短语集合;Obtain the synonyms corresponding to each phrase from the preset thesaurus, and obtain the synonymous phrase set corresponding to each phrase;
根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息。According to the sentence structure of the candidate reply message, a phrase is selected from each synonymous phrase set, and the selected phrases are combined to generate a reply message.
一种答复消息生成装置,所述装置包括:A reply message generating device, the device comprising:
用户信息获取模块,用于实时接收目标用户输入的语音消息,并根据所述语音信息获取所述目标用户的身份标识;A user information obtaining module, configured to receive voice messages input by a target user in real time, and obtain the identity of the target user according to the voice information;
性格分类结果获取模块,用于获取预设的身份标识与性格分类结果的关系,根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果;The personality classification result acquisition module is used to acquire the relationship between the preset identity identifier and the personality classification result, and obtain the personality classification target corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result result;
候选消息生成模块,用于提取所述语音消息包含的目标关键词,根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息;Candidate message generating module for extracting target keywords contained in the voice message, and generating a response candidate message according to the target keywords and the personality classification target result;
候选消息处理模块,用于获取所述答复候选消息的句式结构,根据所述句式结构对所述答复候选消息进行拆分处理,得到多个短语;A candidate message processing module, configured to obtain the sentence structure of the reply candidate message, and split the reply candidate message according to the sentence structure to obtain multiple phrases;
同义词获取模块,用于从预设同义词库中获取各所述短语对应的同义词,得到所述各个短语对应的同义短语集合;The synonym acquisition module is used to acquire the synonym corresponding to each phrase from the preset thesaurus, and obtain the synonymous phrase set corresponding to each phrase;
答复消息生成模块,用于根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息。The reply message generating module is used to select a phrase from each synonymous phrase set according to the sentence structure of the reply candidate message, and combine the selected phrases to generate a reply message.
一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:A computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when the processor executes the computer program:
实时接收目标用户输入的语音消息,并根据所述语音信息获取所述目标用户的身份标识;Receiving the voice message input by the target user in real time, and obtaining the identity of the target user according to the voice information;
获取预设的身份标识与性格分类结果的关系,根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果;Acquiring the relationship between the preset identity identifier and the personality classification result, and obtaining the personality classification target result corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result;
提取所述语音消息包含的目标关键词,根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息;Extracting the target keywords contained in the voice message, and generating a response candidate message according to the target keywords and the personality classification target result;
获取所述答复候选消息的句式结构,根据所述句式结构对所述答复候选消息进行拆分处理,得到多个短语;Acquiring the sentence structure of the candidate reply message, and splitting the candidate reply message according to the sentence structure to obtain multiple phrases;
从预设同义词库中获取各所述短语对应的同义词,得到所述各个短语对应的同义短语集合;Obtain the synonyms corresponding to each phrase from the preset thesaurus, and obtain the synonymous phrase set corresponding to each phrase;
根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息。According to the sentence structure of the candidate reply message, a phrase is selected from each synonymous phrase set, and the selected phrases are combined to generate a reply message.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:A computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
实时接收目标用户输入的语音消息,并根据所述语音信息获取所述目标用户的身份标识;Receiving the voice message input by the target user in real time, and obtaining the identity of the target user according to the voice information;
获取预设的身份标识与性格分类结果的关系,根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果;Acquiring the relationship between the preset identity identifier and the personality classification result, and obtaining the personality classification target result corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result;
提取所述语音消息包含的目标关键词,根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息;Extracting the target keywords contained in the voice message, and generating a response candidate message according to the target keywords and the personality classification target result;
获取所述答复候选消息的句式结构,根据所述句式结构对所述答复候选消息进行拆分处理,得到多个短语;Acquiring the sentence structure of the candidate reply message, and splitting the candidate reply message according to the sentence structure to obtain multiple phrases;
从预设同义词库中获取各所述短语对应的同义词,得到所述各个短语对应的同义短语集合;Obtain the synonyms corresponding to each phrase from the preset thesaurus, and obtain the synonymous phrase set corresponding to each phrase;
根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息。According to the sentence structure of the candidate reply message, a phrase is selected from each synonymous phrase set, and the selected phrases are combined to generate a reply message.
上述答复消息生成方法、装置、计算机设备和存储介质,一方面综合性格分类目标结果以及语音消息中的关键词等维度,生成答复候选消息;另一方面,对答复候选消息进行拆分处理,得到多个短语,获取各短语对应的同义词,得到各个短语对应的同义短语集合,对各同义短语集合中的短语进行组合,生成答复消息,这样最终得到的答复消息综合了多个维度考虑,可以提高信息识别的准确率,还可以丰富答复消息形式,提高了答复灵活性。The foregoing reply message generation method, device, computer equipment and storage medium, on the one hand, integrate the personality classification target results and the dimensions of the keywords in the voice message to generate reply candidate messages; on the other hand, the reply candidate messages are split and processed to obtain Multiple phrases, get the synonyms corresponding to each phrase, get the synonymous phrase set corresponding to each phrase, combine the phrases in each synonymous phrase set to generate a reply message, so that the final reply message obtained integrates multiple dimensional considerations. The accuracy of information recognition can be improved, and the form of reply messages can be enriched, and the flexibility of reply can be improved.
附图说明Description of the drawings
图1为一个实施例中答复消息生成方法的应用环境图;Figure 1 is an application environment diagram of a method for generating a reply message in an embodiment;
图2为一个实施例中答复消息生成方法的流程示意图;Figure 2 is a schematic flowchart of a method for generating a reply message in an embodiment;
图3为一个实施例中答复消息生成步骤的流程示意图;FIG. 3 is a schematic flowchart of a step of generating a reply message in an embodiment;
图4为一个实施例中答复消息生成装置的结构框图;Figure 4 is a structural block diagram of an apparatus for generating a reply message in an embodiment;
图5为一个实施例中计算机设备的内部结构图。Fig. 5 is an internal structure diagram of a computer device in an embodiment.
具体实施方式Detailed ways
本申请提供的答复消息生成方法,可以应用于如图1所示的应用环境中。其中,用户终端102通过网络与服务器104进行通信。服务器104从用户终端102实时接收目标用户输入的语音消息,并根据语音消息获取目标用户的身份标识。获取预设的身份标识与性格分类结果的关系,根据预设的身份标识与性格分类结果的关系,得到与目标用户的身份标识对应的性格分类目标结果;提取语音消息包含的目标关键词,根据目标关键词以及性格分类目标结果,生成答复候选消息;获取答复候选消息的句式结构,根据句式结构对答复候选消息进行拆分处理,得到多个短语,从预设同义词库中获取各短语对应的同义词,得到各个短语对应的同义短语集合;根据答复候选消息的句式结构,分别从每个同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息。其中,用户终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机和平板电脑,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The method for generating a reply message provided in this application can be applied to the application environment as shown in FIG. 1. Among them, the user terminal 102 communicates with the server 104 through the network. The server 104 receives the voice message input by the target user from the user terminal 102 in real time, and obtains the identity of the target user according to the voice message. Obtain the relationship between the preset ID and the personality classification result, and obtain the personality classification target result corresponding to the target user's ID according to the relationship between the preset ID and the personality classification result; extract the target keywords contained in the voice message according to Target keywords and personality classification target results, generate response candidate messages; obtain the sentence structure of the response candidate message, split the response candidate message according to the sentence structure, obtain multiple phrases, and obtain each phrase from the preset thesaurus Corresponding synonyms, the corresponding synonymous phrase set of each phrase is obtained; according to the sentence structure of the reply candidate message, a phrase is selected from each synonymous phrase set, and the selected phrases are combined to generate a reply message. The user terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, and tablet computers. The server 104 may be implemented by an independent server or a server cluster composed of multiple servers.
在一个实施例中,如图2所示,提供了一种答复消息生成方法,以该方法应用于图1中的服务器为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2, a method for generating a reply message is provided. Taking the method applied to the server in FIG. 1 as an example for description, the method includes the following steps:
步骤202,实时接收目标用户输入的语音消息,并根据语音信息获取目标用户的身份标识。Step 202: Receive the voice message input by the target user in real time, and obtain the identity of the target user according to the voice information.
语音消息可以是用户通过用户终端发出,用于对感兴趣的业务进行咨询,目标用户是指有业务咨询需求,并发送语音消息的用户。比如用户可以在用户终端上下载某金融应用程序,然后在该应用程序加载的聊天框中输入金融语音消息。用户身份标识用于标识不同的用户。The voice message may be sent by a user through a user terminal for consulting on a business of interest. The target user refers to a user who has a business consulting requirement and sends a voice message. For example, a user can download a financial application program on the user terminal, and then enter a financial voice message in the chat box loaded by the application program. User identification is used to identify different users.
步骤204,获取预设的身份标识与性格分类结果的关系,根据预设的身份标识与性格分类结果的关系,得到与目标用户的身份标识对应的性格分类目标结果。Step 204: Obtain the relationship between the preset identity identifier and the personality classification result, and obtain the personality classification target result corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result.
根据预设的身份标识与性格分类结果的关系,得到与目标用户的身份标识对应的性格分类目标结果之前,还包括:向用户终端发送性格测试问题,并接收不同用户终端对性格测试问题的反馈以及对应的身份标识;根据对性格测试问题的反馈以及预定的性格分类规则,得到不同身份标识对应的性格分类结果;根据不同身份标识对应的性格分类结果,生成预设的身份标识与性格分类结果的关系。比如可以将用户分为健谈型和简要型,外向型和内向型,专业型和非专业型等等。将每一种性格分类结果与一类特定个性的聊天机器人模块相关联,相关联的聊天机器人模块将通过用户更青睐的方式与用户进行交谈。通过区分不同类型的机器人模块不仅可以提高对语音消息解析的精准性,还可以加快对用户咨询的响应速度。According to the preset relationship between the identity identifier and the personality classification result, before obtaining the personality classification target result corresponding to the identity identifier of the target user, it also includes: sending a personality test question to the user terminal, and receiving feedback from different user terminals on the personality test question And the corresponding identity identification; according to the feedback on the personality test questions and the predetermined personality classification rules, the personality classification results corresponding to different identification identifications are obtained; according to the personality classification results corresponding to the different identification identifications, the preset identification identification and personality classification results are generated Relationship. For example, users can be divided into talkative and brief, extroverted and introverted, professional and non-professional, and so on. Associate each personality classification result with a specific personality chat robot module, and the associated chat robot module will talk to the user in a way that the user prefers. By distinguishing different types of robot modules, not only the accuracy of the analysis of voice messages can be improved, but also the response speed to user inquiries can be accelerated.
步骤206,提取语音消息包含的目标关键词,根据目标关键词以及性格分类目标结果,生成答复候选消息。Step 206: Extract the target keywords contained in the voice message, and generate response candidate messages according to the target keywords and the personality classification target results.
可以通过自动语音识别技术将语音消息转换为文本消息,通过已训练的自然语言理解模型获取文本消息的关键词。ASR(Automatic Speech Recognition,自动语音识别)技术是将人类的语音中的词汇内容转换为计算机可读的输入,例如按键、二进制编码或者字符序列。NLU(Natural Language Understanding,自然语言理解)模型,比如神经网络模型,使用先前的文本数据进行训练,实现将输入文本数据分类为各种意图。如果语音消息是语音消息,例如来自电话或麦克风的数据,则通过自动语音识别将原始语音数据转换为文本。此外,通过对语音消息进行分析,可以推断用户的情绪状态。如果是文本消息,则直接通过已训练的自然语言理解模型获取关键词。The voice message can be converted into a text message through automatic voice recognition technology, and the key words of the text message can be obtained through the trained natural language understanding model. ASR (Automatic Speech Recognition, automatic speech recognition) technology is to convert the vocabulary content of human speech into computer-readable input, such as keystrokes, binary codes, or character sequences. NLU (Natural Language Understanding) models, such as neural network models, use previous text data for training to classify input text data into various intents. If the voice message is a voice message, such as data from a phone or microphone, the original voice data is converted into text through automatic voice recognition. In addition, by analyzing the voice message, the emotional state of the user can be inferred. If it is a text message, the keywords are directly obtained through the trained natural language understanding model.
预设数据库中存储有关键词以及与关键词对应的答案,根据提取的关键词在数据库中查找,得到提取的关键词对应的答案;综合性格分类目标结果以及提取的关键词对应的答案,生成答复候选消息。比如答复候选消息包括提取的关键词对应的答案加上某些表情符号,或者以正式句子组织关键词对应的答案 作为答复候选消息。The preset database stores keywords and answers corresponding to the keywords. Search in the database according to the extracted keywords to obtain the answers corresponding to the extracted keywords; the comprehensive personality classification target results and the answers corresponding to the extracted keywords are generated Reply to candidate messages. For example, the answer candidate message includes the answer corresponding to the extracted keyword plus some emoticons, or the answer corresponding to the keyword is organized in a formal sentence as the answer candidate message.
步骤208,获取答复候选消息的句式结构,根据句式结构对答复候选消息进行拆分处理,得到多个短语。Step 208: Obtain the sentence structure of the reply candidate message, and split the reply candidate message according to the sentence structure to obtain multiple phrases.
以“what is the current number of money owed to banks you are required to pay back?”作为答复候选消息,获取答复候选消息的句式结构,比如主谓结构、主谓宾结构、主系表结构、主谓宾补结构等,根据句式结构对答复候选消息进行拆分处理,得到what is the current number of、money owed to banks、you、are required to pay back等多个不同的短语。Take "what is the current number of money owed to banks you are required to pay back?" as the reply candidate message, and obtain the sentence structure of the reply candidate message, such as subject-predicate structure, subject-predicate-object structure, subject-predicate-object structure, subject-predicate structure, subject The predicate-object-complement structure, etc., split the response candidate message according to the sentence structure, and obtain multiple different phrases such as what is the current number of, money owed to banks, you, are required to pay back, etc.
步骤210,从预设同义词库中获取各短语对应的同义词,得到各个短语对应的同义短语集合。Step 210: Obtain synonyms corresponding to each phrase from a preset thesaurus, and obtain a synonymous phrase set corresponding to each phrase.
承上所述,从预设语料库中查找各个短语的替换短语/同义词短语,得到各个短语对应的同义短语集合为{how many|what is the current amount of|what is the total value of}{outstanding loans|money owed to banks|debts}you{current have|currentlyowe|are required to pay back}。Continuing from the above, search for replacement phrases/synonym phrases for each phrase from the preset corpus, and get the synonymous phrase set corresponding to each phrase as {how many|what is the current amount of|what is the total value of} {outstanding loans|money owed to banks|debts}you {current have|currentlyowe|are required to pay back}.
步骤212,根据答复候选消息的句式结构,分别从每个同义短语集合中选择一个短语,将选择的各个短语合并,生成答复消息。Step 212: According to the sentence structure of the reply candidate message, a phrase is selected from each synonymous phrase set, and the selected phrases are merged to generate a reply message.
通过对答复候选消息进行拓展处理,可以避免答复消息形式单一的问题。例如,答复候选消息为:“what is the current number of money owed to banks you are required to pay back?”获取答复候选消息的句式结构,根据所述句式结构对答复候选消息进行拆分处理,得到what is the current number of、money owed to banks、you、are required to pay back等多个不同的短语,从预设语料库中查找各个短语的替换短语/同义词短语,得到各个短语对应的同义短语集合{how many|what is the current amount of|what is the total value of}{outstanding loans|money owed to banks|debts}you{current have|currentlyowe|are required to pay back}。根据答复候选消息的句式结构,分别从各个同义短语集合中选择一个短语,将选择的各个短语合并,生成与答复候选消息内容相同但措辞不同的处理后的答复消息具体可以是:By expanding the processing of the reply candidate message, the problem of a single reply message form can be avoided. For example, the reply candidate message is: "what is the current number of money owed to banks you are required to pay back?" to obtain the sentence structure of the reply candidate message, and split the reply candidate message according to the sentence structure, Obtain multiple different phrases such as what is the current number of, money owed to banks, you, are required to pay back, etc., and search for the replacement phrase/synonym phrase of each phrase from the preset corpus to obtain the synonymous phrase corresponding to each phrase Collection {how many|what is the current amount of|what is the total value of} {outstanding loans|money owed to banks|debts}you{current have|currentlyowe|are required to payback}. According to the sentence structure of the reply candidate message, a phrase is selected from each synonymous phrase set, and the selected phrases are merged to generate a processed reply message with the same content as the reply candidate message but different wording. Specifically, it can be:
-“how many outstanding loans you are currently required to pay back?”-"How many outstanding loans you are currently required to pay back?"
-“what is the total value of money owed to banks you currently have?”-"What is the total value of money owed to banks you currently have?"
上述答复消息生成方法,一方面综合用户的语言模式、性格分类目标结果以及语音消息中的关键词等多个维度,生成答复候选消息;另一方面,对答复候选消息进行拆分处理,得到多个短语,获取各短语对应的同义词,得到各个短语对应的同义短语集合,对各同义短语集合中的短语进行组合,生成答复消息,这样最终得到的答复消息不仅综合了多个维度考虑,可以提高信息识别的准确率,还可以丰富答复消息形式,提高了答复灵活性。The above method for generating reply messages, on the one hand, integrates multiple dimensions such as the user’s language model, personality classification target results, and keywords in the voice message to generate reply candidate messages; on the other hand, the reply candidate messages are split and processed to obtain multiple Get the synonym corresponding to each phrase, get the synonymous phrase set corresponding to each phrase, combine the phrases in each synonymous phrase set to generate a reply message, so that the final reply message not only integrates multiple dimensional considerations, The accuracy of information recognition can be improved, and the form of reply messages can be enriched, and the flexibility of reply can be improved.
在一个实施例中,如图3所示,根据答复候选消息的句式结构,分别从每 个同义短语集合中选择一个短语,将选择的各个短语合并,生成答复消息之前,还包括:步骤302,对各同义短语集合进行顺序编号,根据答复候选消息的当前语法结构确定同义语法结构;步骤304,根据各同义短语集合在同义语法结构中的次序,确定与同义语法结构对应的句式结构;根据答复候选消息的句式结构,分别从每个同义短语集合中选择一个短语,将选择的各个短语合并,生成答复消息,包括:步骤306,从同义语法结构对应的句式结构中选择一个句式结构,根据已选择的句式结构从每个同义短语集合中选择一个短语进行组合,对组合后的句子进行语法修正,生成答复消息。通过对答复候选消息进行上述拓展处理,可以避免答复消息形式单一的问题。例如:“With respect to the financial institutions you currently deal and the{outstanding loans|money owed to banks|debts}you{currently have|currentlyowe|are required to pay back},could you tell me{how many|what is the current amount of|what is the total amount of}these”?在这种情况下,可以生成3*3*3*2=54个句子,各个句子各不相同。以语法变化的方法得到具有相同含义的句子,可以通过以下方式实现。首先从预设语料库中查找各个短语的替换短语/同义词短语,得到各个短语对应的同义短语集合,并对同义短语集合按顺序编号,得到:[1]{how many|what is the current amount of|what is the total value of};[2]{outstanding loans|money owed to banks|debts};[3]{current have|currentlyowe|are required to pay back}。然后获取答复候选消息的当前语法结构,根据答复候选消息的当前语法结构在语法库中查找,得到答复候选消息的所有可选择的同义语法结构,综合单个语法结构以及同义短语集合的编号确定答复候选消息的句式结构。具体可以如下:1):“[1][2]you[3]”?In one embodiment, as shown in FIG. 3, according to the sentence structure of the reply candidate message, a phrase is selected from each synonymous phrase set, and the selected phrases are merged to generate the reply message before further including: 302. Number each synonymous phrase set in sequence, and determine the synonymous grammatical structure according to the current grammatical structure of the reply candidate message; step 304, determine the synonymous grammatical structure according to the sequence of each synonymous phrase set in the synonymous grammatical structure Corresponding sentence structure; according to the sentence structure of the reply candidate message, select a phrase from each synonymous phrase set separately, merge the selected phrases to generate a reply message, including: step 306, corresponding from the synonymous grammatical structure Select a sentence structure in the sentence structure, select a phrase from each synonymous phrase set to combine according to the selected sentence structure, perform grammatical correction on the combined sentence, and generate a reply message. By performing the above-mentioned expansion processing on the reply candidate message, the problem of a single reply message form can be avoided. For example: "Withrespect to the financial institutions you currently deal and the {outstanding loans|money owed to banks|debts}you{currently have|currentlyowe|are required to payback},could be you tell me{howmanthey| current amount of|what is the total amount of}these"? In this case, 3*3*3*2=54 sentences can be generated, and each sentence is different. Using grammatical changes to obtain sentences with the same meaning can be achieved in the following ways. First, search for the replacement phrase/synonym phrase of each phrase from the preset corpus, obtain the synonymous phrase set corresponding to each phrase, and number the synonymous phrase set in order to obtain: [1] {how many|what is the current amount of|what is the total value of}; [2] {outstanding loans|money owed to banks|debts}; [3] {current have|currentlyowe|are required to pay back}. Then obtain the current grammatical structure of the reply candidate message, search in the grammar library according to the current grammatical structure of the reply candidate message, and obtain all the selectable synonymous grammatical structures of the reply candidate message, and determine the number of a single grammatical structure and synonymous phrase set The sentence structure of the reply candidate message. The details can be as follows: 1): "[1][2]you[3]"?
2):“With respect to the financial institutions you currently deal with and the[2]you[3],could you tell me[1]these you have”?2): "With respect to the financial institutions you currently deal with and the[2]you[3],could you tell me[1]these you have"?
3):“if we consider the”[2]you[3],what is the current amount of[2]and it’s value?3): "if we consider the"[2]you[3],what is the current amount of[2]and it’s value?
4):“You“[3]“how many[2]?4): "You"[3]"how many[2]?
5):“At this point in time”,[1][2]“that you”[3]5):"At this point in time",[1][2]"that you"[3]
选择以上任意一个句式结构,再从同义短语集合中选择该句式结构的组成部分。以句式结构5为例,通过选择同义短语集合1_1,2_2,3_3,得到的句子为:Choose any of the above sentence structures, and then select the components of the sentence structure from the synonymous phrase set. Taking sentence structure 5 as an example, by selecting the synonymous phrase set 1_1, 2_2, 3_3, the sentence obtained is:
“At this point in time,how many money owed to banks that you are required to pay back”"At this point in time, how many money owed to banks that you are required to pay back"
对组合得到的句子进行语法修正,得到答复消息:Correct the grammar of the combined sentence and get the reply message:
“At this point in time,how much money owed to banks are you required to pay back”?"At this point in time, how much money owed to banks are you required to pay back"?
以句式结构4为例,通过选择同义短语集合3_2,2_1,得到的句子为:Taking sentence structure 4 as an example, by selecting the synonymous phrase set 3_2, 2_1, the sentence obtained is:
“You currently owe how many outstanding loans?”,该句子的语法是正确的,因此进行语法修正,仍为同一句话。"You currently owe how many outstanding loans?", the grammar of the sentence is correct, so the grammatical correction is still the same sentence.
以句式结构2为例,通过选择同义短语集合2_1,3_1,1_2,得到的句子为:Taking sentence structure 2 as an example, by selecting the synonymous phrase set 2_1, 3_1, 1_2, the sentence obtained is:
“With respect to the financial institutions you currently deal with and the outstanding loans you currently have,could you tell me what is the current amount of these you have?”"With respect to the financial institutions you currently deal with and the outstanding loans you currently have, could you tell me what is the current amount of these you have?"
进行语法修正后的句子为:The sentence after grammatical correction is:
“With respect to the financial institutions you currently deal with and the outstanding loans you currently have,could you tell me what is the current amount of these you have?”"With respect to the financial institutions you currently deal with and the outstanding loans you currently have, could you tell me what is the current amount of these you have?"
在一个实施例中,答复消息生成方法还包括:基于书面语词汇量对语音消息进行语言模式识别,得到目标用户的语言模式;根据目标关键词以及性格分类目标结果,生成答复候选消息,包括:根据目标用户的语言模式、性格分类目标结果以及预设的需求分类模型,得到用户的需求类型,其中,需求分类模型为已训练的用于求解用户需求类型的神经网络模型;根据目标关键词在预设的关键词-答案对应关系中查找,得到与目标关键词对应的目标答案;根据用户的需求类型以及目标答案,生成答复候选消息。这样从多个维度考虑生成答复候选消息,以保证其全面性。比如,可以调用服务器中的机器人模块检测语音消息中包含的书面语词汇量;当语音消息中包含的书面语词汇量小于预设阈值时,得到用户的语言模式为非正式语言模式;当语音消息中包含的书面语词汇量大于或等于预设阈值时,得到用户的语言模式为正式语言模式。In one embodiment, the reply message generation method further includes: performing language pattern recognition on the voice message based on the written language vocabulary to obtain the language pattern of the target user; generating the reply candidate message according to the target keywords and personality classification target results, including: The target user’s language model, personality classification target result, and preset demand classification model are used to obtain the user’s demand type. Among them, the demand classification model is a neural network model that has been trained to solve the user’s demand type; Set the keyword-answer correspondence relationship to search to obtain the target answer corresponding to the target keyword; generate a response candidate message according to the user's demand type and the target answer. In this way, the response candidate message is generated from multiple dimensions to ensure its comprehensiveness. For example, the robot module in the server can be called to detect the written vocabulary contained in the voice message; when the written vocabulary contained in the voice message is less than a preset threshold, the user’s language mode is obtained as an informal language mode; when the voice message contains When the written language vocabulary of is greater than or equal to the preset threshold, the user's language mode is obtained as a formal language mode.
预先设置规则,如果语音消息中书面语数量小于阈值时,判定用户语言模式属于非正式语言模式L1;如果语音消息中书面语数量大于或等于阈值时,则判定用户语言模式属于正式语言模式L2。通过检测用户语音消息包含的书面语数量,由此判定用户的语言模式。如果用户使用口语短句(如“yo”,“hi”,“yup”),则判定为非正式语言模式。如果用户使用书面语的句子结构,例如“早上好”、“下午好”和更长的书面语句子结构,则判定为正式语言模式。Pre-set rules. If the number of written words in the voice message is less than the threshold, it is determined that the user language mode belongs to the informal language mode L1; if the number of written words in the voice message is greater than or equal to the threshold, it is determined that the user language mode belongs to the formal language mode L2. By detecting the number of written words contained in the user's voice message, the user's language mode can be determined. If the user uses spoken short sentences (such as "yo", "hi", "yup"), it is judged as an informal language mode. If the user uses the sentence structure of the written language, such as "good morning", "good afternoon" and longer written sentence substructures, it is judged as a formal language mode.
根据用户的需求类型以及目标答案,生成答复候选消息,比如某用户在一天的特定时间习惯性地查看银行余额。在学习该模式之后,机器人R可以主动发送数据而无需用户请求。在更复杂的自动学习场景中,正式角色的聊天机器人模块可以建议用户在获取到月薪之后为长期储蓄留出一些钱;非正式角色的聊天机器人可能也会提出类似的建议。随着时间的推移,可以评估哪个角色可以更有效地实现用户的财务目标。在另一个示例中,如果用户请求查看自己的每月消费,则可以将消费呈现为饼图,列表或条形图。如果用户更喜欢非正式的聊天机器人,那么这些图表可能会带有“可爱”艺术品的动画和卡通化。然而,如果用户更喜欢正式的聊天机器人,那么这种表示更可能是简洁、静态和 商务化的。According to the user's demand type and target answer, a candidate reply message is generated. For example, a user habitually checks the bank balance at a certain time of the day. After learning this mode, the robot R can actively send data without the user's request. In more complex automatic learning scenarios, the chatbot module of a formal role can suggest that the user set aside some money for long-term savings after receiving a monthly salary; chatbots in an informal role may also make similar suggestions. Over time, you can evaluate which role can more effectively achieve the user's financial goals. In another example, if a user requests to view their monthly consumption, the consumption can be presented as a pie chart, list or bar chart. If users prefer informal chatbots, these charts may be animated and cartoonized with "cute" artwork. However, if users prefer formal chatbots, then this representation is more likely to be concise, static, and commercial.
神经网络模型的训练,包括:获取样本数据,样本数据包括样本用户的语言模式、对应的性格分类结果以及对应的需求类型;将样本用户的语言模式以及对应的性格分类结果输入至神经网络模型进行训练,得到训练结果;将训练结果与样本用户对应的需求类型进行比较,调整神经网络模型的参数,直到训练结果满足预设条件,得到已训练的用于求解用户需求类型的神经网络模型。The training of the neural network model includes: obtaining sample data. The sample data includes the language pattern of the sample user, the corresponding personality classification result and the corresponding demand type; the language pattern of the sample user and the corresponding personality classification result are input into the neural network model for processing Train to obtain the training result; compare the training result with the corresponding demand type of the sample user, adjust the parameters of the neural network model until the training result meets the preset conditions, and obtain the trained neural network model for solving the user demand type.
预设数据库中存储有关键词以及与关键词对应的答案,根据提取的目标关键词在数据库中查找,得到提取的目标关键词对应的答案;综合用户的需求类型以及提取的目标关键词对应的答案,生成答复候选消息。如果金融机器人模块为“正式”角色对应的聊天机器人模型,则通过冗长正式句子进行响应。如果金融机器人模块为“非正式”角色对应的聊天机器人模型,则使用较短的口语化句子进行响应,还可以使用表情符号。The preset database stores keywords and the answers corresponding to the keywords. According to the extracted target keywords, search in the database to obtain the answers corresponding to the extracted target keywords; comprehensive user’s needs types and the extracted target keywords correspond to Answer, generate reply candidate message. If the financial robot module is a chat robot model corresponding to the "official" role, it will respond with a lengthy formal sentence. If the financial robot module is a chat robot model corresponding to an "informal" role, a shorter colloquial sentence is used to respond, and emojis can also be used.
比如:such as:
(正式聊天机器人)(Official chatbot)
用户A:“早上好”User A: "Good morning"
机器人R_f:“早上好雅各布,今天能为你做什么?”Robot R_f: "Good morning Jacob, what can I do for you today?"
(非正式聊天机器人)(Informal chatbot)
用户A:“嘿Paco”User A: "Hey Paco"
机器人R_i:“怎么样?”Robot R_i: "How is it?"
在示例中机器人模块使用了“正式”和“非正式”聊天机器人角色,可能会有越来越多的人物角色,例如“快乐”,“商务”,“幼稚”,“责骂”,“老人”,“明智”,“无忧无虑”等。In the example, the robot module uses "formal" and "informal" chatbot roles, and there may be more and more personas, such as "happy", "business", "childish", "scolding", "old man" , "Wise", "carefree" and so on.
应该理解的是,虽然图2-3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowchart of FIGS. 2-3 are displayed in sequence as indicated by the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order for the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in Figure 2-3 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. These sub-steps or stages The execution order of is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
在一个实施例中,如图4所示,提供了一种答复消息生成装置,包括:用户信息获取模块402、性格分类结果获取模块404、候选消息生成模块406、候选消息处理模块408、同义词获取模块410以及答复消息生成模块412。其中,用户信息获取模块,用于实时接收目标用户输入的语音消息,并根据语音消息获取目标用户的身份标识。性格分类结果获取模块,用于获取预设的身份标识与性格分类结果的关系,根据预设的身份标识与性格分类结果的关系,得到与目标用户的身份标识对应的性格分类目标结果。候选消息生成模块,用于提取 语音消息包含的目标关键词,根据目标关键词以及性格分类目标结果,生成答复候选消息。候选消息处理模块,用于获取答复候选消息的句式结构,根据句式结构对答复候选消息进行拆分处理,得到多个短语。同义词获取模块,用于从预设同义词库中获取各短语对应的同义词,得到各个短语对应的同义短语集合。答复消息生成模块,用于根据答复候选消息的句式结构,分别从每个同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息。In one embodiment, as shown in FIG. 4, a reply message generation device is provided, including: user information acquisition module 402, personality classification result acquisition module 404, candidate message generation module 406, candidate message processing module 408, synonym acquisition Module 410 and reply message generating module 412. Among them, the user information obtaining module is used to receive the voice message input by the target user in real time, and obtain the identity of the target user according to the voice message. The personality classification result acquisition module is used to acquire the relationship between the preset identity identifier and the personality classification result, and obtain the personality classification target result corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result. The candidate message generating module is used to extract the target keywords contained in the voice message, and generate the reply candidate message according to the target keywords and the character classification target result. The candidate message processing module is used to obtain the sentence structure of the reply candidate message, and split the reply candidate message according to the sentence structure to obtain multiple phrases. The synonym acquisition module is used to acquire the synonyms corresponding to each phrase from the preset thesaurus, and obtain the synonymous phrase set corresponding to each phrase. The reply message generation module is used to select a phrase from each synonymous phrase set according to the sentence structure of the reply candidate message, and combine the selected phrases to generate a reply message.
在一个实施例中,答复消息生成模块之前还包括句式确定模块,用于对各同义短语集合进行顺序编号,根据答复候选消息的当前语法结构确定答复候选消息同义语法结构;根据各同义短语集合在同义语法结构中的次序,确定与同义语法结构对应的句式结构;答复消息生成模块用于从同义语法结构对应的句式结构中选择一个句式结构,根据已选择的句式结构从每个同义短语集合中选择一个短语进行组合,对组合后的句子进行语法修正,生成答复消息。In one embodiment, the reply message generation module further includes a sentence pattern determination module, which is used to sequentially number each synonymous phrase set, and determine the synonymous grammatical structure of the reply candidate message according to the current grammatical structure of the reply candidate message; The sequence of the synonymous phrase set in the synonymous grammatical structure determines the sentence structure corresponding to the synonymous grammatical structure; the reply message generation module is used to select a sentence structure from the syntactic structure corresponding to the synonymous grammatical structure. Select a phrase from each synonymous phrase set to combine the sentence structure of, and make grammatical corrections to the combined sentence to generate a reply message.
在一个实施例中,性格分类结果获取模块之前还包括对应关系建立模块,用于向用户终端发送性格测试问题,并接收不同用户终端对性格测试问题的反馈以及对应的身份标识;根据对性格测试问题的反馈以及预定的性格分类规则,得到不同身份标识的性格分类结果;根据不同身份标识对应的性格分类结果,生成预设的身份标识与性格分类结果的关系。In one embodiment, the personality classification result acquisition module also includes a corresponding relationship establishment module, which is used to send personality test questions to the user terminal, and receive feedback on the personality test questions from different user terminals and the corresponding identification; according to the personality test Question feedback and predetermined personality classification rules to obtain the personality classification results of different identities; according to the personality classification results corresponding to the different identities, the relationship between the preset identity identification and the personality classification results is generated.
在一个实施例中,答复消息生成装置还包括语言模式获取模块,用于基于书面语词汇量对语音消息进行语言模式识别,得到目标用户的语言模式;候选消息生成模块用于根据目标用户的语言模式、性格分类目标结果以及预设的需求分类模型,得到用户的需求类型,其中,需求分类模型为已训练的用于求解用户需求类型的神经网络模型;根据目标关键词在预设的关键词-答案对应关系中查找,得到与目标关键词对应的目标答案;根据用户的需求类型以及目标答案,生成答复候选消息。In one embodiment, the reply message generating device further includes a language pattern acquisition module, which is used to perform language pattern recognition on the voice message based on the written language vocabulary to obtain the language pattern of the target user; the candidate message generation module is used to generate the language pattern of the target user according to the language pattern of the target user. , Personality classification target results and preset demand classification model to obtain the user's demand type, where the demand classification model is a neural network model that has been trained to solve the user's demand type; according to the target keyword in the preset keyword- Search in the answer correspondence relationship to obtain the target answer corresponding to the target keyword; generate a response candidate message according to the user's demand type and target answer.
在一个实施例中,语言模式获取模块还用于当语音消息包含的书面语词汇量小于预设阈值时,得到用户的语言模式为非正式语言模式;当语音消息包含的书面语词汇量大于或等于预设阈值时,得到用户的语言模式为正式语言模式。In one embodiment, the language mode acquisition module is also used to obtain the user’s language mode as an informal language mode when the written language vocabulary contained in the voice message is less than a preset threshold; when the written language vocabulary contained in the voice message is greater than or equal to the predetermined threshold, When the threshold is set, the user's language mode is obtained as the official language mode.
在一个实施例中,候选消息生成模块之前还包括模型建立模块,用于获取样本数据,样本数据包括样本用户的语言模式、对应的性格分类结果以及对应的需求类型;将样本用户的语言模式以及对应的性格分类结果输入至神经网络模型进行训练,得到训练结果;将训练结果与样本用户对应的需求类型进行比较,调整神经网络模型的参数,直到训练结果满足预设条件,得到已训练的用于求解用户需求类型的神经网络模型。In one embodiment, the candidate message generation module also includes a model building module before it is used to obtain sample data. The sample data includes the language mode of the sample user, the corresponding personality classification result, and the corresponding demand type; the language mode of the sample user and The corresponding personality classification results are input to the neural network model for training, and the training results are obtained; the training results are compared with the corresponding types of needs of the sample users, and the parameters of the neural network model are adjusted until the training results meet the preset conditions, and the trained users are obtained. Neural network model for solving the types of user needs.
关于答复消息生成装置的具体限定可以参见上文中对于答复消息生成方法的限定,在此不再赘述。上述答复消息生成装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算 机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Regarding the specific limitation of the reply message generating device, please refer to the above limitation on the reply message generating method, which will not be repeated here. Each module in the above reply message generating device can be implemented in whole or in part by software, hardware or a combination thereof. The above modules can be embedded in the form of hardware or independent of the processor in the computer device, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图5所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储身份标识与性格分类结果的关系、答复消息等数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种答复消息生成方法。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. 5. The computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used to store data such as the relationship between the identity identifier and the personality classification result, and reply messages. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for generating a reply message is realized.
本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 5 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,该存储器存储有计算机程序,该处理器执行计算机程序时实现任一实施例中答复消息生成方法的步骤。其中,答复消息生成方法主要包括:实时接收目标用户输入的语音信息,并根据所述语音信息获取所述目标用户的身份标识;获取预设的身份标识与性格分类结果的关系,根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果;提取所述语音信息包含的目标关键词,根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息;获取所述答复候选消息的句式结构,根据所述句式结构对所述答复候选消息进行拆分处理,得到多个短语;从预设同义词库中获取各所述短语对应的同义词,得到所述各个短语对应的同义短语集合;根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息。In one embodiment, a computer device is provided, including a memory and a processor, the memory stores a computer program, and the processor implements the steps of the reply message generation method in any embodiment when the computer program is executed. The method for generating a reply message mainly includes: receiving voice information input by a target user in real time, and obtaining the identity of the target user according to the voice information; obtaining the relationship between the preset identity and the result of personality classification, and obtaining the relationship between the preset identity and the personality classification result according to the prediction. Set the relationship between the identity identifier and the personality classification result to obtain the personality classification target result corresponding to the identity identifier of the target user; extract the target keywords contained in the voice information, and according to the target keywords and the personality classification targets As a result, a candidate reply message is generated; the sentence structure of the candidate reply message is obtained, and the candidate reply message is split according to the sentence structure to obtain a plurality of phrases; each of the above-mentioned phrases is obtained from the preset thesaurus Synonyms corresponding to the phrase, obtain the synonymous phrase set corresponding to each phrase; according to the sentence structure of the reply candidate message, select a phrase from each synonymous phrase set, and combine the selected phrases To generate a reply message.
在一个实施例中,提供了一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性,其上存储有计算机程序,计算机程序被处理器执行时实现任一实施例中答复消息生成方法的步骤。其中,答复消息生成方法主要包括:实时接收目标用户输入的语音信息,并根据所述语音信息获取所述目标用户的身份标识;获取预设的身份标识与性格分类结果的关系,根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果;提取所述语音信息包含的目标关键词,根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息;获取所述答复候选消息的句式结构,根据所述句式结构对所述答复候选消息进行拆分处理, 得到多个短语;从预设同义词库中获取各所述短语对应的同义词,得到所述各个短语对应的同义短语集合;根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息。In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium may be non-volatile or volatile, and a computer program is stored thereon. When the computer program is executed by a processor, Implement the steps of the reply message generation method in any embodiment. The method for generating a reply message mainly includes: receiving voice information input by a target user in real time, and obtaining the identity of the target user according to the voice information; obtaining the relationship between the preset identity and the result of personality classification, and obtaining the relationship between the preset identity and the personality classification result according to the prediction. Set the relationship between the identity identifier and the personality classification result to obtain the personality classification target result corresponding to the identity identifier of the target user; extract the target keywords contained in the voice information, and according to the target keywords and the personality classification targets As a result, a candidate reply message is generated; the sentence structure of the candidate reply message is obtained, and the candidate reply message is split according to the sentence structure to obtain a plurality of phrases; each of the above-mentioned phrases is obtained from the preset thesaurus Synonyms corresponding to the phrase, obtain the synonymous phrase set corresponding to each phrase; according to the sentence structure of the reply candidate message, select a phrase from each synonymous phrase set, and combine the selected phrases To generate a reply message.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage. In the medium, when the computer program is executed, it may include the procedures of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not a limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation manners of the present application, and their description is relatively specific and detailed, but they should not be understood as a limitation on the scope of the invention patent. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can be made, and these all fall within the protection scope of this application. Therefore, the scope of protection of the patent of this application shall be subject to the appended claims.

Claims (20)

  1. 一种答复消息生成方法,其中,所述方法包括:A method for generating a reply message, wherein the method includes:
    实时接收目标用户输入的语音信息,并根据所述语音信息获取所述目标用户的身份标识;Receiving the voice information input by the target user in real time, and obtaining the identity of the target user according to the voice information;
    获取预设的身份标识与性格分类结果的关系,根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果;Acquiring the relationship between the preset identity identifier and the personality classification result, and obtaining the personality classification target result corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result;
    提取所述语音信息包含的目标关键词,根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息;Extracting the target keywords contained in the voice information, and generating a response candidate message according to the target keywords and the personality classification target result;
    获取所述答复候选消息的句式结构,根据所述句式结构对所述答复候选消息进行拆分处理,得到多个短语;Acquiring the sentence structure of the candidate reply message, and splitting the candidate reply message according to the sentence structure to obtain multiple phrases;
    从预设同义词库中获取各所述短语对应的同义词,得到所述各个短语对应的同义短语集合;Obtain the synonyms corresponding to each phrase from the preset thesaurus, and obtain the synonymous phrase set corresponding to each phrase;
    根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息。According to the sentence structure of the candidate reply message, a phrase is selected from each synonymous phrase set, and the selected phrases are combined to generate a reply message.
  2. 根据权利要求1所述的方法,其中,所述根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息之前,还包括:2. The method according to claim 1, wherein the sentence structure of the candidate message for reply selects a phrase from each synonymous phrase set, and combines the selected phrases to generate a reply message Before, it also included:
    对各所述同义短语集合进行顺序编号,根据所述答复候选消息的当前语法结构确定同义语法结构;Serially number each of the synonymous phrase sets, and determine the synonymous grammatical structure according to the current grammatical structure of the reply candidate message;
    根据所述各同义短语集合在所述同义语法结构中的次序,确定与所述同义语法结构对应的句式结构;Determine the sentence structure corresponding to the synonymous grammatical structure according to the sequence of the synonymous phrase set in the synonymous grammatical structure;
    所述根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息,包括:According to the sentence structure of the reply candidate message, selecting a phrase from each synonymous phrase set and combining the selected phrases to generate a reply message includes:
    从所述同义语法结构对应的句式结构中选择一个句式结构,根据已选择的句式结构从每个所述同义短语集合中选择一个短语进行组合,对组合后的句子进行语法修正,生成答复消息。Select a sentence structure from the sentence structure corresponding to the synonymous grammatical structure, select a phrase from each synonymous phrase set to combine according to the selected sentence structure, and perform grammatical correction on the combined sentence To generate a reply message.
  3. 根据权利要求1所述的方法,其中,所述根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果之前,还包括:The method according to claim 1, wherein before obtaining the personality classification target result corresponding to the identity of the target user according to the relationship between the preset identity identifier and the personality classification result, the method further comprises:
    向用户终端发送性格测试问题,并接收不同用户终端对所述性格测试问题的反馈以及对应的身份标识;Sending a personality test question to the user terminal, and receiving feedback from different user terminals on the personality test question and the corresponding identification;
    根据所述对性格测试问题的反馈以及预定的性格分类规则,得到不同身份标识对应的性格分类结果;According to the feedback on the personality test question and the predetermined personality classification rules, the personality classification results corresponding to different identities are obtained;
    根据所述不同身份标识对应的性格分类结果,生成预设的身份标识与性格分类结果的关系。According to the personality classification results corresponding to the different identities, a preset relationship between the identities and the personality classification results is generated.
  4. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    基于书面语词汇量对所述语音消息进行语言模式识别,得到所述目标用户的语言模式;Performing language pattern recognition on the voice message based on the written language vocabulary to obtain the language pattern of the target user;
    所述根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息,包括:The generating a response candidate message according to the target keyword and the personality classification target result includes:
    根据所述目标用户的语言模式、性格分类目标结果以及预设的需求分类模型,得到用户的需求类型,其中,所述需求分类模型为已训练的用于求解用户需求类型的神经网络模型;Obtain the user's demand type according to the target user's language mode, personality classification target result, and a preset demand classification model, where the demand classification model is a trained neural network model for solving the user's demand type;
    根据所述目标关键词在预设的关键词-答案对应关系中查找,得到与所述目标关键词对应的目标答案;Searching in a preset keyword-answer correspondence according to the target keyword to obtain a target answer corresponding to the target keyword;
    根据所述用户的需求类型以及所述目标答案,生成答复候选消息。According to the user's demand type and the target answer, a response candidate message is generated.
  5. 根据权利要求4所述的方法,其中,所述基于书面语词汇量对所述语音消息进行语言模式识别,得到用户的语言模式,包括:The method according to claim 4, wherein the performing language pattern recognition on the voice message based on the written language vocabulary to obtain the language pattern of the user comprises:
    当所述语音消息包含的书面语词汇量小于预设阈值时,得到用户的语言模式为非正式语言模式;When the written language vocabulary contained in the voice message is less than a preset threshold, the user's language mode is obtained as an informal language mode;
    当所述语音消息包含的书面语词汇量大于或等于所述预设阈值时,得到用户的语言模式为正式语言模式。When the written language vocabulary included in the voice message is greater than or equal to the preset threshold, the user's language mode is obtained as a formal language mode.
  6. 根据权利要求4所述的方法,其中,所述根据所述目标用户的语言模式、性格分类目标结果以及预设的需求分类模型,得到用户的需求类型之前,包括:The method according to claim 4, wherein, before obtaining the user's demand type according to the target user's language mode, personality classification target result, and preset demand classification model, the method comprises:
    获取样本数据,样本数据包括样本用户的语言模式、对应的性格分类结果以及对应的需求类型;Obtain sample data, which includes the language patterns of the sample users, the corresponding personality classification results, and the corresponding demand types;
    将样本用户的语言模式以及对应的性格分类结果输入至神经网络模型进行训练,得到训练结果;Input the language patterns of the sample users and the corresponding personality classification results into the neural network model for training, and obtain the training results;
    将训练结果与样本用户对应的需求类型进行比较,调整神经网络模型的参数,直到训练结果满足预设条件,得到已训练的用于求解用户需求类型的神经网络模型。The training results are compared with the corresponding types of needs of the sample users, and the parameters of the neural network model are adjusted until the training results meet the preset conditions, and the trained neural network model for solving the types of user needs is obtained.
  7. 一种答复消息生成装置,其中,所述装置包括:A reply message generating device, wherein the device includes:
    用户信息获取模块,用于实时接收目标用户输入的语音消息,并根据所述语音信息获取所述目标用户的身份标识;A user information obtaining module, configured to receive voice messages input by a target user in real time, and obtain the identity of the target user according to the voice information;
    性格分类结果获取模块,用于获取预设的身份标识与性格分类结果的关系,根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果;The personality classification result acquisition module is used to acquire the relationship between the preset identity identifier and the personality classification result, and obtain the personality classification target corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result result;
    候选消息生成模块,用于提取所述语音消息包含的目标关键词,根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息;Candidate message generating module for extracting target keywords contained in the voice message, and generating a response candidate message according to the target keywords and the personality classification target result;
    候选消息处理模块,用于获取所述答复候选消息的句式结构,根据所述句式结构对所述答复候选消息进行拆分处理,得到多个短语;A candidate message processing module, configured to obtain the sentence structure of the reply candidate message, and split the reply candidate message according to the sentence structure to obtain multiple phrases;
    同义词获取模块,用于从预设同义词库中获取各所述短语对应的同义词, 得到所述各个短语对应的同义短语集合;The synonym acquisition module is used to acquire the synonym corresponding to each phrase from the preset thesaurus, and obtain the synonymous phrase set corresponding to each phrase;
    答复消息生成模块,用于根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息。The reply message generating module is used to select a phrase from each synonymous phrase set according to the sentence structure of the reply candidate message, and combine the selected phrases to generate a reply message.
  8. 根据权利要求7所述的装置,其中,所述答复消息生成模块之前还包括:8. The device according to claim 7, wherein the reply message generating module further comprises:
    句式确定模块,用于对各所述同义短语集合进行顺序编号,根据所述答复候选消息的当前语法结构确定所述答复候选消息同义语法结构;根据所述各同义短语集合在所述同义语法结构中的次序,确定与所述同义语法结构对应的句式结构;The sentence pattern determination module is used to sequentially number each of the synonymous phrase sets, determine the synonymous grammatical structure of the reply candidate message according to the current grammatical structure of the reply candidate message; State the order in the synonymous grammatical structure, and determine the sentence structure corresponding to the synonymous grammatical structure;
    所述答复消息生成模块用于从所述同义语法结构对应的句式结构中选择一个句式结构,根据已选择的句式结构从每个所述同义短语集合中选择一个短语进行组合,对组合后的句子进行语法修正,生成答复消息。The reply message generating module is used to select a sentence structure from the sentence structure corresponding to the synonymous grammatical structure, and select a phrase from each synonymous phrase set for combination according to the selected sentence structure, Correct the grammar of the combined sentence to generate a reply message.
  9. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其中,所述处理器执行所述计算机程序时实现一种答复消息生成方法的步骤,实时接收目标用户输入的语音信息,并根据所述语音信息获取所述目标用户的身份标识;A computer device includes a memory and a processor, the memory stores a computer program, wherein the processor implements the steps of a method for generating a reply message when the computer program is executed, and receives voice information input by a target user in real time, And obtain the identity of the target user according to the voice information;
    获取预设的身份标识与性格分类结果的关系,根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果;Acquiring the relationship between the preset identity identifier and the personality classification result, and obtaining the personality classification target result corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result;
    提取所述语音信息包含的目标关键词,根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息;Extracting the target keywords contained in the voice information, and generating a response candidate message according to the target keywords and the personality classification target result;
    获取所述答复候选消息的句式结构,根据所述句式结构对所述答复候选消息进行拆分处理,得到多个短语;Acquiring the sentence structure of the candidate reply message, and splitting the candidate reply message according to the sentence structure to obtain multiple phrases;
    从预设同义词库中获取各所述短语对应的同义词,得到所述各个短语对应的同义短语集合;Obtain the synonyms corresponding to each phrase from the preset thesaurus, and obtain the synonymous phrase set corresponding to each phrase;
    根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息。According to the sentence structure of the candidate reply message, a phrase is selected from each synonymous phrase set, and the selected phrases are combined to generate a reply message.
  10. 根据权利要求9所述的计算机设备,其中,所述根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息之前,还包括:9. The computer device according to claim 9, wherein the sentence structure of the reply candidate message selects one phrase from each synonymous phrase set, and combines the selected phrases to generate a reply Before the message, it also includes:
    对各所述同义短语集合进行顺序编号,根据所述答复候选消息的当前语法结构确定同义语法结构;Serially number each of the synonymous phrase sets, and determine the synonymous grammatical structure according to the current grammatical structure of the reply candidate message;
    根据所述各同义短语集合在所述同义语法结构中的次序,确定与所述同义语法结构对应的句式结构;Determine the sentence structure corresponding to the synonymous grammatical structure according to the sequence of the synonymous phrase set in the synonymous grammatical structure;
    所述根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息,包括:According to the sentence structure of the reply candidate message, selecting a phrase from each synonymous phrase set and combining the selected phrases to generate a reply message includes:
    从所述同义语法结构对应的句式结构中选择一个句式结构,根据已选择的句式结构从每个所述同义短语集合中选择一个短语进行组合,对组合后的句子进行语法修正,生成答复消息。Select a sentence structure from the sentence structure corresponding to the synonymous grammatical structure, select a phrase from each synonymous phrase set to combine according to the selected sentence structure, and perform grammatical correction on the combined sentence To generate a reply message.
  11. 根据权利要求9所述的计算机设备,其中,所述根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果之前,还包括:9. The computer device according to claim 9, wherein before obtaining the personality classification target result corresponding to the identity of the target user according to the relationship between the preset identity identifier and the personality classification result, the method further comprises:
    向用户终端发送性格测试问题,并接收不同用户终端对所述性格测试问题的反馈以及对应的身份标识;Sending a personality test question to the user terminal, and receiving feedback from different user terminals on the personality test question and the corresponding identification;
    根据所述对性格测试问题的反馈以及预定的性格分类规则,得到不同身份标识对应的性格分类结果;According to the feedback on the personality test question and the predetermined personality classification rules, the personality classification results corresponding to different identities are obtained;
    根据所述不同身份标识对应的性格分类结果,生成预设的身份标识与性格分类结果的关系。According to the personality classification results corresponding to the different identities, a preset relationship between the identities and the personality classification results is generated.
  12. 根据权利要求9所述的计算机设备,其中,所述答复消息生成方法还包括:The computer device according to claim 9, wherein the method for generating a reply message further comprises:
    基于书面语词汇量对所述语音消息进行语言模式识别,得到所述目标用户的语言模式;Performing language pattern recognition on the voice message based on the written language vocabulary to obtain the language pattern of the target user;
    所述根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息,包括:The generating a response candidate message according to the target keyword and the personality classification target result includes:
    根据所述目标用户的语言模式、性格分类目标结果以及预设的需求分类模型,得到用户的需求类型,其中,所述需求分类模型为已训练的用于求解用户需求类型的神经网络模型;Obtain the user's demand type according to the target user's language mode, personality classification target result, and a preset demand classification model, where the demand classification model is a trained neural network model for solving the user's demand type;
    根据所述目标关键词在预设的关键词-答案对应关系中查找,得到与所述目标关键词对应的目标答案;Searching in a preset keyword-answer correspondence according to the target keyword to obtain a target answer corresponding to the target keyword;
    根据所述用户的需求类型以及所述目标答案,生成答复候选消息。According to the user's demand type and the target answer, a response candidate message is generated.
  13. 根据权利要求12所述的计算机设备,其中,所述基于书面语词汇量对所述语音消息进行语言模式识别,得到用户的语言模式,包括:The computer device according to claim 12, wherein the performing language pattern recognition on the voice message based on the written language vocabulary to obtain the language pattern of the user comprises:
    当所述语音消息包含的书面语词汇量小于预设阈值时,得到用户的语言模式为非正式语言模式;When the written language vocabulary contained in the voice message is less than the preset threshold, the user's language mode is obtained as an informal language mode;
    当所述语音消息包含的书面语词汇量大于或等于所述预设阈值时,得到用户的语言模式为正式语言模式。When the written language vocabulary included in the voice message is greater than or equal to the preset threshold, the user's language mode is obtained as a formal language mode.
  14. 根据权利要求12所述的计算机设备,其中,所述根据所述目标用户的语言模式、性格分类目标结果以及预设的需求分类模型,得到用户的需求类型之前,包括:11. The computer device according to claim 12, wherein, before obtaining the user's demand type according to the target user's language model, personality classification target result, and preset demand classification model, the method comprises:
    获取样本数据,样本数据包括样本用户的语言模式、对应的性格分类结果以及对应的需求类型;Obtain sample data, which includes the language patterns of the sample users, the corresponding personality classification results, and the corresponding demand types;
    将样本用户的语言模式以及对应的性格分类结果输入至神经网络模型进行 训练,得到训练结果;Input the language patterns of the sample users and the corresponding personality classification results into the neural network model for training, and obtain the training results;
    将训练结果与样本用户对应的需求类型进行比较,调整神经网络模型的参数,直到训练结果满足预设条件,得到已训练的用于求解用户需求类型的神经网络模型。The training results are compared with the needs types corresponding to the sample users, and the parameters of the neural network model are adjusted until the training results meet the preset conditions, and a trained neural network model for solving user needs types is obtained.
  15. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现一种答复消息生成方法的步骤,所述答复消息生成方法包括:A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of a method for generating a reply message are realized, and the method for generating a reply message includes:
    实时接收目标用户输入的语音信息,并根据所述语音信息获取所述目标用户的身份标识;Receiving the voice information input by the target user in real time, and obtaining the identity of the target user according to the voice information;
    获取预设的身份标识与性格分类结果的关系,根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果;Acquiring the relationship between the preset identity identifier and the personality classification result, and obtaining the personality classification target result corresponding to the identity identifier of the target user according to the relationship between the preset identity identifier and the personality classification result;
    提取所述语音信息包含的目标关键词,根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息;Extracting the target keywords contained in the voice information, and generating a response candidate message according to the target keywords and the personality classification target result;
    获取所述答复候选消息的句式结构,根据所述句式结构对所述答复候选消息进行拆分处理,得到多个短语;Acquiring the sentence structure of the candidate reply message, and splitting the candidate reply message according to the sentence structure to obtain multiple phrases;
    从预设同义词库中获取各所述短语对应的同义词,得到所述各个短语对应的同义短语集合;Obtain the synonyms corresponding to each phrase from the preset thesaurus, and obtain the synonymous phrase set corresponding to each phrase;
    根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息。According to the sentence structure of the candidate reply message, a phrase is selected from each synonymous phrase set, and the selected phrases are combined to generate a reply message.
  16. 根据权利要求15所述的计算机可读存储介质,其中,所述根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息之前,还包括:15. The computer-readable storage medium according to claim 15, wherein the phrase is selected from each of the synonymous phrase sets according to the sentence structure of the reply candidate message, and the selected phrases are combined Before generating the reply message, it also includes:
    对各所述同义短语集合进行顺序编号,根据所述答复候选消息的当前语法结构确定同义语法结构;Serially number each of the synonymous phrase sets, and determine the synonymous grammatical structure according to the current grammatical structure of the reply candidate message;
    根据所述各同义短语集合在所述同义语法结构中的次序,确定与所述同义语法结构对应的句式结构;Determine the sentence structure corresponding to the synonymous grammatical structure according to the sequence of the synonymous phrase set in the synonymous grammatical structure;
    所述根据所述答复候选消息的句式结构,分别从每个所述同义短语集合中选择一个短语,将选择的各个短语进行组合,生成答复消息,包括:According to the sentence structure of the reply candidate message, selecting a phrase from each synonymous phrase set and combining the selected phrases to generate a reply message includes:
    从所述同义语法结构对应的句式结构中选择一个句式结构,根据已选择的句式结构从每个所述同义短语集合中选择一个短语进行组合,对组合后的句子进行语法修正,生成答复消息。Select a sentence structure from the sentence structure corresponding to the synonymous grammatical structure, select a phrase from each synonymous phrase set to combine according to the selected sentence structure, and perform grammatical correction on the combined sentence To generate a reply message.
  17. 根据权利要求15所述的计算机可读存储介质,其中,所述根据所述预设的身份标识与性格分类结果的关系,得到与所述目标用户的身份标识对应的性格分类目标结果之前,还包括:The computer-readable storage medium according to claim 15, wherein, before obtaining the personality classification target result corresponding to the identity of the target user according to the preset relationship between the identity identifier and the personality classification result, further include:
    向用户终端发送性格测试问题,并接收不同用户终端对所述性格测试问题 的反馈以及对应的身份标识;Sending a personality test question to the user terminal, and receiving feedback from different user terminals on the personality test question and the corresponding identification;
    根据所述对性格测试问题的反馈以及预定的性格分类规则,得到不同身份标识对应的性格分类结果;According to the feedback on the personality test question and the predetermined personality classification rules, the personality classification results corresponding to different identities are obtained;
    根据所述不同身份标识对应的性格分类结果,生成预设的身份标识与性格分类结果的关系。According to the personality classification results corresponding to the different identities, a preset relationship between the identities and the personality classification results is generated.
  18. 根据权利要求15所述的计算机可读存储介质,其中,所述答复消息生成方法还包括:The computer-readable storage medium according to claim 15, wherein the method for generating a reply message further comprises:
    基于书面语词汇量对所述语音消息进行语言模式识别,得到所述目标用户的语言模式;Performing language pattern recognition on the voice message based on the written language vocabulary to obtain the language pattern of the target user;
    所述根据所述目标关键词以及所述性格分类目标结果,生成答复候选消息,包括:The generating a response candidate message according to the target keyword and the personality classification target result includes:
    根据所述目标用户的语言模式、性格分类目标结果以及预设的需求分类模型,得到用户的需求类型,其中,所述需求分类模型为已训练的用于求解用户需求类型的神经网络模型;Obtain the user's demand type according to the target user's language mode, personality classification target result, and a preset demand classification model, where the demand classification model is a trained neural network model for solving the user's demand type;
    根据所述目标关键词在预设的关键词-答案对应关系中查找,得到与所述目标关键词对应的目标答案;Searching in a preset keyword-answer correspondence according to the target keyword to obtain a target answer corresponding to the target keyword;
    根据所述用户的需求类型以及所述目标答案,生成答复候选消息。According to the user's demand type and the target answer, a response candidate message is generated.
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述基于书面语词汇量对所述语音消息进行语言模式识别,得到用户的语言模式,包括:18. The computer-readable storage medium of claim 18, wherein the performing language pattern recognition on the voice message based on the written language vocabulary to obtain the user's language pattern comprises:
    当所述语音消息包含的书面语词汇量小于预设阈值时,得到用户的语言模式为非正式语言模式;When the written language vocabulary contained in the voice message is less than the preset threshold, the user's language mode is obtained as an informal language mode;
    当所述语音消息包含的书面语词汇量大于或等于所述预设阈值时,得到用户的语言模式为正式语言模式。When the written language vocabulary included in the voice message is greater than or equal to the preset threshold, the user's language mode is obtained as a formal language mode.
  20. 根据权利要求18所述的计算机可读存储介质,其中,所述根据所述目标用户的语言模式、性格分类目标结果以及预设的需求分类模型,得到用户的需求类型之前,包括:18. The computer-readable storage medium according to claim 18, wherein, before obtaining the user's demand type according to the target user's language model, personality classification target result, and preset demand classification model, the method comprises:
    获取样本数据,样本数据包括样本用户的语言模式、对应的性格分类结果以及对应的需求类型;Obtain sample data, which includes the language patterns of the sample users, the corresponding personality classification results, and the corresponding demand types;
    将样本用户的语言模式以及对应的性格分类结果输入至神经网络模型进行训练,得到训练结果;Input the language patterns of the sample users and the corresponding personality classification results into the neural network model for training, and obtain the training results;
    将训练结果与样本用户对应的需求类型进行比较,调整神经网络模型的参数,直到训练结果满足预设条件,得到已训练的用于求解用户需求类型的神经网络模型。The training results are compared with the corresponding types of needs of the sample users, and the parameters of the neural network model are adjusted until the training results meet the preset conditions, and the trained neural network model for solving the types of user needs is obtained.
PCT/CN2020/087818 2019-10-12 2020-04-29 Reply message generation method and apparatus, computer device and storage medium WO2021068490A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910968475.2A CN110931012A (en) 2019-10-12 2019-10-12 Reply message generation method and device, computer equipment and storage medium
CN201910968475.2 2019-10-12

Publications (1)

Publication Number Publication Date
WO2021068490A1 true WO2021068490A1 (en) 2021-04-15

Family

ID=69848829

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/087818 WO2021068490A1 (en) 2019-10-12 2020-04-29 Reply message generation method and apparatus, computer device and storage medium

Country Status (2)

Country Link
CN (1) CN110931012A (en)
WO (1) WO2021068490A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110931012A (en) * 2019-10-12 2020-03-27 深圳壹账通智能科技有限公司 Reply message generation method and device, computer equipment and storage medium
CN111462726B (en) * 2020-03-30 2023-08-22 中国建设银行股份有限公司 Method, device, equipment and medium for answering out call
CN113129866B (en) * 2021-04-13 2022-08-02 重庆度小满优扬科技有限公司 Voice processing method, device, storage medium and computer equipment
CN113053394B (en) * 2021-04-27 2024-01-09 广州小鹏汽车科技有限公司 Speech processing method, server, speech processing system, and storage medium
CN117251557B (en) * 2023-11-20 2024-02-27 中信证券股份有限公司 Legal consultation sentence reply method, device, equipment and computer readable medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1419686A (en) * 2000-10-30 2003-05-21 皇家菲利浦电子有限公司 User interface/entertainment equipment of imitating human interaction and loading relative external database using relative data
CN106297789A (en) * 2016-08-19 2017-01-04 北京光年无限科技有限公司 The personalized interaction method of intelligent robot and interactive system
CN106328133A (en) * 2016-08-18 2017-01-11 张培 Voice response responding device
CN110188177A (en) * 2019-05-28 2019-08-30 北京搜狗科技发展有限公司 Talk with generation method and device
CN110931012A (en) * 2019-10-12 2020-03-27 深圳壹账通智能科技有限公司 Reply message generation method and device, computer equipment and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6278996B1 (en) * 1997-03-31 2001-08-21 Brightware, Inc. System and method for message process and response
JP2004258902A (en) * 2003-02-25 2004-09-16 P To Pa:Kk Conversation controller, and conversation control method
KR100546743B1 (en) * 2003-10-02 2006-01-26 한국전자통신연구원 Method for automatically creating a question and indexing the question-answer by language-analysis and the question-answering method and system
CN105868313B (en) * 2016-03-25 2019-02-12 浙江大学 A kind of knowledge mapping question answering system and method based on template matching technique
CN107798032B (en) * 2017-02-17 2020-05-19 平安科技(深圳)有限公司 Method and device for processing response message in self-service voice conversation
CN107609101B (en) * 2017-09-11 2020-10-27 远光软件股份有限公司 Intelligent interaction method, equipment and storage medium
CN109840255B (en) * 2019-01-09 2023-09-19 平安科技(深圳)有限公司 Reply text generation method, device, equipment and storage medium
CN110110040A (en) * 2019-03-15 2019-08-09 深圳壹账通智能科技有限公司 Language exchange method, device, computer equipment and storage medium
CN110287297A (en) * 2019-05-22 2019-09-27 深圳壹账通智能科技有限公司 Dialogue replies method, apparatus, computer equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1419686A (en) * 2000-10-30 2003-05-21 皇家菲利浦电子有限公司 User interface/entertainment equipment of imitating human interaction and loading relative external database using relative data
CN106328133A (en) * 2016-08-18 2017-01-11 张培 Voice response responding device
CN106297789A (en) * 2016-08-19 2017-01-04 北京光年无限科技有限公司 The personalized interaction method of intelligent robot and interactive system
CN110188177A (en) * 2019-05-28 2019-08-30 北京搜狗科技发展有限公司 Talk with generation method and device
CN110931012A (en) * 2019-10-12 2020-03-27 深圳壹账通智能科技有限公司 Reply message generation method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110931012A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
WO2021068490A1 (en) Reply message generation method and apparatus, computer device and storage medium
CN110765244B (en) Method, device, computer equipment and storage medium for obtaining answering operation
CN109829039B (en) Intelligent chat method, intelligent chat device, computer equipment and storage medium
WO2020147428A1 (en) Interactive content generation method and apparatus, computer device, and storage medium
US11997055B2 (en) Chat management system
CN110263150B (en) Text generation method, device, computer equipment and storage medium
CN108491443B (en) Computer-implemented method and computer system for interacting with a user
US11450311B2 (en) System and methods for accent and dialect modification
WO2020206957A1 (en) Intention recognition method and device for intelligent customer service robot
US9760565B2 (en) Natural expression processing method, processing and response method, device, and system
CN111400470A (en) Question processing method and device, computer equipment and storage medium
CN110493019B (en) Automatic generation method, device, equipment and storage medium of conference summary
US11238050B2 (en) Method and apparatus for determining response for user input data, and medium
KR102100214B1 (en) Method and appratus for analysing sales conversation based on voice recognition
US11699437B2 (en) System and method for quantifying meeting effectiveness using natural language processing
CN116821290A (en) Multitasking dialogue-oriented large language model training method and interaction method
CN114706973A (en) Extraction type text abstract generation method and device, computer equipment and storage medium
CN112307166B (en) Intelligent question-answering method and device, storage medium and computer equipment
CN117009113A (en) Method and device for calling artificial intelligent model, computer equipment and storage medium
KR20210009266A (en) Method and appratus for analysing sales conversation based on voice recognition
CN110931002A (en) Human-computer interaction method and device, computer equipment and storage medium
CN114996417A (en) Method for recommending dialect, method and system for recommending dialect interaction
CN117909483B (en) Personalized dialogue method, system, equipment and medium
CN111460106A (en) Information interaction method, device and equipment
Song et al. Task-oriented dialogue system based on reinforcement learning

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.08.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20874712

Country of ref document: EP

Kind code of ref document: A1