WO2018014579A1 - 自动回复方法、装置、设备及计算机可读存储介质 - Google Patents

自动回复方法、装置、设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2018014579A1
WO2018014579A1 PCT/CN2017/077963 CN2017077963W WO2018014579A1 WO 2018014579 A1 WO2018014579 A1 WO 2018014579A1 CN 2017077963 W CN2017077963 W CN 2017077963W WO 2018014579 A1 WO2018014579 A1 WO 2018014579A1
Authority
WO
WIPO (PCT)
Prior art keywords
reply
chat
category
chat message
message
Prior art date
Application number
PCT/CN2017/077963
Other languages
English (en)
French (fr)
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 平安科技(深圳)有限公司
Priority to JP2017560292A priority Critical patent/JP6431993B2/ja
Priority to SG11201709529SA priority patent/SG11201709529SA/en
Priority to KR1020187035330A priority patent/KR102125348B1/ko
Priority to AU2017258821A priority patent/AU2017258821A1/en
Priority to US15/578,227 priority patent/US10404629B2/en
Priority to EP17800690.4A priority patent/EP3306867B1/en
Publication of WO2018014579A1 publication Critical patent/WO2018014579A1/zh

Links

Classifications

    • 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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • 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/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • H04L51/046Interoperability with other network applications or services
    • 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/21Monitoring or handling of messages
    • H04L51/216Handling conversation history, e.g. grouping of messages in sessions or threads

Definitions

  • the present invention relates to the field of network technologies, and in particular, to an automatic reply method, apparatus, device, and computer readable storage medium.
  • chat applications such as Microsoft Xiaobing, Xiaohuangji, etc.
  • Microsoft Xiaobing Xiaohuangji
  • chat applications can automatically talk or chat with users.
  • the user can clearly feel that the conversation with him is not a real human being, lacking realism, and greatly reducing the interest of chatting.
  • the chat bot can imitate a human being to chat or talk.
  • the chat bot talks with the user, since the content of the reply of the chat bot is pre-recorded, after receiving the chat message input by the user, the chat message is searched according to the chat message of the user.
  • the reply statement can be replied, and the reply speed is much faster than the normal manual reply.
  • the automatic reply of the chat robot can usually be received in a very short time, and the manual reply speed is much slower.
  • the user can easily determine whether the current reply is an artificial or a robot.
  • the current chat application software is less anthropomorphic, and it can not bring a more realistic chat feeling to the user.
  • the main object of the present invention is to provide an automatic reply method, device, device and computer readable storage medium, which aims to solve the technical problem of low degree of anthropomorphization of automatic reply of the chat application software.
  • the present invention provides an automatic reply method, the automatic reply method comprising the following steps:
  • Receiving a chat message sent by the chat object determining that the time point of receiving the chat message is a start time
  • a reply message corresponding to the category is invoked to perform a reply of the chat message.
  • the method before the step of configuring the reply time according to the pre-configured reply interval and the start time, the method further includes:
  • the reply interval is calculated according to the number of reply message words corresponding to the category and the preset typing rate.
  • the method before the step of configuring the reply time according to the pre-configured reply interval and the start time, the method further includes:
  • the process proceeds to: performing a reply time according to the pre-configured reply interval and the start time.
  • the automatic reply method further includes:
  • the automatic reply method further includes:
  • the classifier is trained based on neural network algorithms and logistic regression algorithms using pre-configured corpus samples.
  • the present invention also provides an automatic reply device, the automatic reply device comprising:
  • a receiving module configured to receive a chat message sent by the chat object, and determine a time point when the chat message is received as a start time
  • a classifying module configured to acquire a category of the chat message hit based on a pre-trained classifier
  • a configuration module configured to configure a reply time according to the pre-configured reply interval and the start time
  • a reply module configured to: when the reply time is reached, invoke a reply message corresponding to the category to perform a reply of the chat message.
  • the automatic reply device further includes:
  • the calculating module is configured to calculate a reply interval according to the number of the reply message words corresponding to the category and the preset typing rate.
  • the automatic reply device further includes:
  • a querying module configured to query, according to the pre-configured chat record, the number of times the category is hit within a preset time period
  • the configuration module is further configured to: if the number of hits of the category in the time period is less than a preset value, configure a reply time according to the pre-configured reply interval and the start time.
  • the automatic reply device further includes:
  • the rejection module is configured to not reply the chat message if the category of the chat message hit is not successfully obtained.
  • the automatic reply device further includes:
  • a training module is configured to use the pre-configured corpus samples to train the classifier based on a neural network algorithm and a logistic regression algorithm.
  • the present invention further provides an automatic reply device, where the automatic reply device includes a processor, a network interface, and a memory, where the automatic reply program is stored in the memory;
  • the network interface is configured to connect to a user equipment, and perform data communication with the user equipment;
  • the processor is configured to execute the automatic reply procedure to implement the following steps:
  • Receiving a chat object based on the chat message sent by the user equipment, determining that a time point of receiving the chat message is a start time;
  • a reply message corresponding to the category is invoked to perform a reply of the chat message.
  • the processor is further configured to execute the automatic reply procedure to implement the following steps:
  • the reply interval is calculated according to the number of reply message words corresponding to the category and the preset typing rate.
  • the processor is further configured to execute the automatic reply procedure to implement the following steps:
  • the reply time is configured according to the pre-configured reply interval and the start time.
  • the processor is further configured to execute the automatic reply procedure to implement the following steps:
  • the processor is further configured to execute the automatic reply procedure to implement the following steps:
  • the classifier is trained based on neural network algorithms and logistic regression algorithms using pre-configured corpus samples.
  • the present invention also provides a computer readable storage medium, wherein the computer readable storage medium stores one or more programs, and the one or more programs may be one or more
  • the processor executes to implement the following steps:
  • Receiving a chat message sent by the chat object determining that the time point of receiving the chat message is a start time
  • a reply message corresponding to the category is invoked to perform a reply of the chat message.
  • the one or more programs are executable by the one or more processors, and the following steps are also implemented:
  • the reply interval is calculated according to the number of reply message words corresponding to the category and the preset typing rate.
  • the one or more programs are executable by the one or more processors, and the following steps are also implemented:
  • the reply time is configured according to the pre-configured reply interval and the start time.
  • the one or more programs are executable by the one or more processors, and the following steps are also implemented:
  • the one or more programs are executable by the one or more processors, and the following steps are also implemented:
  • the classifier is trained based on neural network algorithms and logistic regression algorithms using pre-configured corpus samples.
  • An automatic reply method, device, device, and computer readable storage medium which are determined by the embodiment of the present invention, after receiving a chat message sent by a chat object, determining that the time point of receiving the chat message is a start time;
  • the trained classifier classifies the chat message to obtain the category of the chat message hit; then, according to the start time and the pre-configured reply interval, configure the reply time; when the reply time is reached, the category of the chat message hit is invoked.
  • the corresponding reply message is used to reply to the chat message.
  • the invention realizes the control of the automatic reply speed of the chat application software through the setting of the reply interval, so as to be close to the speed of the manual reply, enhances the realness of the simulated manual reply, and improves the degree of personification of the chat application software.
  • FIG. 1 is a schematic flow chart of a first embodiment of an automatic reply method according to the present invention.
  • FIG. 2 is a schematic flow chart of a second embodiment of an automatic reply method according to the present invention.
  • FIG. 3 is a schematic flow chart of a third embodiment of an automatic reply method according to the present invention.
  • FIG. 4 is a schematic flow chart of a fourth embodiment of an automatic reply method according to the present invention.
  • FIG. 5 is a schematic flowchart diagram of a fifth embodiment of an automatic reply method according to the present invention.
  • FIG. 6 is a schematic diagram of functional modules of a first embodiment of an automatic reply device of the present invention.
  • FIG. 7 is a schematic diagram of functional modules of a second embodiment of an automatic reply device of the present invention.
  • FIG. 8 is a schematic diagram of functional modules of a third embodiment of an automatic recovery device of the present invention.
  • FIG. 9 is a schematic diagram of functional modules of a fourth embodiment of an automatic reply device of the present invention.
  • FIG. 10 is a schematic diagram of functional modules of a fifth embodiment of an automatic reply device of the present invention.
  • FIG. 11 is a schematic structural diagram of a device in a hardware operating environment according to an embodiment of the present invention.
  • a first embodiment of an automatic reply method of the present invention provides an automatic reply method, where the automatic reply method includes:
  • Step S10 Receive a chat message sent by the chat object, and determine that the time point of receiving the chat message is a start time.
  • the automatic reply of the chat application software is closer to the manual reply, enhancing the realism of the chat scene and improving the user experience.
  • the chat application software is used as an example for the chat robot.
  • a chat bot is an application that simulates humans chatting or talking.
  • the invention is not limited to the chat robot, and can also be applied to other application software that needs to perform automatic reply, for example, chatting with a chat object through social software such as WeChat, QQ, automatically replying to the chat message of the chat object, or simulating the Taobao customer service. Chat with consumers and provide customer service.
  • the chat bot establishes a chat session with the chat object, for example, the chat bot and the chat object become friends of the social software, and the chat bot can actively trigger to enter the automatic reply mode, or can receive the chat object.
  • the trigger information is sent, the automatic reply mode is entered.
  • the chat robot enters the automatic reply mode after receiving the trigger information.
  • the chat bot receives the chat message sent by the chat object.
  • the chat object can be a human or other chat bot. This embodiment is exemplified by the chat object being a human.
  • the chat message sent by the chat object may be of a voice or text message type. If the chat message sent by the chat object is text information, the corresponding category can be obtained directly through the classifier; if the chat message sent by the chat object is voice, the text information needs to be converted by voice recognition, and then the text information is used for classification.
  • the chat robot records the time point when the chat message is received, and determines that the time point is the starting time point of the conversation.
  • Step S20 Acquire a category of the chat message hit based on the pre-trained classifier.
  • the chat bot After acquiring the chat message, the chat bot uses the pre-trained classifier to obtain the category of the chat message hit.
  • the classifier is pre-configured with a plurality of given categories, and different categories correspond to different reply messages, and the classifier can map the chat messages of the unknown category to one of the given categories, thereby obtaining a reply message.
  • different categories can be identified by means of numerical labels and the like.
  • the text information of the chat message is segmented to obtain each phrase.
  • the word segmentation of the text information is put into the pre-trained classifier, and the category of the hit is searched according to the characteristics of the text information segmentation.
  • the category of the hit that is, the classification of the current chat message
  • the category of the hit is obtained based on the feature mapping of the chat message. Different chat messages may hit the same category due to the same semantics, but the same chat message can only hit the same category. .
  • chat message "What kind of product do you need to buy” and "What kind of product do you want to buy?"
  • the chat message may hit the same response message content as a specific product category.
  • Step S30 Configure a reply time according to the pre-configured reply interval and the start time.
  • the chat robot After obtaining the category hit by the chat message, the chat robot controls the reply time of the chat message according to the preset reply interval.
  • the preset reply interval may be a fixed time interval.
  • the time point of the chat message will be received, that is, the start time, plus the preset time interval, and the obtained time point is the reply time of the chat message. .
  • the preset reply interval may also be a time interval corresponding to the configuration of the reply message according to different categories.
  • the time interval can be flexibly configured according to the semantics of different reply messages, the number of text words, the length of the voice, and the like, so as to be close to the speed of manual reply.
  • the chat robot obtains the time interval corresponding to the category.
  • the time point at which the chat message is received that is, the start time, plus the time interval corresponding to the category, the obtained time point is also the reply time of the chat message.
  • Step S40 When the reply time is reached, the reply message corresponding to the category is invoked to perform reply of the chat message.
  • the chat bot After successfully obtaining the category of the chat message hit, the chat bot obtains the reply message corresponding to the category as the reply message corresponding to the chat message.
  • the reply message may be a text message or a pre-configured voice message or the like, and may be flexibly configured according to actual needs.
  • the chat message obtained this time is sent to the chat object.
  • the start time is reconfigured to perform a new round of automatic reply.
  • the chat application software After receiving the chat message sent by the chat object, determining that the time point of receiving the chat message is the start time; then, classifying the chat message based on the classifier obtained by the pre-training, and obtaining the chat message hit Then, according to the start time and the pre-configured reply interval, the reply time is configured; when the reply time is reached, the reply message corresponding to the category hit by the chat message is called to reply the chat message.
  • the automatic reply speed control of the chat application software is realized by the setting of the reply interval, so as to be close to the speed of the manual reply, the realness of the simulated manual reply is enhanced, and the degree of personification of the chat application software is improved.
  • the second embodiment of the automatic reply method of the present invention provides an automatic reply method. Based on the embodiment shown in FIG. 1 , before the step S30, the method further includes:
  • Step S50 Calculate a reply interval according to the number of reply message words corresponding to the category and a preset typing rate.
  • all reply messages are configured as text information.
  • the chat robot When receiving the chat message sent by the chat object, the chat robot records the time point when the chat message is received.
  • the chat robot After obtaining the category of the chat message hit by the chat object, the chat robot obtains a reply message corresponding to the category.
  • the chat robot counts the number of words of the reply message, and calculates the reply interval according to the obtained word number and the preset typing rate.
  • the preset typing rate can also be understood as an artificial typing rate, such as one word per second.
  • the chat robot After the reply interval is obtained, the chat robot will receive the chat message at the time point plus the reply interval time, and get the reply time point of the local chat message.
  • the chat bot detects the current time and sends a reply message to the chat subject when the reply time point is reached.
  • the operation time for obtaining a reply message is usually very short, usually when the reply message is obtained, the time point does not exceed the reply time point, and thus the control of the reply time is not affected.
  • the reply interval for replying to the current chat message is calculated; and then, according to the start The time and the response interval obtained are configured to reply to the reply time of this chat message.
  • the time interval by configuring the time interval according to the number of words of the reply message and the typing rate, the typing speed of the manual reply is simulated to enhance the sense of scene of the manual reply, and the degree of personification of the chat application software is improved.
  • the third embodiment of the automatic recovery method of the present invention provides an automatic recovery method, based on the embodiment shown in FIG. 1 or FIG. 2 (the embodiment is illustrated by using FIG. 1), the step S30. Previously, it also included:
  • Step S60 Query, according to the pre-configured chat record, the number of times the category is hit in the preset time period; if the number of hits of the category in the time period is less than a preset value, proceed to step S30.
  • the chat robot records each chat message sent by the chat object, the category of each chat message hit, and the corresponding reply time, and configures a chat record.
  • chat bot obtains the category of the chat message hit, according to the configured chat record, it is queried whether the category is hit within the preset time period.
  • the number of times the category is hit during this time period is counted. In this embodiment, when the number of times this category is hit is counted, the current hit is not counted in the statistical result.
  • the chat message After obtaining the number of times the category is hit within the preset time period, it is determined whether the number of hits is less than a preset value; if the number of hits is less than the preset value, it is determined that the category is valid, and the chat message may be performed. Reply; if the number of hits is greater than or equal to the preset value, it is determined that this category is invalid, and the chat message is not replied.
  • the default value is 1.
  • the chat bot obtains the hit category, the number of times the category is hit in the chat record within 2 minutes is queried.
  • this category is hit once in 2 minutes, it means that the chat message of this category has been replied within 2 minutes, and the chat object is sending a duplicate chat message, then it will not reply again; if this category is within 2 minutes
  • a hit of 0 times means that the chat message of this category has not been received within 2 minutes, and a reply can be made, and the reply time is configured. When the reply time is reached, the reply message corresponding to the category is called to reply the chat message.
  • the number of times the category is hit in the preset time period is queried, thereby obtaining the book received in the preset time period.
  • the number of times of the second chat message if the number of times the category is hit within the preset time period is less than the preset value, that is, the number of times the chat message of this category is received within the preset time period is less than the preset value, the reply time is performed. Configure to reply to chat messages.
  • the preset value is configured, and only when the number of the same type of chat messages received in the preset time period is less than the preset value, the current chat message is replied; when received within the preset time period, When there are too many chat messages in the same category, no reply is sent to avoid repeatedly replying to the same category of chat messages with the same content, which is more in line with the habit of human chat, and improves the degree of personification of the chat application software.
  • the fourth embodiment of the automatic replying method of the present invention provides an automatic replying method.
  • the automatic replying method further includes: based on the embodiment shown in FIG. 1, FIG. 2 or FIG.
  • Step 70 If the category of the chat message hit is not successfully obtained, the reply of the chat message is not performed.
  • the reply of the chat message is not controlled.
  • the purpose is to simulate the customer test salesman to operate in violation of the rules without the knowledge of the salesperson. Therefore, in order to avoid the suspicion of the salesman, the salesman is sent.
  • a chat message is automatically replied, it needs to have a higher degree of personification.
  • chat message sent by the salesperson does not hit a specific category in the classifier, it can be considered that the chat message sent by the current salesperson is not within the range of the auto-recoverable, and no reply is sent; if the reply message pre-configured for the situation is used, Replying, or randomly selecting a reply message to reply, may cause the salesperson to suspect that the current customer has an abnormal situation and affect the test result because it does not meet the current chat scenario.
  • the chat message of the missed category is not replied to avoid undue reply when there is no suitable reply message, which is more in line with the habit of human chat, and enhances the degree of personification of the chat application.
  • the fifth embodiment of the automatic reply method of the present invention provides an automatic reply method.
  • the automatic reply method further includes: based on the embodiment shown in FIG. 1, FIG. 2, FIG. 3 or FIG.
  • Step S80 Using a pre-configured corpus sample, the classifier is trained based on a neural network algorithm and a logistic regression algorithm.
  • This embodiment trains a classifier for classifying chat messages based on a neural network algorithm and a logistic regression algorithm.
  • a pre-configured corpus sample is obtained, and the corpus sample may be a large number of chat messages, and the more the corpus samples, the better the training effect.
  • the categories in which the classifier classifies the corpus can be configured as needed, and different categories correspond to different reply messages.
  • Each of the chat messages in the corpus sample is configured with its mapped category, that is, the chat messages in the corpus samples are classified, and the corresponding categories are marked to prepare for the training of the classifier.
  • the corpus sample is segmented, and the chat message in units of sentences is divided into a single word.
  • feature extraction is performed on the chat message after the word segmentation, and the extracted feature may be a part-of-speech feature or the like.
  • each chat message is classified and trained so that each chat message can hit its pre-configured category.
  • the classifier When classifying the chat message, based on the feature extracted by the chat message, the classifier selects the category with the highest probability among the specified categories as the category of the hit, and then determines whether the classification is successful according to the pre-configured category of the chat message, according to Whether the classification is successful or not
  • the reciprocal training of the corpus samples is classified as much as possible so that the classifier can hit the correct category according to the characteristics of the chat message.
  • the classification model is learned according to the training classification result of the corpus sample, and the classifier is modified, so that the feature extracted from the chat message is that the chat message is most prominent and can be distinguished from other chat messages.
  • the feature extracted from the chat message is that the chat message is most prominent and can be distinguished from other chat messages.
  • the test corpus can be used to test the success rate of the classifier. If the success rate reaches the preset required value, the classifier can be determined to complete the training; if the success rate does not reach the preset required value, the process can be continued. Train the classifier until the success rate reaches the preset required value.
  • the neural network algorithm and the logistic regression algorithm are used to train the classifier, so that the classifier can extract the most prominent features of the corpus sample, and the classification result of the chat message is more accurate.
  • the above-mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the first embodiment of the automatic reply device of the present invention provides an automatic reply device, and the automatic reply device includes:
  • the receiving module 10 is configured to receive a chat message sent by the chat object, and determine a time point when the chat message is received as a start time.
  • the automatic reply of the chat application software is closer to the manual reply, enhancing the realism of the chat scene and improving the user experience.
  • the chat application establishes a chat session with the chat object, for example, the chat bot and the chat object become friends of the social software, and the chat bot can actively trigger to enter the automatic reply mode, or can receive the chat.
  • the chat bot can actively trigger to enter the automatic reply mode, or can receive the chat.
  • the trigger information sent by the object is entered, the automatic reply mode is entered.
  • the chat application controls to enter the automatic reply mode after receiving the trigger information.
  • the receiving module 10 receives the chat message sent by the chat object.
  • the chat object can be a human or other chat application software. This embodiment illustrates the chat object as a human.
  • the chat message sent by the chat object may be of a voice or text message type. If the chat message sent by the chat object is text information, the corresponding category can be obtained directly by the classifier; if the chat message sent by the chat object is voice, the receiving module 10 needs to convert the text message information by using voice recognition, and then use the text information. sort.
  • the receiving module 10 records the time point when the chat message is received, and determines that the time point is the starting time point of the conversation.
  • the classification module 20 is configured to acquire a category of the chat message hit based on a pre-trained classifier.
  • the classification module 20 uses the pre-trained classifier to obtain the category of the chat message hit.
  • the classifier is pre-configured with a plurality of given categories, and different categories correspond to different reply messages, and the classifier can map the chat messages of the unknown category to one of the given categories, thereby obtaining a reply message.
  • different categories can be identified by means of numerical labels and the like.
  • the classification module 20 segments the text information of the chat message to obtain each phrase.
  • the classification module 20 puts the word segmentation of the text information into a pre-trained classifier, and finds the category of the hit based on the characteristics of the text information segmentation.
  • the category of the hit that is, the classification of the current chat message
  • the category of the hit is obtained based on the feature mapping of the chat message. Different chat messages may hit the same category due to the same semantics, but the same chat message can only hit the same category. .
  • chat message "What kind of product do you need to buy” and "What kind of product do you want to buy?"
  • the chat message may hit the same response message content as a specific product category.
  • the configuration module 30 is configured to configure a reply time according to the pre-configured reply interval and the start time.
  • the configuration module 30 controls the reply time of the current chat message according to the preset reply interval.
  • the preset reply interval may be a fixed time interval.
  • the configuration module 30 will receive the time point of the chat message, that is, the start time, plus the preset time interval, and the obtained time point is the reply to the chat message. time.
  • the preset reply interval may also be a time interval corresponding to the configuration of the reply message according to different categories.
  • the time interval can be flexibly configured according to the semantics of different reply messages, the number of text words, the length of the voice, and the like, so as to be close to the speed of manual reply.
  • the configuration module 30 obtains the time interval corresponding to the category.
  • the configuration module 30 will receive the time point of the chat message, that is, the start time, plus the time interval corresponding to the category, and the obtained time point is the reply time of the chat message.
  • the replying module 40 is configured to, when the reply time is reached, invoke a reply message corresponding to the category to perform a reply of the chat message.
  • the reply module 40 After successfully obtaining the category of the chat message hit, the reply module 40 obtains the reply message corresponding to the category as the reply message corresponding to the chat message.
  • the reply message may be a text message or a pre-configured voice message or the like, and may be flexibly configured according to actual needs.
  • the reply module 40 sends the chat message acquired this time to the chat object.
  • the receiving module 10 reconfigures the start time to perform a new round of automatic reply.
  • the receiving module 10 determines that the time point of receiving the chat message is the start time; then, the classification module 20 performs the chat message based on the pre-trained classifier. Classification, the category of the chat message hit is obtained; then, the configuration module 30 configures the reply time according to the start time and the pre-configured reply interval; when the reply time is reached, the reply module 40 invokes the reply message corresponding to the category of the chat message hit. Reply to this chat message.
  • the automatic reply speed control of the chat application software is realized by the setting of the reply interval, so as to be close to the speed of the manual reply, the realness of the simulated manual reply is enhanced, and the degree of personification of the chat application software is improved.
  • the second embodiment of the automatic reply device of the present invention provides an automatic reply device.
  • the automatic reply device further includes:
  • the calculating module 50 is configured to calculate a reply interval according to the number of reply message words corresponding to the category and a preset typing rate.
  • all reply messages are configured as text information.
  • the receiving module 10 records the time point when the chat message is received when receiving the chat message sent by the chat object.
  • the calculation module 50 After obtaining the category of the chat message hit by the chat object, the calculation module 50 obtains the reply message corresponding to the category.
  • the calculation module 50 counts the number of words of the current reply message, and calculates a reply interval according to the obtained number of words and the preset typing rate.
  • the preset typing rate can also be understood as an artificial typing rate, such as one word per second.
  • the configuration module 30 adds the time of the chat message to the time of the reply interval to obtain a reply time point for the local chat message.
  • the reply module 40 detects the current time and sends a reply message to the chat subject when the reply time point is reached.
  • the operation time for obtaining a reply message is usually very short, usually when the reply message is obtained, the time point does not exceed the reply time point, and thus the control of the reply time is not affected.
  • the calculation module 50 calculates the reply interval for replying to the chat message according to the number of the reply message words corresponding to the category and the preset typing rate;
  • the reply time of replying to the chat message is configured according to the start time and the obtained reply interval.
  • the typing speed of the manual reply is simulated to enhance the sense of scene of the manual reply, and the degree of personification of the chat application software is improved.
  • the third embodiment of the automatic reply device of the present invention provides an automatic reply device.
  • the automatic reply device is based on the embodiment shown in FIG. 6 or FIG. 7 (this embodiment takes FIG. 6 as an example).
  • the device also includes:
  • the querying module 60 is configured to query, according to the pre-configured chat record, the number of times the category is hit within a preset time period;
  • the configuration module 30 is further configured to: if the number of hits of the category in the time period is less than a preset value, configure a reply time according to the pre-configured reply interval and the start time.
  • the query module 60 records each chat message sent by the chat object, the category of each chat message hit, and the corresponding reply time, and configures a chat record.
  • the query module 60 queries whether the category is hit within the preset time period according to the configured chat record.
  • the query module 60 counts the number of times the category was hit during this time period. In this embodiment, when the number of times this category is hit is counted, the current hit is not counted in the statistical result.
  • the query module 60 determines whether the number of hits is less than a preset value; if the number of hits is less than the preset value, the query module 60 determines that the category is valid, The current chat message is replied; if the number of hits is greater than or equal to the preset value, the query module 60 determines that the category is invalid, and does not reply to the chat message.
  • the default value is 1.
  • the query module 60 queries the number of times the category is hit in the chat record within 2 minutes.
  • this category is hit once in 2 minutes, it means that the chat message of this category has been replied within 2 minutes, and the chat object is sending a duplicate chat message, then it will not reply again; if this category is within 2 minutes If the hit time is 0, it means that the chat message of this category is not received within 2 minutes, and the response can be replied.
  • the configuration module 30 configures the reply time. When the reply time is reached, the reply module 40 calls the reply message corresponding to the category. Reply to the chat message.
  • the query module 60 queries the number of hits of the category in the preset time period according to the pre-configured chat record, thereby obtaining the preset time period.
  • the module 30 performs the configuration of the reply time, and the reply module 40 performs a reply to the chat message.
  • the preset value is configured, and only when the number of the same type of chat messages received in the preset time period is less than the preset value, the current chat message is replied; when received within the preset time period, When there are too many chat messages in the same category, no reply is sent to avoid repeatedly replying to the same category of chat messages with the same content, which is more in line with the habit of human chat, and improves the degree of personification of the chat application software.
  • a fourth embodiment of the automatic recovery device of the present invention provides an automatic recovery device based on the embodiment shown in FIG. 6, FIG. 7, or FIG. 8 (this embodiment takes FIG. 6 as an example).
  • the automatic reply device further includes:
  • the refusal module 70 is configured to not reply the chat message if the category of the chat message hit is not successfully obtained.
  • the rejection module 70 controls not to reply to the chat message.
  • the purpose is to simulate the customer test salesman to operate in violation of the rules without the knowledge of the salesperson. Therefore, in order to avoid the suspicion of the salesman, the salesman is sent.
  • a chat message is automatically replied, it needs to have a higher degree of personification.
  • chat message sent by the salesperson does not hit a specific category in the classifier, it can be considered that the chat message sent by the current salesperson is not within the range of the auto-recoverable, and no reply is sent; if the reply message pre-configured for the situation is used, Replying, or randomly selecting a reply message to reply, may cause the salesperson to suspect that the current customer has an abnormal situation and affect the test result because it does not meet the current chat scenario.
  • the refusal module 70 controls not to reply to the chat message of the miss category to avoid undue reply when there is no suitable reply message, which is more in line with the habit of human chat, and enhances the degree of personification of the chat application.
  • a fifth embodiment of the automatic recovery device of the present invention provides an automatic recovery device based on the embodiment shown in FIG. 6, FIG. 7, FIG. 8 or FIG. 9 (this embodiment takes FIG. 9 as an example).
  • the automatic reply device further includes:
  • the training module 80 is configured to use the pre-configured corpus samples to train the classifier based on a neural network algorithm and a logistic regression algorithm.
  • the training module 80 of the present embodiment trains a classifier for classifying chat messages based on a neural network algorithm and a logistic regression algorithm.
  • the training module 80 obtains a pre-configured corpus sample, and the corpus sample may be a large number of chat messages. The more the corpus samples, the better the training effect.
  • the categories in which the classifier classifies the corpus can be configured as needed, and different categories correspond to different reply messages.
  • Each of the chat messages in the corpus sample is configured with its mapped category, that is, the chat messages in the corpus samples are classified, and the corresponding categories are marked to prepare for the training of the classifier.
  • the training module 80 performs segmentation on the corpus sample, and divides the chat message in units of sentences into a single word.
  • the training module 80 performs feature extraction on the chat message after the word segmentation, and the extracted feature may be a part-of-speech feature or the like.
  • the training module 80 then uses a logistic regression algorithm to classify each chat message based on the characteristics of each chat message so that each chat message can hit its pre-configured category.
  • the classifier When classifying the chat message, based on the feature extracted by the chat message, the classifier selects the category with the highest probability among the specified categories as the category of the hit, and then determines whether the classification is successful according to the pre-configured category of the chat message, according to Whether the classification is successful or not
  • the reciprocal training of the corpus samples is classified as much as possible so that the classifier can hit the correct category according to the characteristics of the chat message.
  • the training module 80 learns the classification mode based on the training classification result of the corpus sample based on the neural network algorithm, and corrects the classifier, so that the feature extracted from the chat message is that the chat message is most significant and can be distinguished from the other.
  • the characteristics of the chat message improve the success rate of the classification result.
  • the training module 80 can test the success rate of the classifier by using the test corpus. If the success rate reaches the preset required value, the classifier can be determined to complete the training; if the success rate does not reach the preset required value, The classifier can be trained until the success rate reaches the preset required value.
  • the training module 80 uses a neural network algorithm and a logistic regression algorithm to perform classifier training, so that the classifier can extract the most prominent features of the corpus sample, and the classification result of the chat message is more accurate.
  • the above receiving module 10, classification module 20, configuration module 30, reply module 40, computing module 50, query module 60, rejection module 70, and training module 80 may be embedded in hardware.
  • it may also be stored in the form of software in the memory of the automatic reply device, so that the processor calls to perform the operations corresponding to the above respective modules.
  • the processor can be a central processing unit (CPU), a microprocessor, a microcontroller, or the like.
  • FIG. 11 is a schematic structural diagram of a device in a hardware operating environment according to an embodiment of the present invention.
  • the automatic reply device in the embodiment of the present invention may be a PC, or may be a terminal device such as a smart phone, a tablet computer, an e-book reader, or a portable computer.
  • the automatic reply device may include a processor 1001, such as a CPU, and a network interface 1002, a memory 1003. Connection communication between these components can be achieved via a communication bus.
  • the network interface 1002 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface).
  • the memory 1003 may be a high speed RAM memory or a stable memory (non-volatile) Memory), such as disk storage.
  • the memory 1003 can also optionally be a storage device independent of the aforementioned processor 1001.
  • the automatic reply device may further include a user interface, a camera, and an RF (Radio) Frequency, RF) circuits, sensors, audio circuits, WiFi modules, and more.
  • the user interface may include a display, an input unit such as a keyboard, and the optional user interface may also include a standard wired interface, a wireless interface.
  • the automatic reply device structure shown in FIG. 11 does not constitute a limitation on the automatic reply device, and may include more or less components than those illustrated, or combine some components or different components. Arrangement.
  • an operating system As shown in FIG. 11, an operating system, a network communication module, and an automatic reply program may be included in the memory 1003 as a computer storage medium.
  • the operating system is a program for managing and controlling the hardware and software resources of the automatic reply device, and supports the operation of the network communication module, the automatic reply program, and other programs or software; the network communication module is used to manage and control the network interface 1002.
  • the network interface 1002 is mainly used to connect to the user equipment, perform data communication with the user equipment, and the chat object inputs a chat message through the user equipment, and sends the message to the automatic reply device; and the processor 1001 can use
  • the automatic reply procedure stored in the memory 1003 is executed to implement the following steps:
  • Receiving a chat message sent by the chat object determining that the time point of receiving the chat message is a start time
  • a reply message corresponding to the category is invoked to perform a reply of the chat message.
  • processor 1001 can also execute an automatic reply procedure stored in the memory 1003 to implement the following steps:
  • the reply interval is calculated according to the number of reply message words corresponding to the category and the preset typing rate.
  • processor 1001 can also execute an automatic reply procedure stored in the memory 1003 to implement the following steps:
  • the reply time is configured according to the pre-configured reply interval and the start time.
  • processor 1001 can also execute an automatic reply procedure stored in the memory 1003 to implement the following steps:
  • processor 1001 can also execute an automatic reply procedure stored in the memory 1003 to implement the following steps:
  • the classifier is trained based on neural network algorithms and logistic regression algorithms using pre-configured corpus samples.
  • the specific embodiment of the automatic reply device of the present invention is basically the same as the above embodiments of the automatic reply method and device, and details are not described herein.
  • the present invention provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the following steps:
  • Receiving a chat message sent by the chat object determining that the time point of receiving the chat message is a start time
  • a reply message corresponding to the category is invoked to perform a reply of the chat message.
  • the one or more programs may be executed by the one or more processors, and the following steps are also implemented:
  • the reply interval is calculated according to the number of reply message words corresponding to the category and the preset typing rate.
  • the one or more programs may be executed by the one or more processors, and the following steps are also implemented:
  • the reply time is configured according to the pre-configured reply interval and the start time.
  • the one or more programs may be executed by the one or more processors, and the following steps are also implemented:
  • the one or more programs may be executed by the one or more processors, and the following steps are also implemented:
  • the classifier is trained based on neural network algorithms and logistic regression algorithms using pre-configured corpus samples.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • a storage medium such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.

