WO2022033462A9 - 用于生成预测信息的方法、装置、电子设备和介质 - Google Patents
用于生成预测信息的方法、装置、电子设备和介质 Download PDFInfo
- Publication number
- WO2022033462A9 WO2022033462A9 PCT/CN2021/111734 CN2021111734W WO2022033462A9 WO 2022033462 A9 WO2022033462 A9 WO 2022033462A9 CN 2021111734 W CN2021111734 W CN 2021111734W WO 2022033462 A9 WO2022033462 A9 WO 2022033462A9
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- vector
- user
- word
- input text
- image
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/274—Converting codes to words; Guess-ahead of partial word inputs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2413—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
- G06F18/24133—Distances to prototypes
- G06F18/24137—Distances to cluster centroïds
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/205—Parsing
- G06F40/216—Parsing using statistical methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/289—Phrasal analysis, e.g. finite state techniques or chunking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/40—Processing or translation of natural language
- G06F40/42—Data-driven translation
- G06F40/44—Statistical methods, e.g. probability models
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/14—Image acquisition
- G06V30/148—Segmentation of character regions
Definitions
- Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method, apparatus, electronic device, and medium for generating prediction information.
- GIF Graphics Interchange Format
- Some embodiments of the present disclosure propose methods, apparatuses, electronic devices, and media for generating prediction information to solve the technical problems mentioned in the background section above.
- some embodiments of the present disclosure provide a method for generating prediction information, the method comprising: acquiring at least one input word, wherein the at least one input word is obtained by segmenting target input text; generating A word vector (word vector) of each input word in at least one input word to obtain a word vector set; based on the above word vector set, an input text vector is generated; based on the above input text vector and user vector, a prediction for predicting user intent is generated information.
- some embodiments of the present disclosure provide an apparatus for generating prediction information, the apparatus comprising: an obtaining unit configured to obtain at least one input word, wherein the at least one input word is a Word segmentation is obtained; the word vector generation unit is configured to generate a word vector of each input word in at least one input word, and obtain a word vector set, wherein the at least one input word is obtained by performing word segmentation on the target input text; input text The vector generating unit is configured to generate an input text vector based on the above-mentioned word vector set; the generating unit is configured to generate prediction information for predicting the user's intention based on the above-mentioned input text vector and the user vector.
- some embodiments of the present disclosure provide an electronic device, comprising: one or more processors; a storage device on which one or more programs are stored, when one or more programs are stored by one or more The processor executes such that the one or more processors implement the method as described in the first aspect.
- some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method as described in the first aspect.
- One of the above-mentioned embodiments of the present disclosure has the following beneficial effects: generating an input text vector by generating a word vector of an input word. It can avoid the situation that directly generating the input text vector is easy to cause errors. Then, based on the input text vector and the user vector, prediction information for estimating the user's demand intention is generated. Because, the user vector is obtained based on the user history information. Therefore, the user vector can reflect the user's historical behavior. Therefore, the generated prediction information is also more in line with user needs. Thus, a method for judging the user's demand intention according to the user vector and the input text vector is provided. By predicting the user's demand intention before popping up the GIF image to the user, the pop-up of unnecessary information is reduced, and the user is prevented from being disturbed, thereby improving the user experience.
- FIG. 1 is a schematic diagram of an application scenario of a method for generating prediction information according to some embodiments of the present disclosure
- FIG. 2 is a flowchart of some embodiments of a method for generating predictive information in accordance with the present disclosure
- FIG. 3 is a schematic diagram of an application scenario of a method for generating prediction information according to some embodiments of the present disclosure
- FIG. 4 is a schematic diagram of an application scenario of the method for generating prediction information according to some embodiments of the present disclosure
- FIG. 6 is a schematic diagram of an application scenario of the method for generating prediction information according to other embodiments of the present disclosure.
- FIG. 7 is a schematic structural diagram of some embodiments of an apparatus for generating prediction information according to the present disclosure.
- FIG. 8 is a schematic structural diagram of an electronic device suitable for implementing some embodiments of the present disclosure.
- FIG. 1 is a schematic diagram of an application scenario of a method for generating prediction information according to some embodiments of the present disclosure.
- computing device 101 may obtain input word 103 and input word 104 .
- the acquisition of the input word 103 and the input word 104 may be obtained by segmenting the input text 102 .
- the above word segmentation can also be performed by another computing device on the input text 102 , and then the computing device directly obtains the word segmentation result, input word 103 and input word 104 .
- the computing device 101 may generate a word vector 105 for the input word 103 and a word vector 106 for the input word 104 .
- an input text vector 107 may be generated.
- Computing device 101 may generate prediction information 110 based on generated input text vector 107 and user vector 108 .
- the above computing device 101 may be hardware or software.
- the computing device When the computing device is hardware, it can be implemented as a distributed cluster composed of multiple servers or terminal devices, or can be implemented as a single server or a single terminal device.
- a computing device When a computing device is embodied in software, it can be implemented as multiple software or software modules, for example, to provide distributed services, or as a single software or software module. There is no specific limitation here.
- FIG. 1 is merely illustrative. There may be any number of computing devices depending on implementation needs.
- the method for generating prediction information includes the following steps:
- Step 201 acquiring at least one input word.
- the execution body of the method for generating prediction information may acquire the above at least one input word through a wired connection or a wireless connection.
- the above at least one input word can be a word obtained by segmenting the target input text.
- the above-mentioned execution body may receive the input text input by the user as the target input text. Then, performing word segmentation on the received target input text to obtain at least one input word.
- the execution body may receive an input word input by the user as the at least one input word.
- wireless connection methods may include but are not limited to 3G/4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or developed in the future .
- Step 202 Generate a word vector for each input word in the at least one input word, and obtain a word vector set.
- the above-mentioned execution body can generate the word vector of the input word in various ways. For example, the above-mentioned execution body may perform word embedding on each input word in the above-mentioned at least one input word, obtain a word vector of each input word, and combine to obtain the above-mentioned word vector set. For another example, the above-mentioned execution body may obtain the word vector of the above-mentioned input word by searching in a predefined word vector table.
- the word vector table can be used to represent the correspondence between input words and word vectors.
- word embeddings stated above are a general term for language models and representation learning techniques in Natural Language Processing (NLP).
- NLP Natural Language Processing
- a word vector may be a vector of words or phrases mapped to real numbers by a word embedding method.
- it involves mathematical embeddings from a one-dimensional space per word to a continuous vector space with lower dimensions.
- Step 203 based on the above word vector set, generate an input text vector.
- the above-mentioned execution body may generate the above-mentioned input text vector by means of summation.
- the above-mentioned execution body may use an accumulation method to add word vectors in the above-mentioned word vector set to generate the above-mentioned input text vector.
- the above-mentioned execution body may use an averaging method to add the word vectors in the above-mentioned word vector set, and then obtain an average value to generate the above-mentioned input text vector.
- Step 204 based on the input text vector and the user vector, generate prediction information for predicting the user's intention.
- the execution body may perform a dot product on the input text vector and the user vector to obtain a dot product result.
- the above-mentioned execution body may obtain the user vector by searching according to the user's account information in a predefined correspondence table between user account information and user vector.
- the user vector may be a vector used to represent the user's historical operations.
- the user vector may be a vector representing the history of whether the user clicked on the pop-up GIF image.
- the dot product result can be processed by the activation function to get the dot product score.
- the activation function can be a sigmoid function, which can be used to map the data to the (0,1) interval.
- the score can be expressed in various forms, for example it can be represented by a probability.
- the dot product of vectors can also be called the inner product or quantity product of vectors.
- Dot multiplication can be done by multiplying the corresponding bits of two vectors one by one and then summing them up. The result of the dot multiplication is a scalar.
- the user vector is obtained based on user history information.
- the user history record information may be the history operation record information of whether the user clicks on the pop-up image.
- the above-mentioned execution body may also use a normalization method to process the dot product result to obtain a dot product score. Normalization methods can be used to convert data to decimals between (0,1).
- the above-mentioned executive body may compare the obtained dot product score with a preset threshold to obtain a comparison result. According to the above comparison result, prediction information for predicting the user's intention is generated.
- the prediction information may be a literal expression of the above comparison result.
- the preset threshold may be a preset score value used to determine whether the above-mentioned point product score meets the requirement.
- the obtained dot product score may be "0.8 points", and the preset threshold may be "0.6 points".
- the above-mentioned executive body may compare the above-mentioned point product score with the above-mentioned preset threshold, and obtain a comparison result "the above-mentioned point product score is greater than the above-mentioned preset threshold”. Then, the above-mentioned execution body can generate the prediction information "The user may need to pop up the GIF image".
- the above-mentioned execution body may generate prediction information "The user may need to pop up a GIF image" according to the comparison result.
- the above-mentioned executive body displays the image 302 .
- the above-mentioned execution subject may send the image 302 as sending information.
- the above-mentioned execution body may generate prediction information "The user may not need to pop up the GIF image" according to the comparison result. As a result, the above-mentioned executive body does not display an image.
- the above-mentioned execution body may send the information input by the user in the input box 301 .
- the above-mentioned method further includes: determining whether to pop up an image according to the above-mentioned prediction information for predicting the user's intention; in response to determining the pop-up image, selecting at least one image from the image database as a pop-up images to obtain a pop-up image set; based on the above-mentioned user historical operation record information, sort the pop-up images in the above-mentioned pop-up image set to obtain a pop-up image sequence; select a predetermined number of pop-up images from the above-mentioned pop-up image sequence; A pop-up image is displayed on the target interface.
- selecting at least one image from the image database as the pop-up image to obtain the pop-up image set includes: in response to determining the pop-up image, obtaining the pop-up image in the image database The feature vector of each image is obtained to obtain a feature vector set; the correlation between each feature vector in the above-mentioned feature vector set and the above-mentioned input text vector is determined to obtain a correlation set; based on the above-mentioned correlation set, from the above image database, select The images whose correlation degree is greater than the preset threshold are regarded as pop-up images, and a set of pop-up images is obtained.
- the prediction information for predicting the user's intention may be "the user may need to pop up a GIF image". Then, the above-mentioned execution body may determine that an image (eg, a GIF image) is to be popped up. Then, the above-mentioned executive body can obtain the feature vector of each image in the image database.
- the image database includes at least one image and a feature vector corresponding to the image.
- the above-mentioned correlation degree may be a score used to characterize the existence of correlation between the feature vector and the input text vector.
- the above-mentioned executive body can obtain the correlation between each feature vector and the input text vector through algorithm calculation, and can also obtain the correlation between each feature vector and the input text vector by using a pre-trained correlation model. Afterwards, the above-mentioned execution body may select an image whose correlation degree is greater than a preset threshold from the image database as a pop-up image to obtain a pop-up image set.
- the above-mentioned user historical operation record information may include whether the user has clicked on the pop-up image, and may also include the number of times the user has clicked on the clicked pop-up image. Therefore, the above-mentioned execution body can sort the pop-up image set based on the value of the number of clicks from large to small to obtain a pop-up image sequence. Finally, the above-mentioned executive body may select a predetermined number of pop-up images from the obtained pop-up image sequence, and display them on the target interface.
- the above-mentioned execution body may input the above-mentioned input text vector and the above-mentioned user vector into a pre-trained prediction information generation model to obtain prediction information.
- the above-mentioned execution body can generate the above-mentioned prediction information generation model through the following steps: the first step is to obtain a training sample set, wherein the training samples include the sample input text vector, the sample user vector and the sample prediction information; the second step, from the above-mentioned training sample set.
- the sample input text vector and the sample user vector in the training samples of the training sample set are input into the initial model;
- the fourth step the output prediction information is compared with the above sample prediction information to obtain the information loss
- the fifth step is to compare the above-mentioned information loss value with the preset threshold to obtain a comparison result;
- the sixth step is to determine whether the training of the above-mentioned initial model is completed according to the comparison result;
- the seventh step in response to the completion of the above-mentioned initial model training, the The above-mentioned initial model is determined as a predictive information generation model.
- an optimization method of gradient descent is used in the training process of the prediction information generation model to reduce the information loss value.
- the above-mentioned execution body may obtain the user vector through the following steps: first, the above-mentioned execution body may obtain the user's account information; second, the above-mentioned execution body may, according to the user's account information, The user's historical operation record information is retrieved from the database, wherein the above-mentioned database includes the user's account information and the historical operation record information corresponding to the account information; in the third step, the above-mentioned execution body can perform a wording on the user's historical operation record information. Embed to obtain the historical operation record information vector; in the fourth step, the above-mentioned execution subject may determine the obtained historical operation record information vector as the user vector of the user.
- the above-mentioned sample prediction information may be sample information used to represent whether the user clicks on the pop-up image.
- the sample prediction information may be "0" or "1". Wherein, when the sample prediction information is "0", it may indicate that "the user has not clicked on the pop-up image", and when the sample prediction information is "1", it may indicate that "the user has clicked on the pop-up image".
- the information loss value stated above may be a value obtained by taking the above output prediction information and corresponding sample prediction information as parameters and inputting the executed loss function.
- a loss function (such as a squared loss function, an exponential loss function, etc.) is usually used to estimate the predicted value of the model (such as the above-mentioned sample feature corresponding to the sample sampling frame) and the real value (such as the multiple sample samples obtained through the above steps).
- the smaller the loss function the better the robustness of the model.
- the loss function can be set according to actual needs.
- the loss function may be a cross entropy loss function (Cross Entropy).
- the above-mentioned initial model may be untrained, or a model that fails to meet the preset condition after training.
- the above-mentioned initial model may also be a model with a deep neural network structure.
- the pre-trained feature extraction model may be a pre-trained neural network model for feature extraction.
- the neural network model can have various existing neural network structures.
- the neural network structure may be a Convolutional Neural Network (CNN).
- CNN Convolutional Neural Network
- the above method further includes: in response to determining that the training of the initial model is not completed, adjusting relevant parameters in the initial model, and reselecting samples from the training sample set, using the adjusted initial model The model is used as the initial model, and the above training steps are continued.
- the above-mentioned training sample set is updated by the following steps: acquiring a user-related information set, wherein the user-related information in the above-mentioned user-related information set includes: an input text vector, a user vector and prediction information, wherein the prediction information is not obtained through prediction by the prediction information generation model; based on a preset ratio, data augmentation is performed on the user-related information set to obtain an augmented user-related information set; the augmented user-related information set is obtained; The relevant information set is added to the above training sample set to generate an updated training sample set.
- performing data augmentation on the above-mentioned user-related information set may be based on a preset ratio, repeatedly sampling user-related information in the above-mentioned user-related information set, to obtain an augmented user-related information set.
- the user-related information in the user-related information set is used to determine the user's intention through the predictive information generation model, then in the new data
- the user-related information obtained during the accumulation process will be doped with the results of model interference.
- a preset proportion for example, 90%
- the remaining for example, the remaining ten percent
- the user-related information is expanded to the proportion of the full amount by means of repeated sampling.
- the above-mentioned execution body may update the training sample set of the prediction information generation model according to a preset period.
- One of the above-mentioned embodiments of the present disclosure has the following beneficial effects: generating an input text vector by generating a word vector of an input word. It can avoid the situation that directly generating the input text vector is easy to cause errors. Then, based on the input text vector and the user vector, prediction information for estimating the user's demand intention is generated. Because, the user vector is obtained based on the user history information. Therefore, the user vector can reflect the user's historical behavior. Therefore, the generated prediction information is also more in line with user needs. Thus, a method for judging the user's demand intention according to the user vector and the input text vector is provided, which helps to reduce the pop-up of unnecessary information. It is possible to avoid disturbing the user, thereby improving the user experience.
- the method for generating prediction information includes the following steps:
- Step 501 acquiring at least one input word.
- Step 502 Generate a word vector for each input word in the at least one input word, and obtain a word vector set.
- steps 501-502 for the specific implementation of steps 501-502 and the technical effects brought about, reference may be made to steps 201-202 in those embodiments corresponding to FIG. 2, and details are not repeated here.
- Step 503 obtaining a user vector.
- the above-mentioned execution body can obtain the user vector in various ways.
- the above-mentioned execution body can obtain the user vector from the local database.
- the above-mentioned executive body may be connected to other electronic devices through a wired connection or a wireless connection, thereby acquiring the user vector.
- Step 504 Input the above user vector into the pre-trained fully connected network to obtain a new user vector.
- the above-mentioned execution body may input the above-mentioned user vector into a pre-trained fully connected network to obtain a new user vector.
- the above pre-trained fully connected network has nonlinear capability and can extract more user features.
- Step 505 Do a dot product of each word vector in the above-mentioned word vector set and the above-mentioned new user vector to generate a score, and obtain a score group.
- the above-mentioned execution body may perform dot product on each word vector in the above-mentioned word vector set and the above-mentioned new user vector respectively.
- Each of the obtained dot multiplication results can be processed by a normalization method to obtain the scores of the above-mentioned dot multiplication results, and combined to obtain a score group.
- the score can be used to characterize the weight of the word vector.
- normalization methods can be used to convert the data to decimals between [0, 1].
- Step 506 based on the above-mentioned word vector set and the above-mentioned score group, generate an input text vector.
- the above-mentioned execution body may firstly use the corresponding score of each word vector in the above-mentioned word vector set in the above-mentioned score group as the weight of the word vector. After that, the above-mentioned executive body may multiply each word vector in the above-mentioned word vector set by the weight corresponding to the word vector to obtain a multiplication result. Then, the above-mentioned execution body can add the obtained multiplication results to obtain the input text vector.
- the set of word vectors may be "[A(1, 2, 3), B(6, 9, 8), C(3, 4, 7)]" and the score group may be "[A-0.4, B -0.8, C-0.1]".
- the above executive body can multiply each word vector in the above word vector set by the score (weight) corresponding to the word vector, and the multiplication results are obtained as "(1, 2, 3)*0.4", “(6, 9” , 8)*0.8" and "(3,4,7)*0.1".
- the above execution body can add and sum the obtained multiplication results to obtain the input text vector "[0.4(1,2,3)+0.8(6,9,8)+0.1(3,4,7)]".
- Step 507 Do the dot product between the input text vector and the new user vector to obtain a dot product score.
- the execution body may perform a dot product on the input text vector and the new user vector to obtain a dot product result. Then, the normalization method is used to process the above dot product result to obtain the above dot product score.
- Step 508 generating prediction information for predicting the user's intention according to the obtained point product score.
- step 508 for the specific implementation of step 508 and the technical effect brought about, reference may be made to step 204 in those embodiments corresponding to FIG. 2 , and details are not repeated here.
- the computing device 101 may acquire the input word 602 and the input word 603 .
- the acquisition of the input word 103 and the input word 104 may be obtained by segmenting the input text 601 .
- the above word segmentation can also be performed by another computing device on the input text 601 , and then the computing device directly obtains the word segmentation result, input word 602 and input word 603 .
- the computing device 101 may generate a word vector 604 for the input word 602 and a word vector 605 for the input word 603 .
- computing device 101 may obtain user vector 607 .
- the computing device 101 may then input the user vector 607 into the pre-trained fully connected network 608 to obtain a new user vector 609 . Then, the computing device 101 may perform a dot product on the word vector 604 and the word vector 605 and the above-mentioned new user vector 609 to generate a score to obtain a (dot product) score group 610 . Afterwards, the computing device 101 may generate an input text vector 611 based on the word vector 604 , the word vector 605 , and the above-described (dot-multiply) score group 610 .
- the computing device 101 may perform a dot product on the input text vector 611 and the above-mentioned new user vector 609 to obtain a dot product score 612 . Finally, computing device 101 may generate prediction information 613 based on the resulting dot product score 612.
- FIG. 6 is merely illustrative. There may be any number of computing devices depending on implementation needs.
- a word vector of an input word is generated to obtain a word vector set.
- the optimized new user vector can be obtained by passing the user vector through the fully connected network. Then, the new user vector is dot-multiplied with each word vector in the set of word vectors, resulting in a score group to generate the input text vector. Then, the input text vector is dot-multiplied with the new user vector, and the dot-multiply score can be obtained. The accuracy of the dot product score can be improved based on two dot products with the new user vector. Finally, according to the points multiplied by the scores, prediction information is generated.
- a method for predicting the user's demand intention based on the user vector and the dot product of the user vector and the input text vector is provided, which helps to reduce the pop-up of unnecessary information. It can avoid disturbing the user, thereby improving the user experience.
- the present disclosure provides some embodiments of an apparatus for generating prediction information, and these apparatus embodiments correspond to the above-mentioned method embodiments in FIG. 2 .
- the device can be specifically applied to various electronic devices.
- the apparatus 700 for generating prediction information in some embodiments includes: an obtaining unit 701 , a word vector generating unit 702 , an input text vector generating unit 703 , and a generating unit 704 .
- the obtaining unit 701 is configured to obtain at least one input word, wherein the at least one input word is obtained by segmenting the target input text;
- the word vector generating unit 702 is configured to generate each input word in the at least one input word
- the word vector of obtains the word vector set;
- the input text vector generating unit 703 is configured to generate the input text vector based on the above-mentioned word vector set; Predictive information about user intent.
- the input text vector generating unit 703 of the apparatus 700 for generating prediction information is further configured to: sum the word vectors in the above word vector set to obtain the above input text vector.
- the input text vector generating unit 703 of the apparatus 700 for generating prediction information is further configured to: obtain a user vector; based on the above-mentioned word vector set, the above-mentioned user vector and the attention mechanism network to obtain the above input text vector.
- the input text vector generating unit 703 of the apparatus 700 for generating prediction information is further configured to: input the above-mentioned user vector into a pre-trained fully connected network to obtain a new user vector; input the above-mentioned word vector set and the above-mentioned new user vector into the above-mentioned attention mechanism network to obtain the above-mentioned input text vector.
- the input text vector generating unit 703 of the apparatus 700 for generating prediction information is further configured to: perform a dot product on each word vector in the above-mentioned word vector set and the above-mentioned user vector , generate a score, and obtain a score group; based on the above-mentioned word vector set and the above-mentioned score group, the above-mentioned input text vector is obtained.
- the generating unit 704 of the apparatus 700 for generating prediction information is further configured to: perform a dot product on the above-mentioned input text vector and the above-mentioned new user vector to obtain a dot product score; Based on the above-mentioned dot product scores, prediction information is generated.
- the generating unit 703 of the apparatus 700 for generating prediction information is further configured to: input the above-mentioned input text vector and the above-mentioned user vector into a pre-trained prediction information generation model to obtain Prediction information, wherein the above-mentioned prediction information generation model is obtained by training a training sample set.
- the training samples in the above-mentioned training sample set include a sample input text vector, a sample user vector and sample prediction information, and the above-mentioned prediction information generation model is based on the above-mentioned sample input text vector and the above-mentioned sample.
- the user vector is used as input, and the above-mentioned sample prediction information is used as the expected output for training.
- the above-mentioned training sample set is updated by the following steps: acquiring a user-related information set, wherein the user-related information in the above-mentioned user-related information set includes: an input text vector, a user vector and prediction information, wherein the prediction information is not obtained through prediction by the prediction information generation model; based on a preset ratio, data augmentation is performed on the user-related information set to obtain an augmented user-related information set; the augmented user-related information set is obtained; The relevant information set is added to the above training sample set to generate an updated training sample set.
- the above-mentioned user history record information includes historical operation record information of whether the user clicks on the pop-up image.
- selecting at least one image from the image database as the pop-up image to obtain a pop-up image set including: in response to determining the pop-up image, acquiring the above image database The feature vector of each image in the above-mentioned feature vector set is obtained, and the feature vector set is obtained; the correlation degree between each feature vector in the above-mentioned feature vector set and the above-mentioned input text vector is determined, and the correlation degree set is obtained; based on the above-mentioned correlation degree set, select from the above-mentioned image database An image with a degree of correlation greater than a preset threshold is taken as a pop-up image, and a pop-up image set is obtained.
- the units recorded in the apparatus 700 correspond to the respective steps in the method described with reference to FIG. 2 . Therefore, the operations, features, and beneficial effects described above with respect to the method are also applicable to the apparatus 700 and the units included therein, and details are not repeated here.
- FIG. 8 a schematic structural diagram of an electronic device (eg, the computing device in FIG. 1 ) 800 suitable for implementing some embodiments of the present disclosure is shown.
- the server shown in FIG. 8 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
- an electronic device 800 may include a processing device (eg, a central processing unit, a graphics processor, etc.) 801 that may be loaded into random access according to a program stored in a read only memory (ROM) 802 or from a storage device 808 Various appropriate actions and processes are executed by the programs in the memory (RAM) 803 . In the RAM 803, various programs and data necessary for the operation of the electronic device 800 are also stored.
- the processing device 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804.
- An input/output (I/O) interface 805 is also connected to bus 804 .
- the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration An output device 807 of a computer, etc.; a storage device 808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 809. Communication means 809 may allow electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While FIG. 8 shows an electronic device 800 having various means, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in FIG. 8 can represent one device, and can also represent multiple devices as required.
- input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.
- LCD liquid crystal display
- speakers vibration
- the processes described above with reference to the flowcharts may be implemented as computer software programs.
- some embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
- the computer program may be downloaded and installed from the network via the communication device 809, or from the storage device 808, or from the ROM 802.
- the processing device 801 When the computer program is executed by the processing device 801, the above-mentioned functions defined in the methods of some embodiments of the present disclosure are performed.
- the computer-readable medium described above may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the foregoing two.
- the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above.
- a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
- a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein.
- Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
- a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
- Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.
- the client and server can communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and can communicate with digital data in any form or medium Communication (eg, a communication network) interconnects.
- HTTP HyperText Transfer Protocol
- Examples of communication networks include local area networks (“LAN”), wide area networks (“WAN”), the Internet (eg, the Internet), and peer-to-peer networks (eg, ad hoc peer-to-peer networks), as well as any currently known or future development network of.
- the above-mentioned computer-readable medium may be included in the above-mentioned apparatus; or may exist alone without being assembled into the electronic device.
- the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to: acquire at least one input word, wherein the at least one input word is a target input text Obtained by word segmentation; generating a word vector for each input word in at least one input word, and obtaining a word vector set; based on the above word vector set, generating an input text vector; forecast information.
- Computer program code for carrying out operations of some embodiments of the present disclosure may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, or a combination thereof, Also included are conventional procedural programming languages - such as the "C" language or similar programming languages.
- the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
- the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider to via Internet connection).
- LAN local area network
- WAN wide area network
- each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions.
- the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
- each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
- the units described in some embodiments of the present disclosure may be implemented by means of software, and may also be implemented by means of hardware.
- the described unit can also be set in the processor, for example, it can be described as: a processor includes an acquisition unit, a word vector generation unit, an input text vector generation unit and a generation unit. Wherein, the names of these units do not constitute a limitation on the unit itself under certain circumstances, for example, the acquiring unit may also be described as "a unit for acquiring at least one input word".
- exemplary types of hardware logic components include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chips (SOCs), Complex Programmable Logical Devices (CPLDs) and more.
- FPGAs Field Programmable Gate Arrays
- ASICs Application Specific Integrated Circuits
- ASSPs Application Specific Standard Products
- SOCs Systems on Chips
- CPLDs Complex Programmable Logical Devices
- a method for generating predictions comprising: acquiring at least one input word, wherein the at least one input word is obtained by segmenting target input text; generating at least one input word A word vector of each input word in the input word is input to obtain a word vector set; based on the above word vector set, an input text vector is generated; based on the above input text vector and user vector, prediction information for predicting user intent is generated.
- generating the input text vector based on the above-mentioned word vector set includes: summing the word vectors in the above-mentioned word vector set to obtain the above-mentioned input text vector.
- generating the input text vector based on the word vector set includes: obtaining a user vector; and obtaining the input text vector based on the word vector set, the user vector and the attention mechanism network.
- obtaining the above-mentioned input text vector based on the above-mentioned word vector set, the above-mentioned user vector and the attention mechanism network includes: inputting the above-mentioned user vector into a pre-trained fully connected network to obtain a new The above-mentioned word vector set and the above-mentioned new user vector are input into the above-mentioned attention mechanism network, and the above-mentioned input text vector is obtained.
- the above-mentioned inputting the above-mentioned word vector set and the above-mentioned new user vector into the above-mentioned attention mechanism network, to obtain the above-mentioned input text vector includes: combining each word vector in the above-mentioned word vector set with The above-mentioned user vector is dot-multiplied to generate a score, and a score group is obtained; based on the above-mentioned word vector set and the above-mentioned score group, the above-mentioned input text vector is generated.
- generating the prediction information based on the input text vector and the user vector includes: performing a dot product on the input text vector and the new user vector to obtain a dot product score; Multiply the score to generate predictive information.
- generating the prediction information based on the input text vector and the user vector includes: inputting the input text vector and the user vector into a pre-trained prediction information generation model to obtain prediction information, wherein, the above-mentioned prediction information generation model is obtained by training a training sample set.
- the training samples in the training sample set include a sample input text vector, a sample user vector, and sample prediction information
- the prediction information generation model is based on the sample input text vector and the sample user vector.
- the above-mentioned sample prediction information is used as the desired output for training.
- the above-mentioned training sample set is updated by the following steps: obtaining a user-related information set, wherein the user-related information in the above-mentioned user-related information set includes: an input text vector, a user vector and a prediction information, wherein the above-mentioned prediction information is not obtained through prediction by the above-mentioned prediction information generation model; based on a preset ratio, data augmentation is performed on the above-mentioned user-related information set to obtain an augmented user-related information set; the above-mentioned augmented user-related information The set is added to the above training sample set to generate an updated training sample set.
- the above-mentioned user history record information includes historical operation record information of whether the user clicks on the pop-up image.
- the above-mentioned method further includes: determining whether to pop up an image according to the above-mentioned prediction information for predicting the user's intention; and in response to determining the pop-up image, selecting at least one image from the image database as the pop-up image , obtain a pop-up image set; based on the above-mentioned user historical operation record information, sort the pop-up images in the above-mentioned pop-up image set to obtain a pop-up image sequence; select a predetermined number of pop-up images from the above-mentioned pop-up image sequence; The image is displayed on the target screen.
- the above-mentioned selecting at least one image from the image database as the pop-up image in response to determining the pop-up image to obtain the pop-up image set includes: in response to determining the pop-up image, obtaining each image in the image database The feature vector of the image is obtained to obtain a feature vector set; the correlation between each feature vector in the above-mentioned feature vector set and the above-mentioned input text vector is determined to obtain a correlation set; based on the above-mentioned correlation set, the correlation is selected from the above-mentioned image database Images larger than the preset threshold are regarded as pop-up images, and a set of pop-up images is obtained.
- an apparatus for generating prediction information comprising: an obtaining unit configured to obtain at least one input word, wherein the at least one input word is a word segmentation; word vector generation unit, configured to generate a word vector for each input word in at least one input word, to obtain a word vector set; input text vector generation unit, configured to generate an input text vector based on the above word vector set a generating unit configured to generate prediction information for predicting the user's intention based on the input text vector and the user vector.
- an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, when the one or more programs are stored by one or more The execution of the processor causes one or more processors to implement a method as described in any of the above embodiments.
- a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the foregoing embodiments.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Mining & Analysis (AREA)
- Probability & Statistics with Applications (AREA)
- Multimedia (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Machine Translation (AREA)
- User Interface Of Digital Computer (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本公开的实施例公开了用于生成预测信息的方法、装置、电子设备和介质。该方法的一具体实施方式包括:获取至少一个输入单词;生成至少一个输入单词中每个输入单词的词向量,得到词向量集合,其中,上述至少一个输入单词是对目标输入文本进行分词得到的;基于上述词向量集合,生成输入文本向量;基于上述输入文本向量和用户向量,生成用于预测用户意图的预测信息,其中,上述用户向量是基于用户历史记录信息得到的。该实施方式生成了用于预测用户意图的预测信息,从而减少了不必要信息的弹出。可以避免对用户产生打扰,从而提高了用户体验。
Description
相关申请的交叉引用
本申请基于申请号为202010797886.2、申请日为2020年08月10日,名称为“用于生成预测信息的方法、装置、电子设备和介质”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。
本公开的实施例涉及计算机技术领域,具体涉及用于生成预测信息的方法、装置、电子设备和介质。
随着互联网时代的发展,人们经常使用电子设备来输入信息以便进行交流,输入信息一般为文字信息。为了使得输入信息的表达更为丰富和直观,也经常会使用与文字信息相关的GIF(Graphics Interchange Format)图像。为了提升用户体验,可以采用自动弹出GIF图像的方式。例如,在用户使用私信对话时,输入文本信息后可以自动弹出GIF图像。但是,过于频繁的弹出GIF图像也会对用户产生打扰,影响用户体验。
发明内容
本公开的内容部分用于以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。本公开的内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。
本公开的一些实施例提出了用于生成预测信息的方法、装置、电子设备和介质,来解决以上背景技术部分提到的技术问题。
第一方面,本公开的一些实施例提供了一种用于生成预测信息的 方法,该方法包括:获取至少一个输入单词,其中,上述至少一个输入单词是对目标输入文本进行分词得到的;生成至少一个输入单词中每个输入单词的词向量(word vector),得到词向量集合;基于上述词向量集合,生成输入文本向量;基于上述输入文本向量和用户向量,生成用于预测用户意图的预测信息。
第二方面,本公开的一些实施例提供了一种用于生成预测信息的装置,装置包括:获取单元,被配置成获取至少一个输入单词,其中,上述至少一个输入单词是对目标输入文本进行分词得到的;词向量生成单元,被配置成生成至少一个输入单词中每个输入单词的词向量,得到词向量集合,其中,上述至少一个输入单词是对目标输入文本进行分词得到的;输入文本向量生成单元,被配置成基于上述词向量集合,生成输入文本向量;生成单元,被配置成基于上述输入文本向量和用户向量,生成用于预测用户意图的预测信息。
第三方面,本公开的一些实施例提供了一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如第一方面中所描述的方法。
第四方面,本公开的一些实施例提供了一种计算机可读介质,其上存储有计算机程序,其中,程序被处理器执行时实现如第一方面中所描述的方法。
本公开的上述各个实施例中的一个实施例具有如下有益效果:通过生成输入单词的词向量,来生成输入文本向量。可以避免直接生成输入文本向量容易造成误差的情况。然后,基于输入文本向量和用户向量,来生成用于预估用户的需求意图的预测信息。由于,用户向量是基于用户历史记录信息得到的。所以,用户向量可以反映用户的历史行为。从而,生成的预测信息也更加符合用户需求。由此,提供了一种根据根据用户向量与输入文本向量来判断用户的需求意图的方法。通过在向用户弹出GIF图像之前,先对用户的需求意图进行预测,从而减少不必要信息的弹出,避免对用户产生打扰,从而,提高了用户体验。
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。
图1是根据本公开的一些实施例的用于生成预测信息的方法的一个应用场景的示意图;
图2是根据本公开的用于生成预测信息的方法的一些实施例的流程图;
图3是根据本公开的一些实施例的用于生成预测信息的方法的一个应用场景的示意图;
图4是根据本公开的一些实施例的用于生成预测信息的方法的一个应用场景的示意图;
图5是根据本公开的用于生成预测信息的方法的另一些实施例的流程图;
图6是根据本公开的另一些实施例的用于生成预测信息的方法的一个应用场景的示意图;
图7是根据本公开的用于生成预测信息的装置的一些实施例的结构示意图;
图8是适于用来实现本公开的一些实施例的电子设备的结构示意图。
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例。相反,提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
下面将参考附图并结合实施例来详细说明本公开。
图1是根据本公开一些实施例的用于生成预测信息的方法的一个应用场景的示意图。
如图1所示,计算设备101可以获取输入单词103和输入单词104。其中,获取输入单词103和输入单词104可以是对输入文本102进行分词得到的。当然,上述分词也可以是别的计算设备对输入文本102进行,然后计算设备直接拿到分词结果,输入单词103和输入单词104。之后,计算设备101可以生成输入单词103的词向量105和输入单词104的词向量106。基于生成的词向量105和词向量106,可以生成输入文本向量107。计算设备101可以基于生成的输入文本向量107和用户向量108,生成预测信息110。
需要说明的是,上述计算设备101可以是硬件,也可以是软件。当计算设备为硬件时,可以实现成多个服务器或终端设备组成的分布式集群,也可以实现成单个服务器或单个终端设备。当计算设备体现为软件时,可以实现成例如用来提供分布式服务的多个软件或软件模块,也可以实现成单个软件或软件模块。在此不做具体限定。
应该理解,图1中的计算设备的数目仅仅是示意性的。根据实现需要,可以具有任意数目的计算设备。
继续参考图2,示出了根据本公开的用于生成预测信息的方法的一些实施例的流程200。该用于生成预测信息的方法,包括以下步骤:
步骤201,获取至少一个输入单词。
在一些实施例中,用于生成预测信息的方法的执行主体(如图1所示的计算设备101)可以通过有线连接方式或无线连接方式获取上述至少一个输入单词。上述至少一个输入单词可以对目标输入文本进行分词得到的单词。例如,上述执行主体可以接收用户输入的输入文本作为目标输入文本。然后,对接收的目标输入文本进行分词处理得到至少一个输入单词。又例如,上述执行主体可以接收用户输入的输入单词作为上述至少一个输入单词。
需要指出的是,上述无线连接方式可以包括但不限于3G/4G连接、WiFi连接、蓝牙连接、WiMAX连接、Zigbee连接、UWB(ultra wideband)连接、以及其他现在已知或将来开发的无线连接方式。
步骤202,生成至少一个输入单词中每个输入单词的词向量,得到词向量集合。
在一些实施例中,上述执行主体可以通过多种方式生成输入单词的词向量。例如,上述执行主体可以对上述至少一个输入单词中每个输入单词进行词嵌入,得到每个输入单词的词向量,组合得到上述词向量集合。又例如,上述执行主体可以在预先定义的单词向量表中通过查找的方式,得到上述输入单词的词向量。这里,单词向量表可以用于表示输入单词与词向量之间的对应关系。
上文陈述的词嵌入是自然语言处理(Natural Language Processing,NLP)中语言模型与表征学习技术的统称。概念上而言,它是指把一个维数为所有词的数量的高维空间嵌入到一个维数低得多的连续向量空间中,每个单词或词组被映射为实数域上的向量。具体地,词向量可以是单词或短语通过词嵌入方法被映射到实数的向量。从概念上讲,它涉及从每个单词一维的空间到具有更低维度的连续向量空间的数学嵌入。
步骤203,基于上述词向量集合,生成输入文本向量。
在一些实施例中,上述执行主体可以通过求和的方式生成上述输入文本向量。作为示例,上述执行主体可以利用累加法将上述词向量集合中的词向量相加,生成上述输入文本向量。作为示例,上述执行主体可以利用平均法将上述词向量集合中的词向量相加再求平均值,生成上述输入文本向量。
步骤204,基于上述输入文本向量和用户向量,生成用于预测用户意图的预测信息。
在一些实施例中,上述执行主体可以将上述输入文本向量与上述用户向量进行点乘,得到点乘结果。上述执行主体可以通过在预先定义的用户账号信息与用户向量的对应关系表中根据用户的账号信息进行查找来得到用户向量。这里,用户向量可以是用于表示用户历史操作的向量。作为示例,用户向量可以是用于表示用户对弹出的GIF图像是否点击的历史记录的向量。对点乘结果,可以利用激活函数处理,得到点乘得分。这里,激活函数可以是Sigmoid函数,可以用于把数据映射至(0,1)区间。得分可以有多种表达形式,例如其可以由概率来表示。这里,向量的点乘也可以称为向量的内积、数量积。点乘可以是对两个向量对应位一一相乘之后再求和,点乘的结果是标量。
在一些实施例的一些可选的实现方式中,用户向量是基于用户历史记录信息得到的。用户历史记录信息可以是用户对弹出的图像是否进行了点击的历史操作记录信息。
可选的,上述执行主体也可以利用归一化方法对点乘结果进行处理,得到点乘得分。归一化方法可以用于把数据转变为(0,1)之间的小数。
在一些实施例中,上述执行主体可以对所得到的点乘得分与预设阈值进行比较,得到比较结果。再根据上述比较结果,生成用于预测用户意图的预测信息。预测信息可以是上述比较结果的文字表达。这里,预设阈值可以是预先设定的用于确定上述点乘得分是否满足需求的分数值。
作为示例,所得到的点乘得分可以是“0.8分”,预设阈值可以是“0.6分”。上述执行主体可以将上述点乘得分和上述预设阈值进行比 较,得到比较结果“上述点乘得分大于上述预设阈值”。那么,上述执行主体可以生成预测信息“用户可能需要弹出GIF图像”。
作为示例,在图3的应用场景中,用户接收消息后,在输入框301输入信息“喵”时,所得到的点乘得分可以是“0.9分”,预设阈值可以是“0.6分”。那么,上述执行主体可以根据比较结果,生成预测信息“用户可能需要弹出GIF图像”。由此,上述执行主体显示图像302。可选的,用户点击图像302时,上述执行主体可以将图像302作为发送信息发送。在图4的应用场景中,用户接收消息后,在输入框301输入信息“都喜欢”时,所得到的点乘得分可以是“0.3分”。那么,上述执行主体可以根据比较结果,生成预测信息“用户可能不需要弹出GIF图像”。由此,上述执行主体不显示图像。可选的,用户点击发送按钮303时,上述执行主体可以将用户在输入框301中输入的信息发送。
在一些实施例的一些可选的实现方式中,上述方法还包括:根据上述用于预测用户意图的预测信息,确定是否弹出图像;响应于确定弹出图像,从图像数据库中选择出至少一个图像作为弹出图像,得到弹出图像集合;基于上述用户历史操作记录信息,对上述弹出图像集合中的弹出图像进行排序,得到弹出图像序列;从上述弹出图像序列中选择预定数目个弹出图像;将上述预定数目个弹出图像显示至目标界面上。
在一些实施例的一些可选的实现方式中,上述响应于确定弹出图像,从图像数据库中选择出至少一个图像作为弹出图像,得到弹出图像集合,包括:响应于确定弹出图像,获取图像数据库中每个图像的特征向量,得到特征向量集合;确定上述特征向量集合中的每个特征向量与上述输入文本向量的相关度,得到相关度集合;基于上述相关度集合,从上述图像数据库中选择出相关度大于预设阈值的图像作为弹出图像,得到弹出图像集合。
作为示例,用于预测用户意图的预测信息可以是“用户可能需要弹出GIF图像”。那么,上述执行主体可以确定要弹出图像(例如,GIF图像)。然后,上述执行主体可以获取图像数据库中每个图像的特 征向量。这里,图像数据库中包括至少一个图像和与该图像对应的特征向量。上述相关度可以是用于表征特征向量与输入文本向量之间存在相互联系的分值。上述执行主体可以通过算法计算得到每个特征向量与输入文本向量之间的相关度,也可以利用预先训练的相关度模型得到每个特征向量与输入文本向量之间的相关度。之后,上述执行主体可以从图像数据库中选择出相关度大于预设阈值的图像作为弹出图像,得到弹出图像集合。上述用户历史操作记录信息可以包括用户对弹出的图像是否进行了点击,还可以包括用户对点击过的弹出的图像的点击次数。所以,上述执行主体可以基于点击次数的数值由大到小,对弹出图像集合进行排序,得到弹出图像序列。最后,上述执行主体可以从得到的弹出图像序列中选择预定数目个弹出图像,将其显示至目标界面上。
在一些实施例的一些可选的实现方式中,上述执行主体可以将上述输入文本向量和上述用户向量输入至预先训练的预测信息生成模型,得到预测信息。上述执行主体可以通过如下步骤生成上述预测信息生成模型:第一步,获取训练样本集合,其中,训练样本包括样本输入文本向量,样本用户向量和样本预测信息;第二步,从上述训练样本集合中选取训练样本;第三步,将训练样本集合的训练样本中的样本输入文本向量和样本用户向量输入初始模型;第四步,将输出的预测信息与上述样本预测信息进行比较,得到信息损失值;第五步,将上述信息损失值与预设阈值进行比较,得到比较结果;第六步,根据比较结果确定上述初始模型是否训练完成;第七步,响应于上述初始模型训练完成,将上述初始模型确定为预测信息生成模型。
在一些实施例的一些可选的实现方式中,在预测信息生成模型的训练过程中采用了梯度下降的优化方式来降低信息损失值。
在一些实施例的一些可选的实现方式中,上述执行主体可以通过如下步骤得到用户向量:第一,上述执行主体可以获取用户的账号信息;第二,上述执行主体可以根据用户的账号信息,从数据库中检索出用户的历史操作记录信息,其中,上述数据库中包括用户的账号信息和与账号信息对应的历史操作记录信息;第三步,上述执行主体可 以对用户的历史操作记录信息进行词嵌入,得到历史操作记录信息向量;第四步,上述执行主体可以将得到的历史操作记录信息向量确定为该用户的用户向量。
在一些实施例的一些可选的实现方式中,上述样本预测信息可以是用于表征用户对弹出的图像是否进行了点击的样本信息。作为示例,样本预测信息可以是“0”,也可以是“1”。其中,样本预测信息为“0”时可以表示“用户没有对弹出的图像进行点击”,样本预测信息为“1”时可以表示“用户对弹出的图像进行了点击”。
上文陈述的信息损失值可以是将上述输出的预测信息与对应的样本预测信息作为参数,输入执行的损失函数中得到的值。这里,损失函数(例如平方损失函数、指数损失函数等)通常是用来估量模型的预测值(例如该样本采样帧对应的上述样本特征)与真实值(例如通过上述步骤得到的多个样本采样帧中的每个采样帧所对应的样本特征)的不一致程度。它是一个非负实值函数。一般情况下,损失函数越小,模型的鲁棒性就越好。损失函数可以根据实际需求来设置。作为示例,损失函数可以是交叉熵损失函数(Cross Entropy)。
在这里,上述初始模型可以是未经训练,或者训练后未达到预设条件的模型。上述初始模型也可以是具有深度神经网络结构的模型。预先训练的特征提取模型可以是预先训练好的用于提取特征的神经网络模型。该神经网络模型可以具有现有的各种神经网络结构。例如,神经网络结构可以是卷积神经网络(Convolutional Neural Network,CNN)。初始模型的存储位置在本公开中同样不限制。
在一些实施例的一些可选的实现方式中,上述方法还包括:响应于确定初始模型未训练完成,调整初始模型中的相关参数,以及从上述训练样本集中重新选取样本,使用调整后的初始模型作为初始模型,继续执行上述训练步骤。
在一些实施例的一些可选的实现方式中,上述训练样本集合是通过以下步骤进行更新:获取用户相关信息集合,其中,上述用户相关信息集合中的用户相关信息包括:输入文本向量,用户向量和预测信息,其中,上述预测信息不是通过上述预测信息生成模型进行预测得 到的;基于预设比例,对上述用户相关信息集合进行数据扩增,得到扩增用户相关信息集合;将上述扩增用户相关信息集合加入上述训练样本集合,生成更新后的训练样本集合。
作为示例,对上述用户相关信息集合进行数据扩增可以是基于预设比例,对上述用户相关信息集合中的用户相关信息进行重复采样,得到扩增用户相关信息集合。
在一些实施例的一些可选的实现方式中,在预测信息生成模型的实际运行过程中,如果将用户相关信息集合中的用户相关信息通过预测信息生成模型来判断用户意图,那么,在新数据的积累过程中得到的用户相关信息中会掺杂模型干扰的结果。从而,导致生成的预测信息不准确。由此影响用户体验。所以,在实际运行过程中,将预设比例(例如,百分之九十)的用户相关信息通过预测信息生成模型来判断用户意图。将其余(例如,其余百分之十)的用户相关信息利用重复采样的方式,将数据量扩充到全量的比例。再用这些数据对预测信息生成模型进行下一次训练。由于本次训练使用的数据不掺杂模型干扰的结果,有利于提高预测信息生成模型的准确度。我们将这种方法称之为数据消偏。
可选的,上述执行主体可以按照预设周期对预测信息生成模型的训练样本集合进行更新。
本公开的上述各个实施例中的一个实施例具有如下有益效果:通过生成输入单词的词向量,来生成输入文本向量。可以避免直接生成输入文本向量容易造成误差的情况。然后,基于输入文本向量和用户向量,来生成用于预估用户的需求意图的预测信息。由于,用户向量是基于用户历史记录信息得到的。所以,用户向量可以反映用户的历史行为。从而,生成的预测信息也更加符合用户需求。由此,提供了一种根据根据用户向量与输入文本向量来判断用户的需求意图的方法,有助于减少不必要信息的弹出。可以避免对用户产生打扰,从而,提高了用户体验。
继续参考图5,示出了根据本公开的用于生成预测信息的方法的 另一些实施例的流程500。该用于生成预测信息的方法,包括以下步骤:
步骤501,获取至少一个输入单词。
步骤502,生成至少一个输入单词中每个输入单词的词向量,得到词向量集合。
在一些实施例中,步骤501-502的具体实现及所带来的技术效果可以参考图2对应的那些实施例中的步骤201-202,在此不再赘述。
步骤503,获取用户向量。
在一些实施例中,上述执行主体可以通过多种方式获取用户向量。例如,上述执行主体可以从本地数据库中获取用户向量。又例如,上述执行主体可以通过有线连接或无线连接的方式连接其他电子设备,从而,获取用户向量。
步骤504,将上述用户向量输入至预先训练的全连接网络,得到新的用户向量。
在一些实施例中,上述执行主体可以将上述用户向量输入至预先训练的全连接网络,得到新的用户向量。上述预先训练的全连接网络具有非线性能力,可以提取更多的用户特征。
步骤505,将上述词向量集合中每个词向量与上述新的用户向量进行点乘,生成分数,得到分数组。
在一些实施例中,上述执行主体可以将上述词向量集合中每个词向量分别与上述新的用户向量进行点乘。对得到的各个点乘结果,可以利用归一化方法处理,得到上述各个点乘结果的分数,组合得到分数组。这里,分数可以用于表征词向量的权重。这里,归一化方法可以用于把数据转变为[0,1]之间的小数。
步骤506,基于上述词向量集合和上述分数组,生成输入文本向量。
在一些实施例中,上述执行主体首先可以将上述词向量集合中的每个词向量在上述分数组中对应的分数作为该词向量的权重。之后,上述执行主体可以将上述词向量集合中的每个词向量与该词向量对应的权重相乘,得到相乘结果。然后,上述执行主体可以将得到的各个 相乘结果相加,得到输入文本向量。
作为示例,词向量集合可以是“[A(1,2,3),B(6,9,8),C(3,4,7)]”,分数组可以是“[A-0.4,B-0.8,C-0.1]”。上述执行主体可以将上述词向量集合中每个词向量与该词向量对应的分数(权重)相乘,得到相乘结果分别为“(1,2,3)*0.4”,“(6,9,8)*0.8”和“(3,4,7)*0.1”。上述执行主体可以将得到的相乘结果相加求和,得到输入文本向量“[0.4(1,2,3)+0.8(6,9,8)+0.1(3,4,7)]”。
步骤507,将上述输入文本向量与上述新的用户向量进行点乘,得到点乘得分。
在一些实施例中,上述执行主体可以将上述输入文本向量与上述新的用户向量进行点乘,得到点乘结果。再利用归一化方法对上述点乘结果进行处理,得到上述点乘得分。
步骤508,根据所得到的点乘得分,生成用于预测用户意图的预测信息。
在一些实施例中,步骤508的具体实现及所带来的技术效果可以参考图2对应的那些实施例中的步骤204,在此不再赘述。
作为示例,在图6的应用场景中,计算设备101可以获取输入单词602和输入单词603。其中,获取输入单词103和输入单词104可以是对输入文本601进行分词得到的。当然,上述分词也可以是别的计算设备对输入文本601进行,然后计算设备直接拿到分词结果,输入单词602和输入单词603。之后,计算设备101可以生成输入单词602的词向量604和输入单词603的词向量605。作为示例,计算设备101可以获取用户向量607。然后,计算设备101可以将用户向量607输入预先训练的全连接网络608,得到新的用户向量609。再然后,计算设备101可以将词向量604和词向量605与上述新的用户向量609进行点乘,生成分数,得到(点乘)分数组610。之后,计算设备101可以基于词向量604、词向量605和上述(点乘)分数组610,生成输入文本向量611。再之后,计算设备101可以将输入文本向量611和上述新的用户向量609进行点乘,得到点乘得分612。最后,计算设 备101可以根据所得到的点乘得分612生成预测信息613。
应该理解,图6中的计算设备的数目仅仅是示意性的。根据实现需要,可以具有任意数目的计算设备。
本公开的上述各个实施例中的一个实施例具有如下有益效果:首先,生成输入单词的词向量,得到词向量集合。将用户向量通过全连接网络可以得到优化后的新的用户向量。然后,将新的用户向量与词向量集合中的每个词向量进行点乘,得到分数组以生成输入文本向量。再将输入文本向量与新的用户向量进行点乘,可以得到点乘得分。基于与新的用户向量的两次点乘,可以提高点乘得分的准确性。最后,根据点乘得分,生成预测信息。由此,提供了一种基于用户向量和对用户向量与输入文本向量进行点乘,来预判用户的需求意图的方法,有助于减少不必要信息的弹出。可以避免对用户产生打扰,从而提高了用户体验。
继续参考图7,作为对上述各图上述方法的实现,本公开提供了一种用于生成预测信息的装置的一些实施例,这些装置实施例与图2上述的那些方法实施例相对应,该装置具体可以应用于各种电子设备中。
如图7所示,一些实施例的用于生成预测信息的装置700包括:获取单元701、词向量生成单元702、输入文本向量生成单元703、和生成单元704。其中,获取单元701被配置成获取至少一个输入单词,其中,上述至少一个输入单词是对目标输入文本进行分词得到的;词向量生成单元702,被配置成生成至少一个输入单词中每个输入单词的词向量,得到词向量集合;输入文本向量生成单元703,被配置成基于上述词向量集合,生成输入文本向量;生成单元704,被配置成基于上述输入文本向量和用户向量,生成用于预测用户意图的预测信息。
在一些实施例的一些可选的实现方式中,用于生成预测信息的装置700的输入文本向量生成单元703进一步被配置成:将上述词向量集合中的词向量进行求和,得到上述输入文本向量。
在一些实施例的一些可选的实现方式中,用于生成预测信息的装置700的输入文本向量生成单元703进一步被配置成:获取用户向量;基于上述词向量集合,上述用户向量和注意力机制网络,得到上述输入文本向量。
在一些实施例的一些可选的实现方式中,用于生成预测信息的装置700的输入文本向量生成单元703进一步被配置成:将上述用户向量输入至预先训练的全连接网络,得到新的用户向量;将上述词向量集合与上述新的用户向量输入至上述注意力机制网络,得到上述输入文本向量。
在一些实施例的一些可选的实现方式中,用于生成预测信息的装置700的输入文本向量生成单元703进一步被配置成:将上述词向量集合中每个词向量与上述用户向量进行点乘,生成分数,得到分数组;基于上述词向量集合和上述分数组,得到上述输入文本向量。
在一些实施例的一些可选的实现方式中,用于生成预测信息的装置700的生成单元704进一步被配置成:将上述输入文本向量与上述新的用户向量进行点乘,得到点乘得分;基于上述点乘得分,生成预测信息。
在一些实施例的一些可选的实现方式中,用于生成预测信息的装置700的生成单元703进一步被配置成:将上述输入文本向量和上述用户向量输入至预先训练的预测信息生成模型,得到预测信息,其中,上述预测信息生成模型是通过训练样本集合训练得到的。
在一些实施例的一些可选的实现方式中,上述训练样本集合中的训练样本包括样本输入文本向量,样本用户向量和样本预测信息,上述预测信息生成模型是以上述样本输入文本向量和上述样本用户向量作为输入,以上述样本预测信息用于作为期望输出训练得到的。
在一些实施例的一些可选的实现方式中,上述训练样本集合是通过以下步骤进行更新:获取用户相关信息集合,其中,上述用户相关信息集合中的用户相关信息包括:输入文本向量,用户向量和预测信息,其中,上述预测信息不是通过上述预测信息生成模型进行预测得到的;基于预设比例,对上述用户相关信息集合进行数据扩增,得到 扩增用户相关信息集合;将上述扩增用户相关信息集合加入上述训练样本集合,生成更新后的训练样本集合。
在一些实施例的一些可选的实现方式中,上述用户历史记录信息包括用户对弹出的图像是否进行了点击的历史操作记录信息。
在一些实施例的一些可选的实现方式中,上述根据上述用于预测用户意图的预测信息,确定是否弹出图像;响应于确定弹出图像,从图像数据库中选择出至少一个图像作为弹出图像,得到弹出图像集合;基于上述用户历史操作记录信息,对上述弹出图像集合中的弹出图像进行排序,得到弹出图像序列;从上述弹出图像序列中选择预定数目个弹出图像;将上述预定数目个弹出图像显示至目标界面上。
在一些实施例的一些可选的实现方式中,上述响应于确定弹出图像,从图像数据库中选择出至少一个图像作为弹出图像,得到弹出图像集合,包括:响应于确定弹出图像,获取上述图像数据库中每个图像的特征向量,得到特征向量集合;确定上述特征向量集合中的每个特征向量与上述输入文本向量的相关度,得到相关度集合;基于上述相关度集合,从上述图像数据库中选择出相关度大于预设阈值的图像作为弹出图像,得到弹出图像集合。
可以理解的是,该装置700中记载的诸单元与参考图2描述的方法中的各个步骤相对应。由此,上文针对方法描述的操作、特征以及产生的有益效果同样适用于装置700及其中包含的单元,在此不再赘述。
下面参考图8,其示出了适于用来实现本公开的一些实施例的电子设备(例如图1中的计算设备)800的结构示意图。图8示出的服务器仅仅是一个示例,不应对本公开的实施例的功能和使用范围带来任何限制。
如图8所示,电子设备800可以包括处理装置(例如中央处理器、图形处理器等)801,其可以根据存储在只读存储器(ROM)802中的程序或者从存储装置808加载到随机访问存储器(RAM)803中的程序而执行各种适当的动作和处理。在RAM 803中,还存储有电子设备 800操作所需的各种程序和数据。处理装置801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。
通常,以下装置可以连接至I/O接口805:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置806;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置807;包括例如磁带、硬盘等的存储装置808;以及通信装置809。通信装置809可以允许电子设备800与其他设备进行无线或有线通信以交换数据。虽然图8示出了具有各种装置的电子设备800,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。图8中示出的每个方框可以代表一个装置,也可以根据需要代表多个装置。
特别地,根据本公开的一些实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的一些实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的一些实施例中,该计算机程序可以通过通信装置809从网络上被下载和安装,或者从存储装置808被安装,或者从ROM 802被安装。在该计算机程序被处理装置801执行时,执行本公开的一些实施例的方法中限定的上述功能。
需要说明的是,本公开的一些实施例上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开的一些实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质, 该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开的一些实施例中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述装置中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取至少一个输入单词,其中,上述至少一个输入单词是对目标输入文本进行分词得到的;生成至少一个输入单词中每个输入单词的词向量,得到词向量集合;基于上述词向量集合,生成输入文本向量;基于上述输入文本向量和用户向量,生成用于预测用户意图的预测信息。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的一些实施例的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一 个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开的一些实施例中的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括获取单元、词向量生成单元、输入文本向量生成单元和生成单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,获取单元还可以被描述为“获取至少一个输入单词的单元”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
根据本公开的一个或多个实施例,提供了一种用于生成预测的方法,包括:获取至少一个输入单词,其中,上述至少一个输入单词是对目标输入文本进行分词得到的;生成至少一个输入单词中每个输入 单词的词向量,得到词向量集合;基于上述词向量集合,生成输入文本向量;基于上述输入文本向量和用户向量,生成用于预测用户意图的预测信息。
根据本公开的一个或多个实施例,上述基于上述词向量集合,生成输入文本向量,包括:将上述词向量集合中的词向量进行求和,得到上述输入文本向量。
根据本公开的一个或多个实施例,上述基于上述词向量集合,生成输入文本向量,包括:获取用户向量;基于上述词向量集合,上述用户向量和注意力机制网络,得到上述输入文本向量。
根据本公开的一个或多个实施例,上述基于上述词向量集合,上述用户向量和注意力机制网络,得到上述输入文本向量,包括:将上述用户向量输入至预先训练的全连接网络,得到新的用户向量;将上述词向量集合与上述新的用户向量输入至上述注意力机制网络,得到上述输入文本向量。
根据本公开的一个或多个实施例,上述将上述词向量集合与上述新的用户向量输入至上述注意力机制网络,得到上述输入文本向量,包括:将上述词向量集合中每个词向量与上述用户向量进行点乘,生成分数,得到分数组;基于上述词向量集合和上述分数组,生成上述输入文本向量。
根据本公开的一个或多个实施例,上述基于上述输入文本向量和用户向量,生成预测信息,包括:将上述输入文本向量与上述新的用户向量进行点乘,得到点乘得分;基于上述点乘得分,生成预测信息。
根据本公开的一个或多个实施例,上述基于上述输入文本向量和用户向量,生成预测信息,包括:将上述输入文本向量和上述用户向量输入至预先训练的预测信息生成模型,得到预测信息,其中,上述预测信息生成模型是通过训练样本集合训练得到的。
根据本公开的一个或多个实施例,上述训练样本集合中的训练样本包括样本输入文本向量,样本用户向量和样本预测信息,上述预测信息生成模型是以上述样本输入文本向量和上述样本用户向量作为输入,以上述样本预测信息用于作为期望输出训练得到的。
根据本公开的一个或多个实施例,上述训练样本集合是通过以下步骤进行更新:获取用户相关信息集合,其中,上述用户相关信息集合中的用户相关信息包括:输入文本向量,用户向量和预测信息,其中,上述预测信息不是通过上述预测信息生成模型进行预测得到的;基于预设比例,对上述用户相关信息集合进行数据扩增,得到扩增用户相关信息集合;将上述扩增用户相关信息集合加入上述训练样本集合,生成更新后的训练样本集合。
根据本公开的一个或多个实施例,上述用户历史记录信息包括用户对弹出的图像是否进行了点击的历史操作记录信息。
根据本公开的一个或多个实施例,上述方法还包括:根据上述用于预测用户意图的预测信息,确定是否弹出图像;响应于确定弹出图像,从图像数据库中选择出至少一个图像作为弹出图像,得到弹出图像集合;基于上述用户历史操作记录信息,对上述弹出图像集合中的弹出图像进行排序,得到弹出图像序列;从上述弹出图像序列中选择预定数目个弹出图像;将上述预定数目个弹出图像显示至目标界面上。
根据本公开的一个或多个实施例,上述响应于确定弹出图像,从图像数据库中选择出至少一个图像作为弹出图像,得到弹出图像集合,包括:响应于确定弹出图像,获取图像数据库中每个图像的特征向量,得到特征向量集合;确定上述特征向量集合中的每个特征向量与上述输入文本向量的相关度,得到相关度集合;基于上述相关度集合,从上述图像数据库中选择出相关度大于预设阈值的图像作为弹出图像,得到弹出图像集合。
根据本公开的一个或多个实施例,提供了一种用于生成预测信息的装置,包括:获取单元,被配置成获取至少一个输入单词,其中,上述至少一个输入单词是对目标输入文本进行分词得到的;词向量生成单元,被配置成生成至少一个输入单词中每个输入单词的词向量,得到词向量集合;输入文本向量生成单元,被配置成基于上述词向量集合,生成输入文本向量;生成单元,被配置成基于上述输入文本向量和用户向量,生成用于预测用户意图的预测信息。
根据本公开的一个或多个实施例,提供了一种电子设备,包括: 一个或多个处理器;存储装置,其上存储有一个或多个程序,当一个或多个程序被一个或多个处理器执行,使得一个或多个处理器实现如上述任一实施例描述的方法。
根据本公开的一个或多个实施例,提供了一种计算机可读介质,其上存储有计算机程序,其中,程序被处理器执行时实现如上述任一实施例描述的方法。
以上描述仅为本公开的一些较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开的实施例中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开的实施例中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
Claims (15)
- 一种用于生成预测信息的方法,包括:获取至少一个输入单词,其中,所述至少一个输入单词是对目标输入文本进行分词得到的;生成至少一个输入单词中每个输入单词的词向量,得到词向量集合;基于所述词向量集合,生成输入文本向量;基于所述输入文本向量和用户向量,生成用于预测用户意图的预测信息,其中,所述用户向量是基于用户历史记录信息得到的。
- 根据权利要求1所述的方法,其中,所述基于所述词向量集合,生成输入文本向量,包括:将所述词向量集合中的词向量进行求和,得到所述输入文本向量。
- 根据权利要求1所述的方法,其中,所述基于所述词向量集合,生成输入文本向量,包括:获取用户向量;基于所述词向量集合,所述用户向量和注意力机制网络,得到所述输入文本向量。
- 根据权利要求3所述的方法,其中,所述基于所述词向量集合,所述用户向量和注意力机制网络,得到所述输入文本向量,包括:将所述用户向量输入至预先训练的全连接网络,得到新的用户向量;将所述词向量集合与所述新的用户向量输入至所述注意力机制网络,得到所述输入文本向量。
- 根据权利要求4所述的方法,其中,所述将所述词向量集合与所述新的用户向量输入至所述注意力机制网络,得到所述输入文本向 量,包括:将所述词向量集合中每个词向量与所述新的用户向量进行点乘,生成分数,得到分数组;基于所述词向量集合和所述分数组,生成所述输入文本向量。
- 根据权利要求5所述的方法,其中,所述基于所述输入文本向量和用户向量,生成预测信息,包括:将所述输入文本向量与所述新的用户向量进行点乘,得到点乘得分;基于所述点乘得分,生成预测信息。
- 根据权利要求1-6之一所述的方法,其中,所述基于所述输入文本向量和用户向量,生成预测信息,包括:将所述输入文本向量和所述用户向量输入至预先训练的预测信息生成模型,得到预测信息,其中,所述预测信息生成模型是通过训练样本集合训练得到的。
- 根据权利要求7所述的方法,其中,所述训练样本集合中的训练样本包括样本输入文本向量,样本用户向量和样本预测信息,所述预测信息生成模型是以所述样本输入文本向量和所述样本用户向量作为输入,以所述样本预测信息用于作为期望输出训练得到的。
- 根据权利要求8所述的方法,其中,所述训练样本集合是通过以下步骤进行更新:获取用户相关信息集合,其中,所述用户相关信息集合中的用户相关信息包括:输入文本向量,用户向量和预测信息,其中,所述预测信息不是通过所述预测信息生成模型进行预测得到的;基于预设比例,对所述用户相关信息集合进行数据扩增,得到扩增用户相关信息集合;将所述扩增用户相关信息集合加入所述训练样本集合,生成更新 后的训练样本集合。
- 根据权利要求1所述的方法,其中,所述用户历史记录信息包括用户对弹出的图像是否进行了点击的历史操作记录信息。
- 根据权利要求10所述的方法,其中,所述方法还包括:根据所述用于预测用户意图的预测信息,确定是否弹出图像;响应于确定弹出图像,从图像数据库中选择出至少一个图像作为弹出图像,得到弹出图像集合;基于所述用户历史操作记录信息,对所述弹出图像集合中的弹出图像进行排序,得到弹出图像序列;从所述弹出图像序列中选择预定数目个弹出图像;将所述预定数目个弹出图像显示至目标界面上。
- 根据权利要求11所述的方法,其中,所述响应于确定弹出图像,从图像数据库中选择出至少一个图像作为弹出图像,得到弹出图像集合,包括:响应于确定弹出图像,获取所述图像数据库中每个图像的特征向量,得到特征向量集合;确定所述特征向量集合中的每个特征向量与所述输入文本向量的相关度,得到相关度集合;基于所述相关度集合,从所述图像数据库中选择出相关度大于预设阈值的图像作为弹出图像,得到弹出图像集合。
- 一种用于生成预测信息的装置,包括:获取单元,被配置成获取至少一个输入单词,其中,所述至少一个输入单词是对目标输入文本进行分词得到的;词向量生成单元,被配置成生成至少一个输入单词中每个输入单词的词向量,得到词向量集合;输入文本向量生成单元,被配置成基于所述词向量集合,生成输 入文本向量;生成单元,被配置成基于所述输入文本向量和用户向量,生成用于预测用户意图的预测信息,其中,所述用户向量是基于用户历史记录信息得到的。
- 一种电子设备,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-12中任一所述的方法。
- 一种计算机可读介质,其上存储有计算机程序,其中,所述程序被处理器执行时实现如权利要求1-12中任一所述的方法。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2023507396A JP2023537480A (ja) | 2020-08-10 | 2021-08-10 | 予測情報を生成するための方法、装置、電子機器及び媒体 |
EP21855514.2A EP4177784A4 (en) | 2020-08-10 | 2021-08-10 | PREDICTION INFORMATION GENERATION METHOD AND APPARATUS AND ELECTRONIC DEVICE AND MEDIUM |
EP24194159.0A EP4435665A2 (en) | 2020-08-10 | 2021-08-10 | Method and apparatus for generating prediction information, and electronic device and medium |
US18/078,747 US11842163B2 (en) | 2020-08-10 | 2022-12-09 | Method and apparatus for generating prediction information, and electronic device and medium |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010797886.2 | 2020-08-10 | ||
CN202010797886.2A CN111931494B (zh) | 2020-08-10 | 2020-08-10 | 用于生成预测信息的方法、装置、电子设备和介质 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US18/078,747 Continuation US11842163B2 (en) | 2020-08-10 | 2022-12-09 | Method and apparatus for generating prediction information, and electronic device and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
WO2022033462A1 WO2022033462A1 (zh) | 2022-02-17 |
WO2022033462A9 true WO2022033462A9 (zh) | 2022-04-28 |
Family
ID=73308181
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/111734 WO2022033462A1 (zh) | 2020-08-10 | 2021-08-10 | 用于生成预测信息的方法、装置、电子设备和介质 |
Country Status (5)
Country | Link |
---|---|
US (1) | US11842163B2 (zh) |
EP (2) | EP4435665A2 (zh) |
JP (1) | JP2023537480A (zh) |
CN (1) | CN111931494B (zh) |
WO (1) | WO2022033462A1 (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111931494B (zh) * | 2020-08-10 | 2022-06-28 | 北京字节跳动网络技术有限公司 | 用于生成预测信息的方法、装置、电子设备和介质 |
CN114020795B (zh) * | 2021-10-14 | 2022-06-24 | 深圳华云信息系统有限公司 | 一种业务处理方法、装置、电子设备及存储介质 |
CN118092864B (zh) * | 2024-02-23 | 2024-10-18 | 朴道征信有限公司 | 信息服务应用动态调整方法、装置、电子设备和介质 |
Family Cites Families (20)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106777013B (zh) * | 2016-12-07 | 2020-09-11 | 科大讯飞股份有限公司 | 对话管理方法和装置 |
US10699302B2 (en) * | 2017-03-29 | 2020-06-30 | Ebay | Generating keywords by associative context with input words |
CN107066449B (zh) * | 2017-05-09 | 2021-01-26 | 北京京东尚科信息技术有限公司 | 信息推送方法和装置 |
US10956520B1 (en) * | 2017-11-07 | 2021-03-23 | Shutterstock, Inc. | Dynamic image search engine for personalized image editing |
CN108334605B (zh) * | 2018-02-01 | 2020-06-16 | 腾讯科技(深圳)有限公司 | 文本分类方法、装置、计算机设备及存储介质 |
CN108733651A (zh) * | 2018-05-17 | 2018-11-02 | 新华网股份有限公司 | 表情符号预测方法及模型构建方法、装置、终端 |
CN110555207A (zh) * | 2018-06-01 | 2019-12-10 | 海信集团有限公司 | 语句识别方法、装置、机器设备和计算机可读存储介质 |
CN109284357B (zh) * | 2018-08-29 | 2022-07-19 | 腾讯科技(深圳)有限公司 | 人机对话方法、装置、电子设备及计算机可读介质 |
CN111368565B (zh) * | 2018-09-05 | 2022-03-18 | 腾讯科技(深圳)有限公司 | 文本翻译方法、装置、存储介质和计算机设备 |
CN109634438B (zh) * | 2018-12-14 | 2021-01-08 | 维沃移动通信有限公司 | 一种输入法的控制方法及终端设备 |
US11361084B1 (en) * | 2018-12-18 | 2022-06-14 | NortonLifeLock Inc. | Identifying and protecting against a computer security threat while preserving privacy of individual client devices using differential privacy for text documents |
US11423056B2 (en) * | 2018-12-21 | 2022-08-23 | Atlassian Pty Ltd. | Content discovery systems and methods |
US20220130378A1 (en) * | 2018-12-27 | 2022-04-28 | Telepathy Labs, Inc. | System and method for communicating with a user with speech processing |
CN110162191B (zh) * | 2019-04-03 | 2024-08-06 | 腾讯科技(深圳)有限公司 | 一种表情推荐方法、装置及存储介质 |
US11381651B2 (en) * | 2019-05-29 | 2022-07-05 | Adobe Inc. | Interpretable user modeling from unstructured user data |
CN112051743A (zh) * | 2019-06-06 | 2020-12-08 | 北京三星通信技术研究有限公司 | 设备控制方法、冲突处理方法、相应的装置及电子设备 |
CN110502614B (zh) * | 2019-08-16 | 2023-05-09 | 创新先进技术有限公司 | 文本拦截方法、装置、系统以及设备 |
CN110941710B (zh) * | 2019-11-27 | 2020-10-30 | 贝壳找房(北京)科技有限公司 | 用于实现会话的方法、装置、介质以及电子设备 |
US11386885B2 (en) * | 2020-02-17 | 2022-07-12 | Wipro Limited | Method and system for detecting intent as an ordered sequence from a user query |
CN111931494B (zh) * | 2020-08-10 | 2022-06-28 | 北京字节跳动网络技术有限公司 | 用于生成预测信息的方法、装置、电子设备和介质 |
-
2020
- 2020-08-10 CN CN202010797886.2A patent/CN111931494B/zh active Active
-
2021
- 2021-08-10 EP EP24194159.0A patent/EP4435665A2/en active Pending
- 2021-08-10 WO PCT/CN2021/111734 patent/WO2022033462A1/zh unknown
- 2021-08-10 JP JP2023507396A patent/JP2023537480A/ja active Pending
- 2021-08-10 EP EP21855514.2A patent/EP4177784A4/en active Pending
-
2022
- 2022-12-09 US US18/078,747 patent/US11842163B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
EP4177784A1 (en) | 2023-05-10 |
WO2022033462A1 (zh) | 2022-02-17 |
JP2023537480A (ja) | 2023-09-01 |
US20230106202A1 (en) | 2023-04-06 |
CN111931494A (zh) | 2020-11-13 |
CN111931494B (zh) | 2022-06-28 |
EP4177784A4 (en) | 2023-11-15 |
US11842163B2 (en) | 2023-12-12 |
EP4435665A2 (en) | 2024-09-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022033462A9 (zh) | 用于生成预测信息的方法、装置、电子设备和介质 | |
US20220129731A1 (en) | Method and apparatus for training image recognition model, and method and apparatus for recognizing image | |
US11620532B2 (en) | Method and apparatus for generating neural network | |
US11995528B2 (en) | Learning observation representations by predicting the future in latent space | |
US20220121906A1 (en) | Task-aware neural network architecture search | |
WO2023273985A1 (zh) | 一种语音识别模型的训练方法、装置及设备 | |
WO2020207174A1 (zh) | 用于生成量化神经网络的方法和装置 | |
WO2020182123A1 (zh) | 用于推送语句的方法和装置 | |
EP4113394A2 (en) | Federated learning method, apparatus and system, electronic device, and storage medium | |
US20200151563A1 (en) | Method for supervised graph sparsification | |
US20230041339A1 (en) | Method, device, and computer program product for user behavior prediction | |
WO2022012178A1 (zh) | 用于生成目标函数的方法、装置、电子设备和计算机可读介质 | |
WO2023045870A1 (zh) | 网络模型的压缩方法、图像生成方法、装置、设备及介质 | |
WO2023011397A1 (zh) | 一种生成声学特征、语音模型训练、语音识别方法及装置 | |
CN116843991A (zh) | 模型训练方法、信息生成方法、装置、设备和介质 | |
CN113343664B (zh) | 图像文本之间的匹配度的确定方法及装置 | |
CN107766944B (zh) | 一种利用api分析进行系统功能流优化的系统和方法 | |
CN115292487A (zh) | 基于朴素贝叶斯的文本分类方法、装置、设备和介质 | |
WO2023226064A1 (zh) | 椭圆定位数据处理方法、装置、设备、介质和程序产品 | |
CN116881997B (zh) | 城市规划界面展示方法、装置、电子设备和介质 | |
CN112270170B (zh) | 一种隐式表述语句的分析方法、装置、介质和电子设备 | |
WO2024193681A1 (zh) | 训练数据确定方法、目标检测方法、装置、设备、介质 | |
CN113378808B (zh) | 人物图像识别方法、装置、电子设备和计算机可读介质 | |
CN113010784B (zh) | 用于生成预测信息的方法、装置、电子设备和介质 | |
CN114399355B (zh) | 基于用户转化率的信息推送方法、装置和电子设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21855514 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2023507396 Country of ref document: JP Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 2021855514 Country of ref document: EP Effective date: 20230131 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |