Artificial Intelligence-Based Conversation Method, Device, Readable Storage Medium and Robot
By receiving and processing time information in customer session requests in the conversation robot, finding and matching target time information, and conducting sessions according to preferred speech strategies, the problem of low utilization rate of time information in the prior art session robot is solved, and more accurate customer service is achieved.
Patent Information
- Application Number
- CN202111270501.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2041-10-29
AI Technical Summary
Existing conversational robots have a low utilization rate of time information and cannot effectively guide conversational robots to provide more accurate and appropriate services.
By receiving the customer session request information sent by the terminal device, the target customer identification is extracted, the candidate time information set is found in the preset customer database, and the session statement is generated and sent based on this information. Receive time information in the feedback session statement, find matching target time information, and conduct a conversation according to the corresponding preferred speech strategy.
It improves the utilization rate of time information by conversational robots, can provide services more accurately, and enhances the quality of interaction with customers.
Smart Images

Figure CN114003703B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of artificial intelligence, and particularly relates to a conversation method, device, computer-readable storage medium and robot based on artificial intelligence. Background Art
[0002] With the continuous development of artificial intelligence technology, conversation robots with the function of natural language communication with customers have been widely used in enterprise customer service. These conversation robots use natural language processing (NLP) technology and can communicate with customers according to pre-formulated conversation strategies to provide corresponding services to customers, greatly improving the efficiency of customer service work.
[0003] However, during the communication between a customer and a conversation robot, the conversation often includes rich information, but existing conversation robots can often only extract part of the information, and a large amount of effective information is wasted. For example, there are often a lot of time-related information in the conversation, and these time information are submerged in the conversation and cannot effectively guide the conversation robot to provide more accurate and appropriate services. Therefore, how to further improve the utilization rate of time information by conversation robots has become an urgent technical problem to be solved. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a conversation method, device, computer-readable storage medium and robot based on artificial intelligence to solve the problem of low utilization rate of time information in existing conversation methods.
[0005] The first aspect of the embodiments of the present invention provides a conversation method based on artificial intelligence, which may include:
[0006] Receiving customer conversation request information sent by a terminal device, and extracting a target customer identifier in the customer conversation request information;
[0007] Searching for a candidate time information set in a preset customer database; the candidate time information set is a set composed of each piece of time information corresponding to the target customer identifier;
[0008] Generating a first conversation sentence according to the candidate time information set, and sending the first conversation sentence to the terminal device; each piece of time information in the candidate time information set is included in the first conversation sentence;
[0009] Receiving a second conversation sentence fed back by the terminal device based on the first conversation sentence, and extracting the time information in the second conversation sentence;
[0010] Search for target time information in the set of candidate time information; the target time information is the time information that matches the time information in the second conversation sentence.
[0011] Search for an optimal conversation strategy in a preset conversation strategy library and conduct a conversation according to the optimal conversation strategy; the optimal conversation strategy is the conversation strategy corresponding to the target time information.
[0012] In a specific implementation manner of the first aspect, the searching for the set of candidate time information in a preset customer database includes:
[0013] Determine the customer type corresponding to the target customer identifier.
[0014] Search for a target sub-database in the customer database; the target sub-database is the sub-database corresponding to the determined customer type.
[0015] Search for customer information corresponding to the target customer identifier in the target sub-database.
[0016] Extract each piece of time information from the retrieved customer information to form the set of candidate time information.
[0017] In a specific implementation manner of the first aspect, the searching for target time information in the set of candidate time information includes:
[0018] Calculate the time differences between the time information in the second conversation sentence and each piece of time information in the set of candidate time information respectively.
[0019] Search for the target time information in the set of candidate time information according to the time differences between the time information in the second conversation sentence and each piece of time information in the set of candidate time information.
[0020] In a specific implementation manner of the first aspect, the calculating the time differences between the time information in the second conversation sentence and each piece of time information in the set of candidate time information respectively includes:
[0021] Calculate the time differences between the time information in the second conversation sentence and each piece of time information in the set of candidate time information respectively according to the following formula:
[0022] TimeGap m = abs(CusTimeInfo - CandTimeInfo m )
[0023] Among them, CusTimeInfo is the time information in the second conversation sentence, m is the serial number of each piece of time information in the candidate time information set, 1 ≤ m ≤ M, M is the total number of pieces of time information in the candidate time information set, and CandTimeInfo m is the m-th piece of time information in the candidate time information set, abs is the absolute value function, and TimeGap m is the time difference between the time information in the second conversation sentence and the m-th piece of time information in the candidate time information set.
[0024] In a specific implementation manner of the first aspect, the finding the target time information in the candidate time information set according to the time difference between the time information in the second conversation sentence and each piece of time information in the candidate time information set includes:
[0025] Determining the target time information according to the following formula:
[0026] TgtTimeInfo = argmin(TimeGap1, TimeGap2,..., TimeGap m ,..., TimeGap M )
[0027] Among them, m is the serial number of each piece of time information in the candidate time information set, 1 ≤ m ≤ M, M is the total number of pieces of time information in the candidate time information set, and TimeGap m is the time difference between the time information in the second conversation sentence and the m-th piece of time information in the candidate time information set, argmin is the minimum independent variable function, and TgtTimeInfo is the serial number of the target time information in the candidate time information set.
[0028] In a specific implementation manner of the first aspect, the generating the first conversation sentence according to the candidate time information set and sending the first conversation sentence to the terminal device includes:
[0029] If the conversation is in text form, directly send the generated first conversation sentence to the terminal device in text form;
[0030] If the conversation is in voice form, use the preset text-to-speech technology to convert the first conversation sentence from text to voice, and send the first conversation sentence to the terminal device in voice form.
[0031] In a specific implementation manner of the first aspect, the receiving the second conversation sentence fed back by the terminal device based on the first conversation sentence and extracting the time information in the second conversation sentence includes:
[0032] If the session is in text form, directly extract the time information in the second session sentence;
[0033] If the session is in voice form, use the preset automatic speech recognition technology to convert the second session sentence from voice to text, and extract the time information in the second session sentence.
[0034] The second aspect of the embodiments of the present invention provides an artificial intelligence-based session device, which may include:
[0035] A session request receiving module, configured to receive the customer session request information sent by the terminal device, and extract the target customer identifier in the customer session request information;
[0036] A candidate time information searching module, configured to search for a set of candidate time information in a preset customer database; the set of candidate time information is a set composed of each piece of time information corresponding to the target customer identifier;
[0037] A first session sentence sending module, configured to generate a first session sentence according to the set of candidate time information, and send the first session sentence to the terminal device; each piece of time information in the set of candidate time information is included in the first session sentence;
[0038] A second session sentence receiving module, configured to receive the second session sentence fed back by the terminal device based on the first session sentence, and extract the time information in the second session sentence;
[0039] A target time information searching module, configured to search for target time information in the set of candidate time information; the target time information is the time information that matches the time information in the second session sentence;
[0040] A preferred conversation strategy searching module, configured to search for a preferred conversation strategy in a preset conversation strategy library, and conduct a conversation according to the preferred conversation strategy; the preferred conversation strategy is the conversation strategy corresponding to the target time information.
[0041] In a specific implementation manner of the second aspect, the candidate time information searching module may include:
[0042] A customer type determining unit, configured to determine the customer type corresponding to the target customer identifier;
[0043] A target sub-library searching unit, configured to search for a target sub-library in the customer database; the target sub-library is the sub-library corresponding to the determined customer type;
[0044] A customer information search unit for searching for customer information corresponding to the target customer identifier in the target sub-library;
[0045] A time information extraction unit for extracting each piece of time information from the found customer information to form the candidate time information set.
[0046] In a specific implementation manner of the second aspect, the target time information search module may include:
[0047] A time difference calculation unit for respectively calculating the time differences between the time information in the second conversation sentence and each piece of time information in the candidate time information set;
[0048] A target time information search unit for searching for the target time information in the candidate time information set according to the time differences between the time information in the second conversation sentence and each piece of time information in the candidate time information set.
[0049] In a specific implementation manner of the second aspect, the time difference calculation unit may specifically be used to respectively calculate the time differences between the time information in the second conversation sentence and each piece of time information in the candidate time information set according to the following formula:
[0050] TimeGap m = abs(CusTimeInfo - CandTimeInfo m )
[0051] wherein, CusTimeInfo is the time information in the second conversation sentence, m is the serial number of each piece of time information in the candidate time information set, 1 ≤ m ≤ M, M is the total number of pieces of time information in the candidate time information set, CandTimeInfo m is the m-th piece of time information in the candidate time information set, abs is the absolute value function, and TimeGap m is the time difference between the time information in the second conversation sentence and the m-th piece of time information in the candidate time information set.
[0052] In a specific implementation manner of the second aspect, the target time information search unit may specifically be used to determine the target time information according to the following formula:
[0053] TgtTimeInfo = argmin(TimeGap1, TimeGap2,..., TimeGap m ,..., TimeGap M )
[0054] where m is the serial number of each piece of time information in the candidate time information set, 1 ≤ m ≤ M, and M is the total number of pieces of time information in the candidate time information set, TimeGap m is the time difference between the time information in the second conversation sentence and the m-th piece of time information in the candidate time information set, argmin is the minimum independent variable function, and TgtTimeInfo is the serial number of the target time information in the candidate time information set.
[0055] In a specific implementation manner of the second aspect, the first conversation sentence sending module may include:
[0056] A first processing unit, configured to directly send the generated first conversation sentence to the terminal device in text form if the conversation is in text form;
[0057] A second processing unit, configured to convert the first conversation sentence from text to speech by using a preset text-to-speech technology and send the first conversation sentence to the terminal device in speech form if the conversation is in speech form.
[0058] In a specific implementation manner of the second aspect, the second conversation sentence receiving module may include:
[0059] A third processing unit, configured to directly extract the time information in the second conversation sentence if the conversation is in text form;
[0060] A fourth processing unit, configured to convert the second conversation sentence from speech to text by using a preset automatic speech recognition technology and extract the time information in the second conversation sentence if the conversation is in speech form.
[0061] A third aspect of the embodiments of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above artificial intelligence-based conversation methods are implemented.
[0062] A fourth aspect of the embodiments of the present invention provides a robot, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of any one of the above artificial intelligence-based conversation methods are implemented.
[0063] A fifth aspect of the embodiments of the present invention provides a computer program product. When the computer program product runs on a robot, the robot is enabled to execute the steps of any one of the above artificial intelligence-based conversation methods.
[0064] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: The embodiments of the present invention receive the customer session request information sent by the terminal device, and extract the target customer identifier in the customer session request information; search for a candidate time information set in the preset customer database; the candidate time information set is a set composed of each piece of time information corresponding to the target customer identifier; generate a first conversation sentence according to the candidate time information set, and send the first conversation sentence to the terminal device; each piece of time information in the candidate time information set is included in the first conversation sentence; receive the second conversation sentence fed back by the terminal device based on the first conversation sentence, and extract the time information in the second conversation sentence; search for the target time information in the candidate time information set; the target time information is the time information that matches the time information in the second conversation sentence; search for an optimal conversation strategy in the preset conversation strategy library, and conduct a conversation according to the optimal conversation strategy; the optimal conversation strategy is the conversation strategy corresponding to the target time information. Through the embodiments of the present invention, the time information in the conversation can be extracted, and the corresponding conversation strategy can be selected accordingly, so as to improve the utilization rate of the time information by the conversation robot and provide more accurate and appropriate services for customers. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0066] Figure 1 It is a flowchart of an embodiment of a conversation method based on artificial intelligence in an embodiment of the present invention;
[0067] Figure 2 It is a structural diagram of an embodiment of a conversation device based on artificial intelligence in an embodiment of the present invention;
[0068] Figure 3 It is a schematic block diagram of a robot in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0069] In order to make the invention purpose, features, and advantages of the present invention more obvious and understandable, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the following described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0070] Embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results.
[0071] Artificial intelligence basic technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technologies mainly include several major directions such as computer vision technology, robotics, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0072] The execution subject of the embodiments of the present invention can be a conversation robot based on artificial intelligence, which is used to execute the conversation method based on artificial intelligence in the embodiments of the present invention. The conversation robot can be deployed in a preset server, and the server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0073] Please refer to Figure 1 , an embodiment of a conversation method based on artificial intelligence in the embodiments of the present invention may include:
[0074] Step S101, receive the customer conversation request information sent by the terminal device, and extract the target customer identifier in the customer conversation request information.
[0075] The terminal device is a device such as a mobile phone, tablet, or computer used by the customer that can establish a communication connection with the robot and have a conversation. The conversation between the customer and the robot can be based on a preset Instant Messaging (IM) client or based on a preset Session Initiation Protocol (SIP). The conversation can be in text form or voice form.
[0076] When the customer needs to have a conversation with the robot, the customer can send customer conversation request information to the robot through the terminal device, and the customer identification (ID) of the customer is carried in this information. After receiving the customer conversation request information, the robot can extract the customer identification from it and use it as the target customer identification.
[0077] Step S102, search for a set of candidate time information in a preset customer database.
[0078] The set of candidate time information is a set composed of each piece of time information corresponding to the target customer identification.
[0079] The customer database is a database storing customer information of each customer. The customer information may include basic information such as customer identification, name, age, gender, etc., and may also include each piece of time information such as the insurance expiration date and exclusive membership date of the customer.
[0080] In a specific implementation of the embodiment of the present invention, all customer information in the customer database can be traversed in sequence until the customer information containing the target customer identification is found, and then each piece of time information therein is extracted to form the set of candidate time information.
[0081] In another specific implementation of the embodiment of the present invention, in order to speed up the search speed, the customer database can also be divided into different sub-databases according to customer types, and each sub-database is independent of each other and not related to each other.
[0082] The customer type can be set according to the actual situation. For example, customers can be divided into types such as auto insurance customers and life insurance customers, or customers can be divided into types such as ordinary customers and VIP customers. Of course, the customer type can also be divided according to other rules. The embodiment of the present invention does not make specific limitations on this.
[0083] The correspondence between customer types and sub-libraries can be dynamically configured according to actual conditions. When there is a new customer type, the corresponding usage space can be allocated to the customer type in the unused space in the database, that is, the sub-library corresponding to the customer type; when a customer type is no longer needed, the correspondence between the customer type and the sub-library can be released, and the database space used by the sub-library corresponding to the customer type can be released; when the sub-library space corresponding to the customer type is insufficient, the sub-library can be expanded, and the new usage space can be allocated to the customer type in the unused space in the database. The sub-library in this application is a logical concept, not a physical concept. The sub-library corresponding to a certain customer type does not have to be a continuous physical storage space, but can be a collection of multiple discontinuous physical storage spaces. Assume that the sub-library is composed of N discontinuous physical storage spaces, which are respectively recorded as storage space segment 1, storage space segment 2, ..., storage space segment N. Then, a pointer to the segment header of storage space segment 2 is stored at the end of storage space segment 1, and a pointer to the segment header of storage space segment 3 is stored at the end of storage space segment 2, and so on, thereby forming a logically continuous sub-library.
[0084] In this case, if a candidate time information set is to be searched in the customer database, the customer type corresponding to the target customer identifier can be first determined, and then a target sub-library can be searched in the customer database, where the target sub-library is a sub-library corresponding to the determined customer type. Finally, the customer information corresponding to the target customer identifier can be searched only in the target sub-library, and each piece of time information can be extracted from the found customer information to form the candidate time information set.
[0085] Step S103: Generate a first conversation statement according to the candidate time information set, and send the first conversation statement to the terminal device.
[0086] The first conversation sentence includes each piece of time information in the candidate time information set.
[0087] For example, if there are two pieces of time information in the candidate time information set, the first piece of time information is: the expiration date of the car insurance is August 5; the second piece of time information is: the exclusive member day is July 10.
[0088] Then the first conversation sentence can be "Dear customer, your car insurance will expire on August 5. July 10 is your exclusive membership day. Let me tell you about your exclusive discount."
[0089] It should be noted that the above first conversation sentence is only an example, and other similar first conversation sentences may be generated according to actual conditions, which is not specifically limited in the embodiment of the present invention.
[0090] If the conversation is in text form, the generated first conversation sentence can be directly sent to the terminal device in text form.
[0091] If the conversation is in voice form, the first conversation sentence can be converted from text to voice using Text To Speech (TTS) technology. The TTS system used in the embodiments of the present invention can include several parts such as text analysis, speech synthesis, and speech evaluation. Among them, text analysis refers to the linguistic analysis of the input text, performing lexical, grammatical, and semantic analyses sentence by sentence to determine the low-level structure of the sentence and the phoneme composition of each word, including sentence segmentation, word segmentation, processing of polyphonic characters, processing of numbers, processing of abbreviations, etc. Speech synthesis refers to extracting the corresponding single words or phrases of the processed text from the speech synthesis library and converting the linguistic description into a speech waveform. Speech evaluation refers to the subjective evaluation of the output speech in terms of clarity, naturalness, and coherence. Clarity is the percentage of correctly recognized meaningful words; naturalness is used to evaluate whether the synthesized speech quality is close to the human voice and whether the intonation of the synthesized words is natural; coherence is used to evaluate whether the synthesized sentences are fluent.
[0092] After completing the text-to-voice conversion, the first conversation sentence can be sent to the terminal device in voice form.
[0093] Step S104: Receive the second conversation sentence fed back by the terminal device based on the first conversation sentence, and extract the time information in the second conversation sentence.
[0094] After receiving the first conversation sentence, the customer can respond with a second conversation sentence through the terminal device. After the robot receives the second conversation sentence, it can extract the time information therein. For example, if the second round sentence is "I'm going to buy it in August.", the time information "August" can be extracted therefrom.
[0095] If the conversation is in text form, the time information in the second conversation sentence can be directly extracted.
[0096] If the session is in the form of voice, the Automatic Speech Recognition (ASR) technology can be used to convert the second session sentence from voice to text. The ASR system used in the embodiments of the present invention can include four major parts: feature extraction, acoustic model, language model, and dictionary and decoding. In addition, in order to extract features more effectively, audio data preprocessing operations such as filtering and framing the voice can be performed to appropriately extract the audio signal to be analyzed from the original signal; the feature extraction operation converts the voice from the time domain to the frequency domain and provides appropriate feature vectors for the acoustic model; in the acoustic model, the score of each feature vector in terms of acoustic features is calculated according to the acoustic characteristics; and the language model calculates the probability of the possible phrase sequence corresponding to the voice according to the relevant linguistic theories; finally, according to the existing dictionary, the phrase sequence is decoded to obtain the final possible text. After completing the conversion from voice to text, the time information in the second session sentence is extracted again.
[0097] Step S105: Search for the target time information in the candidate time information set.
[0098] The target time information is the time information that matches the time information in the second session sentence.
[0099] In the embodiments of the present invention, the target time information can be compared with each piece of time information in the candidate time information set respectively, and the time information that is closest to the target time information among them is used as the target time information.
[0100] Specifically, the time information in the second session sentence is denoted as CusTimeInfo, and each piece of time information in the candidate time information set is denoted as CandTimeInfo1, CandTimeInfo2,..., CandTimeInfo m 、…、CandTimeInfo M , where m is the serial number of each piece of time information in the candidate time information set, 1 ≤ m ≤ M, M is the total number of pieces of time information in the candidate time information set, and CandTimeInfo m is the mth piece of time information in the candidate time information set.
[0101] The time differences between the time information in the second session sentence and each piece of time information in the candidate time information set are calculated respectively, that is:
[0102] TimeGap m = abs(CusTimeInfo - CandTimeInfo m )
[0103] where abs is the absolute value function, and TimeGap m is the time difference between the time information in the second conversation sentence and the m-th time information in the candidate time information set.
[0104] Then, based on the time differences between the time information in the second conversation sentence and each piece of time information in the candidate time information set, search for the target time information in the candidate time information set.
[0105] Specifically, the time information with the smallest time difference from the target time information in the candidate time information set can be used as the target time information, that is:
[0106] TgtTimeInfo = argmin(TimeGap1, TimeGap2,..., TimeGap m ,..., TimeGap M )
[0107] where argmin is the minimum argument function, and TgtTimeInfo is the serial number of the target time information in the candidate time information set.
[0108] It should be noted that if the time information in the second conversation sentence only has a month without a specific date, then only the months are compared with each piece of time information in the candidate time information set. For example, if there are two pieces of time information in the candidate time information set, the first piece of time information is: the expiration date of the car insurance is August 5th; the second piece of time information is: the exclusive membership day is July 10th. The time information in the second conversation sentence is August, which is closer to the first piece of time information, then the first piece of time information (i.e., the expiration date of the car insurance is August 5th) is used as the target time information.
[0109] Step S106: Search for an optimal conversation strategy in a preset conversation strategy library and conduct a conversation according to the optimal conversation strategy.
[0110] The optimal conversation strategy is the conversation strategy corresponding to the target time information.
[0111] In a specific implementation of the embodiment of the present invention, a conversation strategy library can be established in advance. The conversation strategy library includes various conversation strategies, where each conversation strategy corresponds to a certain time information. For example, conversation strategy 1 is the conversation strategy for the insurance expiration date, conversation strategy 2 is the conversation strategy for the exclusive membership day, and so on.
[0112] After determining the target time information, a corresponding conversation strategy can be searched in the conversation strategy library and used as the preferred conversation strategy, and a conversation can be carried out according to the preferred conversation strategy.
[0113] In summary, the embodiment of the present invention receives a customer conversation request information sent by a terminal device, and extracts a target customer identifier in the customer conversation request information; searches for a candidate time information set in a preset customer database; the candidate time information set is a set composed of each piece of time information corresponding to the target customer identifier; generates a first conversation sentence according to the candidate time information set, and sends the first conversation sentence to the terminal device; each piece of time information in the candidate time information set is included in the first conversation sentence; receives a second conversation sentence fed back by the terminal device based on the first conversation sentence, and extracts the time information in the second conversation sentence; searches for a target time information in the candidate time information set; the target time information is time information matching the time information in the second conversation sentence; searches for a preferred conversation strategy in a preset conversation strategy library, and carries out a conversation according to the preferred conversation strategy; the preferred conversation strategy is a conversation strategy corresponding to the target time information. Through the embodiment of the present invention, the time information in the conversation can be extracted, and a corresponding conversation strategy can be selected accordingly, so that the utilization rate of the time information by the conversation robot can be improved, and more accurate and appropriate services can be provided for customers.
[0114] It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
[0115] Corresponding to the above-described conversation method based on artificial intelligence in the embodiment, Figure 2 FIG. shows a structural diagram of an embodiment of a conversation device based on artificial intelligence provided by an embodiment of the present invention.
[0116] In this embodiment, a conversation device based on artificial intelligence may include:
[0117] A conversation request receiving module 201, configured to receive a customer conversation request information sent by a terminal device, and extract a target customer identifier in the customer conversation request information;
[0118] A candidate time information searching module 202, configured to search for a candidate time information set in a preset customer database; the candidate time information set is a set composed of each piece of time information corresponding to the target customer identifier;
[0119] The first conversation sentence sending module 203 is configured to generate a first conversation sentence according to the candidate time information set, and send the first conversation sentence to the terminal device; each piece of time information in the candidate time information set is included in the first conversation sentence;
[0120] The second conversation sentence receiving module 204 is configured to receive a second conversation sentence fed back by the terminal device based on the first conversation sentence, and extract the time information in the second conversation sentence;
[0121] The target time information searching module 205 is configured to search for target time information in the candidate time information set; the target time information is the time information that matches the time information in the second conversation sentence;
[0122] The preferred conversation strategy searching module 206 is configured to search for a preferred conversation strategy in a preset conversation strategy library, and conduct a conversation according to the preferred conversation strategy; the preferred conversation strategy is the conversation strategy corresponding to the target time information.
[0123] In a specific implementation manner of the embodiment of the present invention, the candidate time information searching module may include:
[0124] The customer type determining unit is configured to determine the customer type corresponding to the target customer identifier;
[0125] The target sub-library searching unit is configured to search for a target sub-library in the customer database; the target sub-library is the sub-library corresponding to the determined customer type;
[0126] The customer information searching unit is configured to search for customer information corresponding to the target customer identifier in the target sub-library;
[0127] The time information extracting unit is configured to extract each piece of time information from the found customer information to form the candidate time information set.
[0128] In a specific implementation manner of the embodiment of the present invention, the target time information searching module may include:
[0129] The time difference calculating unit is configured to calculate the time difference between the time information in the second conversation sentence and each piece of time information in the candidate time information set respectively;
[0130] The target time information searching unit is configured to search for the target time information in the candidate time information set according to the time difference between the time information in the second conversation sentence and each piece of time information in the candidate time information set.
[0131] In a specific implementation manner of an embodiment of the present invention, the time difference calculation unit may be specifically configured to calculate the time difference between the time information in the second conversation sentence and each piece of time information in the candidate time information set according to the following formula:
[0132] TimeGap m =abs(CusTimeInfo-CandTimeInfo m )
[0133] wherein, CusTimeInfo is the time information in the second conversation sentence, m is the serial number of each piece of time information in the candidate time information set, 1≤m≤M, M is the total number of pieces of time information in the candidate time information set, CandTimeInfo m is the m-th piece of time information in the candidate time information set, abs is the absolute value function, and TimeGap m is the time difference between the time information in the second conversation sentence and the m-th piece of time information in the candidate time information set.
[0134] In a specific implementation manner of an embodiment of the present invention, the target time information searching unit may be specifically configured to determine the target time information according to the following formula:
[0135] TgtTimeInfo=argmin(TimeGap1、TimeGap2、…、TimeGap m 、…、TimeGap M )
[0136] wherein, m is the serial number of each piece of time information in the candidate time information set, 1≤m≤M, M is the total number of pieces of time information in the candidate time information set, TimeGap m is the time difference between the time information in the second conversation sentence and the m-th piece of time information in the candidate time information set, argmin is the minimum independent variable function, and TgtTimeInfo is the serial number of the target time information in the candidate time information set.
[0137] In a specific implementation manner of an embodiment of the present invention, the first conversation sentence sending module may include:
[0138] A first processing unit, configured to directly send the generated first conversation sentence to the terminal device in text form if the conversation is in text form;
[0139] A second processing unit, configured to, if the session is in a voice form, convert the first session sentence from text to voice by using a preset text-to-speech technology, and send the first session sentence to the terminal device in a voice form.
[0140] In a specific implementation manner of the embodiment of the present invention, the second session sentence receiving module may include:
[0141] A third processing unit, configured to directly extract the time information in the second session sentence if the session is in a text form;
[0142] A fourth processing unit, configured to, if the session is in a voice form, convert the second session sentence from voice to text by using a preset automatic speech recognition technology, and extract the time information in the second session sentence.
[0143] Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working processes of the above-described devices, modules, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be described herein again.
[0144] In the above embodiments, the descriptions of the various embodiments have their own emphases. For parts not detailed or recorded in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0145] Figure 3 A schematic block diagram of a robot provided by an embodiment of the present invention is shown. For the convenience of description, only parts related to the embodiment of the present invention are shown.
[0146] The robot 3 may include: a processor 30, a memory 31, and computer-readable instructions 32 stored in the memory 31 and executable on the processor 30, such as computer-readable instructions for executing the above-mentioned artificial intelligence-based session method. When the processor 30 executes the computer-readable instructions 32, the steps in the above-mentioned various artificial intelligence-based session method embodiments are implemented, such as Figure 1 The steps S101 to S106 shown. Alternatively, when the processor 30 executes the computer-readable instructions 32, the functions of the various modules / units in the above-mentioned device embodiments are implemented, such as Figure 2 The functions of the modules 201 to 206 shown.
[0147] Exemplarily, the computer program 32 may be divided into one or more modules / units, and the one or more modules / units are stored in the memory 31 and executed by the processor 30 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 32 in the robot 3.
[0148] Those skilled in the art can understand that Figure 3 This is merely an example of the robot 3 and does not constitute a limitation on the robot 3. It may include more or fewer components than those shown, or combine certain components, or have different components. For example, the robot 3 may also include input / output devices, network access devices, buses, etc.
[0149] The processor 30 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0150] The memory 31 may be an internal storage unit of the robot 3, such as the hard disk or memory of the robot 3. The memory 31 may also be an external storage device of the robot 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on the robot 3. Further, the memory 31 may also include both the internal storage unit and the external storage device of the robot 3. The memory 31 is used to store the computer program and other programs and data required by the robot 3. The memory 31 may also be used to temporarily store data that has been output or is to be output.
[0151] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiments can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of this application. The specific working processes of the units and modules in the above system can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0152] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0153] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in the form of hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0154] In the embodiments provided in this application, it should be understood that the disclosed device / robot and method can be implemented in other ways. For example, the device / robot embodiments described above are only illustrative. For example, the division of the module or unit is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
[0155] The unit described as a separated component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0156] In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0157] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on such an understanding, all or part of the processes in the above-mentioned method embodiments of the present application can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.
[0158] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A conversation method based on artificial intelligence, characterized in that, including: Receiving customer session request information sent by a terminal device and extracting a target customer identifier from the customer session request information; Searching for a set of candidate time information in a preset customer database; the set of candidate time information is a set composed of each piece of time information corresponding to the target customer identifier; Generating a first conversation sentence according to the set of candidate time information and sending the first conversation sentence to the terminal device; each piece of time information in the set of candidate time information is included in the first conversation sentence; Receiving a second conversation sentence fed back by the terminal device based on the first conversation sentence and extracting the time information in the second conversation sentence; Calculating the time difference between the time information in the second conversation sentence and each piece of time information in the set of candidate time information respectively; taking the time information with the smallest time difference between the set of candidate time information and the time information in the second conversation sentence as the target time information; the target time information is the time information matching the time information in the second conversation sentence; Searching for an optimal conversation strategy in a preset conversation strategy library and conducting a conversation according to the optimal conversation strategy; the optimal conversation strategy is the conversation strategy corresponding to the target time information.
2. The conversation method based on artificial intelligence according to claim 1, wherein, The searching for a set of candidate time information in a preset customer database includes: Determining the customer type corresponding to the target customer identifier; Searching for a target sub-database in the customer database; the target sub-database is the sub-database corresponding to the determined customer type; Searching for customer information corresponding to the target customer identifier in the target sub-database; Extracting each piece of time information from the found customer information to form the set of candidate time information.
3. The conversation method based on artificial intelligence according to claim 1, characterized in that, The calculating the time difference between the time information in the second conversation sentence and each piece of time information in the set of candidate time information respectively includes: Calculating the time difference between the time information in the second conversation sentence and each piece of time information in the set of candidate time information respectively according to the following formula: TimeGap m = abs(CusTimeInfo - CandTimeInfo m ) Among them, CusTimeInfo is the time information in the second conversation sentence, m is the serial number of each piece of time information in the candidate time information set, 1 ≤ m ≤ M, M is the total number of pieces of time information in the candidate time information set, and CandTimeInfo m is the m-th piece of time information in the candidate time information set, abs is the absolute value function, and TimeGap m is the time difference between the time information in the second conversation sentence and the m-th piece of time information in the candidate time information set.
4. The conversation method based on artificial intelligence according to claim 1, wherein The taking the time information with the smallest time difference between the set of candidate time information and the time information in the second conversation sentence as the target time information includes: Determining the target time information according to the following formula: TgtTimeInfo = argmin(TimeGap1, TimeGap2, …, TimeGap m , …, TimeGap M ) where m is the serial number of each piece of time information in the candidate time information set, 1 ≤ m ≤ M, M is the total number of pieces of time information in the candidate time information set, TimeGap m is the time difference between the time information in the second session sentence and the m-th piece of time information in the candidate time information set, argmin is the minimum independent variable function, and TgtTimeInfo is the serial number of the target time information in the candidate time information set.
5. The conversation method based on artificial intelligence according to claim 1, characterized in that, The generating a first conversation sentence according to the set of candidate time information and sending the first conversation sentence to the terminal device includes: If the conversation is in text form, directly sending the generated first conversation sentence to the terminal device in text form; If the conversation is in voice form, converting the first conversation sentence from text to voice by using a preset text-to-voice technology and sending the first conversation sentence to the terminal device in voice form.
6. The artificial intelligence-based conversation method according to any one of claims 1 to 5, characterized in that The receiving a second conversation sentence fed back by the terminal device based on the first conversation sentence and extracting the time information in the second conversation sentence includes: If the conversation is in text form, directly extracting the time information in the second conversation sentence; If the session is in voice form, the preset automatic speech recognition technology is used to convert the second session sentence from voice to text, and the time information in the second session sentence is extracted.
7. An artificial intelligence-based conversation device, characterized in that, It includes: A session request receiving module, configured to receive the customer session request information sent by the terminal device, and extract the target customer identifier in the customer session request information; A candidate time information searching module, configured to search for a set of candidate time information in a preset customer database; the set of candidate time information is a set composed of each piece of time information corresponding to the target customer identifier; A first session sentence sending module, configured to generate a first session sentence according to the set of candidate time information, and send the first session sentence to the terminal device; each piece of time information in the set of candidate time information is included in the first session sentence; A second session sentence receiving module, configured to receive the second session sentence fed back by the terminal device based on the first session sentence, and extract the time information in the second session sentence; A target time information searching module, configured to calculate the time difference between the time information in the second session sentence and each piece of time information in the set of candidate time information respectively; the time information with the smallest time difference between the set of candidate time information and the time information in the second session sentence is used as the target time information; the target time information is the time information that matches the time information in the second session sentence; An optimal conversation strategy searching module, configured to search for an optimal conversation strategy in a preset conversation strategy library, and conduct a conversation according to the optimal conversation strategy; the optimal conversation strategy is the conversation strategy corresponding to the target time information.
8. A computer-readable storage medium storing computer-readable instructions, characterized in that, When the computer-readable instructions are executed by the processor, the steps of the artificial intelligence-based conversation method described in any one of claims 1 to 6 are implemented.
9. A robot, comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that, When the processor executes the computer-readable instructions, the steps of the artificial intelligence-based conversation method described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Session message display method and device, apparatus and storage medium
CN110138645A
Account registration method and system based on voice interaction
CN111464519A