An information processing method, apparatus and electronic device

By encoding and decoding language input information using a preset model and adjusting the probability range of response information generation, the problem of insufficient response information in existing technologies is solved, and the richness and diversity of response information are improved.

CN113849619BActive Publication Date: 2025-10-31LENOVO (BEIJING) LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111120210.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-24
Publication Date
2025-10-31
Estimated Expiration
2041-09-24

AI Technical Summary

Technical Problem

In existing technologies, due to the long-tail phenomenon in datasets, the amount of information generated in response information is small and the diversity is poor, resulting in insufficient response information in dialogue generation tasks.

Method used

By acquiring a set of language input information, and using the encoding and decoding modules of a pre-defined model, the input information is encoded and decoded based on language rules. The generation probability range of response information is adjusted to ensure that the generation probability of words in the response information set is less than the probability range of the input information, thus solving the long-tail phenomenon.

Benefits of technology

It effectively improves the amount and diversity of response information, solves the long-tail phenomenon in generating response information datasets, and ensures that response information is richer and more diverse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113849619B_ABST
    Figure CN113849619B_ABST
Patent Text Reader

Abstract

This application provides an information processing method, apparatus, and electronic device. In this solution, various language input information is processed based on a preset model to generate corresponding response information. The various response information forms a response information set. The occurrence probability of each word in the language input information set to which the language input information belongs is within a first probability range, while the generation probability of each word in the response information set is within a smaller second probability range. The generation probability range of words in the output response information set is smaller than the occurrence probability range of words in the language input information set. The two probability ranges are different, and the probability range corresponding to the output is smaller than the probability range corresponding to the input. This solves the long-tail phenomenon of the generated response information dataset and effectively improves the information content and diversity of the response.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information technology, and more specifically, to an information processing method, apparatus, and electronic device. Background Technology

[0002] During the dialogue, both parties primarily exchange semantic information. Therefore, a rich amount of information is essential for a smooth dialogue. Furthermore, flexible and diverse language expression not only comprehensively reflects language skills but also accurately and efficiently conveys semantic information.

[0003] Since the dialogue generation task is to generate responses based on user input to achieve communication with users, and these responses are sentences generated based on a dataset, the dataset has a significant long-tail phenomenon, resulting in the generated responses containing less information and less diversity. Summary of the Invention

[0004] In view of this, this application provides an information processing method, as follows:

[0005] An information processing method, comprising:

[0006] Obtain a set of language input information, wherein the set of language input information includes at least two language input information, each of the language input information includes at least one word, and the probability of occurrence of each word in the set of language input information is within a first probability range;

[0007] Based on a preset model, response information is generated for each language input information in the language input information set to obtain a response information set; any response information includes at least one word, and the generation probability of each word in the response information set is within a second probability range, which is smaller than the first probability range.

[0008] Optionally, in the above method, generating response information based on a preset model for any language information includes:

[0009] The encoding module of the control preset model encodes the language input information to obtain a vector of the language input information, and the decoding module of the control preset model decodes the vector of the language input information based on preset language rules to obtain the response information.

[0010] Optionally, in the above method, the encoding module of the control preset model encodes the language input information, including:

[0011] If the language input information includes a word, the encoding module of the preset model is controlled to encode the word;

[0012] If the language input information includes at least two words; split the language input information into at least two words; control the encoding module of the preset model to encode the at least two words.

[0013] Optionally, in the above method, the language rules are obtained statistically based on a corpus, which includes high-frequency words and low-frequency words. The frequency of use of high-frequency words is higher than a preset frequency, the frequency of use of low-frequency words is lower than a preset frequency, the number of high-frequency words is less than a preset value, and the number of low-frequency words is greater than a preset value. The generation probability of each word in the corpus is within a first probability range.

[0014] Optionally, in the above method, the decoding module of the control preset model decodes the vector of the language input information based on preset language rules to obtain the response information, including:

[0015] The vector of the language input information is input into the decoding module to obtain the first set of predicted words, and the decoding module is trained based on the language rules.

[0016] The generation probability of each word in the first predicted word set is adjusted based on the preset adjustment rules to obtain the target predicted word set;

[0017] The words whose generation probability meets the conditions in the target prediction word set are identified as target words;

[0018] The target word is returned to the decoding module until the termination condition is met.

