Information processing method, device and equipment
By obtaining and processing the weight of text information in the dialogue system, using convolutional neural networks and long and short-term memory networks to determine user intentions, solving the problem of inaccurate intention recognition in the prior art and improving the accuracy of user intentions.
Patent Information
- Application Number
- CN202010221435.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-26
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2040-03-26
AI Technical Summary
When obtaining user intentions, existing dialogue systems rely on the most recent sentence for intention recognition, resulting in the inability to accurately obtain user intentions.
By obtaining the first text information and its corresponding historical text information, its weight is determined separately, and the word matrix is processed by using the convolutional neural network and the long and short-term memory network to calculate the importance of the text information, and then determine the user's intention.
Improve the accuracy of user intentions and avoid the inaccuracy of user intentions caused by single-sentence intent identification errors.
Smart Images

Figure CN111767721B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of artificial intelligence technology, and in particular to an information processing method, device and equipment. Background Art
[0002] A dialogue system is generally an intelligent system that can generate responses based on dialogue input by a user. Currently, in the process of generating responses by a dialogue system, it is necessary to obtain the user intention of the user input dialogue, so as to generate a response based on the user intention.
[0003] In the related art, a method for a dialogue system to obtain the user intention of an input dialogue includes: obtaining the closest sentence in the current dialogue, and performing intent recognition on the closest sentence to obtain the user intention. In the above method, the user intention is obtained by performing intent recognition on the closest sentence, resulting in an inability to accurately obtain the user intention. Summary of the invention
[0004] The present application provides an information processing method, apparatus and device for improving the accuracy of determining user intent.
[0005] In a first aspect, the present application provides an information processing method, comprising:
[0006] Acquire the first text information and at least one historical text information corresponding to the first text information;
[0007] Determine a first weight of the first text information and a second weight of each historical text information respectively, the first weight indicating the importance of the first text information to the intention recognition, and the second weight indicating the importance of the historical text information to the intention recognition;
[0008] A user intention of the first text information is determined according to the first text information, each piece of historical text information, the first weight, and each second weight.
[0009] In a possible implementation, respectively determining the first weight of the first text information and the second weight of each piece of historical text information includes:
[0010] Performing word segmentation processing on the first text information and each historical text information respectively to obtain a first word set of the first text information and a second word set of each historical text information;
[0011] Obtain a first word matrix corresponding to the first word set and a second word matrix corresponding to each second word set;
[0012] According to the first word matrix and each second word matrix, a first weight of the first text information and a second weight of each historical text information are determined.
[0013] In another possible implementation, obtaining a first word matrix corresponding to the first word set and a second word matrix corresponding to each second word set includes:
[0014] If the number of words in the first word set and each second word set is not equal to the preset number, the first word set and each second word set are respectively padded or truncated to obtain a third word set corresponding to the first word set and a fourth word set corresponding to each second word set;
[0015] Determine a first word matrix corresponding to the first word set according to the third word set;
[0016] According to each fourth word set, determining a second word matrix corresponding to each second word set;
[0017] The number of words in the third word set and each fourth word set is equal to a preset number.
[0018] In another possible implementation, determining the first weight of the first text information and the second weight of each historical text information according to the first word matrix and each second word matrix includes:
[0019] The first word matrix and each second word matrix are processed by a preset network model to obtain a third word matrix of the first text information and a fourth word matrix of each historical text information;
[0020] Determining a first weight of the first text information according to the third word matrix and the conversation matrix;
[0021] A second weight of each historical text information is determined according to each fourth word matrix and a conversation matrix, wherein the conversation matrix is obtained according to the conversation text information, and the conversation text information includes the first text information and at least one historical text information.
[0022] In another possible implementation, the preset network model includes a convolutional neural network and a long short-term memory network; the first word matrix and each second word matrix are processed by the preset network model to obtain a third word matrix of the first text information and a fourth word matrix of each historical text information, including:
[0023] The first word matrix and each second word matrix are processed by a convolutional neural network and a long short-term memory network in turn to obtain a third word matrix of the first text information and a fourth word matrix of each historical text information.
[0024] In another possible implementation, determining the user intention of the first text information according to the first text information, each historical text information, the first weight, and each second weight includes:
[0025] Determining an intermediate intent of the first text information based on the third word matrix of the first text information, the fourth word matrix of each historical text information, the first weight, and each second weight;
[0026] A user intention of the first text message is determined according to the intermediate intention and at least one preset intention.
[0027] In another possible implementation, determining the user intent of the first text message according to the intermediate intent and at least one preset intent includes:
[0028] Determining, based on the intermediate intention and at least one preset intention, a degree of matching between the intermediate intention and each preset intention;
[0029] According to each matching degree, a user intention of the first text information is determined in at least one preset intention.
[0030] In another possible implementation, determining, according to the intermediate intent and at least one preset intent, a matching degree between the intermediate intent and each preset intent includes:
[0031] The intermediate intent and at least one preset intent are processed by a preset regression model to obtain a matching degree between the intermediate intent and each preset intent.
[0032] In a second aspect, the present application provides an information processing device, including: an acquisition module and a determination module, wherein:
[0033] The acquisition module is used to acquire the first text information and at least one historical text information corresponding to the first text information;
[0034] The determination module is used to respectively determine a first weight of the first text information and a second weight of each historical text information, wherein the first weight indicates the importance of the first text information to the intention recognition, and the second weight indicates the importance of the historical text information to the intention recognition;
[0035] The determination module is further used to determine the user intention of the first text information according to the first text information, each historical text information, the first weight and each second weight.
[0036] In a possible implementation manner, the determination module is specifically configured to:
[0037] Performing word segmentation processing on the first text information and each historical text information respectively to obtain a first word set of the first text information and a second word set of each historical text information;
[0038] Obtain a first word matrix corresponding to the first word set and a second word matrix corresponding to each second word set;
[0039] According to the first word matrix and each second word matrix, a first weight of the first text information and a second weight of each historical text information are determined.
[0040] In another possible implementation, the determination module is specifically configured to:
[0041] If the number of words in the first word set and each second word set is not equal to the preset number, the first word set and each second word set are respectively padded or truncated to obtain a third word set corresponding to the first word set and a fourth word set corresponding to each second word set;
[0042] Determine a first word matrix corresponding to the first word set according to the third word set;
[0043] According to each fourth word set, determining a second word matrix corresponding to each second word set;
[0044] The number of words in the third word set and each fourth word set is equal to a preset number.
[0045] In another possible implementation, the determination module is specifically configured to:
[0046] The first word matrix and each second word matrix are processed by a preset network model to obtain a third word matrix of the first text information and a fourth word matrix of each historical text information;
[0047] Determining a first weight of the first text information according to the third word matrix and the conversation matrix;
[0048] A second weight of each historical text information is determined according to each fourth word matrix and a conversation matrix, wherein the conversation matrix is obtained according to the conversation text information, and the conversation text information includes the first text information and at least one historical text information.
[0049] In another possible implementation, the preset network model includes a convolutional neural network and a long short-term memory network; the determination module is specifically used to:
[0050] The first word matrix and each second word matrix are processed by a convolutional neural network and a long short-term memory network in turn to obtain a third word matrix of the first text information and a fourth word matrix of each historical text information.
[0051] In another possible implementation, the determination module is further specifically configured to:
[0052] Determining an intermediate intent of the first text information based on the third word matrix of the first text information, the fourth word matrix of each historical text information, the first weight, and each second weight;
[0053] A user intention of the first text message is determined according to the intermediate intention and at least one preset intention.
[0054] In another possible implementation, the determination module is further specifically configured to determine the user intention of the first text message according to the intermediate intention and at least one preset intention, including:
[0055] Determining, based on the intermediate intention and at least one preset intention, a degree of matching between the intermediate intention and each preset intention;
[0056] According to each matching degree, a user intention of the first text information is determined in at least one preset intention.
[0057] In another possible implementation, the determination module is further specifically configured to:
[0058] The intermediate intent and at least one preset intent are processed by a preset regression model to obtain a matching degree between the intermediate intent and each preset intent.
[0059] In a third aspect, the present application provides an information processing device, including: at least one processor and a memory;
[0060] Memory stores computer-executable instructions;
[0061] At least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the information processing method as described in any one of the first aspects.
[0062] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, an information processing method as described in any one of the first aspects is implemented.
[0063] The present embodiment provides an information processing method, apparatus and device, the method comprising: obtaining a first text message and at least one historical text message corresponding to the first text message; respectively determining a first weight of the first text message and a second weight of each historical text message, the first weight indicating the importance of the first text message to the intent recognition, and the second weight indicating the importance of the historical text message to the intent recognition; determining the user intent of the first text message according to the first text message, each historical text message, the first weight and each second weight. In the present application, determining the user intent of the first text message according to the first text message, each historical text message, the first weight and each second weight can improve the accuracy of determining the user intent. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0065] Figure 1 Schematic diagram of application scenarios provided for this application;
[0066] Figure 2 Schematic diagram of the information processing method provided for this application Figure 1 ;
[0067] Figure 3 Schematic diagram of the information processing method provided for this application Figure 2 ;
[0068] Figure 4 The structure of the preset network model provided for this application;
[0069] Figure 5 A schematic diagram of the structure of the information processing device provided by this application;
[0070] Figure 6 A schematic diagram of the hardware structure of the information processing device provided in this application. DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0072] Figure 1 This is a schematic diagram of the application scenario provided by this application. Figure 1 As shown, it includes: a smart device 101 and a server 102. Among them, the smart device 101 can interact with the server 102 through a wireless network. For example, the wireless network can be a 2G network, a 3G network, a 4G network or a 5G network, a Wireless Fidelity (Wireless Fidelity, referred to as WIFI) network, etc.
[0073] During the interaction between the smart device 101 and the server 102, the smart device 101 may send at least one text message input by the dialog user to the server 102. After receiving the at least one text message, the server 102 may determine the user's intention according to the at least one text message, obtain response information according to the user's intention, and then send the response information to the smart device 101.
[0074] Specifically, the smart device 101 may be a smart phone, a computer, etc. The smart device 101 may display a dialogue interface 103, in which the text information input by the dialogue user and the response information of the dialogue machine are displayed. For example, the text information input by the dialogue user may be "Hello", "It has been three days since I placed the order, why haven't I received the goods yet", "Then return it". The smart device 101 may send the text information to the server 102, and the server 102 may determine the user's intention - "delivery cycle" according to the text information, determine the response information - "Please wait, I will help you check the delivery information" according to the user's intention, and send the response information to the smart device 101, so that the dialogue interface 103 of the smart device 101 displays "Please wait, I will help you check the logistics information". In the above method, the server 102 determines the user's intention based on multiple text messages, which can improve the accuracy of determining the user's intention.
[0075] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0076] Figure 2 Schematic diagram of the information processing method provided for this application Figure 1 The information processing method may be executed by a server or an information processing device disposed in the server, wherein the information processing device may be implemented by a combination of software and / or hardware. Figure 2 As shown, the information processing method includes:
[0077] S201: Acquire first text information and at least one historical text information corresponding to the first text information.
[0078] The first text message is the most recent message input by the dialog user in the conversation text message, such as Figure 1 As shown in FIG. 1 , the first text message is “Then withdraw.” It should be noted that the conversation text message includes the first text message and at least one historical text message corresponding to the first text message, such as Figure 1 As shown, at least one historical text message includes "Hello", "It has been three days since I placed the order, why haven't I received the goods yet?"
[0079] Optionally, the number of at least one historical text message may be N, where N is greater than or equal to 1. Specifically, this application does not limit the value of N.
[0080] Optionally, at least one historical text message may also include response information of the dialogue machine.
[0081] S202: Determine a first weight of the first text information and a second weight of each historical text information respectively, the first weight indicating the importance of the first text information to the intent recognition, and the second weight indicating the importance of the historical text information to the intent recognition.
[0082] Specifically, a first word matrix of the first text information and a second word matrix of each historical text information are obtained, and the first word matrix and each second word matrix are processed by a preset model to obtain a first weight and a second weight of each historical text information. The first word matrix is a matrix determined according to the words in the first text information, the second word matrix is a matrix determined according to the words in the historical text information, and the preset model includes a convolutional neural network (CNN), a long short-term memory LSTM (LSTM) network, and an attention mechanism (Attention Mechanism).
[0083] Furthermore, the first word matrix and each second word matrix are processed in turn through a CNN network, an LSTM network, and an attention mechanism to obtain a first weight of the first text information and a second weight of each historical text information.
[0084] S203: Determine the user intention of the first text information according to the first text information, each historical text information, the first weight, and each second weight.
[0085] Specifically, the user intention of the first text information is determined according to the third word matrix of the first text information, the fourth matrix of each historical text information, the first weight and each second weight. The third word matrix and each fourth matrix are obtained by processing the first word matrix and each second word matrix through the CNN network and the LSTM network in sequence.
[0086] In one prior art, the user's intention is obtained by performing intent recognition on the most recent sentence, which results in an inability to accurately obtain the user's intention. For example, the user in the conversation first enters "I want to return the goods" and then enters "who pays the shipping fee". If the user in the conversation enters "who pays the shipping fee", it is impossible to determine whether the user's intention is to inquire about the pre-sale shipping fee (the merchant sends the goods to the customer) or the post-sale shipping fee (the customer sends the goods to the merchant). In another prior art, all the text information of the conversation user is spliced together, and the intent is recognized based on the spliced text information, which may lead to incorrect determination of the user's intention. For example, Figure 1 The dialog information shown is spliced and the intent is identified based on the spliced text information. The user intent obtained may be "return", while the actual user intent is "delivery cycle", resulting in an error in determining the user intent. In the present application, the user intent is determined based on the weight of the first text information and each historical text information, which can improve the accuracy of determining the user intent.
[0087] The information processing method provided in this embodiment includes: obtaining a first text message and at least one historical text message corresponding to the first text message; respectively determining a first weight of the first text message and a second weight of each historical text message, the first weight indicating the importance of the first text message to the intent recognition, and the second weight indicating the importance of the historical text message to the intent recognition; determining the user intent of the first text message according to the first text message, each historical text message, the first weight, and each second weight. In the present application, determining the user intent of the first text message according to the first text message, each historical text message, the first weight, and each second weight can improve the accuracy of determining the user intent.
[0088] exist Figure 2 Based on the following Figure 3 The information processing method in this application is further described in detail.
[0089] Figure 3 Schematic diagram of the information processing method provided for this application Figure 2 .like Figure 3 As shown, the information processing method includes:
[0090] S301: Acquire first text information and at least one historical text information corresponding to the first text information.
[0091] Specifically, the execution method of S301 is the same as the execution method of S302, and the execution process of S301 will not be repeated here.
[0092] S302: Perform word segmentation processing on the first text information and each historical text information respectively to obtain a first word set of the first text information and a second word set of each historical text information.
[0093] Specifically, the first text information and each historical text information are segmented by a pre-set segmentation method to obtain a first word set and each second word set. Optionally, the pre-set segmentation method may be a single-word segmentation method or a word segmentation method.
[0094] For example, if the text information is "I want to return goods", if it is processed by the single-word segmentation method, the resulting word set is: I, want, return, goods; if it is processed by the word segmentation method, the resulting word set is: I, want, return.
[0095] S303: Obtain a first word matrix corresponding to the first word set and a second word matrix corresponding to each second word set.
[0096] In a possible implementation, it includes: if the number of words in the first word set and each second word set is not equal to a preset number, padding or truncating the first word set and each second word set respectively to obtain a third word set corresponding to the first word set and a fourth word set corresponding to each second word set; determining a first word matrix corresponding to the first word set according to the third word set; determining a second word matrix corresponding to each second word set according to each fourth word set, wherein the number of words in the third word set and each fourth word set is equal to the preset number.
[0097] Optionally, the preset number can be 20, 30, 50, etc., and this application does not limit the preset number.
[0098] Optionally, performing filling processing on the word set includes inserting a preset word into a first preset position in the word set, and performing truncation processing on the word set includes deleting a word at a second preset position in the word set.
[0099] The preset word may be any preset word, for example, 0, 1, 2, %, etc. The first preset position may be a starting position or an ending position, and the second preset position may be an intermediate position.
[0100] For example, the conversation text information includes a first text message "I want to return the goods" and a historical text message "It has been three days since I placed the order, why haven't I received it yet?" If the word segmentation method is used to process the first text message, the first word set obtained is: I, want, return goods; if the word segmentation method is used to process the historical text information, the second word set obtained is: I, placed an order, it has been three days, why, I haven't, received it yet, ah.
[0101] For example, when the preset number is 8, the preset word is 0, the first preset position is the starting position, and the second preset position is the middle position, the third word set obtained after filling the first word set can be: 0, 0, 0, 0, 0, I, want, return, and the fourth word set obtained after truncation of the second word set can be: I, place an order, already, three days, still, not, received, ah, among which the third word set and the fourth word set both include 8 words.
[0102] Furthermore, the third word set is processed by a preset word matrix algorithm to obtain a first word matrix corresponding to the first word set, and a second word matrix corresponding to each second word set is obtained for each fourth word set. The preset word matrix algorithm may be a word2vector algorithm.
[0103] S304: Determine a first weight of the first text information and a second weight of each piece of historical text information according to the first word matrix and each second word matrix.
[0104] In a possible implementation, the first word matrix and each second word matrix are processed by a preset network model to obtain a third word matrix of the first text information and a fourth word matrix of each historical text information; a first weight of the first text information is determined based on the third word matrix and the conversation matrix; a second weight of each historical text information is determined based on each fourth word matrix and the conversation matrix, wherein the conversation matrix is obtained based on the conversation text information, and the conversation text information includes the first text information and at least one historical text information.
[0105] Specifically, the preset network model includes a convolutional neural network and a long short-term memory network. The first word matrix and each second word matrix are processed by the convolutional neural network and the long short-term memory network in turn to obtain the third word matrix of the first text information and the fourth word matrix of each historical text information. For details, please refer to Figure 4 Detailed description of the preset network model.
[0106] Optionally, the weight values may be determined by the following feasible formulas 1 and 2:
[0107] U i =tanh(WH i +B) Formula 1;
[0108]
[0109] Among them, w i is the weight, U is the session matrix, e is the natural base, W and B are the parameters of the long short-term memory network output, H i is the weight w i The corresponding word matrix, where H iThe value of is the third word matrix and the fourth word matrix of each historical text information.
[0110] S305: Determine the intermediate intent of the first text information according to the third word matrix of the first text information, the fourth word matrix of each historical text information, the first weight, and each second weight.
[0111] Specifically, the intermediate intent of the first text information may be determined by the following formula 3:
[0112] V=∑ i w i H i Formula 3;
[0113] Among them, V is the intermediate intention, w i is the weight, H i is the weight w i The corresponding word matrix, H i The values are the third word matrix and the fourth word matrix of each historical text information.
[0114] It should be noted that the above formulas 1, 2 and 3 are formulas in the attention mechanism.
[0115] S306: Determine the user intent of the first text message according to the intermediate intent and at least one preset intent.
[0116] In a possible implementation, based on the intermediate intent and at least one preset intent, a matching degree between the intermediate intent and each preset intent is determined; and based on each matching degree, a user intent of the first text message is determined in at least one preset intent.
[0117] Specifically, the intermediate intent and at least one preset intent are processed by a preset regression model to obtain a matching degree between the intermediate intent and each preset intent, wherein the preset regression model is a Softmax regression model.
[0118] Furthermore, the preset intention corresponding to the maximum matching degree is determined as the user intention.
[0119] In the present application, the first word matrix and each second word matrix are processed through a preset network model to obtain the third word matrix of the first text information and the fourth word matrix of each historical text information, so as to extract the effective information in each text information (i.e., the third word matrix and each fourth word matrix), and then determine the user intention based on the effective information in each text information and the importance (weight) of each text information, thereby improving the accuracy of determining the user intention.
[0120] The information processing method provided in this embodiment includes: obtaining a first text message and at least one historical text message corresponding to the first text message; performing word segmentation processing on the first text message and each historical text message respectively to obtain a first word set of the first text message and a second word set of each historical text message; obtaining a first word matrix corresponding to the first word set and a second word matrix corresponding to each second word set; determining a first weight of the first text message and a second weight of each historical text message according to the first word matrix and each second word matrix; determining an intermediate intention of the first text message according to the third word matrix of the first text message, the fourth word matrix of each historical text message, the first weight and each second weight; determining a user intention of the first text message according to the intermediate intention and at least one preset intention. In the above method, determining the user intention according to the first text message, each historical text message and the weight can improve the accuracy of determining the user intention.
[0121] Figure 4 This is a schematic diagram of the structure of the preset network model provided in this application. Figure 4 As shown, the preset network model includes: a convolutional neural network and a long short-term memory network, wherein the long short-term memory network includes at least one processing node.
[0122] Optionally, the number of convolutional neural networks is M, M is greater than or equal to 1, and each convolutional neural network includes a convolution layer and a pooling layer.
[0123] Specifically, the number of the convolutional neural network is the same as the number of at least one processing node, and the total number of at least one first text information and at least one historical text information is the same as the number of at least one processing node.
[0124] For example, the number of at least one processing node is M, M is greater than or equal to 1, if the number of text information included in the conversation text information is greater than M, the first text information and M-1 text information before the first text information are determined as at least one historical text information, so that the total number of the first text information and the at least one historical text information is M.
[0125] Next, taking the first word matrix as an example, the working process of the preset network model is explained.
[0126] The first word matrix is processed by a convolutional neural network, and the processing result output by the convolutional neural network is provided to a processing node in the long short-term memory network (corresponding to the convolutional neural network). The processing node processes the learning information provided by the previous processing node and the processing result output by the convolutional neural network to obtain a third word matrix.
[0127] It should be noted that the LSTM network is a unidirectional LSTM network. In practical applications, since the user intention is usually most relevant to the most recent information (the first text information), the unidirectional LSTM network can make the determined user intention more accurate.
[0128] Figure 5 Schematic diagram of the structure of the information processing device provided in this application. The information processing device 10 is set in the server, such as Figure 5 As shown, the information processing device 10 includes: an acquisition module 11 and a determination module 12, wherein:
[0129] The acquisition module 11 is used to acquire the first text information and at least one historical text information corresponding to the first text information;
[0130] The determination module 12 is used to respectively determine a first weight of the first text information and a second weight of each historical text information, wherein the first weight indicates the importance of the first text information to the intention recognition, and the second weight indicates the importance of the historical text information to the intention recognition;
[0131] The determination module 12 is further configured to determine the user intention of the first text information according to the first text information, each piece of historical text information, the first weight and each second weight.
[0132] The information processing device provided in the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0133] In a possible implementation manner, the determination module 12 is specifically configured to:
[0134] Performing word segmentation processing on the first text information and each historical text information respectively to obtain a first word set of the first text information and a second word set of each historical text information;
[0135] Obtain a first word matrix corresponding to the first word set and a second word matrix corresponding to each second word set;
[0136] According to the first word matrix and each second word matrix, a first weight of the first text information and a second weight of each historical text information are determined.
[0137] In another possible implementation, the determination module 12 is specifically configured to:
[0138] If the number of words in the first word set and each second word set is not equal to the preset number, the first word set and each second word set are respectively padded or truncated to obtain a third word set corresponding to the first word set and a fourth word set corresponding to each second word set;
[0139] Determine a first word matrix corresponding to the first word set according to the third word set;
[0140] According to each fourth word set, determining a second word matrix corresponding to each second word set;
[0141] The number of words in the third word set and each fourth word set is equal to a preset number.
[0142] In another possible implementation, the determination module 12 is specifically configured to:
[0143] The first word matrix and each second word matrix are processed by a preset network model to obtain a third word matrix of the first text information and a fourth word matrix of each historical text information;
[0144] Determining a first weight of the first text information according to the third word matrix and the conversation matrix;
[0145] A second weight of each historical text information is determined according to each fourth word matrix and a conversation matrix, wherein the conversation matrix is obtained according to the conversation text information, and the conversation text information includes the first text information and at least one historical text information.
[0146] In another possible implementation, the preset network model includes a convolutional neural network and a long short-term memory network; the determination module 12 is specifically used to:
[0147] The first word matrix and each second word matrix are processed by a convolutional neural network and a long short-term memory network in turn to obtain a third word matrix of the first text information and a fourth word matrix of each historical text information.
[0148] In another possible implementation, the determination module 12 is further specifically configured to:
[0149] Determining an intermediate intent of the first text information based on the third word matrix of the first text information, the fourth word matrix of each historical text information, the first weight, and each second weight;
[0150] A user intention of the first text message is determined according to the intermediate intention and at least one preset intention.
[0151] In another possible implementation, the determination module 12 is further specifically configured to:
[0152] Determining the user intention of the first text message according to the intermediate intention and at least one preset intention, includes:
[0153] Determining, based on the intermediate intention and at least one preset intention, a degree of matching between the intermediate intention and each preset intention;
[0154] According to each matching degree, a user intention of the first text information is determined in at least one preset intention.
[0155] In another possible implementation, the determination module 12 is further specifically configured to:
[0156] The intermediate intent and at least one preset intent are processed by a preset regression model to obtain a matching degree between the intermediate intent and each preset intent.
[0157] Figure 6 This is a schematic diagram of the hardware structure of the information processing device provided in this application. Figure 6 As shown, the information processing device 20 includes: at least one processor 21 and a memory 22. The processor 21 and the memory 22 are connected via a bus 23.
[0158] In a specific implementation process, at least one processor 21 executes the computer execution instructions stored in the memory 22, so that at least one processor 21 executes the above information processing method.
[0159] The specific implementation process of the processor 21 can refer to the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated in this embodiment. Among them, the information processing device 20 can be a server.
[0160] In the above Figure 6 In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0161] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk storage.
[0162] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0163] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above information processing method is implemented.
[0164] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0165] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0166] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0167] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple blockchain units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0168] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0169] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or blockchain device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0170] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0171] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An information processing method, characterized in that: include: Acquire first text information and at least one historical text information corresponding to the first text information; Determine a first weight of the first text information and a second weight of each historical text information respectively, wherein the first weight indicates the importance of the first text information to the intention recognition, and the second weight indicates the importance of the historical text information to the intention recognition; wherein the first weight is obtained by a first word matrix determined according to the words in the first text information; and the second weight is obtained by a second word matrix determined according to the words in the historical text information; A user intention of the first text information is determined according to the first text information, each of the historical text information, the first weight, and each of the second weights.
2. The method according to claim 1, characterized in that Determining a first weight of the first text information and a second weight of each piece of historical text information respectively includes: Performing word segmentation processing on the first text information and each historical text information respectively to obtain a first word set of the first text information and a second word set of each historical text information; Obtain a first word matrix corresponding to the first word set and a second word matrix corresponding to each second word set; A first weight of the first text information and a second weight of each historical text information are determined according to the first word matrix and each second word matrix.
3. The method according to claim 2, characterized in that Obtaining a first word matrix corresponding to the first word set and a second word matrix corresponding to each second word set, including: If the number of words in the first word set and each second word set is not equal to the preset number, the first word set and each second word set are respectively padded or truncated to obtain a third word set corresponding to the first word set and a fourth word set corresponding to each second word set; Determine, according to the third word set, a first word matrix corresponding to the first word set; According to each fourth word set, determining a second word matrix corresponding to each second word set; The number of words in the third word set and each fourth word set is equal to the preset number.
4. The method according to claim 2, characterized in that: Determining a first weight of the first text information and a second weight of each historical text information according to the first word matrix and each second word matrix includes: Processing the first word matrix and each second word matrix through a preset network model to obtain a third word matrix of the first text information and a fourth word matrix of each historical text information; Determining a first weight of the first text information according to the third word matrix and the conversation matrix; A second weight of each historical text information is determined according to each fourth word matrix and the conversation matrix, wherein the conversation matrix is obtained according to conversation text information, and the conversation text information includes the first text information and the at least one historical text information.
5. The method according to claim 4, characterized in that The preset network model includes a convolutional neural network and a long short-term memory network; the first word matrix and each second word matrix are processed by the preset network model to obtain a third word matrix of the first text information and a fourth word matrix of each historical text information, including: The first word matrix and each second word matrix are processed by the convolutional neural network and the long short-term memory network in turn to obtain a third word matrix of the first text information and a fourth word matrix of each historical text information.
6. The method according to any one of claims 2 to 5, characterized in that: Determining the user intention of the first text information according to the first text information, each historical text information, the first weight, and each second weight includes: determining an intermediate intent of the first text information according to the third word matrix of the first text information, the fourth word matrix of each historical text information, the first weight, and each second weight; The user intent of the first text information is determined according to the intermediate intent and at least one preset intent.
7. The method according to claim 6, characterized in that Determining the user intent of the first text message according to the intermediate intent and at least one preset intent includes: Determining, according to the intermediate intention and the at least one preset intention, a degree of matching between the intermediate intention and each preset intention; According to each matching degree, a user intention of the first text information is determined in the at least one preset intention.
8. The method according to claim 7, characterized in that Determining, according to the intermediate intention and the at least one preset intention, a matching degree between the intermediate intention and each preset intention, including: The intermediate intent and the at least one preset intent are processed by a preset regression model to obtain a matching degree between the intermediate intent and each preset intent.
9. An information processing device, characterized in that: include: Get module and determine module, where, The acquisition module is used to acquire the first text information and at least one historical text information corresponding to the first text information; The determination module is used to respectively determine a first weight of the first text information and a second weight of each historical text information, wherein the first weight indicates the importance of the first text information to the intention recognition, and the second weight indicates the importance of the historical text information to the intention recognition; wherein the first weight is obtained by a first word matrix determined according to words in the first text information; and the second weight is obtained by a second word matrix determined according to words in the historical text information; The determination module is further configured to determine the user intention of the first text information according to the first text information, each piece of historical text information, the first weight, and each second weight.
10. An information processing device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the information processing method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the information processing method according to any one of claims 1 to 8 is implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the information processing method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Interactive content generation method and device, computer equipment and storage medium
CN109857848A