Abstract

本发明公开了一种自动回复方法,该方法包括:接收聊天对象发送的聊天消息,确定收到所述聊天消息的时间点为起始时间;基于预先训练得到的分类器,获取所述聊天消息命中的类别;根据预先配置的回复间隔和所述起始时间,配置回复时间;在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。本发明还公开了一种自动回复装置、设备及计算机可读存储介质。本发明实现了对聊天应用软件自动回复速度的控制,以贴近人工回复的速度,增强了模拟人工回复的真实度,提升了聊天应用软件的拟人化程度。

Description

自动回复方法、装置、设备及计算机可读存储介质
技术领域
本发明涉及网络技术领域,尤其涉及一种自动回复方法、装置、设备及计算机可读存储介质。
背景技术
目前,越来越多的聊天应用软件,例如微软小冰、小黄鸡等,能够自动与用户进行对话或聊天。但是,在聊天时,用户能够清楚的感觉到与其进行对话的并非真实的人类,缺乏真实感,也大大降低了聊天的趣味性。
例如,聊天机器人能够模仿人类进行聊天或对话,在聊天机器人与用户对话时,由于聊天机器人的回复的内容是预先录入的,因此在收到用户输入的聊天消息后,根据用户的聊天消息查找对应的回复语句进行回复即可,回复速度比普通的人工回复要快很多。
对于用户而言,输入聊天消息后,通常在极短的时间内即可以收到聊天机器人的自动回复,而人工回复的速度则慢许多。在对话过程中,用户可以轻易的判断出当前进行回复的是人工还是机器人。
因此,目前的聊天应用软件拟人化程度较低,还无法给用户带来较为真实的聊天感。
发明内容
本发明的主要目的在于提供一种自动回复方法、装置、设备及计算机可读存储介质,旨在解决聊天应用软件自动回复的拟人化程度低的技术问题。
为实现上述目的,本发明提供一种自动回复方法,所述自动回复方法包括以下步骤:
接收聊天对象发送的聊天消息,确定收到所述聊天消息的时间点为起始时间;
基于预先训练得到的分类器,获取所述聊天消息命中的类别;
根据预先配置的回复间隔和所述起始时间,配置回复时间;
在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。
在一个实施例中,所述根据预先配置的回复间隔和所述起始时间,配置回复时间的步骤之前,还包括:
根据所述类别对应的回复消息字数,以及预设的打字速率,计算得到回复间隔。
在一个实施例中,所述根据预先配置的回复间隔和所述起始时间,配置回复时间的步骤之前,还包括:
根据预先配置的聊天记录,查询预设时间段内所述类别被命中的次数;
若所述类别在所述时间段内被命中的次数小于预设值,则转入执行步骤:根据预先配置的回复间隔和所述起始时间,配置回复时间。
在一个实施例中,所述自动回复方法还包括:
若未成功获取所述聊天消息命中的类别,则不进行所述聊天消息的回复。
在一个实施例中,所述自动回复方法还包括:
使用预先配置的语料样本,基于神经网络算法和逻辑回归算法训练得到所述分类器。
此外,为实现上述目的,本发明还提供一种自动回复装置,所述自动回复装置包括:
接收模块,用于接收聊天对象发送的聊天消息,确定收到所述聊天消息的时间点为起始时间;
分类模块,用于基于预先训练得到的分类器,获取所述聊天消息命中的类别;
配置模块,用于根据预先配置的回复间隔和所述起始时间,配置回复时间;
回复模块,用于在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。
在一个实施例中,所述自动回复装置还包括:
计算模块,用于根据所述类别对应的回复消息字数,以及预设的打字速率,计算得到回复间隔。
在一个实施例中,所述自动回复装置还包括:
查询模块,用于根据预先配置的聊天记录,查询预设时间段内所述类别被命中的次数;
所述配置模块,还用于若所述类别在所述时间段内被命中的次数小于预设值,则根据预先配置的回复间隔和所述起始时间,配置回复时间。
在一个实施例中,所述自动回复装置还包括:
拒复模块,用于若未成功获取所述聊天消息命中的类别,则不进行所述聊天消息的回复。
在一个实施例中,所述自动回复装置还包括:
训练模块,用于使用预先配置的语料样本,基于神经网络算法和逻辑回归算法训练得到所述分类器。
此外,为实现上述目的,本发明还提供一种自动回复设备,所述自动回复设备包括处理器、网络接口及存储器,所述存储器中存储有自动回复程序;
所述网络接口用于连接用户设备,与所述用户设备进行数据通信;
所述处理器用于执行所述自动回复程序,以实现以下步骤:
接收聊天对象基于所述用户设备发送的聊天消息,确定收到所述聊天消息的时间点为起始时间;
基于预先训练得到的分类器,获取所述聊天消息命中的类别;
根据预先配置的回复间隔和所述起始时间,配置回复时间;
在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。
优选地,所述处理器还用于执行所述自动回复程序,以实现以下步骤:
根据所述类别对应的回复消息字数,以及预设的打字速率,计算得到回复间隔。
优选地,所述处理器还用于执行所述自动回复程序,以实现以下步骤:
根据预先配置的聊天记录,查询预设时间段内所述类别被命中的次数;
若所述类别在所述时间段内被命中的次数小于预设值,则根据预先配置的回复间隔和所述起始时间,配置回复时间。
优选地,所述处理器还用于执行所述自动回复程序,以实现以下步骤:
若未成功获取所述聊天消息命中的类别,则不进行所述聊天消息的回复。
优选地,所述处理器还用于执行所述自动回复程序,以实现以下步骤:
使用预先配置的语料样本,基于神经网络算法和逻辑回归算法训练得到所述分类器。
此外,为实现上述目的,本发明还提供一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现以下步骤:
接收聊天对象发送的聊天消息,确定收到所述聊天消息的时间点为起始时间;
基于预先训练得到的分类器,获取所述聊天消息命中的类别;
根据预先配置的回复间隔和所述起始时间,配置回复时间;
在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。
优选地,所述一个或者多个程序可被所述一个或者多个处理器执行,还实现以下步骤:
根据所述类别对应的回复消息字数,以及预设的打字速率,计算得到回复间隔。
优选地,所述一个或者多个程序可被所述一个或者多个处理器执行,还实现以下步骤:
根据预先配置的聊天记录,查询预设时间段内所述类别被命中的次数;
若所述类别在所述时间段内被命中的次数小于预设值,则根据预先配置的回复间隔和所述起始时间,配置回复时间。
优选地,所述一个或者多个程序可被所述一个或者多个处理器执行,还实现以下步骤:
若未成功获取所述聊天消息命中的类别,则不进行所述聊天消息的回复。
优选地,所述一个或者多个程序可被所述一个或者多个处理器执行,还实现以下步骤:
使用预先配置的语料样本,基于神经网络算法和逻辑回归算法训练得到所述分类器。
本发明实施例提出的一种自动回复方法、装置、设备及计算机可读存储介质,收到聊天对象发送的聊天消息后,确定收到此聊天消息的时间点为起始时间;然后,基于预先训练得到的分类器,对聊天消息进行分类,获取聊天消息命中的类别;然后,根据起始时间和预先配置的回复间隔,配置回复时间;在达到回复时间时,调用本次聊天消息命中的类别对应的回复消息进行本次聊天消息的回复。本发明通过回复间隔的设置,实现了对聊天应用软件自动回复速度的控制,以贴近人工回复的速度,增强了模拟人工回复的真实度,提升了聊天应用软件的拟人化程度。
附图说明
图1为本发明自动回复方法第一实施例的流程示意图;
图2为本发明自动回复方法第二实施例的流程示意图;
图3为本发明自动回复方法第三实施例的流程示意图;
图4为本发明自动回复方法第四实施例的流程示意图;
图5为本发明自动回复方法第五实施例的流程示意图;
图6为本发明自动回复装置第一实施例的功能模块示意图;
图7为本发明自动回复装置第二实施例的功能模块示意图;
图8为本发明自动回复装置第三实施例的功能模块示意图;
图9为本发明自动回复装置第四实施例的功能模块示意图;
图10为本发明自动回复装置第五实施例的功能模块示意图;
图11是本发明实施例方案涉及的硬件运行环境的设备结构示意图。
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
参照图1,本发明自动回复方法第一实施例提供一种自动回复方法,所述自动回复方法包括:
步骤S10、接收聊天对象发送的聊天消息,确定收到所述聊天消息的时间点为起始时间。
本实施例通过控制自动回复的速率,使得聊天应用软件的自动回复更加贴近人工回复,增强聊天场景的真实感,提升用户体验。
本实施例中,以聊天应用软件为聊天机器人进行举例说明。聊天机器人是能够模拟人类进行聊天或是对话的应用程序。本发明并不限定于聊天机器人,还可以应用于其他需要进行自动回复的应用软件,例如,通过微信、QQ等社交软件与聊天对象进行聊天,自动回复聊天对象的聊天消息,或是模拟淘宝客服与消费者聊天,提供客户服务。
具体的,作为一种实施方式,聊天机器人与聊天对象建立聊天会话的条件,例如聊天机器人与聊天对象成为社交软件的好友,则聊天机器人可以主动触发进入自动回复模式,也可以在收到聊天对象发送的触发信息时,进入自动回复模式。
例如,可以配置触发信息为“你好”、“Hi”等,则聊天机器人在收到触发信息后,控制进入自动回复模式。
在自动回复模式下,聊天机器人接收聊天对象发送的聊天消息。聊天对象可以是人类或是其他的聊天机器人,本实施例以聊天对象为人类进行举例说明。
聊天对象发送的聊天消息可以是语音或文字信息等类型。若聊天对象发送的聊天消息为文字信息,则可以直接通过分类器获取对应的类别;若聊天对象发送的聊天消息为语音,则需要通过语音识别转换文文字信息后,再使用文字信息进行分类。
同时,聊天机器人记录收到此条聊天消息的时间点,并确定此时间点为本次对话的起始时间点。
步骤S20、基于预先训练得到的分类器,获取所述聊天消息命中的类别。
在获取聊天消息后,聊天机器人使用预先训练得到的分类器,获取聊天消息命中的类别。
具体的,分类器中预先配置有多个给定的类别,不同的类别对应不同的回复消息,分类器能够将未知类别的聊天消息映射到给定类别中的一个,从而得到回复的消息。其中,不同的类别可以使用数字标号等方式进行标识。
作为一种实施方式,在获取文字类型的聊天消息后,将聊天消息的文本信息进行分词,得到各词组。
然后,将文本信息的分词投入预先训练好的分类器,根据文本信息分词的特征查找命中的类别。
需要说明的是,命中的类别也即当前聊天消息的分类,是基于聊天消息的特征映射得到的,不同的聊天消息由于语义相同可能命中同一个类别,但是同样的聊天消息仅能命中同一个类别。
例如,聊天消息“你需要购买什么样的产品”和“你想要买什么样的产品”,在进行分词,并投入分类器后,可能命中同一个对应回复消息内容是具体产品的类别。
步骤S30、根据预先配置的回复间隔和所述起始时间,配置回复时间。
在获取本次聊天消息命中的类别后,聊天机器人根据预设的回复间隔,控制本次聊天消息的回复时间。
具体的,作为一种实施方式,预设的回复间隔可以是固定的时间间隔。
则聊天机器人在获取聊天消息命中的类别后,将收到此聊天消息的时间点,也即起始时间,加上预设的时间间隔,得到的时间点也即对本次聊天消息的回复时间。
进一步的,预设的回复间隔也可以是根据不同类别回复消息对应配置的时间间隔。时间间隔可以根据不同回复消息的语义、文本字数、语音长度等信息进行灵活配置,以贴近人工回复的速度。
则,聊天机器人在获取聊天消息命中的类别后,获取此类别对应的时间间隔。
然后,将收到此聊天消息的时间点,也即起始时间,加上此类别对应的时间间隔,得到的时间点也即对本次聊天消息的回复时间。
步骤S40、在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。
在成功获取本次聊天消息命中的类别后,聊天机器人获取此类别对应的回复消息作为本次聊天消息对应的回复消息。其中,回复消息可以是文本信息,也可以是预先配置的语音信息等类型的消息,可根据实际需要灵活配置。
在时间达到回复时间时,将本次获取的聊天消息发送给聊天对象。
由此,实现了聊天消息的回复。
此后,若再次收到聊天对象发送的聊天消息,则重新配置起始时间,进行新一轮的自动回复。
在本实施例中,收到聊天对象发送的聊天消息后,确定收到此聊天消息的时间点为起始时间;然后,基于预先训练得到的分类器,对聊天消息进行分类,获取聊天消息命中的类别;然后,根据起始时间和预先配置的回复间隔,配置回复时间;在达到回复时间时,调用本次聊天消息命中的类别对应的回复消息进行本次聊天消息的回复。本实施例通过回复间隔的设置,实现了对聊天应用软件自动回复速度的控制,以贴近人工回复的速度,增强了模拟人工回复的真实度,提升了聊天应用软件的拟人化程度。
进一步的,参照图2,本发明自动回复方法第二实施例提供一种自动回复方法,基于上述图1所示的实施例,所述步骤S30之前,还包括:
步骤S50、根据所述类别对应的回复消息字数,以及预设的打字速率,计算得到回复间隔。
本实施例中,配置所有的回复消息为文本信息。在收到聊天对象发送的聊天消息时,聊天机器人记录收到聊天消息的时间点。
则在获取本次聊天对象发送的聊天消息命中的类别后,聊天机器人获取此类别对应的回复消息。
然后,聊天机器人统计本次回复消息的字数,根据得到的字数和预设的打字速率,计算得到回复间隔。其中,预设的打字速率也可以理解为人工的打字速率,例如每秒一个字等。在计算回复间隔时,将回复消息的字数与打字速率相乘,得到的时间即为回复间隔。
在得到回复间隔后,聊天机器人将收到聊天消息的时间点加上回复间隔的时间,得到对本地聊天消息的回复时间点。
然后,聊天机器人检测当前的时间,在到达回复时间点时,向聊天对象发送回复消息。
由于获取回复消息的运算时间通常非常短,通常在得到回复消息时,时间点不会超过回复时间点,因此不会影响到对于回复时间的控制。
在本实施例中,在获取本次聊天消息命中的类后别,根据此类别对应的回复消息字数,以及预设的打字速率,计算得到回复本次聊天消息的回复间隔;然后,根据起始时间和得到的回复间隔配置回复本次聊天消息的回复时间。本实施例通过根据回复消息的字数和打字速率配置时间间隔,模拟人工回复的打字速度,以增强人工回复的场景感,提高了聊天应用软件的拟人化程度。
进一步的,参照图3,本发明自动回复方法第三实施例提供一种自动回复方法,基于上述图1或图2所示的实施例(本实施例以图1为例),所述步骤S30之前,还包括:
步骤S60、根据预先配置的聊天记录,查询预设时间段内所述类别被命中的次数;若所述类别在所述时间段内被命中的次数小于预设值,则转入执行步骤S30。
本实施例中,聊天机器人记录聊天对象发送的每一条聊天消息,每一条聊天消息命中的类别,和对应的回复时间,配置得到聊天记录。
在聊天机器人获取本次聊天消息命中的类别时,根据配置的聊天记录,查询预设时间段内此类别是否被命中过。
若此类别在预设的时间段内被与本次聊天消息相同或不同的聊天消息命中,则统计此类别在此时间段内被命中的次数。本实施例中,统计此类别被命中的次数时,本次被命中不计入统计结果。
在得到此类别在预设时间段内被命中的次数后,判断被命中的次数是否小于预设值;若被命中的次数小于预设值,则判定此类别有效,可以对本次聊天消息进行回复;若被命中的次数大于或等于预设值,则判定此类别无效,不对本次聊天消息进行回复。
例如,若预设的时间段为2分钟,预设值为1。
则聊天机器人在获取命中的类别时,查询2分钟以内的聊天记录中,此类别被命中的次数。
若此类别在2分钟内被命中1次,意味着此类别的聊天消息在2分钟内已经被回复过,聊天对象在发送重复的聊天消息,则不再次回复;若此类别在2分钟内被命中0次,意味着2分钟内未收到此类别的聊天消息,可以进行回复,则进行回复时间的配置,在达到回复时间时,调用此类别对应的回复消息进行聊天消息的回复。
由此,实现了对相同回复消息的管理。
在本实施例中,在获取本次聊天消息命中的类别后,根据预先配置的聊天记录,查询预设时间段内此类别被命中的次数,从而得到预设时间段内收到此类别的本次聊天消息的次数;若此类别在预设时间段内被命中的次数小于预设值,也即在预设时间段内收到此类别聊天消息的次数小于预设值,则进行回复时间的配置,进行聊天消息的回复。本实施例通过配置预设值,仅在预设时间段内收到的同类别的聊天消息的次数小于预设值时,才对本次聊天消息进行回复;当在预设时间段内收到同类别聊天消息的次数过多时,不进行回复,以避免多次以同样的内容重复回复同一类别的聊天消息,更加符合人类聊天的习惯,提高了聊天应用软件的拟人化程度。
进一步的,参照图4,本发明自动回复方法第四实施例提供一种自动回复方法,基于上述图1、图2或图3所示的实施例,所述自动回复方法还包括:
步骤70、若未成功获取所述聊天消息命中的类别,则不进行所述聊天消息的回复。
本实施例在未获取本次聊天消息命中的类别时,控制不进行聊天消息的回复。
例如,在使用自动回复对公司内部的业务员进行风险测试时,由于目的是在业务员不知情的条件下,模拟客户测试业务员是否违规操作,因此为了避免业务员怀疑,对业务员发送的聊天消息进行自动回复时,需要有较高的拟人化程度。
若业务员发送的聊天消息没有命中分类器中特定的类别,则可以认为当前业务员发送的聊天消息不在可自动回复的范围内,不进行回复;若使用针对此种情况预先配置的回复消息进行回复,或是随机选择回复消息进行回复,则可能由于不符合当前的聊天场景,导致业务员怀疑当前的客户存在异常情况,而影响测试结果。
在本实施例中,不对未命中类别的聊天消息进行回复,以避免在没有合适的回复消息时乱回复,更加符合人类聊天的习惯,增强聊天应用软件的拟人化程度。
进一步的,参照图5,本发明自动回复方法第五实施例提供一种自动回复方法,基于上述图1、图2、图3或图4所示的实施例,所述自动回复方法还包括:
步骤S80、使用预先配置的语料样本,基于神经网络算法和逻辑回归算法训练得到所述分类器。
本实施例基于神经网络算法和逻辑回归算法训练得到用于对聊天消息进行分类的分类器。
具体的,作为一种实时方式,获取预先配置语料样本,语料样本可以是大量的聊天消息,语料样本数量越多,训练效果越好。
可以根据需要配置分类器对于语料进行分类后的类别,不同的类别对应不同的回复消息。分别为语料样本中的各聊天消息配置其映射的类别,也即,将语料样本中的聊天消息进行分类,并标注好对应的类别,为分类器的训练做准备。
然后,对语料样本进行分词,将以句为单位的聊天消息切分为一个一个单独的词。
然后,对分词后的聊天消息进行特征提取,提取的特征可以是词性特征等。
然后,使用逻辑回归算法基于各聊天消息的特征,对各聊天消息进行分类训练,使各聊天消息能够命中其预先配置的类别。
在对聊天消息进行分类时,基于聊天消息提取的特征,使分类器在指定的各类别中选取概率最大的类别作为其命中的类别,再根据此聊天消息预先配置的类别判断是否分类成功,根据分类是否成功的结果对语料样本进行分类的往复训练,尽量使分类器可以根据聊天消息的特征命中正确的类别。
在训练过程中,基于神经网络算法,根据语料样本的训练分类结果学习分类的模式,并修正分类器,使得对聊天消息提取得到的特征为各聊天消息最显著、最能够区别于其他聊天消息的特征,提高分类结果的成功率。
在训练阶段结束后,可以使用测试语料测试分类器的成功率,若成功率达到预设的要求值时,可以判定分类器完成训练;若成功率未达到预设的要求值时,可以继续进行分类器的训练,直至成功率达到预设的要求值。
在本实施例中,采用神经网络算法和逻辑回归算法进行分类器的训练,使得分类器能够提取出语料样本最显著的特征,对聊天消息的分类结果也更加准确。
需要说明的是,本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
参照图6,本发明自动回复装置第一实施例提供一种自动回复装置,所述自动回复装置包括:
接收模块10,用于接收聊天对象发送的聊天消息,确定收到所述聊天消息的时间点为起始时间。
本实施例通过控制自动回复的速率,使得聊天应用软件的自动回复更加贴近人工回复,增强聊天场景的真实感,提升用户体验。
具体的,作为一种实施方式,聊天应用软件与聊天对象建立聊天会话的条件,例如聊天机器人与聊天对象成为社交软件的好友,则聊天机器人可以主动触发进入自动回复模式,也可以在收到聊天对象发送的触发信息时,进入自动回复模式。
例如,可以配置触发信息为“你好”、“Hi”等,则聊天应用软件在收到触发信息后,控制进入自动回复模式。
在自动回复模式下,接收模块10接收聊天对象发送的聊天消息。聊天对象可以是人类或是其他的聊天应用软件,本实施例以聊天对象为人类进行举例说明。
聊天对象发送的聊天消息可以是语音或文字信息等类型。若聊天对象发送的聊天消息为文字信息,则可以直接通过分类器获取对应的类别;若聊天对象发送的聊天消息为语音,则需要接收模块10通过语音识别转换文文字信息后,再使用文字信息进行分类。
同时,接收模块10记录收到此条聊天消息的时间点,并确定此时间点为本次对话的起始时间点。
分类模块20,用于基于预先训练得到的分类器,获取所述聊天消息命中的类别。
在获取聊天消息后,分类模块20使用预先训练得到的分类器,获取聊天消息命中的类别。
具体的,分类器中预先配置有多个给定的类别,不同的类别对应不同的回复消息,分类器能够将未知类别的聊天消息映射到给定类别中的一个,从而得到回复的消息。其中,不同的类别可以使用数字标号等方式进行标识。
作为一种实施方式,在获取文字类型的聊天消息后,分类模块20将聊天消息的文本信息进行分词,得到各词组。
然后,分类模块20将文本信息的分词投入预先训练好的分类器,根据文本信息分词的特征查找命中的类别。
需要说明的是,命中的类别也即当前聊天消息的分类,是基于聊天消息的特征映射得到的,不同的聊天消息由于语义相同可能命中同一个类别,但是同样的聊天消息仅能命中同一个类别。
例如,聊天消息“你需要购买什么样的产品”和“你想要买什么样的产品”,在进行分词,并投入分类器后,可能命中同一个对应回复消息内容是具体产品的类别。
配置模块30,用于根据预先配置的回复间隔和所述起始时间,配置回复时间。
在获取本次聊天消息命中的类别后,配置模块30根据预设的回复间隔,控制本次聊天消息的回复时间。
具体的,作为一种实施方式,预设的回复间隔可以是固定的时间间隔。
则在获取聊天消息命中的类别后,配置模块30将收到此聊天消息的时间点,也即起始时间,加上预设的时间间隔,得到的时间点也即对本次聊天消息的回复时间。
进一步的,预设的回复间隔也可以是根据不同类别回复消息对应配置的时间间隔。时间间隔可以根据不同回复消息的语义、文本字数、语音长度等信息进行灵活配置,以贴近人工回复的速度。
则,在获取聊天消息命中的类别后,配置模块30获取此类别对应的时间间隔。
然后,配置模块30将收到此聊天消息的时间点,也即起始时间,加上此类别对应的时间间隔,得到的时间点也即对本次聊天消息的回复时间。
回复模块40,用于在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。
在成功获取本次聊天消息命中的类别后,回复模块40获取此类别对应的回复消息作为本次聊天消息对应的回复消息。其中,回复消息可以是文本信息,也可以是预先配置的语音信息等类型的消息,可根据实际需要灵活配置。
在时间达到回复时间时,回复模块40将本次获取的聊天消息发送给聊天对象。
由此,实现了聊天消息的回复。
此后,若再次收到聊天对象发送的聊天消息,则接收模块10重新配置起始时间,进行新一轮的自动回复。
在本实施例中,接收模块10收到聊天对象发送的聊天消息后,确定收到此聊天消息的时间点为起始时间;然后,分类模块20基于预先训练得到的分类器,对聊天消息进行分类,获取聊天消息命中的类别;然后,配置模块30根据起始时间和预先配置的回复间隔,配置回复时间;在达到回复时间时,回复模块40调用本次聊天消息命中的类别对应的回复消息进行本次聊天消息的回复。本实施例通过回复间隔的设置,实现了对聊天应用软件自动回复速度的控制,以贴近人工回复的速度,增强了模拟人工回复的真实度,提升了聊天应用软件的拟人化程度。
进一步的,参照图7,本发明自动回复装置第二实施例提供一种自动回复装置,基于上述图6所示的实施例,所述自动回复装置还包括:
计算模块50,用于根据所述类别对应的回复消息字数,以及预设的打字速率,计算得到回复间隔。
本实施例中,配置所有的回复消息为文本信息。接收模块10在收到聊天对象发送的聊天消息时,记录收到聊天消息的时间点。
则在获取本次聊天对象发送的聊天消息命中的类别后,计算模块50获取此类别对应的回复消息。
然后,计算模块50统计本次回复消息的字数,根据得到的字数和预设的打字速率,计算得到回复间隔。其中,预设的打字速率也可以理解为人工的打字速率,例如每秒一个字等。在计算回复间隔时,将回复消息的字数与打字速率相乘,得到的时间即为回复间隔。
在得到回复间隔后,配置模块30将收到聊天消息的时间点加上回复间隔的时间,得到对本地聊天消息的回复时间点。
然后,回复模块40检测当前的时间,在到达回复时间点时,向聊天对象发送回复消息。
由于获取回复消息的运算时间通常非常短,通常在得到回复消息时,时间点不会超过回复时间点,因此不会影响到对于回复时间的控制。
在本实施例中,在获取本次聊天消息命中的类后别,计算模块50根据此类别对应的回复消息字数,以及预设的打字速率,计算得到回复本次聊天消息的回复间隔;然后,根据起始时间和得到的回复间隔配置回复本次聊天消息的回复时间。本实施例通过根据回复消息的字数和打字速率配置时间间隔,模拟人工回复的打字速度,以增强人工回复的场景感,提高了聊天应用软件的拟人化程度。
进一步的,参照图8,本发明自动回复装置第三实施例提供一种自动回复装置,基于上述图6或图7所示的实施例(本实施例以图6为例),所述自动回复装置还包括:
查询模块60,用于根据预先配置的聊天记录,查询预设时间段内所述类别被命中的次数;
所述配置模块30,还用于若所述类别在所述时间段内被命中的次数小于预设值,则根据预先配置的回复间隔和所述起始时间,配置回复时间。
本实施例中,查询模块60记录聊天对象发送的每一条聊天消息,每一条聊天消息命中的类别,和对应的回复时间,配置得到聊天记录。
在获取本次聊天消息命中的类别时,查询模块60根据配置的聊天记录,查询预设时间段内此类别是否被命中过。
若此类别在预设的时间段内被与本次聊天消息相同或不同的聊天消息命中,则查询模块60统计此类别在此时间段内被命中的次数。本实施例中,统计此类别被命中的次数时,本次被命中不计入统计结果。
在得到此类别在预设时间段内被命中的次数后,查询模块60判断被命中的次数是否小于预设值;若被命中的次数小于预设值,则查询模块60判定此类别有效,可以对本次聊天消息进行回复;若被命中的次数大于或等于预设值,则查询模块60判定此类别无效,不对本次聊天消息进行回复。
例如,若预设的时间段为2分钟,预设值为1。
则在获取命中的类别时,查询模块60查询2分钟以内的聊天记录中,此类别被命中的次数。
若此类别在2分钟内被命中1次,意味着此类别的聊天消息在2分钟内已经被回复过,聊天对象在发送重复的聊天消息,则不再次回复;若此类别在2分钟内被命中0次,意味着2分钟内未收到此类别的聊天消息,可以进行回复,则由配置模块30进行回复时间的配置,在达到回复时间时,回复模块40调用此类别对应的回复消息进行聊天消息的回复。
由此,实现了对相同回复消息的管理。
在本实施例中,在获取本次聊天消息命中的类别后,查询模块60根据预先配置的聊天记录,查询预设时间段内此类别被命中的次数,从而得到预设时间段内收到此类别的本次聊天消息的次数;若此类别在预设时间段内被命中的次数小于预设值,也即在预设时间段内收到此类别聊天消息的次数小于预设值,则配置模块30进行回复时间的配置,回复模块40进行聊天消息的回复。本实施例通过配置预设值,仅在预设时间段内收到的同类别的聊天消息的次数小于预设值时,才对本次聊天消息进行回复;当在预设时间段内收到同类别聊天消息的次数过多时,不进行回复,以避免多次以同样的内容重复回复同一类别的聊天消息,更加符合人类聊天的习惯,提高了聊天应用软件的拟人化程度。
进一步的,参照图9,本发明自动回复装置第四实施例提供一种自动回复装置,基于上述图6、图7或图8所示的实施例(本实施例以图6为例),所述自动回复装置还包括:
拒复模块70,用于若未成功获取所述聊天消息命中的类别,则不进行所述聊天消息的回复。
本实施例在未获取本次聊天消息命中的类别时,拒复模块70控制不进行聊天消息的回复。
例如,在使用自动回复对公司内部的业务员进行风险测试时,由于目的是在业务员不知情的条件下,模拟客户测试业务员是否违规操作,因此为了避免业务员怀疑,对业务员发送的聊天消息进行自动回复时,需要有较高的拟人化程度。
若业务员发送的聊天消息没有命中分类器中特定的类别,则可以认为当前业务员发送的聊天消息不在可自动回复的范围内,不进行回复;若使用针对此种情况预先配置的回复消息进行回复,或是随机选择回复消息进行回复,则可能由于不符合当前的聊天场景,导致业务员怀疑当前的客户存在异常情况,而影响测试结果。
在本实施例中,拒复模块70控制不对未命中类别的聊天消息进行回复,以避免在没有合适的回复消息时乱回复,更加符合人类聊天的习惯,增强聊天应用软件的拟人化程度。
进一步的,参照图10,本发明自动回复装置第五实施例提供一种自动回复装置,基于上述图6、图7、图8或图9所示的实施例(本实施例以图9为例),所述自动回复装置还包括:
训练模块80,用于使用预先配置的语料样本,基于神经网络算法和逻辑回归算法训练得到所述分类器。
本实施例训练模块80基于神经网络算法和逻辑回归算法训练得到用于对聊天消息进行分类的分类器。
具体的,作为一种实时方式,训练模块80获取预先配置语料样本,语料样本可以是大量的聊天消息,语料样本数量越多,训练效果越好。
可以根据需要配置分类器对于语料进行分类后的类别,不同的类别对应不同的回复消息。分别为语料样本中的各聊天消息配置其映射的类别,也即,将语料样本中的聊天消息进行分类,并标注好对应的类别,为分类器的训练做准备。
然后,训练模块80对语料样本进行分词,将以句为单位的聊天消息切分为一个一个单独的词。
然后,训练模块80对分词后的聊天消息进行特征提取,提取的特征可以是词性特征等。
然后,训练模块80使用逻辑回归算法基于各聊天消息的特征,对各聊天消息进行分类训练,使各聊天消息能够命中其预先配置的类别。
在对聊天消息进行分类时,基于聊天消息提取的特征,使分类器在指定的各类别中选取概率最大的类别作为其命中的类别,再根据此聊天消息预先配置的类别判断是否分类成功,根据分类是否成功的结果对语料样本进行分类的往复训练,尽量使分类器可以根据聊天消息的特征命中正确的类别。
在训练过程中,训练模块80基于神经网络算法,根据语料样本的训练分类结果学习分类的模式,并修正分类器,使得对聊天消息提取得到的特征为各聊天消息最显著、最能够区别于其他聊天消息的特征,提高分类结果的成功率。
在训练阶段结束后,训练模块80可以使用测试语料测试分类器的成功率,若成功率达到预设的要求值时,可以判定分类器完成训练;若成功率未达到预设的要求值时,可以继续进行分类器的训练,直至成功率达到预设的要求值。
在本实施例中,训练模块80采用神经网络算法和逻辑回归算法进行分类器的训练,使得分类器能够提取出语料样本最显著的特征,对聊天消息的分类结果也更加准确。
需要说明的是,在硬件实现上,以上接收模块10、分类模块20、配置模块30、回复模块40、计算模块50、查询模块60、拒复模块70以及训练模块80等可以以硬件形式内嵌于或独立于自动回复装置中,也可以以软件形式存储于自动回复装置的存储器中,以便于处理器调用执行以上各个模块对应的操作。该处理器可以为中央处理单元(CPU)、微处理器、单片机等。
如图11所示,图11是本发明实施例方案涉及的硬件运行环境的设备结构示意图。
本发明实施例自动回复设备可以是PC,也可以是智能手机、平板电脑、电子书阅读器、便携计算机等终端设备。
如图11所示,自动回复设备可以包括:处理器1001,例如CPU,以及网络接口1002,存储器1003。这些组件之间的连接通信可以通过通信总线实现。网络接口1002可选的可以包括标准的有线接口、无线接口(如WI-FI接口)。存储器1003可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器。存储器1003可选的还可以是独立于前述处理器1001的存储装置。
可选地,自动回复设备还可以包括用户接口、摄像头、RF(Radio Frequency,射频)电路,传感器、音频电路、WiFi模块等等。用户接口可以包括显示屏(Display)、输入单元比如键盘(Keyboard),可选用户接口还可以包括标准的有线接口、无线接口。
本领域技术人员可以理解,图11中示出的自动回复设备结构并不构成对自动回复设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
如图11所示,作为一种计算机存储介质的存储器1003中可以包括操作系统、网络通信模块以及自动回复程序。其中,操作系统是管理和控制自动回复设备硬件与软件资源的程序,支持网络通信模块、自动回复程序以及其他程序或软件的运行;网络通信模块用于管理和控制网络接口1002。
在图11所示的自动回复设备中,网络接口1002主要用于连接用户设备,与用户设备进行数据通信,聊天对象通过用户设备输入聊天消息,并发送给自动回复设备;而处理器1001可以用于执行存储器1003中存储的自动回复程序,以实现以下步骤:
接收聊天对象发送的聊天消息,确定收到所述聊天消息的时间点为起始时间;
基于预先训练得到的分类器,获取所述聊天消息命中的类别;
根据预先配置的回复间隔和所述起始时间,配置回复时间;
在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。
进一步地,处理器1001还可以执行存储器1003中存储的自动回复程序,以实现以下步骤:
根据所述类别对应的回复消息字数,以及预设的打字速率,计算得到回复间隔。
进一步地,处理器1001还可以执行存储器1003中存储的自动回复程序,以实现以下步骤:
根据预先配置的聊天记录,查询预设时间段内所述类别被命中的次数;
若所述类别在所述时间段内被命中的次数小于预设值,则根据预先配置的回复间隔和所述起始时间,配置回复时间。
进一步地,处理器1001还可以执行存储器1003中存储的自动回复程序,以实现以下步骤:
若未成功获取所述聊天消息命中的类别,则不进行所述聊天消息的回复。
进一步地,处理器1001还可以执行存储器1003中存储的自动回复程序,以实现以下步骤:
使用预先配置的语料样本,基于神经网络算法和逻辑回归算法训练得到所述分类器。
本发明自动回复设备的具体实施例与上述自动回复方法和装置各实施例基本相同,在此不作赘述。
本发明提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现以下步骤:
接收聊天对象发送的聊天消息,确定收到所述聊天消息的时间点为起始时间;
基于预先训练得到的分类器,获取所述聊天消息命中的类别;
根据预先配置的回复间隔和所述起始时间,配置回复时间;
在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。
进一步地,所述一个或者多个程序可被所述一个或者多个处理器执行,还实现以下步骤:
根据所述类别对应的回复消息字数,以及预设的打字速率,计算得到回复间隔。
进一步地,所述一个或者多个程序可被所述一个或者多个处理器执行,还实现以下步骤:
根据预先配置的聊天记录,查询预设时间段内所述类别被命中的次数;
若所述类别在所述时间段内被命中的次数小于预设值,则根据预先配置的回复间隔和所述起始时间,配置回复时间。
进一步地,所述一个或者多个程序可被所述一个或者多个处理器执行,还实现以下步骤:
若未成功获取所述聊天消息命中的类别,则不进行所述聊天消息的回复。
进一步地,所述一个或者多个程序可被所述一个或者多个处理器执行,还实现以下步骤:
使用预先配置的语料样本,基于神经网络算法和逻辑回归算法训练得到所述分类器。
本发明计算机可读存储介质的具体实施例与上述自动回复方法和装置各实施例基本相同,在此不作赘述。
还需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
以上仅为本发明的可选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (20)

  1. 一种自动回复方法,其特征在于,所述自动回复方法包括以下步骤:
    接收聊天对象发送的聊天消息,确定收到所述聊天消息的时间点为起始时间;
    基于预先训练得到的分类器,获取所述聊天消息命中的类别;
    根据预先配置的回复间隔和所述起始时间,配置回复时间;
    在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。
  2. 如权利要求1所述的自动回复方法,其特征在于,所述根据预先配置的回复间隔和所述起始时间,配置回复时间的步骤之前,还包括:
    根据所述类别对应的回复消息字数,以及预设的打字速率,计算得到回复间隔。
  3. 如权利要求1所述的自动回复方法,其特征在于,所述根据预先配置的回复间隔和所述起始时间,配置回复时间的步骤之前,还包括:
    根据预先配置的聊天记录,查询预设时间段内所述类别被命中的次数;
    若所述类别在所述时间段内被命中的次数小于预设值,则转入执行步骤:根据预先配置的回复间隔和所述起始时间,配置回复时间。
  4. 如权利要求1所述的自动回复方法,其特征在于,所述自动回复方法还包括:
    若未成功获取所述聊天消息命中的类别,则不进行所述聊天消息的回复。
  5. 如权利要求4所述的自动回复方法,其特征在于,所述自动回复方法还包括:
    使用预先配置的语料样本,基于神经网络算法和逻辑回归算法训练得到所述分类器。
  6. 一种自动回复装置,其特征在于,所述自动回复装置包括:
    接收模块,用于接收聊天对象发送的聊天消息,确定收到所述聊天消息的时间点为起始时间;
    分类模块,用于基于预先训练得到的分类器,获取所述聊天消息命中的类别;
    配置模块,用于根据预先配置的回复间隔和所述起始时间,配置回复时间;
    回复模块,用于在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。
  7. 如权利要求6所述的自动回复装置,其特征在于,所述自动回复装置还包括:
    计算模块,用于根据所述类别对应的回复消息字数,以及预设的打字速率,计算得到回复间隔。
  8. 如权利要求6所述的自动回复装置,其特征在于,所述自动回复装置还包括:
    查询模块,用于根据预先配置的聊天记录,查询预设时间段内所述类别被命中的次数;
    所述配置模块,还用于若所述类别在所述时间段内被命中的次数小于预设值,则根据预先配置的回复间隔和所述起始时间,配置回复时间。
  9. 如权利要求6所述的自动回复装置,其特征在于,所述自动回复装置还包括:
    拒复模块,用于若未成功获取所述聊天消息命中的类别,则不进行所述聊天消息的回复。
  10. 如权利要求9所述的自动回复装置,其特征在于,所述自动回复装置还包括:
    训练模块,用于使用预先配置的语料样本,基于神经网络算法和逻辑回归算法训练得到所述分类器。
  11. 一种自动回复设备,其特征在于,所述自动回复设备包括处理器、网络接口、存储器及通信总线,所述存储器中存储有自动回复程序;
    所述网络接口用于连接用户设备,与所述用户设备进行数据通信;
    所述处理器用于执行所述自动回复程序,以实现以下步骤:
    接收聊天对象基于所述用户设备发送的聊天消息,确定收到所述聊天消息的时间点为起始时间;
    基于预先训练得到的分类器,获取所述聊天消息命中的类别;
    根据预先配置的回复间隔和所述起始时间,配置回复时间;
    在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。
  12. 如权利要求11所述的自动回复设备,其特征在于,所述处理器还用于执行所述自动回复程序,以实现以下步骤:
    根据所述类别对应的回复消息字数,以及预设的打字速率,计算得到回复间隔。
  13. 如权利要求11所述的自动回复设备,其特征在于,所述处理器还用于执行所述自动回复程序,以实现以下步骤:
    根据预先配置的聊天记录,查询预设时间段内所述类别被命中的次数;
    若所述类别在所述时间段内被命中的次数小于预设值,则根据预先配置的回复间隔和所述起始时间,配置回复时间。
  14. 如权利要求11所述的自动回复设备,其特征在于,所述处理器还用于执行所述自动回复程序,以实现以下步骤:
    若未成功获取所述聊天消息命中的类别,则不进行所述聊天消息的回复。
  15. 如权利要求14所述的自动回复设备,其特征在于,所述处理器还用于执行所述自动回复程序,以实现以下步骤:
    使用预先配置的语料样本,基于神经网络算法和逻辑回归算法训练得到所述分类器。
  16. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现以下步骤:
    接收聊天对象发送的聊天消息,确定收到所述聊天消息的时间点为起始时间;
    基于预先训练得到的分类器,获取所述聊天消息命中的类别;
    根据预先配置的回复间隔和所述起始时间,配置回复时间;
    在到达所述回复时间时,调用所述类别对应的回复消息进行所述聊天消息的回复。
  17. 如权利要求16所述的计算机可读存储介质,其特征在于,所述一个或者多个程序可被所述一个或者多个处理器执行,还实现以下步骤:
    根据所述类别对应的回复消息字数,以及预设的打字速率,计算得到回复间隔。
  18. 如权利要求16所述的计算机可读存储介质,其特征在于,所述一个或者多个程序可被所述一个或者多个处理器执行,还实现以下步骤:
    根据预先配置的聊天记录,查询预设时间段内所述类别被命中的次数;
    若所述类别在所述时间段内被命中的次数小于预设值,则根据预先配置的回复间隔和所述起始时间,配置回复时间。
  19. 如权利要求16所述的计算机可读存储介质,其特征在于,所述一个或者多个程序可被所述一个或者多个处理器执行,还实现以下步骤:
    若未成功获取所述聊天消息命中的类别,则不进行所述聊天消息的回复。
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述一个或者多个程序可被所述一个或者多个处理器执行,还实现以下步骤:
    使用预先配置的语料样本,基于神经网络算法和逻辑回归算法训练得到所述分类器。
PCT/CN2017/077963 2016-07-20 2017-03-24 自动回复方法、装置、设备及计算机可读存储介质 WO2018014579A1 (zh)

Priority Applications (6)

Application Number Priority Date Filing Date Title
JP2017560292A JP6431993B2 (ja) 2016-07-20 2017-03-24 自動返答方法、自動返答装置、自動返答機器、自動返答プログラムおよびコンピュータ読み取り可能記憶媒体
SG11201709529SA SG11201709529SA (en) 2016-07-20 2017-03-24 An automatic reply method, device, apparatus, and storage medium
KR1020187035330A KR102125348B1 (ko) 2016-07-20 2017-03-24 자동 회신 방법, 장치, 설비 및 컴퓨터 판독가능 저장 매체
AU2017258821A AU2017258821A1 (en) 2016-07-20 2017-03-24 An automatic reply method, device, apparatus, and storage medium
US15/578,227 US10404629B2 (en) 2016-07-20 2017-03-24 Automatic reply method, device, apparatus, and storage medium
EP17800690.4A EP3306867B1 (en) 2016-07-20 2017-03-24 Auto-response method, apparatus and device, and computer-readable storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610578824.6A CN107040450B (zh) 2016-07-20 2016-07-20 自动回复方法和装置
CN201610578824.6 2016-07-20

Publications (1)

Publication Number Publication Date
WO2018014579A1 true WO2018014579A1 (zh) 2018-01-25

Family

ID=59533122

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/077963 WO2018014579A1 (zh) 2016-07-20 2017-03-24 自动回复方法、装置、设备及计算机可读存储介质

Country Status (9)

Country Link
US (1) US10404629B2 (zh)
EP (1) EP3306867B1 (zh)
JP (1) JP6431993B2 (zh)
KR (1) KR102125348B1 (zh)
CN (1) CN107040450B (zh)
AU (1) AU2017258821A1 (zh)
SG (1) SG11201709529SA (zh)
TW (1) TWI632469B (zh)
WO (1) WO2018014579A1 (zh)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108563657A (zh) * 2017-12-29 2018-09-21 上海与德科技有限公司 机器人应答模式的自适应调整方法及智能机器人
TWI718369B (zh) * 2018-04-26 2021-02-11 國立勤益科技大學 智能互動系統
US10567314B1 (en) * 2018-12-03 2020-02-18 D8AI Inc. Programmable intelligent agents for human-chatbot communication
CN111353024B (zh) * 2018-12-04 2023-04-18 阿里巴巴集团控股有限公司 回评文本的生成方法、装置及系统
US11157701B2 (en) 2019-01-10 2021-10-26 International Business Machines Corporation Regulating velocity of chat discourse
CN109753561B (zh) * 2019-01-16 2021-04-27 长安汽车金融有限公司 一种自动回复的生成方法及装置
CN109639444B (zh) * 2019-02-20 2021-06-18 腾讯科技(深圳)有限公司 消息处理方法、装置、电子设备及存储介质
TWI714019B (zh) * 2019-03-12 2020-12-21 國立清華大學 諮詢式聊天機械人之執行方法
CN110324237A (zh) * 2019-06-24 2019-10-11 中建八局第一建设有限公司 一种基于微信的集成项目应用管理方法
CN110290057B (zh) * 2019-06-28 2021-09-14 联想(北京)有限公司 一种信息处理方法及信息处理装置
CN110351293B (zh) * 2019-07-19 2022-03-01 秒针信息技术有限公司 一种发送信息的方法、装置及系统
CN110445707B (zh) * 2019-07-23 2022-05-13 北京秒针人工智能科技有限公司 一种消息处理方法及装置
CN112491692A (zh) * 2020-11-09 2021-03-12 北京明略软件系统有限公司 定时收集信息方法、系统、计算机可读存储介质及电子设备
CN112612877A (zh) * 2020-12-16 2021-04-06 平安普惠企业管理有限公司 多类型消息智能答复方法、装置、计算机设备及存储介质
CN113297362A (zh) * 2021-05-27 2021-08-24 平安科技(深圳)有限公司 机器人问答方法、装置、计算机设备及存储介质
CN113609275B (zh) * 2021-08-24 2024-03-26 腾讯科技(深圳)有限公司 信息处理方法、装置、设备及存储介质
CN115499397B (zh) * 2022-09-08 2023-11-17 亿咖通(湖北)技术有限公司 一种信息回复方法、装置、设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750705A (zh) * 2013-12-27 2015-07-01 华为技术有限公司 信息回复方法及装置
CN105550679A (zh) * 2016-02-29 2016-05-04 深圳前海勇艺达机器人有限公司 一种机器人循环监听录音的判断方法
CN105608221A (zh) * 2016-01-11 2016-05-25 北京光年无限科技有限公司 一种面向问答系统的自学习方法和装置