[0019] The target words are sorted according to the determined order to obtain the response information of the language input information.

[0020] Optionally, in the above method, satisfying the termination condition includes:

[0021] The first set of predicted words contains a preset end word; or

[0022] The number of target words is equal to a preset threshold.

[0023] An information processing device, comprising:

[0024] An acquisition unit is used to acquire a set of language input information, wherein the set of language input information includes at least two language input information, each of the language input information includes at least one word, and the probability of occurrence of each word in the set of language input information is within a first probability range;

[0025] The response unit is used to generate response information for each language input information in the language input information set based on a preset model, thereby obtaining a response information set; any response information includes at least one word, and the generation probability of each word in the response information set is within a second probability range, wherein the second probability range is smaller than the first probability range.

[0026] Optionally, in the above-described apparatus, the response unit includes a preset model, which includes an encoding module and a decoding module;

[0027] The response unit is specifically used to control the encoding module of the preset model to encode the language input information to obtain a vector of the language input information, and to control the decoding module of the preset model to decode the vector of the language input information based on preset language rules to obtain the response information.

[0028] An electronic device includes: a memory and a processor;

[0029] The memory stores information processing programs;

[0030] The processor is used to load and execute the information processing program stored in the memory to implement the steps of the information processing method as described in any of the preceding claims.

[0031] A readable storage medium having a computer program stored thereon, the computer program being invoked and executed by a processor to implement the steps of the information processing method as described in any of the preceding claims.

[0032] As can be seen from the above technical solution, compared with the prior art, this application provides an information processing method, including: acquiring a language input information set, wherein the language input information set includes at least two language input information, each of the language input information includes at least one word, and the occurrence probability of each word in the language input information set is within a first probability range; generating response information for each language input information in the language input information set based on a preset model, thereby obtaining a response information set; each of the response information includes at least one word, and the generation probability of each word in the response information set is within a second probability range, wherein the second probability range is smaller than the first probability range. In this solution, each language input information is processed based on a preset model, and corresponding response information is generated. The response information forms a response information set. The occurrence probability of each word in the language input information set to which the language input information belongs is within the first probability range, while the generation probability of each word in the response information set is within a smaller second probability range. The generation probability range of words in the output response information set is smaller than the occurrence probability range of words in the language input information set. The probability ranges of the two are different, and the probability range corresponding to the output is smaller than the probability range corresponding to the input. This solves the long-tail phenomenon of the generated response information dataset and effectively improves the information content and diversity of the response. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0034] Figure 1 A flowchart of an embodiment 1 of an information processing method provided in this application;

[0035] Figure 2 A schematic diagram showing the frequency distribution of words in the language input information set in Embodiment 1 of the information processing method provided in this application;

[0036] Figure 3 A schematic diagram of the probability distribution of words in the response information set in Embodiment 1 of the information processing method provided in this application;

[0037] Figure 4 A flowchart of an embodiment 2 of an information processing method provided in this application;

[0038] Figure 5 This is a schematic diagram of the structure of a preset model in Embodiment 2 of an information processing method provided in this application;

[0039] Figure 6 A flowchart of an embodiment 3 of an information processing method provided in this application;

[0040] Figure 7 A schematic diagram of the structure of the encoding module in Embodiment 3 of the information processing method provided in this application;

[0041] Figure 8 A flowchart of an embodiment 4 of an information processing method provided in this application;

[0042] Figure 9 A schematic diagram of the decoding module in Embodiment 4 of an information processing method provided in this application;

[0043] Figure 10 A schematic diagram of the training process of the preset model in Embodiment 4 of the information processing method provided in this application;

[0044] Figure 11 This is a schematic diagram of the structure of an embodiment of an information processing device provided in this application. Detailed Implementation

[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0046] like Figure 1 The diagram shown is a flowchart of an embodiment 1 of an information processing method provided in this application. The method is applied to an electronic device and includes the following steps:

[0047] Step S101: Obtain a language input information set, wherein the language input information set includes at least two language input information sets;

[0048] Wherein, any of the language input information includes at least one word, and the probability of occurrence of each word in the language input information set is within a first probability range.

[0049] The language input information is a language sentence, which can be a single word, two words, or multiple words.

[0050] The language input information includes text or voice.

[0051] Specifically, text input can be done through input structures such as keyboard, mouse, and touchpad; voice input can be voice information collected by a microphone.

[0052] The language input information can be Chinese, English, numbers, or other forms of language; this application does not restrict the form of the language.

[0053] It should be noted that when the input information is in Chinese, the word refers to a single character, while when the input information is in English or other languages, it can be a single word, such as the, that, I, etc.

[0054] Specifically, when the language input information is text, the text in the file is retrieved and used as the language input information.

[0055] Specifically, when the language input information is speech, the speech recognition module is set to recognize the speech information and obtain the recognition result, which is then used as the language input information.

[0056] It should be noted that the probability distribution of words in the language input information set is not balanced, exhibiting a long tail phenomenon, with a small number of words having a high probability of occurrence and a portion of words having a very low probability of occurrence.

[0057] like Figure 2 The diagram illustrates the frequency distribution of words in a language input set, using English as an example. It shows the frequency of the top 200 most frequent bigrams starting with "the" from Wikipedia. "First" appears most frequently (over 250,000 times), while the frequency of subsequent words like "new," "second," ..., "use" drops sharply, with a significant number of low-frequency words. This indicates a clear long-tail phenomenon in the word distribution of this language input set. Furthermore, word frequency is positively correlated with probability of occurrence; the higher the frequency of a word, the greater its probability of occurrence.

[0058] Step S102: Generate response information for each language input information in the language input information set based on the preset model, and obtain a response information set.

[0059] Wherein, any of the response information includes at least one word, and the generation probability of each word in the response information set is within a second probability range, the second probability range being smaller than the first probability range.

[0060] In this model, a response information is generated for the language input information. One response information corresponds to one language input information, and the response information corresponding to the multiple language input information is used to obtain a response information set.

[0061] The response information includes one or more words, and the number of words in the response information may be the same as or different from the number of words in the corresponding language input information.

[0062] The probability of generating each word in the set of response information composed of multiple response information is within a second probability range, and the second probability range is smaller than the first probability range.

[0063] It should be noted that the second probability range being smaller than the first probability range indicates that the generation probability of each word in the response information set is within a smaller range, which is different from the generation probability distribution of words in the language input information set. The distribution of words in the response information set is not a long-tail phenomenon.

[0064] like Figure 3 The diagram shows the probability distribution of words in the response information set. Using English as an example, the diagram shows the probability of the top 500 most frequent bigrams starting with "would". As shown, their probability is mostly above 0.8-0.6, with "be" having the highest probability (approximately 0.8). Subsequent words like "later", "also", ..., "enable" have relatively balanced probabilities. The word distribution in this language input set does not exhibit a long-tail phenomenon.

[0065] It should be noted that in existing technologies, the probability distribution of each word in the response information set is consistent with the word distribution in the language input information set; both exhibit a long-tail phenomenon. Therefore, the response information generated in existing technologies contains less information and has poor diversity. In this embodiment, however, the word distribution in the response information set is balanced, solving the long-tail phenomenon in the generated response information dataset. Compared to existing technologies, the information content and diversity of the responses are effectively improved.

[0066] In summary, this embodiment provides an information processing method comprising: acquiring a language input information set, wherein the language input information set includes at least two language input information, each of the language input information including at least one word, and the occurrence probability of each word in the language input information set being within a first probability range; generating response information for each language input information in the language input information set based on a preset model, thereby obtaining a response information set; wherein each response information includes at least one word, and the generation probability of each word in the response information set is within a second probability range, the second probability range being smaller than the first probability range. In this solution, each language input information is processed based on a preset model, and corresponding response information is generated. The response information forms a response information set. The occurrence probability of each word in the language input information set to which the language input information belongs is within the first probability range, while the generation probability of each word in the response information set is within a smaller second probability range. The generation probability range of words in the output response information set is smaller than the occurrence probability range of words in the language input information set. Since the probability ranges of the two are different, and the output probability range is smaller than the input probability range, this solves the long-tail phenomenon of the generated response information dataset and effectively improves the information content and diversity of the responses.

[0067] like Figure 4 The diagram shown is a flowchart of an embodiment 2 of an information processing method provided in this application. The method includes the following steps:

[0068] Step S401: Obtain a language input information set, wherein the language input information set includes at least two language input information sets;

[0069] Step S401 is the same as step S101 in Embodiment 1, and will not be described again in this embodiment.

[0070] Step S402: Control the encoding module of the preset model to encode the language input information to obtain a vector of the language input information;

[0071] This embodiment uses a single language input as an example to illustrate the generation of response information. In practice, the preset model can obtain a response for each language input.

[0072] like Figure 5 The diagram shown is a schematic of the structure of a preset model, which can be a neural network model. The model includes an encoding module 501 and a decoding module 502.

[0073] The encoding module is used to encode the language input information to obtain a vector of the language input information. The dimension of the vector corresponds to the number of neurons in the last layer of the encoding module.

[0074] Step S403: Control the decoding module of the preset model to decode the vector of the language input information based on the preset language rules to obtain the response information.

[0075] The decoding module is used to decode the vector of language input information to obtain response information, and each language input information corresponds to one response information.

[0076] Specifically, the decoding module is trained based on preset language rules.

[0077] In practice, statistical analysis is performed on the corpus to obtain language patterns. Based on these language patterns, the decoding module decodes the vector of language input information to obtain response information.

[0078] The language rules are obtained statistically based on a corpus, which includes high-frequency words and low-frequency words. The frequency of use of high-frequency words is higher than a preset frequency, and the frequency of use of low-frequency words is lower than a preset frequency. The number of high-frequency words is less than a preset value, and the number of low-frequency words is greater than a preset value. The generation probability of each word in the corpus is within a first probability range.

[0079] The probability of words appearing in this corpus is within the first probability range, and it exhibits a long-tail phenomenon.

[0080] This corpus contains a massive amount of natural language sentences, which represent language usage habits. By statistically analyzing these massive amounts of natural language sentences, we can obtain language usage habits (i.e., language patterns).

[0081] It should be noted that, in this embodiment, although the language input information vector is processed based on the language rules with long tails, the probability distribution of words in the generated response information is different from the language rules and does not exhibit long tails.

[0082] Specifically, the probability of words generated based on language rules is adjusted to make their selection probability more balanced.

[0083] In summary, the information processing method provided in this embodiment, which generates response information for any language information based on a preset model, includes: controlling the encoding module of the preset model to encode the language input information to obtain a vector of the language input information; and controlling the decoding module of the preset model to decode the vector of the language input information based on preset language rules to obtain the response information. In this solution, although the encoding and decoding modules of the preset generation model process the language input information to obtain response information based on language rules exhibiting a long-tail phenomenon, the generated response information has a more balanced distribution of word probabilities, effectively improving the information content and diversity of the response.

[0084] As shown in Figure 6 Figure 3, which is a flowchart of Embodiment 3 of an information processing method provided by this application. The method includes the following steps:

[0085] Step S601: Obtain a set of language input information, where the set of language input information includes at least two language input information;

[0086] Among them, Step S601 is the same as Step S401 in Embodiment 2, and will not be elaborated in this embodiment.

[0087] Step S602: If the language input information includes one word, control the encoding module of the preset model to encode the one word;

[0088] Among them, when the language input information has only one word, control the encoding module of the preset model to encode the one word.

[0089] Step S603: If the language input information includes at least two words; split the language input information into at least two words; control the encoding module of the preset model to encode the at least two words;

[0090] Among them, when the language input information includes multiple words, split the language input information into multiple single words (single characters); control the encoding module of the preset model to encode each of the multiple words separately to obtain the vector of the language input information.

[0091] For example, if the language input information is "What's the weather like tomorrow", split the language input information into single characters such as "明", "天", "天", "气", "怎", "么", "样".

[0092] In specific implementation, according to the situation, the language input information can also be split into two-character words or three-character words. In this application, only single-character words are used as an example for illustration, and no specific form of splitting is limited.

[0093] Among them, the encoding module is used to encode the language input information to obtain the vector of the language input information, and the dimension of the vector corresponds to the number of neurons in the last layer of the encoding module.

[0094] As shown in Figure 7 Figure 4 is a schematic structural diagram of the encoding module. Among them, the encoding module adopts a neural network. The encoding module includes several neurons. The neurons in the encoding module are divided into multiple layers. The language input information includes N words x1,...x N , where x0 is the starting word input to the neural network, x0, x1,...x NThe input information consists of N words in the language, which are sequentially input into the encoding module. Each time a word is input, the neural network in the encoding module updates once. The neural network in the encoding module is updated a total of N+1 times, and the final output vector c is the same as the number of neurons in the last layer of the encoding module. For example, if the last layer has 100 neurons, then the dimension of vector c is 100.

[0095] In subsequent steps, the decoding module of the preset model decodes the vector of the language input information to obtain the response information.

[0096] Step S604: Control the decoding module of the preset model to decode the vector of the language input information based on the preset language rules to obtain the response information.

[0097] Step S604 is the same as step S403 in Example 2, and will not be described again in this example.

[0098] In summary, the information processing method provided in this embodiment involves the encoding module of the control preset model encoding the language input information, including: if the language input information includes one word, the encoding module of the control preset model encodes the one word; if the language input information includes at least two words, the language input information is split into at least two words; and the encoding module of the control preset model encodes the at least two words. In this scheme, the encoding module encodes the language input information to obtain a vector of the language input information, so that the encoding module can decode the vector to obtain the corresponding response information.

[0099] like Figure 8 The diagram shown is a flowchart of an embodiment 4 of an information processing method provided in this application. The method includes the following steps:

[0100] Step S801: Obtain a language input information set, wherein the language input information set includes at least two language input information sets;

[0101] Step S802: Control the encoding module of the preset model to encode the language input information to obtain a vector of the language input information;

[0102] Steps S801-802 are the same as steps S401-402 in Example 2, and will not be described again in this example.

[0103] Step S803: Input the vector of the language input information into the decoding module to obtain the first predicted word set, wherein the decoding module is trained based on the language rules;

[0104] Since the decoding module is trained based on language rules, it decodes the vector of the language input information and obtains that the occurrence probability of each word in the first predicted word set is consistent with the language rules, that is, the occurrence probability of the word conforms to the occurrence probability of the corresponding word in the long tail phenomenon.

[0105] Step S804: Adjust the generation probability of each word in the first predicted word set based on the preset adjustment rules to obtain the target predicted word set;

[0106] The preset adjustment rule can be logarithmic regularization, reciprocal regularization, and logarithmic reciprocal regularization.

[0107] The adjustment rule is used to adjust the generation probability of each word. Its purpose is to reduce the generation probability of words with high frequency but no specific meaning in the first prediction word set, while increasing the generation probability of words with low frequency and that fit the context in the first prediction word set.

[0108] Logarithmic regularization specifically involves taking the logarithm of the generation probability of each word in the first prediction word set and using the logarithmic value as the final generation probability of that word. Since taking the logarithm reduces the difference between the generation probabilities of each word, the distribution of the generation probabilities of the adjusted words is within a smaller range.

[0109] In this context, the probability of two words appearing together as a phrase or individually is combined to determine the probability of a particular word appearing. When the probability of that word appearing as a phrase is high, the probability of that word appearing together will affect the probability of the word itself. For example, words like "awkward" and "ping-pong" are likely to appear as phrases. Therefore, reciprocal regularization aims to eliminate the probability of a word appearing together with another word as a phrase, thus achieving a more balanced probability distribution of word generation.

[0110] Logarithmic reciprocal regularization combines logarithmic regularization and reciprocal regularization. For a given word, it reduces the probability of it and another word appearing as a word phrase. Furthermore, it takes the logarithm of the word's generation probability. After processing in both directions, the final generation probability of the word is obtained.

[0111] Step S805: Determine the words in the target prediction word set whose generation probability satisfies the condition as target words;

[0112] Among them, the word with the highest probability is selected as the target word from the set of target predicted words obtained after adjusting the generation probability according to the adjustment rules.

[0113] In practice, a sorting method can be used to sort the words in the target prediction word set according to their generation probability, and the word with the highest generation probability is selected as the target word; alternatively, a bubble sort method can be used to select the word with the highest generation probability as the target word.

[0114] Step S806: Return the target word to the decoding module until the termination condition is met;

[0115] The selected target word is returned to the input decoding module so that the decoding module can continue to decode based on the target word to generate a set of predicted words. After adjusting the words in the set according to the rules, the word with the highest generation probability is selected as the target word. This process is repeated until the termination condition is met, and then the loop ends.

[0116] Specifically, the conditions for completion include:

[0117] The first set of predicted words contains a preset end word; or

[0118] The number of target words is equal to a preset threshold.

[0119] The decoding module decodes the input information and obtains a preset end word, such as "US", in the first predicted word set. This indicates that the decoding process for the language input information has ended, and the loop ends.

[0120] In general, the length of a sentence is limited, such as 30 words. During the decoding process, the preset end word will not appear. When the number of generated target words reaches the preset threshold, the loop will also end to prevent the generation of excessively long sentences that do not conform to language rules.

[0121] In each loop, the decoding module is executed to decode and adjust the rules, select a target word, and obtain several target words after several loops. For example, after 8 loops, 8 target words are obtained. In the 9th loop, a preset end word appears in the first preset word set, and then 8 target words are generated for the language input information.

[0122] Step S807: Sort the target words according to the determined target word order to obtain the response information of the language input information.

[0123] In this process, the target words are sorted according to their determined order to obtain the response information.

[0124] Specifically, when there is only one target word, it is used as the response information; when there are multiple target words, they are sorted in order to obtain the response information.

[0125] For example, if the determined target words are "tomorrow", "weather", "sunny" respectively, the response information obtained based on the above target words is "Tomorrow the weather is sunny."

[0126] As Figure 9 shown in the schematic diagram of the decoding module and adjustment rules. Among them, the decoding module uses a neural network, which includes several neurons divided into multiple layers. The vector G0 of the initial language input information is input into the decoding module. The last layer (i.e., the fully connected layer) of the decoding module outputs the first set of predicted words h1. After being processed by the adjustment rule A and then selected, the target word y0 is obtained. The loss function loss0 is calculated between y0 and h1. y0 is input into the decoding module again. The last layer of the decoding module outputs the first set of predicted words. After being processed by the adjustment rule and then selected, the target word y1 is obtained. The loss function is calculated between y1 and y0, and the loop continues until y M meets the end condition. y0, y1,... y M are sorted and combined to obtain the response information, which is the response sentence of the language input information. Among them, each set of loss functions obtains the loss function for generating the response information this time. This loss function is used to determine the performance of generating the response information for the language input information. The larger the loss function, the worse the performance, that is, the lower the accuracy of the response information generated for the language input information.

[0127] For example, the loss function adopted in the preset model is as follows:

[0128]

[0129]

[0130] where M is the number of words in the response information, N is the number of words in the language input information, is the generation probability of the word, X is the language input information, and Y is the response information.

[0131] In this embodiment, for the above loss function, a data regularization method based on frequency is adopted to adjust the generation probability of each word

[0132] As Figure 10The diagram illustrates the training process of a pre-defined model, which involves two modules: a training module (1001) and a testing module (1002). The training module executes the following process: A massive corpus is used to statistically analyze the data, yielding linguistic knowledge that represents language patterns. Training data is processed through a model training method, encoded by the encoding module. The decoding module integrates data regularization methods and linguistic knowledge, and the decoded result is based on data regularization and the decoding of linguistic knowledge. The testing module executes the following process: input data is tested by the model, and output data is generated. The model testing process involves encoding the input data through the encoding module and decoding it through the decoding module to obtain the output data.

[0133] In summary, the information processing method provided in this embodiment involves the decoding module of the control preset model decoding the vector of the language input information based on preset language rules to obtain the response information. This includes: inputting the vector of the language input information into the decoding module to obtain a first set of predicted words, where the decoding module is trained based on the language rules; adjusting the generation probability of each word in the first set of predicted words based on preset adjustment rules to obtain a target set of predicted words; determining words in the target set whose generation probabilities meet certain conditions as target words; returning the target words to the decoding module until the termination condition is met; and sorting the target words according to the determined order to obtain the response information of the language input information. In this solution, adjusting the generation probability of each word in the first set of predicted words generated by the decoding module reduces the difference in generation probabilities between words, ensuring that the probability of the selected target words is within a small adjusted probability range, increasing the probability of certain words being selected in the predicted word set, and expanding the information content in the response information.

[0134] Corresponding to the above-described embodiment of an information processing method provided in this application, this application also provides an embodiment of an apparatus for applying the information processing method.

[0135] like Figure 11 The diagram shown is a structural schematic of an embodiment of an information processing device provided in this application. The device includes the following structure: an acquisition unit 1101 and a response unit 1102.

[0136] The acquisition unit 1101 is used to acquire a language input information set, which includes at least two language input information sets, each of which includes at least one word, and the probability of occurrence of each word in the language input information set is within a first probability range.

[0137] The response unit 1102 is used to generate response information for each language input information in the language input information set based on a preset model, thereby obtaining a response information set; any of the response information includes at least one word, and the generation probability of each word in the response information set is within a second probability range, wherein the second probability range is smaller than the first probability range.

[0138] Optionally, the response unit includes a preset model, which includes an encoding module and a decoding module;

[0139] The response unit is specifically used to control the encoding module of the preset model to encode the language input information to obtain a vector of the language input information, and to control the decoding module of the preset model to decode the vector of the language input information based on preset language rules to obtain the response information.

[0140] Optionally, the response unit is specifically used for:

[0141] If the language input information includes a word, the encoding module of the preset model is controlled to encode the word;

[0142] If the language input information includes at least two words; split the language input information into at least two words; control the encoding module of the preset model to encode the at least two words.

[0143] Optionally, the language rules are obtained statistically based on a corpus, which includes high-frequency words and low-frequency words. The frequency of use of high-frequency words is higher than a preset frequency, the frequency of use of low-frequency words is lower than a preset frequency, the number of high-frequency words is less than a preset value, and the number of low-frequency words is greater than a preset value. The generation probability of each word in the corpus is within a first probability range.

[0144] Optionally, the response unit is specifically used for:

[0145] The vector of the language input information is input into the decoding module to obtain the first set of predicted words, and the decoding module is trained based on the language rules.

[0146] The generation probability of each word in the first predicted word set is adjusted based on the preset adjustment rules to obtain the target predicted word set;

[0147] The words whose generation probability meets the conditions in the target prediction word set are identified as target words;

[0148] The target word is returned to the decoding module until the termination condition is met.

[0149] The target words are sorted according to the determined order to obtain the response information of the language input information.

[0150] Optionally, the termination condition includes:

[0151] The first set of predicted words contains a preset end word; or

[0152] The number of target words is equal to a preset threshold.

[0153] The functions of each component in the information processing device in this embodiment are explained in the method embodiment and will not be repeated here.

[0154] In summary, this embodiment provides an information processing device comprising: an acquisition unit for acquiring a set of language input information, wherein the set of language input information includes at least two language input information, each of which includes at least one word, and the probability of occurrence of each word in the set of language input information is within a first probability range; and a response unit for generating response information for each language input information in the set of language input information based on a preset model, thereby obtaining a response information set; wherein each response information includes at least one word, and the probability of generation of each word in the response information set is within a second probability range, the second probability range being smaller than the first probability range. In this solution, each language input information is processed based on a preset model, and corresponding response information is generated. The response information forms a response information set. The probability of occurrence of each word in the language input information set to which the language input information belongs is within the first probability range, while the probability of generation of each word in the response information set is within a smaller second probability range. The probability range of word generation in the output response information set is smaller than the probability range of word occurrence in the language input information set. Since the probability ranges are different, and the output probability range is smaller than the input probability range, the long-tail phenomenon of the generated response information dataset is solved, effectively improving the information content and diversity of the responses.

[0155] Corresponding to the above-described embodiment of an information processing method provided in this application, this application also provides an electronic device and a readable storage medium corresponding to the information processing method.

[0156] The electronic device includes: a memory and a processor;

[0157] The memory stores information processing programs;

[0158] The processor is used to load and execute the information processing program stored in the memory to implement the steps of the information processing method as described in any of the preceding claims.

[0159] For details on the specific information processing method implemented in this electronic device, please refer to the aforementioned information processing method embodiments.

[0160] The readable storage medium stores a computer program that is invoked and executed by a processor to implement the steps of the information processing method as described in any one of the preceding claims.

[0161] For details on the specific implementation of the information processing method by executing the computer program stored in the readable storage medium, please refer to the aforementioned information processing method embodiments.

[0162] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. The apparatus provided in the embodiments is described simply because it corresponds to the method provided in the embodiments; relevant parts can be found in the method section.

[0163] The above description of the provided embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features provided herein.

Claims

1. An information processing method, comprising: Obtain a set of language input information, wherein the set of language input information includes at least two language input information, each of the language input information includes at least one word, and the probability of occurrence of each word in the set of language input information is within a first probability range and exhibits a long tail phenomenon; Based on a preset model, response information is generated for each language input information in the language input information set to obtain a response information set; any response information includes at least one word, and the generation probability of each word in the response information set is within a second probability range. The second probability range is smaller than the first probability range, which indicates that the generation probability of each word in the response information set is within a small range, which is different from the generation probability distribution of words in the language input information set. The distribution of words in the response information set is balanced and there is no long tail phenomenon. The step of generating response information for any language information based on a preset model includes: The encoding module of the preset model encodes the language input information to obtain a vector of the language input information, and the decoding module of the preset model decodes the vector of the language input information based on preset language rules to obtain the response information. The decoding module of the control preset model decodes the vector of the language input information based on preset language rules to obtain the response information, including: The vector of the language input information is input into the decoding module to obtain the first set of predicted words, and the decoding module is trained based on the language rules. The generation probability of each word in the first predicted word set is adjusted based on the preset adjustment rules to obtain the target predicted word set; The words whose generation probability meets the conditions in the target prediction word set are identified as target words; The target word is returned to the decoding module until the termination condition is met. The target words are sorted according to the determined order to obtain the response information of the language input information; The preset adjustment rules are used to adjust the generation probability of each word, reduce the generation probability of words with high frequency but no specific meaning in the first prediction word set, and increase the generation probability of words with low frequency and consistent with the context in the first prediction word set.

2. The method according to claim 1, wherein the encoding module of the control preset model encodes the language input information, comprising: If the language input information includes a word, the encoding module of the preset model is controlled to encode the word; If the language input information includes at least two words; split the language input information into at least two words; control the encoding module of the preset model to encode the at least two words.

3. The method according to claim 1, wherein the language rules are obtained statistically based on a corpus, the corpus includes high-frequency words and low-frequency words, the frequency of use of high-frequency words is higher than a preset frequency, the frequency of use of low-frequency words is lower than a preset frequency, the number of high-frequency words is less than a preset value, the number of low-frequency words is greater than a preset value, and the generation probability of each word in the corpus is within a first probability range.

4. The method according to claim 1, wherein satisfying the termination condition includes: The first set of predicted words contains a preset end word; or The number of target words is equal to a preset threshold.

5. An information processing apparatus, comprising: The acquisition unit is used to acquire a set of language input information, wherein the set of language input information includes at least two language input information, each of the language input information includes at least one word, and the probability of occurrence of each word in the set of language input information is within a first probability range and exhibits a long tail phenomenon. The response unit is used to generate response information for each language input information in the language input information set based on a preset model, thereby obtaining a response information set. Each of the response information includes at least one word, and the generation probability of each word in the response information set is within a second probability range. The second probability range is smaller than the first probability range. The second probability range being smaller than the first probability range indicates that the generation probability of each word in the response information set is within a small range, which is different from the generation probability distribution of words in the language input information set. The distribution of words in the response information set is balanced and there is no long tail phenomenon. The response unit includes a preset model, which includes an encoding module and a decoding module. The response unit is specifically used to control the encoding module of the preset model to encode the language input information to obtain a vector of the language input information, and to control the decoding module of the preset model to decode the vector of the language input information based on preset language rules to obtain the response information; The decoding module of the control preset model decodes the vector of the language input information based on preset language rules to obtain the response information, including: The vector of the language input information is input into the decoding module to obtain the first set of predicted words, and the decoding module is trained based on the language rules. The generation probability of each word in the first predicted word set is adjusted based on the preset adjustment rules to obtain the target predicted word set; The words whose generation probability meets the conditions in the target prediction word set are identified as target words; The target word is returned to the decoding module until the termination condition is met. The target words are sorted according to the determined order to obtain the response information of the language input information; The preset adjustment rules are used to adjust the generation probability of each word, reduce the generation probability of words with high frequency but no specific meaning in the first prediction word set, and increase the generation probability of words with low frequency and consistent with the context in the first prediction word set.

6. An electronic device, comprising: Memory, processor; The memory stores information processing programs; The processor is used to load and execute the information processing program stored in the memory to implement the steps of the information processing method as described in any one of claims 1-4.

7. A readable storage medium having a computer program stored thereon, the computer program being invoked and executed by a processor to implement the steps of the information processing method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Improved cluster search strategy and question-answering system

    CN110851673A