Methods and electronic devices for determining response message
A method for determining a response message includes: determining a target instruction indicated by a query information from a user and a target content to be responded to, the target instruction being configured to indicate a processing requirement for the target content; determining a target historical instruction similar to the target instruction from a historical instruction set, the historical instruction set including at least one historical instruction determined based on historical query information input by the user; determining an instruction intent corresponding to the target historical instruction as a target instruction intent of the target instruction; and determining a first response message for the query information using a first language processing model based on the target content and the target instruction intent of the target instruction.
1 . A method for determining a response message, comprising:
determining a target instruction indicated by a first query information from a user and a target content to be responded to, wherein the target instruction is configured to indicate a processing requirement for the target content;
determining a target historical instruction similar to the target instruction from a historical instruction set, wherein the historical instruction set comprises at least one historical instruction determined based on historical query information input by the user;
determining an instruction intent corresponding to the target historical instruction as a target instruction intent of the target instruction;
determining that there does not exist at least one target historical query information in a first historical query information set whose similarity to the first query information satisfies a condition, wherein the first historical query information set comprises historical query information obtained before the first query information;
in response to there not existing at least one target historical query information in the first historical query information set whose similarity to the first query information satisfies the condition, determining a first response message for the first query information using a first language processing model based on the target content and the target instruction intent of the target instruction;
receiving a second query information from the user;
determining that there exists at least one target historical query information in a second historical query information set whose similarity to the second query information satisfies the condition, wherein the second historical query information set comprises historical query information obtained before the second query information; and
in response to there existing at least one target historical query information in the second historical query information set whose similarity to the second query information satisfies the condition, obtaining a cached historical response message corresponding to the at least one target historical query information, and determining a second response message for the second query information using a second language processing model, based on the second query information, the at least one target historical query information, and the cached historical response message corresponding to the at least one target historical query information,
wherein a structural complexity of the second language processing model is lower than a structural complexity of the first language processing model, and structural complexity is characterized such that, for a same query information, the second language processing model consumes fewer computational resources to generate a corresponding response message than the first language processing model.
2 . The method according to claim 1 , wherein determining the target historical instruction similar to the target instruction from the historical instruction set comprises:
determining the target historical instruction similar to the target instruction from a core historical instruction corresponding to at least one historical instruction group, wherein
the at least one historical instruction group is divided from the historical instruction set, with each historical instruction group corresponding to different instruction intent categories; and
an instruction intent of the core historical instruction corresponding to the at least one historical instruction group is configured to represent an instruction intent category corresponding to the at least one historical instruction group.
3 . The method according to claim 2 , wherein determining the core historical instruction corresponding to the at least one historical instruction group comprises:
respectively determining a feature vector for a historical instruction in the historical instruction set; and
clustering the historical instruction in the historical instruction set based on the feature vector for the historical instruction, thereby obtaining the at least one historical instruction group and the core historical instruction located at a center point of the at least one historical instruction group.
4 . The method according to claim 1 , further comprising:
obtaining a satisfaction level of the user with the second response message; and
when the satisfaction level is lower than a target satisfaction level, determining context information associated with a target conversation to which the second query information belongs, wherein the context information reflects conversational interaction information before the second query information in the target conversation.
5 . The method according to claim 4 , further comprising:
when the satisfaction level is lower than the target satisfaction level, determining a second target instruction indicated by the second query information and a second target content to be responded to; determining a second target historical instruction similar to the second target instruction from the historical instruction set; and determining a second instruction intent corresponding to the second target historical instruction as a target instruction intent of the second target instruction.
6 . The method according to claim 5 , comprising:
determining a third response message for the second query information using the first language processing model based on the context information, the second target content, and the target instruction intent of the second target instruction.
7 . The method according to claim 2 , wherein determining the target historical instruction similar to the target instruction from the core historical instruction corresponding to the at least one historical instruction group comprises:
determining a first historical instruction with a highest similarity to the target instruction and a second historical instruction with a lowest similarity to the target instruction, from the core historical instruction corresponding to the at least one historical instruction group, wherein the highest similarity exceeds a set threshold, the highest similarity between the first historical instruction and the target instruction is a first similarity, and the lowest similarity between the second historical instruction and the target instruction is a second similarity; and
when a difference between the first similarity and the second similarity is greater than a set difference, determining the first historical instruction as the target historical instruction similar to the target instruction.
8 . The method according to claim 7 , further comprising:
when the difference between the first similarity and the second similarity is not greater than the set difference, re-determining the at least one historical instruction group and the core historical instruction corresponding to the at least one historical instruction group based on the historical instruction set, and returning to an operation of determining the first historical instruction and the second historical instruction based on the core historical instruction corresponding to the at least one historical instruction group which is newly determined.
9 . A method for determining a response message, comprising:
in response to a second query information input from a user, at a client device, determining that there exists at least one target historical query information in a second historical query information set stored at the client device whose similarity to the second query information satisfies a condition, obtaining a cached historical response message corresponding to the at least one target historical query information, and determining a second response message for the second query information using a second language processing model executed at the client device based on the second query information, the at least one target historical query information, and the cached historical response message corresponding to the at least one target historical query information, wherein the second historical query information set comprises historical query information obtained before the second query information; and
in response to a first query information input from the user, at the client device, determining that there is not at least one target historical query information in a first historical query information set whose similarity to the first query information satisfies the condition, sending the first query information input by the user from the client device to a server, such that the server determines, using a first language processing model, a first response message for the first query information, wherein the first historical query information set comprises historical query information obtained before the first query information, wherein a structural complexity of the second language processing model is lower than a structural complexity of the first language processing model, and structural complexity is characterized such that, for a same query information, the second language processing model consumes fewer computational resources to generate a corresponding response message than the first language processing model.
10 . The method according to claim 9 , further comprising:
obtaining a satisfaction level of the user with the second response message; and
when the satisfaction level is lower than a target satisfaction level, determining context information associated with a target conversation to which the second query information belongs, and sending the context information and the second query information to the server,
wherein the context information reflects conversation interaction information in the target conversation before the second query information.
11 . An electronic device comprising one or more processors and a memory containing a computer program that, when being executed, causes the one or more processors to perform:
determining a target instruction indicated by a query information from a user and a target content to be responded to, wherein the target instruction is configured to indicate a processing requirement for the target content;
determining a target historical instruction similar to the target instruction from a historical instruction set, wherein the historical instruction set comprises at least one historical instruction determined based on historical query information input by the user;
determining an instruction intent corresponding to the target historical instruction as a target instruction intent of the target instruction;
determining whether there exists at least one target historical query information in a historical query information set whose similarity to the query information satisfies a condition, wherein the historical query information set comprises historical query information obtained before the query information;
in response to there not existing at least one target historical query information in the historical query information set whose similarity to the query information satisfies the condition, determining a first response message for the query information using a first language processing model based on the target content and the target instruction intent of the target instruction; and
in response to there existing at least one target historical query information in the historical query information set whose similarity to the query information satisfies the condition, obtaining a cached historical response message corresponding to the at least one target historical query information, and determining a second response message for the query information using a second language processing model, based on the query information, the at least one target historical query information, and the cached historical response message corresponding to the at least one target historical query information,
wherein a structural complexity of the second language processing model is lower than a structural complexity of the first language processing model, and structural complexity is characterized such that, for same query information, the second language processing model consumes fewer computational resources to generate a corresponding response message than the first language processing model.
12 . The device according to claim 11 , wherein the one or more processors are further configured to perform:
determining the target historical instruction similar to the target instruction from a core historical instruction corresponding to at least one historical instruction group,
wherein
the at least one historical instruction group is divided from the historical instruction set, with each historical instruction group corresponding to different instruction intent categories; and
an instruction intent of the core historical instruction corresponding to the at least one historical instruction group is configured to represent an instruction intent category corresponding to the at least one historical instruction group.
13 . The device according to claim 12 , wherein the one or more processors are further configured to perform:
respectively determining a feature vector for a historical instruction in the historical instruction set; and
clustering the historical instruction in the historical instruction set based on the feature vector for the historical instruction, thereby obtaining the at least one historical instruction group and the core historical instruction located at a center point of the at least one historical instruction group.
14 . The device according to claim 12 , wherein the one or more processors are further configured to perform:
determining a first historical instruction with a highest similarity to the target instruction and a second historical instruction with a lowest similarity to the target instruction, from the core historical instruction corresponding to the at least one historical instruction group, wherein the highest similarity exceeds a set threshold, the highest similarity between the first historical instruction and the target instruction is a first similarity, and the lowest similarity between the second historical instruction and the target instruction is a second similarity; and
when a difference between the first similarity and the second similarity is greater than a set difference, determining the first historical instruction as the target historical instruction similar to the target instruction.
15 . The device according to claim 14 , wherein the one or more processors are further configured to perform:
when the difference between the first similarity and the second similarity is not greater than the set difference, re-determining the at least one historical instruction group and the core historical instruction corresponding to the at least one historical instruction group based on the historical instruction set, and returning to an operation of determining the first historical instruction and the second historical instruction based on the core historical instruction corresponding to the at least one historical instruction group which is newly determined.
16 . The device according to claim 11 , wherein the one or more processors are further configured to perform:
obtaining a satisfaction level of the user with the second response message; and
when the satisfaction level is lower than a target satisfaction level, determining context information associated with a target conversation to which the query information belongs, wherein the context information reflects conversational interaction information before the query information in the target conversation, and determining the target instruction indicated by the query information and the target content to be responded to; and
determining the first response message for the query information using the first language processing model based on the context information, the target content, and the target instruction intent of the target instruction.
17 . An electronic device comprising one or more processors and a memory containing a computer program that, when being executed, causes the one or more processors to perform:
in response to a query information input from a user, and when there exists at least one target historical query information in a historical query information set whose similarity to the query information satisfies a condition, obtaining a cached historical response message corresponding to the at least one target historical query information, and determining a second response message for the query information using a second language processing model based on the query information, the at least one target historical query information, and the cached historical response message corresponding to the at least one target historical query information, wherein the historical query information set comprises historical query information obtained before the query information; and
when there is not at least one target historical query information in the historical query information set whose similarity to the query information satisfies the condition, sending the query information input by the user to a server, such that the server determines a first response message for the query information using a first language processing model, wherein a structural complexity of the second language processing model is lower than a structural complexity of the first language processing model, and structural complexity is characterized such that, for same query information, the second language processing model consumes fewer computational resources to generate a corresponding response message than the first language processing model.
18 . The device according to claim 17 , wherein the one or more processors are further configured to perform:
obtaining a satisfaction level of the user with the second response message; and
when the satisfaction level is lower than a target satisfaction level, determining context information associated with a target conversation to which the query information belongs, and sending the context information and the query information to the server,
wherein the context information reflects conversation interaction information in the target conversation before the query information.