Family Cites Families (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20000050045A (ko) * 2000-03-28 2000-08-05 백찬영 전자 메시지 자동 응답 시스템 및 방법
AU2001275766A1 (en) * 2000-07-20 2002-02-05 Telefonaktiebolaget Lm Ericsson (Publ) Customer support system and method providing virtual and live agent interaction over a data network
US20030182391A1 (en) 2002-03-19 2003-09-25 Mike Leber Internet based personal information manager
TW576118B (en) * 2002-12-31 2004-02-11 Inventec Appliances Corp Method of auto-answering the short message for the mobile phone
US7249162B2 (en) * 2003-02-25 2007-07-24 Microsoft Corporation Adaptive junk message filtering system
US20050282559A1 (en) * 2003-02-25 2005-12-22 Boston Communications Group, Inc. Method and system for providing supervisory control over wireless phone data usage
CN100438511C (zh) * 2005-09-16 2008-11-26 腾讯科技(深圳)有限公司 一种即时通信中按照时间段自动回复的方法及系统
CN101179619A (zh) * 2006-11-08 2008-05-14 中兴通讯股份有限公司 一种移动电话及其自动应答方法
JP2008191748A (ja) * 2007-02-01 2008-08-21 Oki Electric Ind Co Ltd ユーザ間コミュニケーション方法、ユーザ間コミュニケーションプログラム、ユーザ間コミュニケーション装置
JP4625057B2 (ja) * 2007-08-15 2011-02-02 ヤフー株式会社 仮想空間情報要約作成装置
US20090077185A1 (en) * 2007-09-17 2009-03-19 Inventec Corporation Automatic-reply instant messeging system and method thereof
US20140279050A1 (en) * 2008-05-21 2014-09-18 The Delfin Project, Inc. Dynamic chatbot
JP4547721B2 (ja) * 2008-05-21 2010-09-22 株式会社デンソー 自動車用情報提供システム
US7818374B2 (en) * 2008-05-29 2010-10-19 International Business Machines Corporation Effective communication in virtual worlds
CN101800709A (zh) * 2010-01-05 2010-08-11 深圳中兴网信科技有限公司 一种即时通讯中自动回复的实现方法
US9077749B2 (en) * 2012-01-31 2015-07-07 International Business Machines Corporation Identity verification for at least one party to a text-based communication
US9973457B2 (en) * 2012-06-26 2018-05-15 Nuance Communications, Inc. Method and apparatus for live chat integration
US9461945B2 (en) * 2013-10-18 2016-10-04 Jeffrey P. Phillips Automated messaging response
US20150154002A1 (en) * 2013-12-04 2015-06-04 Google Inc. User interface customization based on speaker characteristics
EP2887627A1 (en) * 2013-12-18 2015-06-24 Telefonica Digital España, S.L.U. Method and system for extracting out characteristics of a communication between at least one client and at least one support agent and computer program product thereof
US9559993B2 (en) * 2014-10-02 2017-01-31 Oracle International Corporation Virtual agent proxy in a real-time chat service
CN104615646A (zh) * 2014-12-25 2015-05-13 上海科阅信息技术有限公司 智能聊天机器人系统
CN105068661B (zh) * 2015-09-07 2018-09-07 百度在线网络技术(北京)有限公司 基于人工智能的人机交互方法和系统
CN105227790A (zh) * 2015-09-24 2016-01-06 北京车音网科技有限公司 一种语音应答方法、电子设备和系统
CN105138710B (zh) * 2015-10-12 2019-02-19 金耀星 一种聊天代理系统及方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104750705A (zh) * 2013-12-27 2015-07-01 华为技术有限公司 信息回复方法及装置
CN105608221A (zh) * 2016-01-11 2016-05-25 北京光年无限科技有限公司 一种面向问答系统的自学习方法和装置
CN105550679A (zh) * 2016-02-29 2016-05-04 深圳前海勇艺达机器人有限公司 一种机器人循环监听录音的判断方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3306867A4 *

Also Published As

Publication number Publication date
US10404629B2 (en) 2019-09-03
TWI632469B (zh) 2018-08-11
EP3306867B1 (en) 2020-11-11
EP3306867A1 (en) 2018-04-11
JP6431993B2 (ja) 2018-11-28
KR102125348B1 (ko) 2020-06-23
TW201804339A (zh) 2018-02-01
AU2017258821A1 (en) 2018-02-08
SG11201709529SA (en) 2018-05-30
CN107040450A (zh) 2017-08-11
US20180359197A1 (en) 2018-12-13
KR20190005930A (ko) 2019-01-16
CN107040450B (zh) 2018-06-01
EP3306867A4 (en) 2018-07-04
JP2018527638A (ja) 2018-09-20

Similar Documents

Publication Publication Date Title
WO2018014579A1 (zh) 自动回复方法、装置、设备及计算机可读存储介质
WO2018036154A1 (zh) 名单分配方法、装置、设备及计算机可读存储介质
WO2018182202A1 (en) Electronic device and method of executing function of electronic device
WO2018194268A1 (en) Electronic device and method for processing user speech
WO2017171356A1 (en) Method for positioning video, terminal apparatus and cloud server
WO2018086292A1 (zh) 应用软件安全漏洞检测方法、系统、设备及存储介质
WO2018088794A2 (ko) 디바이스가 이미지를 보정하는 방법 및 그 디바이스
WO2019019340A1 (zh) 应用程序页面打开方法、装置、终端及可读存储介质
DK3036915T3 (en) HEARING WITH AN ADAPTIVE CLASSIFIER
WO2020204221A1 (ko) 공기 조화기
WO2015158133A1 (zh) 语音控制指令纠错方法和系统
EP3491504A1 (en) Image management method and apparatus thereof
WO2018086293A1 (zh) 数据泄露接口检测方法、装置、设备及存储介质
WO2019225961A1 (en) Electronic device for outputting response to speech input by using application and operation method thereof
US20150245147A1 (en) Method for adjusting a hearing apparatus via a formal language
WO2019056462A1 (zh) 名单分配方法、装置、设备以及计算机可读存储介质
WO2015028050A1 (en) Method for controlling and/or configuring a user-specific hearing system via a communication network
WO2015139639A1 (en) Method and apparatus for displaying application icons on terminal
KR20160042101A (ko) 분류기를 구비한 보청기
WO2018036156A1 (zh) 用户信息视图构建方法、系统、设备及存储介质
EP3603040A1 (en) Electronic device and method of executing function of electronic device
WO2015124073A1 (en) Process monitoring method, apparatus, and system
EP3997900A1 (en) Method and apparatus for performing authorization for unmanned aerial system service in wireless communication system
WO2019019351A1 (zh) 用户行为数据处理方法、装置及计算机可读存储介质
WO2017084337A1 (zh) 一种身份验证方法、装置和系统

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2017560292

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 11201709529S

Country of ref document: SG

WWE Wipo information: entry into national phase

Ref document number: 2017800690

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2017258821

Country of ref document: AU

Date of ref document: 20170324

Kind code of ref document: A

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

Ref document number: 17800690

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 20187035330

Country of ref document: KR

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE