CN115470329A - Dialog generation method and device, computer equipment and storage medium - Google Patents

Dialog generation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115470329A
CN115470329A CN202211008750.4A CN202211008750A CN115470329A CN 115470329 A CN115470329 A CN 115470329A CN 202211008750 A CN202211008750 A CN 202211008750A CN 115470329 A CN115470329 A CN 115470329A
Authority
CN
China
Prior art keywords
information
reply
determining
topic
reply information
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202211008750.4A
Other languages
Chinese (zh)
Inventor
纪登林
赵昌健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
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 Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202211008750.4A priority Critical patent/CN115470329A/en
Publication of CN115470329A publication Critical patent/CN115470329A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present disclosure provides a dialog generation method, apparatus, computer device and storage medium, including: receiving dialog information input by a user side, and determining first reply information of the dialog information; determining the information quantity of the first reply information; the information quantity of the first reply information is used for representing the magnitude of information contained in the first reply information; determining target topic information corresponding to the user side under the condition that the information quantity of the first reply information does not meet a preset condition; and generating second reply information based on the target topic information and the first reply information and displaying the second reply information at the user side.

Description

Dialog generation method and device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of information processing technologies, and in particular, to a dialog generation method and apparatus, a computer device, and a storage medium.
Background
An open domain dialog system means that a user can have dialog interaction with the system under a certain environment, and the system can give a reply to the dialog sent by the user. The open domain dialogue system mainly depends on a dialogue generating model, the dialogue generating model is generally carried out in a maximum likelihood mode during training, and the model learns more replies with the most common and highest frequency, so that the condition that the contents of the replies are simple and have no information may occur, for example, the user cannot obtain information from the replies such as kayage and good, which may cause the user to be uninteresting to continue dialogue interaction with the system, and influence the dialogue efficiency and the dialogue experience of the user.
Disclosure of Invention
The embodiment of the disclosure at least provides a dialog generating method, a dialog generating device, a computer device and a storage medium.
In a first aspect, an embodiment of the present disclosure provides a dialog generation method, including:
receiving dialog information input by a user side, and determining first reply information of the dialog information;
determining the information quantity of the first reply information; the information quantity of the first recovery information is used for representing the magnitude of information contained in the first recovery information;
determining target topic information corresponding to the user side under the condition that the information quantity of the first reply information does not meet a preset condition;
and generating second reply information based on the target topic information and the first reply information and displaying the second reply information at the user side.
In a possible embodiment, the determining the information amount of the first reply information includes:
determining an information quantity detection result of the first reply information based on a pre-trained information quantity detection network;
and determining the information quantity of the first reply information based on the information quantity detection result.
In a possible implementation manner, the determining the information amount of the first reply information based on the information amount detection result includes:
performing part-of-speech detection on the first reply information, and determining a first detection result of the first reply information based on a part-of-speech detection result; and/or matching the first reply information with a preset nonsense word library, and determining a second detection result of the first reply information based on a matching result;
determining the information amount of the first reply information based on the information amount detection result, the first detection result and/or the second detection result.
In a possible embodiment, after receiving the dialog information input by the user terminal, the method further includes:
determining the information quantity of the dialogue information;
determining target topic information corresponding to the user side under the condition that the information amount of the first reply information does not meet a preset condition, wherein the determining comprises:
and under the condition that the information quantity of the session information and the information quantity of the first reply information do not meet the preset condition, determining target topic information corresponding to the user side.
In one possible embodiment, the generating a second reply message based on the target topic message and the first reply message includes:
determining a plurality of preset reply messages corresponding to the target topic information;
and determining target reply information based on the preset reply information, and splicing the target reply information and the first reply information to generate the second reply information.
In a possible implementation, in a case that the type of the target topic information is a first preset type for characterizing attributes of users, after the second reply information is generated and displayed, the method further includes:
receiving the dialog information input again, and determining reply information of the dialog information input again;
inputting the re-input dialogue information and the second reply information into a pre-trained answer extraction network, and determining answer information corresponding to the second reply information in the re-input dialogue information;
and correspondingly storing the target topic information and the answer information for subsequently generating reply information.
In a possible embodiment, the method further comprises:
determining related topic information corresponding to the dialogue information, and extracting answer information corresponding to the related topic information in the dialogue information;
and correspondingly storing the associated topic information and answer information corresponding to the associated topic information for subsequently generating reply information.
In a possible implementation, the determining the target topic information corresponding to the user terminal includes:
determining the weight of each topic information in the topic information set;
and determining target topic information corresponding to the user side based on the weight of each topic information.
In one possible embodiment, the determining the weight of each topic information in the topic information set includes:
acquiring preset weight of each topic information in the topic information set; alternatively, the first and second electrodes may be,
the weight of each topic information is determined based on the number of topic information in which the corresponding answer information is stored.
In a possible implementation, in a case that the type of the target topic information is a second preset type other than the first preset type, the determining target reply information based on the plurality of preset reply information includes:
screening candidate reply information from the plurality of preset reply information;
under the condition that the candidate reply information contains information to be filled, determining candidate topic information corresponding to the candidate reply information, and acquiring prestored answer information corresponding to the candidate topic information;
and constructing the target reply information based on the answer information and the candidate reply information.
In a possible implementation manner, in a case that an information amount of the first reply information satisfies a preset condition, the method further includes:
determining associated topic information associated with the first reply information;
and under the condition that the type of the associated topic information is a first preset type used for representing the user attribute, the dialogue information and the first reply information are correspondingly stored for subsequently generating reply information.
In a possible embodiment, the determining the first reply information of the dialog information includes:
and matching the conversation information with a plurality of conversation information stored in advance, and taking reply information corresponding to the conversation information which is successfully matched as the first reply information.
In a second aspect, an embodiment of the present disclosure further provides a dialog generating apparatus, including:
the first determining module is used for receiving the dialogue information input by the user side and determining first reply information of the dialogue information;
the second determining module is used for determining the information quantity of the first reply information; the information quantity of the first reply information is used for representing the magnitude of information contained in the first reply information;
the topic selection module is used for determining target topic information corresponding to the user side under the condition that the information quantity of the first reply information does not meet a preset condition;
and the generating module is used for generating second reply information based on the target topic information and the first reply information and displaying the second reply information at the user side.
In a possible implementation manner, the second determining module, when determining the information amount of the first reply information, is configured to:
determining an information quantity detection result of the first reply information based on a pre-trained information quantity detection network;
and determining the information quantity of the first reply information based on the information quantity detection result.
In one possible implementation manner, the second determining module, when determining the information amount of the first reply information based on the information amount detection result, is configured to:
performing part-of-speech detection on the first reply information, and determining a first detection result of the first reply information based on a part-of-speech detection result; and/or matching the first reply information with a preset nonsense word library, and determining a second detection result of the first reply information based on a matching result;
determining the information amount of the first reply information based on the information amount detection result, the first detection result and/or the second detection result.
In a possible embodiment, after receiving the dialog information input by the user terminal, the second determining module is further configured to:
determining the information quantity of the dialogue information;
the topic selection module, when determining the target topic information corresponding to the user end, is configured to, when the information amount of the first reply information does not satisfy a preset condition:
and under the condition that the information quantity of the session information and the information quantity of the first reply information do not meet the preset condition, determining target topic information corresponding to the user side.
In a possible embodiment, the generating module, when generating a second reply message based on the target topic message and the first reply message, is configured to:
determining a plurality of preset reply messages corresponding to the target topic information;
and determining target reply information based on the plurality of preset reply information, and splicing the target reply information and the first reply information to generate the second reply information.
In a possible implementation, the apparatus further includes a storage module configured to:
under the condition that the type of the target topic information is a first preset type used for representing user attributes, after the second reply information is generated and displayed, the dialog information input again is received, and the reply information of the dialog information input again is determined;
inputting the re-input dialogue information and the second reply information into a pre-trained answer extraction network, and determining answer information corresponding to the second reply information in the re-input dialogue information;
and correspondingly storing the target topic information and the answer information for subsequently generating reply information.
In a possible implementation manner, the storage module is further configured to:
determining relevant topic information corresponding to the dialogue information, and extracting answer information corresponding to the relevant topic information in the dialogue information;
and correspondingly storing the associated topic information and answer information corresponding to the associated topic information for subsequent generation of reply information.
In one possible embodiment, the topic selection module, when determining the target topic information corresponding to the user terminal, is configured to:
determining the weight of each topic information in the topic information set;
and determining target topic information corresponding to the user side based on the weight of each topic information.
In one possible embodiment, the topic selection module, when determining the weight of each topic information in the set of topic information, is configured to:
acquiring preset weight of each topic information in the topic information set; alternatively, the first and second electrodes may be,
the weight of each topic information is determined based on the number of topic information in which the corresponding answer information is stored.
In a possible implementation manner, in a case that the type of the target topic information is a second preset type other than the first preset type, the generating module, when determining target reply information based on the plurality of preset reply information, is configured to:
screening candidate reply information from the plurality of preset reply information;
under the condition that the candidate reply information contains information to be filled, determining candidate topic information corresponding to the candidate reply information, and acquiring prestored answer information corresponding to the candidate topic information;
and constructing the target reply information based on the answer information and the candidate reply information.
In a possible implementation manner, in a case that an information amount of the first reply information satisfies a preset condition, the storage module is further configured to:
determining related topic information associated with the first reply information;
and under the condition that the type of the associated topic information is a first preset type used for representing the user attribute, the dialogue information and the first reply information are correspondingly stored for generating reply information subsequently.
In a possible implementation manner, the first determining module, when determining the first reply information of the dialog information, is configured to:
and matching the dialog information with a plurality of dialog information stored in advance, and taking reply information corresponding to the dialog information which is successfully matched as the first reply information.
In a third aspect, an embodiment of the present disclosure further provides a computer device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the computer device is running, the machine-readable instructions when executed by the processor performing the steps of the first aspect or any one of the possible implementations of the first aspect.
In a fourth aspect, this disclosed embodiment also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps in the first aspect or any one of the possible implementation manners of the first aspect.
According to the conversation generation method, the conversation generation device, the computer equipment and the storage medium, the target topic information corresponding to the user side can be determined under the condition that the information quantity of the generated first reply information is not met with the preset condition, and then the second reply information is generated and displayed based on the target topic information and the first reply information.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly described below, and the drawings herein incorporated in and forming a part of the specification illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It is appreciated that the following drawings depict only certain embodiments of the disclosure and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
Fig. 1 shows a flowchart of a dialog generation method provided by an embodiment of the present disclosure;
fig. 2 is a schematic flow chart illustrating a process of generating second reply information in the dialog generating method provided by the embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating an overall dialog generation method provided by an embodiment of the present disclosure;
fig. 4 is a schematic flow chart illustrating a process of generating second reply information in a dialog generating method provided by the embodiment of the present disclosure;
FIG. 5 illustrates a diagram of a particular dialog scenario for use with embodiments of the present disclosure;
fig. 6 is a schematic diagram illustrating an architecture of a dialog generating device according to an embodiment of the present disclosure;
fig. 7 shows a schematic structural diagram of a computer device provided by an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, as generally described and illustrated in the figures herein, could be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the disclosure, provided in the accompanying drawings, is not intended to limit the scope of the disclosure, as claimed, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
Research shows that the open-domain dialog system mainly depends on a dialog generation model, the dialog generation model is generally carried out in a maximum likelihood mode during training, and the model learns more of the most common and most frequent replies, so that the contents of the replies are simple and have no information, such as 'kay', 'good', and the user cannot obtain information from the replies, which may cause the user to be uninterested in continuing to interact with the system, thereby affecting the dialog efficiency and the dialog experience of the user.
Based on the above research, the present disclosure provides a dialog generation method, apparatus, computer device, and storage medium, which may determine target topic information corresponding to a user side when it is detected that an information amount of generated first reply information does not satisfy a preset condition, and then generate and display second reply information based on the target topic information and the first reply information, so that the target topic information includes the information amount, and thus the second reply information generated based on the target topic information and the first reply information includes the information amount, and a user may obtain information from the second reply information, so that the user may be attracted to continue interacting with a system, and interaction efficiency and interaction experience of the user are improved.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The term "and/or" herein merely describes an associative relationship, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of a, B, C, and may mean including any one or more elements selected from the group consisting of a, B, and C.
It is understood that before the technical solutions disclosed in the embodiments of the present disclosure are used, the type, the use range, the use scene, etc. of the personal information related to the present disclosure should be informed to the user and obtain the authorization of the user through a proper manner according to the relevant laws and regulations.
For example, in response to receiving an active request from a user, a prompt message is sent to the user to explicitly prompt the user that the requested operation to be performed would require the acquisition and use of personal information to the user. Thus, the user can autonomously select whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the disclosed technical solution, according to the prompt information.
As an alternative but non-limiting implementation manner, in response to receiving an active request from the user, the manner of sending the prompt information to the user may be, for example, a pop-up window manner, and the prompt information may be presented in a text manner in the pop-up window. In addition, a selection control for providing personal information to the electronic device by the user's selection of "agreeing" or "disagreeing" can be carried in the pop-up window.
It is understood that the above notification and user authorization process is only illustrative and is not intended to limit the implementation of the present disclosure, and other ways of satisfying the relevant laws and regulations may be applied to the implementation of the present disclosure.
To facilitate understanding of the present embodiment, first, a dialog generating method disclosed in the embodiments of the present disclosure is described in detail, where an execution subject of the dialog generating method provided in the embodiments of the present disclosure is generally a computer device with certain computing capability, and the computer device includes, for example: a terminal device, which may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, or a server or other processing device.
Referring to fig. 1, a flowchart of a dialog generation method provided in an embodiment of the present disclosure is shown, where the method includes steps 101 to 104, where:
step 101, receiving dialog information input by a user terminal, and determining first reply information of the dialog information.
Step 102, determining the information amount of the first reply information; the information quantity of the first reply information is used for representing the magnitude of the information contained in the first reply information.
Step 103, determining target topic information corresponding to the user side when the information amount of the first reply information does not meet a preset condition.
And 104, generating second reply information based on the target topic information and the first reply information, and displaying the second reply information at the user side.
The following is a detailed description of the above steps.
For step 101,
The dialogue information is information input by a user and can be voice, characters and the like; the first reply message may be a reply message generated by the open domain dialog system based on the dialog message, and in one possible implementation, when the first reply message is determined, the dialog message may be input into a pre-trained reply generation network to determine the first reply message.
Here, the reply generation network may be a neural network in the open domain system, and after the dialog information is input into the pre-trained reply generation network, the reply generation network may determine output reply information according to the dialog information, and then may directly use the output reply information as the first reply information, or may process the output reply information according to a reply generation rule corresponding to the open domain system to generate the first reply information.
The disclosure is not limited to any specific reply generation rule, nor is the disclosure limited to other neural network based methods of generating first reply information.
With respect to step 102,
Here, the information amount of the first reply information is used to represent the magnitude/amount of information included in the first reply information, and in practical applications, the information amount of the first reply information may be measured by "more, moderate, less" and the like, or may be measured by "including information amount, not including information amount" and the like, or may be measured by a specific number.
In a possible implementation manner, when determining the information amount of the first recovery information, the information amount detection result of the first recovery information may be determined based on a pre-trained information amount detection network, and then the information amount of the first recovery information may be determined based on the information amount detection result.
In one embodiment, the information amount detection result may be directly used as the information amount of the first reply information. For example, if the information amount detection result of the first reply information amount is "no information amount included", it may be directly determined that the information amount of the first reply information is 0.
The information content detection network may be obtained by training sample information and an information content label of the sample information, where the information content label of the sample information may be used to characterize the information content of the sample information.
Specifically, the sample information may be input into the information amount detection network to be trained to obtain the information amount predicted by the information amount detection network, then a loss value (for example, cross entropy loss) in the current training process is calculated based on the information amount label of the sample information and the information amount predicted by the information amount detection network, and then the network parameter of the information amount detection network to be trained is adjusted based on the loss value.
In practical applications, since the detection accuracy of the neural network is limited, other detection methods may be combined to improve the accuracy of the information amount of the first recovery information.
Exemplarily, part of speech detection may be performed on the first recovery information, and a first detection result of the first recovery information may be determined based on a part of speech detection result; and/or matching the first reply information with a preset nonsense word library, and determining a second detection result of the first reply information based on a matching result; then, the information amount of the first reply information is determined based on the information amount detection result, the first detection result, and/or the second detection result.
Specifically, after the part-of-speech detection is performed on the first reply information, the part-of-speech detection result may include parts-of-speech of each word included in the first reply information, and may include more information amount for verbs, nouns, and the like, and may include less information amount for exclamatory words, word expressions, and the like, so when the first detection result of the first reply information is determined based on the part-of-speech detection result, an exemplary first ratio of a keyword whose part-of-speech is a target part-of-speech is occupied in the first reply information, and when the first ratio exceeds a first preset ratio, the first detection result of the first reply information is determined as including information amount; and determining that the first detection result of the first recovery information does not contain information quantity under the condition that the first ratio does not exceed the first preset ratio.
The nonsense word library may include a plurality of nonsense words, such as "kayao, good", and the like, and after the first reply information is matched with a preset nonsense word library, the nonsense words included in the first reply information may be determined, and when there are more nonsense words included in the first reply information, the information amount in the first reply information is correspondingly small. For example, when determining the second detection result of the first recovery information based on the matching result, a second proportion of nonsense words in the matching result in the first recovery information may be determined, and in a case that the second proportion exceeds a second preset proportion, the second detection result of the first recovery information is determined to be an information-containing quantity; and under the condition that the second proportion does not exceed the second preset proportion, determining that a second detection result of the first recovery message does not contain information quantity.
When the information amount of the first recovery information is determined based on the information amount detection result, the first detection result and the second detection result, it may be exemplarily determined in a voting manner, and when at least two detection results are non-information-containing amounts, it is determined that the information amount of the first recovery information is 0 (i.e., the first recovery information does not contain information amount); and determining that the information amount of the first reply information is 1 (namely the first reply information contains the information amount) when at least two detection results are information containing amounts.
When the information amount of the first reply information is determined based on the information amount detection result, the first detection result, or the second detection result, when both detection results coincide (i.e., the information amount detection result coincides with the first detection result, or the information amount detection result coincides with the second detection volume result), the information amount detection result may be directly used as the information amount of the first reply information; when the two detection results are inconsistent, another detection mode can be performed, and then a voting mode is adopted for determination.
For example, if the information amount detection result is inconsistent with the first detection result, the second detection result may be determined by performing nonsense word bank matching, and the information amount of the first reply information may be determined by voting.
By this method, the amount of calculation can be reduced, and the speed of detecting the amount of information can be increased.
The information amount of the first reply message not meeting the preset condition may mean that the information amount of the first reply message is small, and for example, the information amount of the first reply message may be 0 (that is, the first reply message does not include the information amount).
For step 103 and step 104,
The target topic information may be at least one topic information selected from a plurality of topic information corresponding to the user terminal, and specifically, the plurality of topic information corresponding to the user terminal may include a plurality of categories, for example, may include user attributes (basic information, personal preferences), chat topics, and the like. Here, it should be noted that the user privacy referred to in the present disclosure is obtained after the user authorization, and the specific authorization manner is described above.
The basic information may include, for example, the name, sex, age, birth date, etc. of the user; the personal preferences may include, for example, favorite movies, favorite colors, favorite foods, favorite weather, etc.; the chatty topics may include, for example, future plans, things that occurred in the past, and the like.
Here, the target topic information generally has an information amount, and thus when the first reply information does not have an information amount, the second reply information may be regenerated from the target topic information.
In one possible implementation, when determining the target topic information corresponding to the user terminal, the weight of each topic information in the topic information set may be determined, and then the target topic information corresponding to the user terminal may be determined based on the weight of each topic information.
Here, the topic information set may be a set of a plurality of topic information, and the topic information included in the topic information set may be preset, or may be extracted from historical interaction processes between a plurality of users and a system, for example, a topic of a hot degree in the historical interaction processes may be improved, and the disclosure is not limited to a specific way of determining the topic information set.
The topic information sets corresponding to different users may be the same, or considering that the topic contents of interest for different user attributes may be different, the topic information set corresponding to a user may be a topic information set matching with the attribute information of the user, for example, the attribute information may be gender, age, and the like.
The weight of each topic information can be understood as the probability of each topic information being selected, and the selected topic information is the target topic information. By the method, each topic information can sequentially generate the reply information according to the corresponding weight, the topic content of the reply information is enriched, and the generated reply information content is more diverse.
The weight of the topic information may be a preset weight, or may be a weight that determines each topic information based on the number of topic information in which the corresponding answer information is stored.
Here, the topic information corresponding to the answer information may be topic information for characterizing the user attribute, and the answer information may be understood as an attribute value of the topic information. For example, if the topic information is height, the answer information may be a specific height value. The answer information may be extracted from the dialog information of the user during the conversation process between the system and the user, and the specific extraction method of the answer information will be described below.
For example, when determining the weight of each topic information based on the number of topic information in which the corresponding answer information is stored, the number of the corresponding answer information stored in each type of topic information may be determined, and when the number of any type of topic information exceeds a preset number, the weight of the type of topic information may be adjusted (for example, the weight of the type of topic information may be increased).
For example, if the number of the topic of the user preference exceeds the preset number, the weight of the topic information of the user preference can be adjusted, so that when the second reply information is generated, the reply information can be generated by combining the user preference more, the quality of the reply information is improved, and the user is further attracted to interact with the system.
In a possible application scenario, whether to reply with the information amount may also be combined with the dialog information of the user, if the dialog information is with the information amount and the first reply information is without the information amount, in which case, the user may only want one response and does not need to continue the topic, for example, the dialog information of the user may be "help me determine an alarm clock of five points", the dialog information is with the information amount, and the first reply information may be "good", in which case, the user may only want one response and does not need to perform other topics, so that only the first reply information may be directly replied.
The determining of the target topic information corresponding to the user side when the information amount of the first reply information does not satisfy the preset condition may refer to determining the target topic information corresponding to the user side when the information amount of the session information and the information amount of the first reply information do not satisfy the preset condition after determining the information amount of the session information (a specific determination method may be the same as the method for determining the information amount of the first reply information).
If the information amount of the dialog information does not meet the preset condition, the first reply information meets the preset condition, or the dialog information and the first reply information do not meet the preset condition, the first reply information can be directly displayed.
In one possible implementation, when generating the second reply information based on the target topic information and the first reply information, reference may be made to the method shown in fig. 2, which includes the following steps:
step 201, determining a plurality of preset reply messages corresponding to the target topic information;
here, each topic information may correspond to at least one preset reply information, and the preset reply information may be a question associated with the topic information, for example, if the target topic information is a favorite color, the corresponding preset reply information may be "what is your favorite color", or may be "how good is i guess what is your favorite color".
Step 202, determining target reply information based on the plurality of preset reply information;
here, one of the preset reply messages may be randomly selected as the target reply message; or one reply message may be selected as the target reply message according to the number of times each preset reply message is selected. For example, if there are 3 preset reply messages corresponding to the target topic information, the number of times that the first preset reply message is selected is 20, the number of times that the second preset reply message is selected is 10, and the number of times that the third preset reply message is selected is 2, the third preset reply message with the smallest number of times that is selected may be used as the target reply message.
Step 203, splicing the target reply information and the first reply information to generate the second reply information.
In a possible implementation manner, attribute information of the user (such as the basic information and the personal preference) may be stored in advance, and the target reply information may be related to the attribute information of the user, so that the generated second reply information is more attractive to the user for interaction.
For example, in the case that the target topic information is a second preset type other than the first preset type (the first preset type is a type for representing the user attribute), when determining the target reply information based on a plurality of preset reply information, the following steps may be included:
a1, randomly screening candidate reply information from a plurality of preset reply information;
step A2, under the condition that the candidate reply information contains information to be filled, determining candidate topic information corresponding to the candidate reply information, and acquiring prestored answer information corresponding to the candidate topic information;
and A3, constructing the target reply information based on the answer information and the candidate reply information.
Here, the second preset type may refer to, for example, a chit-chat topic, and since there is no clear topic theme in the chit-chat topic, the previously stored attribute information of the user may be combined.
The preset reply messages corresponding to the chat topics can be complete questions, such as "what you want to eat at night", or can also be questions containing information to be filled, such as "which segment of you like".
The reply information containing the information to be filled needs to be filled with the information, and the information of the filling information is stored before, so that each reply information containing the information to be filled can correspond to at least one topic information, for example, the topic information related to which segment a in your favorite can be the favorite movie, favorite tv series, favorite music, and the like.
In practical application, a plurality of topic information and answer information corresponding to the topic information may be stored in advance, and the storage form may be key-key value, and may be, for example, the form shown in table 1 below:
TABLE 1
Topic information Answer information
Favorite movie Movie a
Favorite music Music B
Favorite color Red colour
As a continuation example, if the candidate reply information is "which segment a of your favorite movie", the corresponding candidate topic information is "favorite movie", and the answer information corresponding to the candidate topic information is "movie a", the target reply information constructed based on the answer information and the candidate reply information is "which segment a of your favorite movie a".
In a possible implementation manner, the answer information corresponding to the topic information may be registration information filled when the user registers; or in another possible implementation manner, the answer information corresponding to the topic information may be extracted based on a historical interaction process.
For example, a first preset type of topic information may be preset, where the first preset type is a type associated with an attribute of a user, and may be, for example, basic information, personal preferences, and the like, and in the history interaction process, if the target topic information selected for the user is the first preset type, second reply information generated based on the target topic information is a question related to the target topic information, and after the second reply information is generated, answer information may be extracted from an answer of the user.
Illustratively, when answer information is extracted in the history interaction process, the following steps may be included, where the dialog information, the second reply information, and the like in the following steps refer to information in the history interaction process:
and step B1, receiving the dialog information input again, and determining reply information of the dialog information input again.
Here, the dialog information may be information input by the user after the second reply information is presented, and a specific method for determining the reply information of the dialog information input again may refer to the steps shown in fig. 1, which are not described herein again.
And B2, inputting the dialog information and the second reply information which are input again into a pre-trained answer extraction network, and determining answer information corresponding to the second reply information in the dialog information which is input again.
After the dialog information and the second reply information which are input again are input to the answer extraction network, the answer extraction network may determine location information of the answer information in the dialog information and a confidence degree corresponding to the answer information, where the confidence degree is a probability that the answer information is an answer corresponding to the second reply information, and when the confidence degree exceeds a preset confidence degree, may determine that target dialog information corresponding to the location information is answer information corresponding to the second reply information.
The answer extraction network can be obtained through a sample question-answer pair and answer labeling training of the sample question-answer pair, wherein the answer labeling of the sample question-answer pair is used for labeling answer information in the sample question-answer pair.
And B3, correspondingly storing the target topic information and the answer information.
In this way, in step A2, answer information corresponding to the candidate topic information can be acquired from the topic information and answer information stored in the manner based on steps B1 to B3.
Alternatively, in another possible implementation, the dialog message sent by the user theme may also include the answer to part of the topic information, for example, the dialog message sent by the user may be "i like movie a, i like you", and the dialog message includes the answer information "movie a" of the topic information "favorite movie".
Therefore, topic information and answer information may also be stored by:
step C1, determining topic information to be stored corresponding to the dialogue information, and extracting answer information corresponding to the topic information to be stored in the dialogue information.
Here, when determining the topic information to be stored corresponding to the dialog information, for example, it may be detected whether the dialog information includes a preset keyword, such as "height", "color", "movie", "song", or the like; after the preset keyword is detected, topic information corresponding to the preset keyword may be used as topic information to be stored, for example, topic information corresponding to a keyword of "movie" may be "favorite movie", "song" may be "favorite song", and the like.
Answer information corresponding to the topic information to be stored in the dialogue information can be extracted, and for example, the topic information to be stored and the dialogue information can be input into the answer extraction network, and answer information contained in the dialogue information can be determined.
Or in another possible implementation, each topic information may be provided with a corresponding keyword library, for example, a plurality of movie names may be stored in the keyword library corresponding to the topic information of "favorite movie", a plurality of song names may be stored in the keyword library corresponding to the topic information of "favorite song", and when determining the topic information to be stored corresponding to the conversation information and the answer information corresponding to the topic information to be stored, the conversation information may be respectively matched with the keywords in the keyword libraries corresponding to the respective topic information, the keyword that is successfully matched is used as the answer information, and the topic information corresponding to the keyword that is successfully matched is used as the topic information to be stored.
In practical applications, when the user sends the dialogue information, the user may include keywords that the user likes, such as "like" and "dislike", which may affect the determination of the topic information to be stored, so that when the topic information to be stored is determined, the user may also combine a target keyword used for representing the like in the dialogue information, and then match the target keyword with the topic information to be stored determined in the foregoing embodiment, and if the matching is successful, perform step C2.
And step C2, correspondingly storing the topic information to be stored and answer information corresponding to the topic information to be stored for subsequently generating reply information.
In practical applications, if the topic information and the answer information are extracted during the historical interaction process with the user, the historical interaction process with the user needs to be sufficient, so in a possible implementation manner, when determining the target topic information corresponding to the user end in step 102, the number of the stored target topic information and the answer information may be determined first, and when the number of the stored answer information exceeds the preset number, the target topic information may be determined from all the topic information; and under the condition that the number of the stored answers does not exceed the preset number, determining the target topic information from the first preset type of topic information.
Or, in a possible scenario, after the target topic information is determined, if the target topic information is the second preset type of topic information, the screened candidate reply information includes information to be filled, but answer information of the candidate topic information corresponding to the candidate reply information is empty, that is, answer information corresponding to the candidate topic information is not stored, in this case, the candidate reply information may be re-screened, or the target topic information may be re-determined.
For example, if the candidate reply information is "which segment o of you like ___", the corresponding candidate topic information is "favorite movie", and the answer information of the topic information of "favorite movie" is empty, the candidate reply information may be re-determined, or the target topic information may be re-determined.
Correspondingly, under the condition that the type of the target topic information is a first preset type, after the second reply information is generated and displayed, the input dialogue information can be received, the dialogue information and the second reply information are input into a pre-trained answer extraction network, answer information corresponding to the second reply information in the dialogue information is determined, and then the target topic information and the answer information are correspondingly stored so as to generate reply information subsequently by the user.
In the interaction process between the user and the system, the user may ask the system some questions about system attributes of the system, for example, the user may send "what is a favorite movie" to the system, at this time, the system may automatically generate and display reply information, but the user may send the same question to the system again, and at this time, the reply information automatically generated by the system may not be the same as the information replied before, for example, the previous answer of the user may be movie a, but the subsequent answer of the user may be movie B, so that different answers may be generated for the same question, and the user experience is poor.
Based on this, in a possible implementation manner, when the information amount of the first reply information satisfies a preset condition, related topic information related to the first reply information may be determined first, and then, when the type of the related topic information is a first preset type, the dialogue information and the first reply information are stored in a corresponding manner, so that, after the dialogue information is received subsequently, the dialogue information received again may be matched with a plurality of pre-stored dialogue information, and the reply information corresponding to the dialogue information that is successfully matched is used as the first reply information.
For example, if the dialog information is "what is a favorite movie", the dialog information may be matched with a plurality of pieces of dialog information stored in advance to check whether the user has proposed a similar problem before, and if the matching fails, it indicates that the user has not proposed a similar problem before, the first reply information may be directly generated and displayed. Correspondingly, the dialogue information and the generated first reply information can be stored, so that the same reply information can be directly replied when the subsequent users reject similar problems.
If the matching is successful, the reply information corresponding to the successfully matched dialogue information can be directly used as the first reply information and displayed.
Through the mode, the same reply information can be provided for the user when the user rejects the same or similar problems at different moments, the inconsistency of the reply before and after is avoided, and the user experience is improved.
The above-described dialog generation method will be described in its entirety with reference to specific embodiments. Referring to fig. 3, an overall flowchart of a dialog generation method provided by the present disclosure includes the following steps:
step 1, receiving dialogue information input by a user side.
And 2, matching the dialogue information with a plurality of dialogue information stored in a question-answer library.
Here, the question-answer library is the database storing the dialogue information and the first reply information.
And 3, judging whether the matching is successful or not.
If the matching is successful, executing the step 4; if the matching is not successful, step 5 is executed.
And 4, taking the reply information corresponding to the successfully matched dialogue information stored in the question-answer library as first reply information, and displaying the first reply information.
And 5, judging whether the dialogue information has information quantity.
If yes, executing the steps 6-9; if not, go to step 10.
And 6, automatically generating first reply information of the dialogue information by the system.
And 7, detecting whether the first reply message has a message quantity.
If yes, executing step 8 and step 9; if not, only step 9 is executed.
And 8, determining related topic information related to the first reply information, and correspondingly storing the dialogue information and the first reply information to a question and answer library under the condition that the type of the related topic information is a first preset type.
And 9, directly displaying the first reply information.
And step 10, the system automatically generates first reply information of the dialogue information.
And 11, detecting whether the first reply message has the message quantity.
If yes, go to step 12; if not, executing steps 13-14.
And step 12, determining related topic information related to first reply information, and correspondingly storing the dialogue information and the first reply information to a question-answering library under the condition that the type of the related topic information is a first preset type.
Specifically, the first reply message may be presented simultaneously when step 12 is executed.
And step 13, determining target topic information corresponding to the user side.
And 14, generating and displaying second reply information based on the target topic information and the first reply information.
In step 14, when generating the second reply message, the process shown in fig. 4 may be referred to, and includes the following steps:
and step 141, judging the type of the target topic information.
If the type of the target topic information is a first preset type, executing step 142;
if the type of the target topic information is the second preset type, step 143 is executed.
And 142, determining a plurality of preset reply messages corresponding to the target topic information, selecting one target reply message from the plurality of preset reply messages, splicing the target reply message with the first reply message, and generating a second reply message.
And 143, screening candidate reply information from a plurality of preset reply information corresponding to the target topic information.
Step 144, determining whether the candidate reply message includes the information to be filled.
If not, go to step 145; if yes, go to step 146.
And step 145, splicing the candidate reply information and the first reply information to generate second reply information.
And step 146, determining candidate topic information corresponding to the candidate reply information, and acquiring answer information corresponding to the candidate topic information from the user information base.
Here, the topic information and answer information extracted based on the above steps B1 to B3 are stored in the user information base.
And 147, constructing target reply information based on the answer information and the candidate reply information, splicing the target reply information and the first reply information, generating second reply information and displaying the second reply information.
After step 147 is performed, the following steps may be further performed:
step 148, receiving the dialog information input again.
Step 149, inputting the re-input dialogue information and the second reply information into a pre-trained answer extraction network, and determining answer information corresponding to the second reply information in the re-input dialogue information.
And 150, storing the target topic information and the answer information into a user information base.
In this way, topic information and answer information stored in the user information base can be combined when reply information is generated subsequently. The specific implementation steps refer to the description of the above embodiment, which will not be described herein.
It should be noted that all the topic information in the present disclosure may be stored in a topic information set, each user may share the topic information set, and each user may further have a corresponding personal information set for storing the topic information and the answer information, as well as the conversation information and the reply information.
Referring to fig. 5, a specific scenario diagram provided in the embodiment of the present disclosure is shown, and a dialog is as follows:
the dialogue information sent by the user is ' boring ', the first reply information automatically generated by the system is ' kayings ', and when no information amount of the first reply information is detected, the second reply information ' kayings ' can be generated according to the topic information of ' favorite songs ', so that the user sings a song bar, and what the favorite song is ', so that the user can be attracted to continuously interact with the system.
Further, when the user replies the dialogue information that "i like song a", the answer information "song a" may be extracted from "i like song a", and the topic information of "favorite song" and the answer information of "song a" may be stored, and after storing, the reply information "which segment you like in song a" may be generated again, thereby generating the reply information in conjunction with the user's conversation, and enhancing the interactive experience.
According to the dialog generation method, the target topic information corresponding to the user side can be determined under the condition that the information quantity of the generated first reply information is not met with the preset condition, and then the second reply information is generated and displayed based on the target topic information and the first reply information.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same inventive concept, a dialog generating device corresponding to the dialog generating method is also provided in the embodiments of the present disclosure, and as the principle of solving the problem of the device in the embodiments of the present disclosure is similar to the dialog generating method described above in the embodiments of the present disclosure, the implementation of the device may refer to the implementation of the method, and the repeated parts are not described again.
Referring to fig. 6, there is shown an architecture schematic diagram of a dialog generating device provided in an embodiment of the present disclosure, where the dialog generating device includes: a first determining module 601, a second determining module 602, a topic selecting module 603, a generating module 604 and a storing module 605; wherein the content of the first and second substances,
a first determining module 601, configured to receive session information input by a user side, and determine first reply information of the session information;
a second determining module 602, configured to determine an information amount of the first reply information; the information quantity of the first recovery information is used for representing the magnitude of information contained in the first recovery information;
the topic selection module 603 is configured to determine target topic information corresponding to the user side when the information amount of the first recovery information does not satisfy a preset condition;
the generating module 604 is configured to generate a second reply message based on the target topic information and the first reply message, and display the second reply message at the user side.
In a possible implementation, the second determining module 602, when determining the information amount of the first reply information, is configured to:
determining an information quantity detection result of the first reply information based on a pre-trained information quantity detection network;
and determining the information quantity of the first reply information based on the information quantity detection result.
In a possible implementation manner, the second determining module 602, when determining the information amount of the first reply information based on the information amount detection result, is configured to:
performing part-of-speech detection on the first recovery information, and determining a first detection result of the first recovery information based on the part-of-speech detection result; and/or matching the first reply information with a preset nonsense word library, and determining a second detection result of the first reply information based on a matching result;
determining the information amount of the first reply information based on the information amount detection result, the first detection result and/or the second detection result.
In a possible implementation, after receiving the dialog information input by the user terminal, the second determining module 602 is further configured to:
determining the information quantity of the dialogue information;
when the information amount of the first reply information does not satisfy the preset condition, the topic selection module 603 is configured to, when determining the target topic information corresponding to the user end:
and under the condition that the information quantity of the session information and the information quantity of the first reply information do not meet the preset condition, determining target topic information corresponding to the user side.
In a possible implementation, the generating module 604, when generating the second reply message based on the target topic message and the first reply message, is configured to:
determining a plurality of preset reply messages corresponding to the target topic information;
and determining target reply information based on the plurality of preset reply information, and splicing the target reply information and the first reply information to generate the second reply information.
In a possible implementation, the apparatus further includes a storage module 605 configured to:
under the condition that the type of the target topic information is a first preset type used for representing user attributes, after the second reply information is generated and displayed, the dialog information input again is received, and the reply information of the dialog information input again is determined;
inputting the re-input dialogue information and the second reply information into a pre-trained answer extraction network, and determining answer information corresponding to the second reply information in the re-input dialogue information;
and correspondingly storing the target topic information and the answer information for subsequently generating reply information.
In a possible implementation manner, the storage module 605 is further configured to:
determining related topic information corresponding to the dialogue information, and extracting answer information corresponding to the related topic information in the dialogue information;
and correspondingly storing the associated topic information and answer information corresponding to the associated topic information for subsequent generation of reply information.
In one possible embodiment, the topic selection module 603, when determining the target topic information corresponding to the user terminal, is configured to:
determining the weight of each topic information in the topic information set;
and determining target topic information corresponding to the user side based on the weight of each topic information.
In one possible embodiment, the topic selection module 603, when determining the weight of each topic information in the topic information set, is configured to:
acquiring preset weight of each topic information in the topic information set; alternatively, the first and second electrodes may be,
the weight of each topic information is determined based on the number of topic information in which the corresponding answer information is stored.
In a possible implementation, in a case that the type of the target topic information is a second preset type other than the first preset type, the generating module 604, when determining target reply information based on the plurality of preset reply information, is configured to:
screening candidate reply information from the plurality of preset reply information;
under the condition that the candidate reply information contains information to be filled, determining candidate topic information corresponding to the candidate reply information, and acquiring prestored answer information corresponding to the candidate topic information;
and constructing the target reply information based on the answer information and the candidate reply information.
In a possible implementation manner, in a case that the information amount of the first reply information satisfies a preset condition, the storage module 605 is further configured to:
determining related topic information associated with the first reply information;
and under the condition that the type of the associated topic information is a first preset type used for representing the user attribute, the dialogue information and the first reply information are correspondingly stored for generating reply information subsequently.
In a possible implementation manner, the first determining module 601, when determining the first reply information of the dialog information, is configured to:
and matching the dialog information with a plurality of dialog information stored in advance, and taking reply information corresponding to the dialog information which is successfully matched as the first reply information.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
Based on the same technical concept, the embodiment of the disclosure also provides computer equipment. Referring to fig. 7, a schematic structural diagram of a computer device 700 provided in the embodiment of the present disclosure includes a processor 701, a memory 702, and a bus 703. The memory 702 is used for storing execution instructions and includes a memory 7021 and an external memory 7022; the memory 7021 is also referred to as an internal memory, and is used to temporarily store operation data in the processor 701 and data exchanged with an external memory 7022 such as a hard disk, the processor 701 exchanges data with the external memory 7022 through the memory 7021, and when the computer apparatus 700 operates, the processor 701 and the memory 702 communicate with each other through the bus 703, so that the processor 701 executes the following instructions:
receiving dialog information input by a user side, and determining first reply information of the dialog information;
determining the information quantity of the first reply information; the information quantity of the first reply information is used for representing the magnitude of information contained in the first reply information;
determining target topic information corresponding to the user side under the condition that the information quantity of the first reply information does not meet a preset condition;
and generating second reply information based on the target topic information and the first reply information and displaying the second reply information at the user side.
In a possible implementation manner, the determining, in an instruction executed by the processor 701, an information amount of the first reply information includes:
determining an information quantity detection result of the first reply information based on a pre-trained information quantity detection network;
and determining the information amount of the first reply information based on the information amount detection result.
In a possible implementation manner, the determining, by the processor 701, the information amount of the first reply information based on the information amount detection result includes:
performing part-of-speech detection on the first reply information, and determining a first detection result of the first reply information based on a part-of-speech detection result; and/or matching the first reply information with a preset nonsense word library, and determining a second detection result of the first reply information based on a matching result;
determining the information amount of the first reply information based on the information amount detection result, the first detection result and/or the second detection result.
In a possible implementation manner, after the processor 701 executes the instructions and receives the dialog information input by the user terminal, the method further includes:
determining the information amount of the dialogue information;
determining target topic information corresponding to the user side under the condition that the information amount of the first reply information does not meet a preset condition, wherein the determining comprises:
and under the condition that the information amount of the dialogue information and the information amount of the first reply information do not meet the preset condition, determining target topic information corresponding to the user side.
In one possible embodiment, the processor 701 executes instructions to generate the second reply information based on the target topic information and the first reply information, including:
determining a plurality of preset reply messages corresponding to the target topic information;
and determining target reply information based on the preset reply information, and splicing the target reply information and the first reply information to generate the second reply information.
In a possible implementation manner, in the instructions executed by the processor 701, in the case that the type of the target topic information is a first preset type for characterizing the user attribute, after generating and presenting the second reply information, the method further includes:
receiving the dialog information input again, and determining reply information of the dialog information input again;
inputting the re-input dialogue information and the second reply information into a pre-trained answer extraction network, and determining answer information corresponding to the second reply information in the re-input dialogue information;
and correspondingly storing the target topic information and the answer information for subsequently generating reply information.
In a possible implementation manner, in the instructions executed by the processor 701, the method further includes:
determining related topic information corresponding to the dialogue information, and extracting answer information corresponding to the related topic information in the dialogue information;
and correspondingly storing the associated topic information and answer information corresponding to the associated topic information for subsequently generating reply information.
In a possible embodiment, the determining the target topic information corresponding to the user terminal by the processor 701 in the instructions executed includes:
determining the weight of each topic information in the topic information set;
and determining target topic information corresponding to the user side based on the weight of each topic information.
In a possible implementation, the determining, in instructions executed by the processor 701, a weight of each topic information in the topic information set includes:
acquiring preset weight of each topic information in the topic information set; alternatively, the first and second electrodes may be,
the weight of each topic information is determined based on the number of topic information in which the corresponding answer information is stored.
In a possible implementation, the determining, by the processor 701, the target reply information based on the plurality of preset reply information in a case that the type of the target topic information is a second preset type other than the first preset type includes:
screening candidate reply information from the plurality of preset reply information;
under the condition that the candidate reply information contains information to be filled, determining candidate topic information corresponding to the candidate reply information, and acquiring prestored answer information corresponding to the candidate topic information;
and constructing the target reply information based on the answer information and the candidate reply information.
In a possible implementation manner, in an instruction executed by the processor 701, in a case that an information amount of the first reply information satisfies a preset condition, the method further includes:
determining associated topic information associated with the first reply information;
and under the condition that the type of the associated topic information is a first preset type used for representing the user attribute, the dialogue information and the first reply information are correspondingly stored for generating reply information subsequently.
In a possible implementation manner, the determining the first reply information of the dialog information in the instructions executed by the processor 701 includes:
and matching the conversation information with a plurality of conversation information stored in advance, and taking reply information corresponding to the conversation information which is successfully matched as the first reply information.
Embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the dialog generating method described in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
The embodiments of the present disclosure also provide a computer program product, where the computer program product carries a program code, and instructions included in the program code may be used to execute the steps of the dialog generating method in the foregoing method embodiments, which may be referred to specifically for the foregoing method embodiments, and are not described herein again.
The computer program product may be implemented by hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the units into only one type of logical function may be implemented in other ways, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some communication interfaces, indirect coupling or communication connection between devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in software functional units and sold or used as a stand-alone product, may be stored in a non-transitory computer-readable storage medium executable by a processor. Based on such understanding, the technical solutions of the present disclosure, which are essential or part of the technical solutions contributing to the prior art, may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present disclosure. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (15)

1. A dialog generation method, comprising:
receiving dialog information input by a user side, and determining first reply information of the dialog information;
determining the information quantity of the first reply information; the information quantity of the first reply information is used for representing the magnitude of information contained in the first reply information;
determining target topic information corresponding to the user side under the condition that the information amount of the first reply information does not meet a preset condition;
and generating second reply information based on the target topic information and the first reply information and displaying the second reply information at the user side.
2. The method of claim 1, wherein the determining the amount of the first reply message comprises:
determining an information quantity detection result of the first reply information based on a pre-trained information quantity detection network;
and determining the information quantity of the first reply information based on the information quantity detection result.
3. The method according to claim 2, wherein the determining the information amount of the first reply information based on the information amount detection result comprises:
performing part-of-speech detection on the first reply information, and determining a first detection result of the first reply information based on a part-of-speech detection result; and/or matching the first reply information with a preset nonsense word library, and determining a second detection result of the first reply information based on a matching result;
determining the information amount of the first reply information based on the information amount detection result, the first detection result and/or the second detection result.
4. The method of claim 1, wherein after receiving the dialog information input by the user terminal, the method further comprises:
determining the information quantity of the dialogue information;
determining target topic information corresponding to the user side under the condition that the information amount of the first reply information does not meet a preset condition, wherein the determining comprises:
and under the condition that the information amount of the dialogue information and the information amount of the first reply information do not meet the preset condition, determining target topic information corresponding to the user side.
5. The method of claim 1, wherein generating a second reply message based on the target topic information and the first reply message comprises:
determining a plurality of preset reply messages corresponding to the target topic information;
and determining target reply information based on the plurality of preset reply information, and splicing the target reply information and the first reply information to generate the second reply information.
6. The method according to claim 5, wherein in a case that the type of the target topic information is a first preset type for characterizing user attributes, after generating and presenting the second reply information, the method further comprises:
receiving the dialog information input again, and determining reply information of the dialog information input again;
inputting the re-input dialogue information and the second reply information into a pre-trained answer extraction network, and determining answer information corresponding to the second reply information in the re-input dialogue information;
and correspondingly storing the target topic information and the answer information for subsequently generating reply information.
7. The method of claim 1 or 6, further comprising:
determining relevant topic information corresponding to the dialogue information, and extracting answer information corresponding to the relevant topic information in the dialogue information;
and correspondingly storing the associated topic information and answer information corresponding to the associated topic information for subsequent generation of reply information.
8. The method of claim 6, wherein the determining the target topic information corresponding to the user terminal comprises:
determining the weight of each topic information in the topic information set;
and determining target topic information corresponding to the user side based on the weight of each topic information.
9. The method according to claim 8, wherein the determining the weight of each topic information in the topic information set comprises:
acquiring preset weight of each topic information in the topic information set; alternatively, the first and second liquid crystal display panels may be,
the weight of each topic information is determined based on the number of topic information in which the corresponding answer information is stored.
10. The method according to claim 6, wherein in a case that the type of the target topic information is a second preset type other than the first preset type, the determining target reply information based on the plurality of preset reply information comprises:
screening candidate reply information from the plurality of preset reply information;
under the condition that the candidate reply information contains information to be filled, determining candidate topic information corresponding to the candidate reply information, and acquiring prestored answer information corresponding to the candidate topic information;
and constructing the target reply information based on the answer information and the candidate reply information.
11. The method according to claim 1, wherein in a case that an information amount of the first reply information satisfies a preset condition, the method further comprises:
determining related topic information associated with the first reply information;
and under the condition that the type of the associated topic information is a first preset type used for representing the user attribute, the dialogue information and the first reply information are correspondingly stored for generating reply information subsequently.
12. The method of claim 1 or 11, wherein the determining the first reply information of the dialog message comprises:
and matching the dialog information with a plurality of dialog information stored in advance, and taking reply information corresponding to the dialog information which is successfully matched as the first reply information.
13. A dialog generating device, comprising:
the first determining module is used for receiving the dialogue information input by the user side and determining first reply information of the dialogue information;
the second determining module is used for determining the information quantity of the first reply information; the information quantity of the first recovery information is used for representing the magnitude of information contained in the first recovery information;
the topic selection module is used for determining target topic information corresponding to the user side under the condition that the information amount of the first reply information does not meet a preset condition;
and the generating module is used for generating second reply information based on the target topic information and the first reply information and displaying the second reply information at the user side.
14. A computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when a computer device is run, the machine-readable instructions, when executed by the processor, performing the steps of the dialog generating method of any of claims 1 to 12.
15. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, performs the steps of the dialog generation method according to one of the claims 1 to 12.
CN202211008750.4A 2022-08-22 2022-08-22 Dialog generation method and device, computer equipment and storage medium Pending CN115470329A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211008750.4A CN115470329A (en) 2022-08-22 2022-08-22 Dialog generation method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211008750.4A CN115470329A (en) 2022-08-22 2022-08-22 Dialog generation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115470329A true CN115470329A (en) 2022-12-13

Family

ID=84365760

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211008750.4A Pending CN115470329A (en) 2022-08-22 2022-08-22 Dialog generation method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115470329A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116384412A (en) * 2023-02-24 2023-07-04 华院计算技术(上海)股份有限公司 Dialogue content generation method and device, computer readable storage medium and terminal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116384412A (en) * 2023-02-24 2023-07-04 华院计算技术(上海)股份有限公司 Dialogue content generation method and device, computer readable storage medium and terminal
CN116384412B (en) * 2023-02-24 2024-03-29 华院计算技术(上海)股份有限公司 Dialogue content generation method and device, computer readable storage medium and terminal

Similar Documents

Publication Publication Date Title
CA3083729C (en) Domain-specific natural language understanding of customer intent in self-help
CN110892395B (en) Virtual assistant providing enhanced communication session services
CN111552880B (en) Knowledge graph-based data processing method and device, medium and electronic equipment
CN104794145B (en) People are connected based on content and relationship gap
CN111159367B (en) Information processing method and related equipment
CN112632242A (en) Intelligent conversation method and device and electronic equipment
CN112446210A (en) User gender prediction method and device and electronic equipment
CN112434501A (en) Work order intelligent generation method and device, electronic equipment and medium
CN110727782A (en) Question and answer corpus generation method and system
CN115470329A (en) Dialog generation method and device, computer equipment and storage medium
US20220164546A1 (en) Machine Learning Systems and Methods for Many-Hop Fact Extraction and Claim Verification
CN108710682B (en) Object recommendation method, device and equipment
CN111241401B (en) Search request processing method and device
CN112447073A (en) Explanation video generation method, explanation video display method and device
CN110929526A (en) Sample generation method and device and electronic equipment
CN116186771A (en) Text processing method, device and medium applied to artificial intelligence generated content
Hijjawi et al. Mobile Arabchat: an Arabic mobile-based conversational agent
CN114218378A (en) Content pushing method, device, equipment and medium based on knowledge graph
CN113010664A (en) Data processing method and device and computer equipment
CN113254788A (en) Big data based recommendation method and system and readable storage medium
CN111552850A (en) Type determination method and device, electronic equipment and computer readable storage medium
JP6885217B2 (en) User dialogue support system, user dialogue support method and program
CN115292471B (en) Knowledge product service pushing method for children and related device
CN113051375A (en) Question-answering data processing method and device based on question-answering equipment
JP7112156B1 (en) Information processing device, information processing method and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination