Video sorting method and device, equipment, storage medium and computer program product
By mapping the encoding vectors of search text and video text to multiple semantic vector subspaces, calculating sub-vector similarities to generate interaction vectors, the problem of inaccurate video sorting in the existing technology is solved, and the accuracy of video sorting is improved.
Patent Information
- Application Number
- CN202310379796.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-01
AI Technical Summary
In existing video sorting methods, the rough ranking model represents the meaning of search terms and video text through a single vector, resulting in inaccurate ranking results. Especially when the amount of search terms information is limited and the word has multiple meanings, it is difficult to accurately recall related videos. .
By inputting the search text and recalled video text into the trained rough ranking model, the encoding vector is obtained and mapped to multiple semantic vector subspaces, and the sub-vector similarity is calculated to generate a semantic interaction vector, and then the rough ranking score is determined for video ranking. .
It improves the accuracy of video sorting, alleviates the problem of polysemy in search terms, and ensures the accuracy of rough ranking scores and the accuracy of video sorting.
Smart Images

Figure CN118733828A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a video sorting method, apparatus, computer equipment, storage medium and computer program product. Background Art
[0002] With the rapid development of information technology, more and more people watch short videos, live videos, TV series, news videos, etc. on the Internet. For example, users enter search terms on various video platforms according to their viewing needs, and each search platform displays related videos on the terminal.
[0003] Usually, in order to conduct relevant searches for the search terms entered by users, most search systems will select the corresponding videos from a large number of videos through recall, rough sorting, and fine sorting. In most search scenarios, the search terms are relatively short, contain limited information, and often have multiple meanings.
[0004] In the related art, the coarse ranking model only uses one vector to represent the meaning of the search term and the video text, which often has insufficient expression ability, resulting in inaccurate ranking results of the coarse ranking model for the recalled videos corresponding to the search term. Summary of the invention
[0005] Based on this, it is necessary to provide a video sorting method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the accuracy of video sorting in order to solve the above technical problems.
[0006] The present application provides a video sorting method. The method comprises:
[0007] Inputting the search text and the recalled video text corresponding to the search text into the trained coarse sorting model;
[0008] Obtaining a first encoding vector corresponding to the search text through the trained rough sorting model, mapping the first encoding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtaining a second encoding vector corresponding to the recalled video text, and mapping the second encoding vector to multiple semantic vector subspaces to obtain multiple second subvectors;
[0009] Determine the similarity between each of the first sub-vectors and each of the second sub-vectors, determine a first semantic interaction vector corresponding to the search text based on the similarity and each of the second sub-vectors, and determine a second semantic interaction vector corresponding to the recalled video text based on the similarity and each of the first sub-vectors;
[0010] A rough ranking score is determined according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of relevance between the search text and the recalled video text, and the rough ranking score is used to sort the recalled videos corresponding to the search text.
[0011] The present application also provides a video sorting device. The device comprises:
[0012] A text input module, used for inputting the search text and the recalled video text corresponding to the search text into the trained rough sorting model;
[0013] A first mapping module is used to obtain a first encoding vector corresponding to the search text through the trained rough sorting model, map the first encoding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtain a second encoding vector corresponding to the recalled video text, and map the second encoding vector to multiple semantic vector subspaces to obtain multiple second subvectors;
[0014] A first interaction vector determination module is used to determine the similarity between each of the first sub-vectors and each of the second sub-vectors, determine a first semantic interaction vector corresponding to the search text based on the similarity and each of the second sub-vectors, and determine a second semantic interaction vector corresponding to the recalled video text based on the similarity and each of the first sub-vectors;
[0015] The first scoring module is used to determine a rough ranking score according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of correlation between the search text and the recalled video text, and the rough ranking score is used to sort the recalled videos corresponding to the search text.
[0016] In some embodiments, the first mapping module is used to input the search text into the encoding layer of the trained coarse-grained model; determine the word vector corresponding to each word in the search text through the word representation network of the encoding layer; determine the semantic weight of each word in the search text according to the word vector through the sentence representation network of the encoding layer, and perform weighted summation of each word vector according to the semantic weight to obtain a first encoding vector corresponding to the search text.
[0017] In some embodiments, the first mapping module is used to map the first encoding vector to multiple semantic vector subspaces through the first mapping layer of the trained coarse-grained model, and obtain the first subvectors of each semantic vector subspace corresponding to the search text. The first mapping module is used to map the second encoding vector to multiple semantic vector subspaces through the second mapping layer of the trained coarse-grained model, and obtain the second vectors of each semantic vector subspace corresponding to the recalled video text.
[0018] In some embodiments, the multiple semantic vector subspaces include m semantic vector subspaces, and a first interaction vector determination module is used to calculate the subvector similarity between a first subvector of the i-th semantic vector subspace corresponding to the search text and a second subvector of the j-th semantic vector subspace corresponding to the recalled video text; wherein, 1≤i≤m, 1≤j≤m; based on the subvector similarity, the similarity between the search text and the recalled video text is obtained.
[0019] In some embodiments, the first interaction vector determination module is used to determine, for the first subvector of each semantic vector subspace corresponding to the search text, the first weight of each second subvector with respect to the first subvector according to the similarity between the first subvector and the second subvector of each semantic vector subspace corresponding to the recalled video text; perform weighted summation of the second subvectors of each semantic vector subspace corresponding to the recalled video text according to each first weight to obtain the semantic interaction vector corresponding to the first subvector; and determine the first semantic interaction vector corresponding to the search text according to the semantic interaction vectors corresponding to each first subvector.
[0020] In some embodiments, the first interaction vector determination module is used to determine the second weights of each first subvector with respect to the second subvector of each semantic vector subspace corresponding to the recalled video text according to the similarity between the second subvector and the first subvector of each semantic vector subspace corresponding to the search text; perform weighted summation of the first subvector of each semantic vector subspace corresponding to the search text according to each second weight to obtain the semantic interaction vector corresponding to the second subvector; and determine the second semantic interaction vector corresponding to the recalled video text according to the semantic interaction vector corresponding to each second subvector.
[0021] In some embodiments, a first scoring module is used to enhance the first semantic interaction vector according to each of the first sub-vectors to determine a first enhanced interaction vector corresponding to the search text; enhance the second semantic interaction vector according to each of the second sub-vectors to determine a second enhanced interaction vector corresponding to the recalled video text; and map a spliced vector obtained by splicing the first enhanced interaction vector and the second enhanced interaction vector into a coarse ranking score.
[0022] In some embodiments, a first scoring module is used to calculate, for each first sub-vector, a first difference between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector, and a first product between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector; concatenate the first sub-vector, the semantic interaction vector corresponding to the first sub-vector, the first difference, and the first product to obtain an enhanced interaction vector corresponding to the first sub-vector; and determine the first enhanced interaction vector corresponding to the search text based on the enhanced interaction vectors corresponding to each of the first sub-vectors.
[0023] In some embodiments, a first scoring module is used to calculate, for each second sub-vector, a second difference between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector, and a second product between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector; concatenate the second sub-vector, the semantic interaction vector corresponding to the second sub-vector, the second difference, and the second product to obtain an enhanced interaction vector corresponding to the second sub-vector; and determine the second enhanced interaction vector corresponding to the recalled video text based on the enhanced interaction vectors corresponding to each of the second sub-vectors.
[0024] The present application also provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned video sorting method when executing the computer program.
[0025] The present application also provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned video sorting method are implemented.
[0026] The present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned video sorting method are implemented.
[0027] The above is a video sorting method, device, computer equipment, storage medium and computer program product. The search text and the recalled video text corresponding to the search text are input into a trained rough sorting model; the first coding vector corresponding to the search text is obtained through the trained rough sorting model, and the first coding vector is mapped to multiple semantic vector subspaces to obtain multiple first subvectors. The same search text is represented by multiple subvectors in different semantic vector subspaces, which can capture the different semantics of the search text in various aspects. The second coding vector corresponding to the recalled video text is obtained, and the second coding vector is mapped to multiple semantic vector subspaces to obtain multiple second subvectors. The same recalled video text is represented by multiple subvectors in different semantic vector subspaces, which can capture the different semantics of the recalled video text in various aspects. The similarity between each first subvector and each second subvector is determined, and the first semantic interaction vector corresponding to the search text is determined based on the similarity and each second subvector, and the second semantic interaction vector corresponding to the recalled video text is determined based on the similarity and each first subvector. In this way, before the rough ranking and scoring, the first sub-vectors of the search text and the second sub-vectors of the recalled video text can be interacted in advance, and the interaction and enhancement of each other's sub-vectors can be used to alleviate the problem of being unable to identify the polysemy of the search text as much as possible, thereby improving the accuracy of the subsequent rough ranking and scoring. The rough ranking score is determined according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of correlation between the search text and the recalled video text, and the rough ranking score is used to sort the recalled videos corresponding to the search text. Based on this, by interacting the first sub-vector and the second sub-vector in advance, the problem of loss of detailed features due to too late interaction can be avoided, and the representation vector of the search text and the representation vector of the recalled video text can be deeply interacted, ensuring the accuracy of the rough ranking score, so that each recalled video can be accurately sorted.
[0028] The present application provides a model training method. The method comprises:
[0029] Acquire a training sample, wherein the training sample includes a sample search text and a sample video text corresponding to the sample search text;
[0030] Obtaining a first coding vector corresponding to the sample search text through a coarse sorting model, mapping the first coding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtaining a second coding vector corresponding to the sample video text, and mapping the second coding vector to multiple semantic vector subspaces to obtain multiple second subvectors;
[0031] Determine the similarity between each of the first sub-vectors and each of the second sub-vectors, determine a first semantic interaction vector corresponding to the sample search text based on the similarity and each of the second sub-vectors, and determine a second semantic interaction vector corresponding to the sample video text based on the similarity and each of the first sub-vectors;
[0032] Determine a rough ranking score according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of relevance between the sample search text and the sample video text;
[0033] The model loss is determined according to the subspace similarity between each of the first sub-vectors, the subspace similarity between each of the second sub-vectors and the coarse sorting score, and the coarse sorting model is trained according to the model loss. The trained coarse sorting model is used to perform video search response to the search text.
[0034] The present application also provides a model training device. The device comprises:
[0035] A sample acquisition module, used to acquire training samples, wherein the training samples include sample search texts and sample video texts corresponding to the sample search texts;
[0036] A second mapping module is used to obtain a first coding vector corresponding to the sample search text through a coarse sorting model, map the first coding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtain a second coding vector corresponding to the sample video text, and map the second coding vector to multiple semantic vector subspaces to obtain multiple second subvectors;
[0037] A second interaction vector determination module is used to determine the similarity between each of the first sub-vectors and each of the second sub-vectors, determine a first semantic interaction vector corresponding to the sample search text based on the similarity and each of the second sub-vectors, and determine a second semantic interaction vector corresponding to the sample video text based on the similarity and each of the first sub-vectors;
[0038] A second scoring module is used to determine a rough ranking score according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of relevance between the sample search text and the sample video text;
[0039] A training module is used to determine the model loss according to the subspace similarity between each of the first sub-vectors, the subspace similarity between each of the second sub-vectors and the coarse sorting score, and to train the coarse sorting model according to the model loss. The trained coarse sorting model is used to perform video search response to the search text.
[0040] In some embodiments, the device further includes a subspace similarity determination module, which is used to calculate the similarity between the first subvectors of each semantic vector subspace corresponding to the sample search text, and obtain the subspace similarity between the first subvectors; for the second subvectors of each semantic vector subspace corresponding to the sample video text, calculate the similarity between the second subvectors, and obtain the subspace similarity between the second subvectors.
[0041] In some embodiments, the second mapping module is used to map the first encoding vector to multiple semantic vector subspaces through the first mapping layer of the coarse-sorting model, and obtain the first subvectors of each semantic vector subspace corresponding to the sample search text; the second mapping module is used to map the second encoding vector to multiple semantic vector subspaces through the second mapping layer of the coarse-sorting model, and obtain the second vectors of each semantic vector subspace corresponding to the sample video text.
[0042] In some embodiments, the second interaction vector determination module is used to determine, for the first subvector of each semantic vector subspace corresponding to the sample search text, the third weight of each second subvector with respect to the first subvector according to the similarity between the first subvector and the second subvector of each semantic vector subspace corresponding to the sample video text; perform weighted summation of the second subvectors of each semantic vector subspace corresponding to the sample video text according to the third weights to obtain the semantic interaction vector corresponding to the first subvector; and determine the first semantic interaction vector corresponding to the sample search text according to the semantic interaction vectors corresponding to each first subvector.
[0043] In some embodiments, the second interaction vector determination module is used to determine, for the second subvector of each semantic vector subspace corresponding to the sample video text, the fourth weight of each first subvector with respect to the second subvector according to the similarity between the second subvector and the first subvector of each semantic vector subspace corresponding to the sample search text; perform weighted summation of the first subvector of each semantic vector subspace corresponding to the sample search text according to each fourth weight to obtain the semantic interaction vector corresponding to the second subvector; and determine the second semantic interaction vector corresponding to the sample video text according to the semantic interaction vector corresponding to each second subvector.
[0044] In some embodiments, a second scoring module is used to enhance the first semantic interaction vector according to each of the first sub-vectors to determine a first enhanced interaction vector corresponding to the sample search text; enhance the second semantic interaction vector according to each of the second sub-vectors to determine a second enhanced interaction vector corresponding to the sample video text; and map a spliced vector obtained by splicing the first enhanced interaction vector and the second enhanced interaction vector into a coarse ranking score.
[0045] In some embodiments, the sample video text includes positive sample video text and negative sample video text, and the coarse ranking score includes the positive sample coarse ranking score corresponding to the sample search text and the positive sample video text and the negative sample coarse ranking score corresponding to the sample search text and the negative sample video text; a training module is used to determine the model loss according to the positive sample coarse ranking score, the subspace similarity between each of the first subvectors, the subspace similarity between each of the second subvectors, and the negative sample coarse ranking score; wherein the model loss is positively correlated with the subspace similarity, negatively correlated with the positive sample coarse ranking score, and positively correlated with the negative sample coarse ranking score.
[0046] The present application also provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above-mentioned model training method when executing the computer program.
[0047] The present application also provides a computer-readable storage medium, wherein a computer program is stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned model training method are implemented.
[0048] The present application also provides a computer program product, which includes a computer program that implements the steps of the above-mentioned model training method when executed by a processor.
[0049] The above-mentioned model training method, device, computer equipment, storage medium and computer program product obtain training samples, the training samples include sample search text and sample video text corresponding to the sample search text; obtain the first encoding vector corresponding to the sample search text through the coarse sorting model, map the first encoding vector to multiple semantic vector subspaces to obtain multiple first subvectors, use multiple subvectors in different semantic vector subspaces to represent the same search text, and capture the different semantics of the sample search text in various aspects. Obtain the second encoding vector corresponding to the sample video text, map the second encoding vector to multiple semantic vector subspaces to obtain multiple second subvectors, use multiple subvectors in different semantic vector subspaces to represent the same recall video text, and can capture the different semantics of the sample video text in various aspects. Determine the similarity between each first subvector and each second subvector, determine the first semantic interaction vector corresponding to the sample search text based on the similarity and each second subvector, and determine the second semantic interaction vector corresponding to the sample video text based on the similarity and each first subvector. In this way, before the coarse sorting model is scored, the first subvectors of the sample search text and the second subvectors of the sample video text can be interacted in advance, and the interaction enhancement of the other party's own subvectors can be used to alleviate the problem of being unable to identify the polysemy of the search text as much as possible, and the representation vector of the search text and the representation vector of the recalled video text can be deeply interacted, thereby improving the accuracy of the coarse sorting score. According to the first semantic interaction vector and the second semantic interaction vector, the coarse sorting score is determined; the coarse sorting score represents the degree of correlation between the sample search text and the sample video text; according to the subspace vector similarity between the first subvectors, the subspace vector similarity between the second subvectors and the coarse sorting score, the model loss is determined, and the coarse sorting model is trained according to the model loss. The trained coarse sorting model is used to respond to the video search for the search text. In this way, similar samples can be brought closer through the coarse sorting score, and the semantic expression of the sentence can be optimized. At the same time, through the subspace vector similarity between the first subvectors and the subspace vector similarity between the second subvectors, the distance between the first semantic interaction vectors of different semantics can be increased, and the distance between the second semantic interaction vectors of different semantics can be increased, thereby ensuring the accuracy of the subsequent coarse sorting model scoring. Therefore, the trained coarse-grained ranking model can improve the semantic matching ability of the model and the accuracy of the coarse-grained ranking model scoring, so that each recalled video can be accurately sorted. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A diagram showing an application environment of a video sorting method in an embodiment;
[0051] Figure 2 A schematic diagram of a flow chart of a video sorting method in one embodiment;
[0052] Figure 3Ais a schematic diagram of a search interface in one embodiment;
[0053] Figure 3B is a schematic diagram of a search interface in another embodiment;
[0054] Figure 4 A schematic diagram of a flow chart of a step of determining a first semantic interaction vector in one embodiment;
[0055] Figure 5 A schematic diagram of a flow chart of a step of determining a second semantic interaction vector in one embodiment;
[0056] Figure 6 A schematic diagram of a process for determining a rough ranking score in one embodiment;
[0057] Figure 7 A schematic diagram of a flow chart of a model training method in one embodiment;
[0058] Figure 8 A schematic diagram of determining a pre-trained coarse-sequence model in one embodiment;
[0059] Fig. 9 A schematic diagram of training samples in the second fine-tuning stage in one embodiment;
[0060] Fig.10 A schematic diagram of training samples in the second fine-tuning stage in one embodiment;
[0061] Fig.11 A schematic flow chart of a video sorting method according to another embodiment;
[0062] Fig.12 is a structural block diagram of a video sorting device in one embodiment;
[0063] Fig.13 is a structural block diagram of a model training device in one embodiment;
[0064] Fig.14 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0066] The video sorting method provided in the embodiment of the present application involves artificial intelligence (AI) technology. Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making.
[0067] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. The video sorting method provided in the embodiment of the present application specifically relates to computer technology of artificial intelligence.
[0068] Usually, for the search terms entered by the user on the terminal, the coarse ranking model will score each recalled video to determine the ranking of each recalled video. Since the search terms entered by the user are generally short and lack information, it is not accurate to represent the meaning of the search terms based on only one vector. Therefore, the coarse ranking model only scores based on one vector of the search terms, which is easy to score incorrectly, that is, it is impossible to accurately rank the recalled videos.
[0069] The video sorting method provided in the embodiment of the present application is to input the search text and the recalled video text corresponding to the search text into a trained rough sorting model; through the trained rough sorting model, the first coding vector corresponding to the search text is obtained, and the first coding vector is mapped to multiple semantic vector subspaces to obtain multiple first subvectors, which can capture the different semantics of the search text, thereby alleviating the problem of polysemy of the search text. The second coding vector corresponding to the recalled video text is obtained, and the second coding vector is mapped to multiple semantic vector subspaces to obtain multiple second subvectors, which can capture the different semantics of the recalled video text, thereby alleviating the problem of polysemy of the recalled video text. The similarity between each first subvector and each second subvector is determined, and the first semantic interaction vector corresponding to the search text is determined based on the similarity and each second subvector, and the second semantic interaction vector corresponding to the recalled video text is determined based on the similarity and each first subvector. In this way, before the rough sorting scoring is performed, the first subvectors of the search text and the second subvectors of the recalled video text can be interacted in advance, thereby improving the accuracy of the subsequent rough sorting scoring. A coarse ranking score is determined based on the first semantic interaction vector and the second semantic interaction vector; the coarse ranking score represents the degree of correlation between the search text and the recalled video text, and is used to sort the recalled videos corresponding to the search text. Based on this, by interacting the first sub-vector and the second sub-vector in advance, the problem of loss of detailed features due to late interaction can be avoided, ensuring the accuracy of the coarse ranking score, thereby accurately sorting the recalled videos.
[0070] The video sorting method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, can be integrated on the server 104, or can be integrated on the cloud or other servers. The terminal 102 and the server 104 can both execute the video sorting method separately, and the terminal 102 and the server 104 can also assist in executing the video sorting method.
[0071] In some embodiments, the video sorting method provided in the embodiment of the present application can be executed by the server 104. The server 104 obtains the search text sent by the terminal 102, and the server 104 determines the recalled video text of the recalled video corresponding to the search text. The server 104 inputs the search text and the recalled video text corresponding to the search text into the trained rough sorting model; the server 104 obtains the first encoding vector corresponding to the search text through the trained rough sorting model, maps the first encoding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtains the second encoding vector corresponding to the recalled video text, maps the second encoding vector to multiple semantic vector subspaces to obtain multiple second subvectors; the server 104 determines the similarity between each first subvector and each second subvector, determines the first semantic interaction vector corresponding to the search text based on the similarity and each second subvector, and determines the second semantic interaction vector corresponding to the recalled video text based on the similarity and each first subvector; the server 104 determines the rough sorting score according to the first semantic interaction vector and the second semantic interaction vector; the rough sorting score represents the degree of correlation between the search text and the recalled video text, and the rough sorting score is used to sort the recalled videos corresponding to the search text.
[0072] Optionally, the server 104 determines the video texts participating in the fine sorting according to the sorting results of each recalled video, and determines the exposure video that is finally used for exposure according to the video texts participating in the fine sorting. The server 104 sends the exposure video to the terminal 102 for display. For example, a client with a video push function is deployed on the terminal 102, and the client can be an e-commerce client, a video client, a social application client, etc. For the search text entered by the user on the client, the terminal 102 sends the search text to the server 104, and the terminal 104 executes the video sorting method of the present application to sort each recalled video.
[0073] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster or cloud server consisting of multiple servers.
[0074] In one embodiment, Figure 2 As shown, a video sorting method is provided, which is applied to a computer device (which may be Figure 1 The server 104 in may also be Figure 1 The terminal 102 in the example is used as an example to illustrate, and the following steps are included:
[0075] Step 202: input the search text and the recalled video text corresponding to the search text into the trained rough sorting model.
[0076] Among them, the search text (also called Query) is an online search term, and the online search term is a term used to search for videos. The search text contains the video information of the target search video. For the same target search video, there are different forms of search texts. For example, the name of the target search video is directly used as the search text. For example, in order to increase the accuracy of the search, the name of the target search video and the names of the actors in the target search video are used as the search text. For example, there are multiple versions of videos of the same subject matter. In this case, the name of the target search video and the video version are used as the search text. It can be seen from this that for the same target search video, each search text corresponding to the same target search video contains the entity words of the target search video name.
[0077] The recalled video text is the video text corresponding to the recalled video. The recalled video is the video selected in the recall stage and used for the rough sorting. Each video has a unique corresponding video text. The video text is used to describe the video information of the corresponding video. The video information includes at least one of the plot summary, video title, video alias, actor name, and video tag.
[0078] The trained rough ranking model refers to the model used in the online rough ranking stage. The trained rough ranking model is used to determine the score of the relevance between the search text and the video text.
[0079] Optionally, the computer device determines the recalled video corresponding to the search text and obtains the recalled video text of the recalled video. The computer device inputs the search text and the recalled video text into the trained coarse sorting model.
[0080] Exemplarily, the computer device obtains the search text and determines a plurality of recalled videos screened out in the recall phase. For any recalled video, the computer device obtains the recalled video text of the recalled video and inputs the search text and the recalled video text into the encoding layer of the trained coarse sorting model.
[0081] Step 204, obtain the first encoding vector corresponding to the search text through the trained rough sorting model, map the first encoding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtain the second encoding vector corresponding to the recalled video text, map the second encoding vector to multiple semantic vector subspaces to obtain multiple second subvectors.
[0082] Among them, the first encoding vector refers to a vector representation of the search text. The second encoding vector is a vector representation of the recalled video text. Each semantic corresponds to a semantic vector subspace. The semantic vector subspace is used to learn the information corresponding to the semantics and extract the vector corresponding to the semantics. It can be understood that for a word, there may be multiple meanings in different contexts or different fields. Based on this, before calculating the rough ranking score, multiple preset semantic vector subspaces are determined. For each semantic vector subspace, the semantic expressions of the search text and the recalled video text in the semantic vector subspace are learned respectively, so as to obtain the first subvector corresponding to the search text with respect to the semantic vector subspace and the second subvector corresponding to the recalled video text with respect to the semantic vector subspace.
[0083] Optionally, the computer device obtains a first coding vector corresponding to the search text and a second coding vector corresponding to the recalled video text through a trained coarse sorting model. The computer device determines a plurality of preset semantic vector subspaces, and the computer device maps the first coding vector to each semantic vector subspace through a trained coarse sorting model to obtain a first subvector corresponding to each semantic vector subspace, and maps the second coding vector to each semantic vector subspace to obtain a second subvector corresponding to each semantic vector subspace.
[0084] Exemplarily, the computer device obtains the first coding vector corresponding to the search text and the second coding vector corresponding to the recalled video text through the coding layer of the trained coarse-grained model. After determining the first coding vector corresponding to the search text and the second coding vector corresponding to the recalled video text, for the same semantic vector subspace, the computer device maps the first coding vector and the second coding vector to the semantic vector subspace through the trained coarse-grained model, respectively, to obtain the first subvector and the second subvector corresponding to the semantic vector subspace.
[0085] It should be noted that any two semantic vector subspaces are independent of each other, that is, the semantics corresponding to any two semantic vector subspaces are different. At this time, the subvectors corresponding to any two semantic vector subspaces are orthogonal to each other. Furthermore, the following is proved by ablation experiments: more than 60,000 groups of combinations are sampled, each combination includes a search text and a recalled video text. Take combination 1 as an example, combination 1 includes search text 1 and recalled video text 1. There are 3 semantic vector subspaces. For search text 1, based on the 3 first subvectors corresponding to search text 1, the similarity between the two first subvectors is calculated to obtain the following matrix array1:
[0086] array1([[1.00000012,-0.00871744,-0.2434016],
[0087] [-0.00871744,0.9999997,0.21546192],
[0088] [-0.2434016,0.21546192,0.99999982]])
[0089] Each element in the matrix array1 represents the i-th first subvector of the search text and the j-th first subvector of the search text. Obviously, for the search text 1, the similarity between different first subvectors is 0, that is, it is proved that the subvectors corresponding to any two semantic vector subspaces are mutually orthogonal, which shows that the semantic vector subspaces are independent of each other and can represent different semantics of the text in different aspects.
[0090] Similarly, for the relevant video text 1, based on the three second sub-vectors corresponding to the relevant video text 1, the similarity between the second vectors is calculated, and the following matrix array2 is obtained: array2([[0.99999999,-0.04584159,-0.18707253],
[0091] [-0.04584159,1,0.29358823],
[0092] [-0.18707253,0.29358823,0.99999999]])
[0093] Each element in the matrix array2 represents the i-th second subvector of the recalled video text 1 and the j-th second subvector of the recalled video text 1. Obviously, for the recalled video text 1, the similarity between different first subvectors is 0, that is, it is proved that the subvectors corresponding to any two semantic vector subspaces are orthogonal to each other.
[0094] The above proves that any two semantic vector subspaces are independent of each other.
[0095] Step 206, determine the similarity between each first sub-vector and each second sub-vector, determine the first semantic interaction vector corresponding to the search text based on the similarity and each second sub-vector, and determine the second semantic interaction vector corresponding to the recalled video text based on the similarity and each first sub-vector.
[0096] The higher the similarity between the first sub-vector and the second sub-vector, the more similar the first sub-vector and the second sub-vector are, that is, the greater the probability that they belong to the same semantic vector subspace. The semantic interaction vector refers to the vector obtained after the two sub-vectors interact with each other.
[0097] Optionally, for each first sub-vector, the computer device calculates the similarity between the first sub-vector and each second sub-vector. For each first sub-vector, the computer device determines the first weight of each second sub-vector for the first sub-vector according to the first similarity between the first sub-vector and each second sub-vector. The higher the first similarity, the greater the first weight corresponding to the first similarity.
[0098] For each second sub-vector, the computer device determines the second weight of each first sub-vector for the second sub-vector according to the second similarity between the second sub-vector and each first sub-vector. The higher the second similarity, the greater the second weight corresponding to the second similarity.
[0099] For example, if there are three semantic vector subspaces, then for search text 1, there are three first vectors, namely a1, a2, and a3. For the recalled video text, there are three second vectors, namely b1, b2, and b3.
[0100] After determining the similarities between a1 and b1, b2, and b3, i.e., similarity 11, similarity 12, and similarity 13, first weights of b1, b2, and b3 for a1 are determined according to similarity 11, similarity 12, and similarity 13. For another example, after determining the similarities between a2 and b1, b2, and b3, i.e., similarity 21, similarity 22, and similarity 23, first weights of b1, b2, and b3 for a2 are determined according to similarity 21, similarity 22, and similarity 23. For another example, after determining the similarities between b1 and a1, a2, and a3, i.e., similarity 11, similarity 21, and similarity 31, second weights of a1, a2, and a3 for b1 are determined according to similarity 11, similarity 21, and similarity 31.
[0101] Optionally, for each first sub-vector, the computer device sorts the first sub-vector and each second sub-vector according to the first similarity, and obtains a first sorting result of the first similarity. The greater the first similarity, the smaller the corresponding sequence number in the first sorting result. The computer device determines the first weight of each second sub-vector for the first sub-vector from a plurality of preset weights according to the first sorting result. The smaller the sequence number in the first sorting result, the larger the corresponding first weight.
[0102] For each second sub-vector, the computer device sorts the second sub-vector and the second similarities between the first sub-vectors to obtain a second sorting result of the second similarity. The greater the second similarity, the smaller the corresponding sequence number in the second sorting result. The computer device determines the second weight of each first sub-vector for the second sub-vector from a plurality of preset weights according to the second sorting result. The smaller the sequence number in the second sorting result, the larger the corresponding second weight.
[0103] For example, after determining the similarities of a1 with b1, b2, and b3, namely, similarity 11, similarity 12, and similarity 13, if the similarities are sorted from large to small, they are similarity 11, similarity 12, and similarity 13. A plurality of preset weights are obtained, which are c1, c2, and c3 from large to small. Then, the first weights of b1, b2, and b3 for a1 are c1, c2, and c3, respectively.
[0104] Step 208, determining a coarse ranking score according to the first semantic interaction vector and the second semantic interaction vector; the coarse ranking score represents the degree of correlation between the search text and the recalled video text, and the coarse ranking score is used to sort the recalled videos corresponding to the search text.
[0105] The coarse ranking score is obtained by scoring the relevance between the search text and the recalled video text using a trained coarse ranking model. The higher the coarse ranking score, the higher the relevance between the search text and the recalled video text.
[0106] Optionally, the computer device determines the coarse ranking scores corresponding to the search text and the recalled video text according to the first semantic interaction vector and the second semantic interaction vector by using a pre-trained coarse ranking model.
[0107] After determining each rough ranking score, the computer device sorts each recalled video text according to each rough ranking score to obtain a rough ranking result, and determines the video texts participating in the fine ranking according to the rough ranking result. The computer device performs a fine ranking score based on the video texts participating in the fine ranking through an online fine ranking model. The computer device determines the video texts participating in the re-ranking according to each fine ranking score. The computer device determines the exposure video corresponding to the search text according to the video texts participating in the re-ranking.
[0108] For example, Figure 3AThe figure shows a schematic diagram of a search interface in an embodiment. During the video search process, the terminal displays the search interface, and a term, such as "Xiaojun's Search for Relatives", is entered in the search box of the search interface through the user account. In response to the input operation, the exposed videos are displayed in the search interface, and the exposed videos include long videos and short videos. Specifically, a boutique area is displayed in the search interface, and the boutique area is used to display long videos. The boutique area displays a filter menu bar corresponding to short videos, and the filter menu bar displays various filter controls, such as "All", "Movies and TV", "Users", "Novels", "Comics" and other filter controls, such as Figure 3A The icon of the TV series title "Xiao Jun's Search for Family" is displayed, and the names of multiple actors who filmed the TV series are also displayed, such as Actor 1 to Actor 4. The boutique area also displays trigger controls for immediate play and cache. The boutique area also displays other related film and television icons, such as "Analysis of Xiao Jun's Search for Family" in the TV series category, "Xiao Jun's Search for Family Animation" in the animation category, and "Xiao Jun's Search for Family Movie" in the movie category.
[0109] After the user has browsed the boutique area, the comprehensive area is displayed in the search interface through sliding operation, such as Figure 3B , which is a schematic diagram of a search interface in another embodiment. The comprehensive area is used to display short videos. The comprehensive area displays a filter menu bar corresponding to short videos, and the filter menu bar displays various filter controls, such as "All", "Movies and TV", "Users", "Novels", "Comics" and other filter controls, such as Figure 3B The icons of various special videos are displayed in the search interface, such as the icon of "Xiaojun's Search for Relatives Collection" and the icon of "Xiaojun's Search for Relatives Interpretation Report". The position of each icon in the search interface can be determined based on the number of views, that is, the one with the higher number of views is displayed in the first position of the comprehensive area. The number of views is displayed on each icon. The number of views of "Xiaojun's Search for Relatives Collection" and "Xiaojun's Search for Relatives Interpretation Report" are 3 million and 1.5 million respectively.
[0110] In the above-mentioned video ranking method, the search text and the recalled video text corresponding to the search text are input into the trained coarse sorting model; the first coding vector corresponding to the search text is obtained through the trained coarse sorting model, and the first coding vector is mapped to multiple semantic vector subspaces to obtain multiple first subvectors. The same search text is represented by multiple subvectors in different semantic vector subspaces, which can capture the different semantics of the search text in various aspects. The second coding vector corresponding to the recalled video text is obtained, and the second coding vector is mapped to multiple semantic vector subspaces to obtain multiple second subvectors. The same recalled video text is represented by multiple subvectors in different semantic vector subspaces, which can capture the different semantics of the recalled video text in various aspects. The similarity between each first subvector and each second subvector is determined, and the first semantic interaction vector corresponding to the search text is determined based on the similarity and each second subvector, and the second semantic interaction vector corresponding to the recalled video text is determined based on the similarity and each first subvector. In this way, before the rough ranking and scoring, the first sub-vectors of the search text and the second sub-vectors of the recalled video text can be interacted in advance, and the interaction and enhancement of each other's sub-vectors can be used to alleviate the problem of being unable to identify the polysemy of the search text as much as possible, thereby improving the accuracy of the subsequent rough ranking and scoring. The rough ranking score is determined according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of correlation between the search text and the recalled video text, and the rough ranking score is used to sort the recalled videos corresponding to the search text. Based on this, by interacting the first sub-vector and the second sub-vector in advance, the problem of loss of detailed features due to too late interaction can be avoided, and the representation vector of the search text and the representation vector of the recalled video text can be deeply interacted, ensuring the accuracy of the rough ranking score, so that each recalled video can be accurately sorted.
[0111] In some embodiments, a first encoding vector corresponding to a search text is obtained through a trained rough sorting model, including: inputting the search text into the encoding layer of the trained rough sorting model; determining the word vector corresponding to each word in the search text through the word representation network of the encoding layer; determining the semantic weight of each word in the search text according to the word vector through the sentence representation network of the encoding layer, and performing weighted summation of each word vector according to the semantic weight to obtain the first encoding vector corresponding to the search text.
[0112] The encoding layer of the trained coarse sorting model includes a word representation network and a sentence representation network. The word representation network includes a first word representation network for searching text and a second word representation network for recalling video text. The sentence representation network includes a first sentence representation network for searching text and a second sentence representation network for recalling video text. The word representation network is used to determine the word vector in the text. The sentence representation network is used to determine the vector corresponding to the text.
[0113] Optionally, the computer device inputs the search text into the encoding layer of the trained coarse-grained model, and slices the search text into a word list for search, to determine the encoding sequence corresponding to the search text. The encoding sequence includes the initial word vectors corresponding to each word. For each word, the computer device determines the word vector corresponding to the word through the first word representation network. For each word, the computer device determines the semantic weight of the word according to the context vector and the word vector of the word through the first sentence representation network. The computer device performs weighted summation of each word vector according to the semantic weight of each word to obtain the first encoding vector corresponding to the search text. Among them, the context vector is learned during the training process of the coarse-grained model and can be used as a high-level representation of an inquiry, such as "Which words contain more important information?".
[0114] Exemplarily, after determining the word vector corresponding to each word, the computer device obtains the context vector and calculates the first word vector similarity between the context vector and the word vector of each word. For the word vector of each word, determine the sentence in which the word is located, and calculate the first sum of the similarities of the first word vectors in the sentence. For each word, the computer device uses the ratio of the first word vector similarity corresponding to the word to the first sum as the semantic weight of the word. The computer device determines the first attention vector by weighted summation according to the semantic weight and word vector of each word. The computer device performs maximum pooling processing on the encoding sequence corresponding to the search text to obtain a first pooled vector. The computer device splices the first attention vector and the first pooled vector to obtain a first spliced vector, and embeds a CLS vector of a special classification character [CLS] representing the beginning of a word sequence before the first spliced vector to obtain the first encoding vector corresponding to the search text.
[0115] The words, initial word vectors, word vectors, and semantic weights mentioned in this embodiment refer to the words, initial word vectors, word vectors, and semantic weights of the search text.
[0116] The above step of determining the word vector of the word can be determined by the following formula 1:
[0117]
[0118] The above formula can be regarded as the formula of the attention mechanism, that is, to find the words in the sentence that have the greatest impact on the meaning of the sentence, W w and b w are the adjustable weights and biases of the attention mechanism. is the initial word vector of the tth word in sentence i. The tanh(.) function is the activation function. is the word vector of the tth word in sentence i. The word vector can also be regarded as an implicit representation of the initial word vector.
[0119] The above step of determining the semantic weight of the word can be determined by the following formula 2:
[0120]
[0121] In the above formula is the semantic weight of the tth word in sentence i. w is a randomly initialized context vector. It represents the first word vector similarity between the context vector and the word vector. In the above formula, exp(.) is an exponential function with base e. The denominator of the above formula is the first sum value obtained by superimposing the first word vector similarities corresponding to each word in sentence i.
[0122] In this embodiment, the search text is input into the encoding layer of the trained coarse sorting model; the word vector corresponding to each word in the search text is determined through the word representation network of the encoding layer; the semantic weight of each word in the search text is determined according to the word vector through the sentence representation network of the encoding layer, and the weighted sum of each word vector is performed according to the semantic weight to obtain the first encoding vector that matches the search text. In this way, the first sub-vector of the search text under different semantics can be accurately and quickly captured later, so that the vector interaction process can be carried out as early as possible, ensuring the accuracy of the coarse sorting score, so that each recalled video can be accurately sorted.
[0123] In some embodiments, a first encoding vector corresponding to a recalled video text is obtained through a trained rough sorting model, including: inputting the recalled video text into the encoding layer of the trained rough sorting model; determining the word vector corresponding to each word in the recalled video text through the word representation network of the encoding layer; determining the semantic weight of each word in the recalled video text according to the word vector through the sentence representation network of the encoding layer, and performing weighted summation of each word vector according to the semantic weight to obtain a second encoding vector corresponding to the recalled video text.
[0124] Optionally, the computer device inputs the recalled video text into the encoding layer of the trained coarse sorting model, and performs a word list search after cutting the recalled video text to determine the encoding sequence corresponding to the recalled video text. The encoding sequence includes the initial word vector corresponding to each word. For each word, the computer device determines the word vector corresponding to the word through the second word representation network. For each word, the computer device determines the semantic weight of the word according to the context vector and the word vector of the word through the second sentence representation network. The computer device performs weighted summation of each word vector according to the semantic weight of each word to obtain the second encoding vector corresponding to the recalled video text.
[0125] Exemplarily, after determining the word vector corresponding to each word, the computer device obtains the context vector and calculates the second word vector similarity between the context vector and the word vector of each word. For each word, the computer device determines the sentence in which the word is located, and calculates the second sum of the similarities of the second word vectors in the matrix. For each word, the computer device uses the ratio of the second word vector similarity corresponding to the word to the second sum as the semantic weight of the word. The computer device determines the second attention vector by weighted summation according to the semantic weight and word vector of each word. The computer device performs maximum pooling processing on the encoding sequence to obtain a second pooled vector. The computer device splices the second attention vector and the second pooled vector to obtain a second spliced vector, and embeds a CLS vector of a special classification character [CLS] representing the beginning of the word sequence before the second spliced vector to obtain a second encoding vector corresponding to the recalled video text.
[0126] The words, initial word vectors, word vectors, and semantic weights mentioned in this embodiment refer to the words, initial word vectors, word vectors, and semantic weights of the recalled video text.
[0127] In this embodiment, the recalled video text is input into the encoding layer of the trained coarse sorting model; the word vector corresponding to each word in the recalled video text is determined through the word representation network of the encoding layer; the semantic weight of each word in the recalled video text is determined according to the word vector through the sentence representation network of the encoding layer, and the weighted sum of each word vector is performed according to the semantic weight, so as to obtain a second encoding vector matching the recalled video text. In this way, the second sub-vector of the recalled video text under different semantics can be accurately and quickly captured later, and the vector interaction process can be carried out as early as possible, ensuring the accuracy of the coarse sorting score, so that each recalled video can be accurately sorted.
[0128] In some embodiments, the first encoding vector is mapped to multiple semantic vector subspaces to obtain multiple first subvectors, including: mapping the first encoding vector to multiple semantic vector subspaces through the first mapping layer of a trained coarse-grained model, and obtaining the first subvector of each semantic vector subspace corresponding to the search text.
[0129] The first mapping layer is used to map the semantic vector of the search text into different semantic vector subspaces.
[0130] Optionally, the computer device maps the first encoding vector to a plurality of semantic vector subspaces through a first mapping layer of a trained coarse-grained model, and obtains first vectors of respective semantic vector subspaces corresponding to the search text.
[0131] Exemplarily, each semantic vector subspace corresponds to a first mapping network, and the first mapping layer includes first mapping networks corresponding to each semantic vector subspace. The computer device maps the first encoding vector to each first mapping network of the first mapping layer, respectively, to obtain the first subvector of each semantic vector subspace corresponding to the search text.
[0132] In order to perform similarity calculation based on the vectors later, the mapped vectors need to be normalized to map each first sub-vector to the same standard. Based on this, the computer device maps the first encoding vectors to each first mapping network of the first mapping layer, respectively, obtains the first initial vectors of each semantic vector subspace corresponding to the search text, and normalizes each first initial vector, respectively, to obtain the first subvectors of each semantic vector subspace corresponding to the search text.
[0133] In this embodiment, the first encoding vector can be mapped to different semantic vector subspaces through the first mapping layer to capture the different semantics of the search text, thereby alleviating the problem of polysemy in the search text. In this way, the accuracy of subsequent rough sorting and scoring can be ensured, thereby improving the accuracy of sorting each recalled video.
[0134] In some embodiments, the second encoding vector is mapped to multiple semantic vector subspaces to obtain multiple second subvectors, including: mapping the second encoding vector to multiple semantic vector subspaces through the second mapping layer of the trained coarse-grained model to obtain the second vectors of the recalled video text corresponding to each semantic vector subspace.
[0135] The second mapping layer is used to map the semantic vector of the recalled video text into different semantic vector subspaces.
[0136] Optionally, the computer device maps the second encoding vector to a plurality of semantic vector subspaces through the second mapping layer of the trained coarse-grained model, and obtains the second vector of each semantic vector subspace corresponding to the recalled video text.
[0137] Exemplarily, each semantic vector subspace corresponds to a second mapping network, and the second mapping layer includes second mapping networks corresponding to each semantic vector subspace. The computer device maps the second encoding vector to each second mapping network of the second mapping layer, and obtains the second subvectors of each semantic vector subspace corresponding to the recalled video text.
[0138] In order to perform similarity calculation based on the vectors later, the mapped vectors need to be normalized to map each second sub-vector to the same standard. Based on this, the computer device maps the second encoding vectors to each second mapping network of the second mapping layer, respectively, obtains the second initial vectors of each semantic vector subspace corresponding to the recalled video text, and normalizes each second initial vector, respectively, to obtain the second subvectors of each semantic vector subspace corresponding to the search text.
[0139] In this embodiment, the second encoding vector can be mapped to different semantic vector subspaces through the second mapping layer to capture the different semantics of the recalled video text, thereby alleviating the problem of polysemy of the recalled video text. In this way, the accuracy of subsequent rough sorting and scoring can be ensured, thereby improving the accuracy of sorting each recalled video.
[0140] In some embodiments, the multiple semantic vector subspaces include m semantic vector subspaces, and determining the similarity between each first subvector and each second subvector includes: calculating the subvector similarity between the first subvector of the i-th semantic vector subspace corresponding to the search text and the second subvector of the j-th semantic vector subspace corresponding to the recalled video text; wherein 1≤i≤m, 1≤j≤m; and obtaining the similarity between the search text and the recalled video text according to the subvector similarity, wherein i, j, and m are all natural numbers greater than 0.
[0141] Optionally, for a first subvector of an i-th semantic vector subspace of the search text, the computer device calculates a subvector similarity between the first subvector of the i-th semantic vector subspace of the search text and a second subvector of the j-th semantic vector subspace corresponding to the recalled video text. The computer device determines the similarity between the search text and the recalled video text based on the subvector similarities.
[0142] The similarity between the search text and the recalled video text can be regarded as a similarity matrix, which includes the similarities of each sub-vector.
[0143] For the first subvector of the i-th semantic vector subspace of the search text, the computer device calculates the similarity between the first subvector of the i-th semantic vector subspace of the search text and the second subvector of the j-th semantic vector subspace corresponding to the recalled video text to obtain the subvector similarity. The computer device determines the similarity between the search text and the recalled video text based on the similarities of each subvector.
[0144] For example, the following formula is used to determine the subvector similarity e between the first subvector of the search text corresponding to the i-th semantic vector subspace and the second subvector of the recalled video text corresponding to the j-th semantic vector subspace: ij :
[0145]
[0146] is the transposed vector of the first subvector of the i-th semantic vector subspace corresponding to the search text. j is the second subvector of the jth semantic vector subspace corresponding to the recalled video text.
[0147] In this embodiment, the subvector similarity between the first subvector of the i-th semantic vector subspace corresponding to the search text and the second subvector of the j-th semantic vector subspace corresponding to the recalled video text is calculated; wherein, 1≤i≤m, 1≤j≤m; according to the subvector similarity, the similarity between the search text and the recalled video text is obtained. In this way, the similarity between the first subvector of the search text and the second subvector of the recalled video text can be intuitively and accurately reflected according to the similarity of each subvector. Based on this, the similarity can be referred to in the subsequent process to reasonably determine the first weight and the second weight, so as to ensure the credibility of the first semantic interaction vector and the second semantic interaction vector obtained in the subsequent process, and the accuracy of the rough sorting score can be improved, so that each recalled video can be accurately sorted.
[0148] In some embodiments, Figure 4 FIG. 1 is a flow chart of a step of determining a first semantic interaction vector in an embodiment. Determining a first semantic interaction vector corresponding to a search text based on similarity and each second sub-vector includes:
[0149] Step 402, for the first subvectors of each semantic vector subspace corresponding to the search text, determine the first weights of each second subvector to the first subvector according to the similarities between the first subvector and the second subvectors of each semantic vector subspace corresponding to the recalled video text.
[0150] Optionally, for the first subvector of each semantic vector subspace corresponding to the search text, the computer device superimposes the subvector similarities between the first subvector and the second subvectors of each semantic vector subspace corresponding to the recalled video text to obtain a similarity sum value. The computer device determines a first weight of the second subvector for the first subvector based on the ratio of the subvector similarity between each second subvector and the first subvector to the similarity sum value.
[0151] It should be noted that, the larger the ratio is, the more similar the second sub-vector is to the first sub-vector.
[0152] For example, if there are three semantic vector subspaces, then for search text 1, there are three first vectors, namely a1, a2, and a3. For the recalled video text, there are three second vectors, namely b1, b2, and b3.
[0153] For the first sub-vector a1 of the semantic vector sub-vector 1 corresponding to the search text 1, the sub-vector similarity e between the first sub-vector a1 and the second sub-vector b1 is calculated. 11 Performing the exponential operation on e yields exp(e 11 ), the sub-vector similarity e between the first sub-vector a1 and the second sub-vector b2 12 Performing the exponential operation on e yields exp(e 12 ), the sub-vector similarity e between the first sub-vector a1 and the second sub-vector b3 12 Performing the exponential operation on e yields exp(e 13 ). Let the first weight of the second sub-vector b1 for the first sub-vector a1 be P 11 , the first weight of the second sub-vector b2 for the first sub-vector a1 is P 12 , the first weight of the second sub-vector b3 for the first sub-vector a1 is P 13 ,but:
[0154]
[0155]
[0156]
[0157] Step 404 , weighted summing is performed on the second sub-vectors of each semantic vector subspace corresponding to the recalled video text according to each first weight, to obtain a semantic interaction vector corresponding to the first sub-vector.
[0158] Optionally, for the first subvector of each semantic vector subspace corresponding to the search text, the computer device performs weighted summation on the second subvectors of each semantic vector subspace corresponding to the recalled video text according to each first weight to obtain a semantic interaction vector corresponding to the first subvector.
[0159] Exemplarily, for the first subvector of the i-th semantic vector subspace corresponding to the search text, the semantic interaction vector corresponding to the first subvector is The calculation formula is as follows:
[0160]
[0161] In the above process b j is the second subvector of the jth semantic vector subspace. ∑(.) is the summation function. e ij It refers to the subvector similarity between the first subvector of the i-th semantic vector subspace and the second subvector of the j-th semantic vector subspace, exp(e ij) is obtained by performing an exponential operation of e on the subvector similarity between the first subvector of the i-th semantic vector subspace and the second subvector of the j-th semantic vector subspace. exp(e ik ) is obtained by performing an exponential operation of e on the subvector similarity between the first subvector of the i-th semantic vector subspace and the second subvector of the k-th semantic vector subspace.
[0162] For example, we now need to take the first subvector a of the first semantic vector subspace 1 Semantic interaction vector It can be calculated using the following formula:
[0163]
[0164] Step 406: Determine the first semantic interaction vector corresponding to the search text according to the semantic interaction vectors corresponding to the first sub-vectors.
[0165] The first semantic interaction vector includes semantic interaction vectors corresponding to each first sub-vector.
[0166] In this embodiment, for the first subvector of each semantic vector subspace corresponding to the search text, the first weight of each second subvector for the first subvector is determined according to the similarity between the first subvector and the second subvector of each semantic vector subspace corresponding to the recalled video text, that is, according to the actual similarity between the first subvector and the second subvector, the first weight matching it is determined, ensuring the validity and credibility of the first weight. In this way, according to each first weight, the second subvector of each semantic vector subspace corresponding to the recalled video text is weighted and summed to obtain the semantic interaction vector corresponding to the first subvector. That is, the higher the similarity between the first subvector and the second subvector, the greater the probability of belonging to the same semantic vector subspace. Based on this, by increasing the weight of the second subvector corresponding to the high similarity, the accuracy of the semantic interaction vector obtained by the interaction is ensured, and then the accuracy of the first semantic interaction vector corresponding to the search text is ensured. In addition, before the rough judgment and scoring, the interaction process is first performed, which can solve the problem of detail feature loss due to too late interaction timing, ensure the accuracy of the rough sorting score, and thus, accurately sort each recalled video.
[0167] In some embodiments, Figure 5 FIG. 1 is a flow chart of a second semantic interaction vector determination step in an embodiment. Determining the second semantic interaction vector corresponding to the recalled video text based on the similarity and each first sub-vector includes:
[0168] Step 502: for the second subvectors of each semantic vector subspace corresponding to the recalled video text, determine the second weights of each first subvector to the second subvector according to the similarities between the second subvectors and the first subvectors of each semantic vector subspace corresponding to the search text.
[0169] Optionally, for each second subvector of the semantic vector subspace corresponding to the recalled video text, the computer device superimposes the subvector similarities between the second subvector and the first subvectors of the semantic vector subspaces corresponding to the recalled video text to obtain a similarity sum value. The computer device determines a second weight of the first subvector for the second subvector based on the ratio of the subvector similarity between each first subvector and the second subvector to the similarity sum value.
[0170] It should be noted that, the larger the ratio is, the more similar the second sub-vector is to the first sub-vector.
[0171] For example, if there are three semantic vector subspaces, then for search text 1, there are three first vectors, namely a1, a2, and a3. For the recalled video text, there are three second vectors, namely b1, b2, and b3.
[0172] For the first sub-vector a1 of the semantic vector sub-vector 1 corresponding to the search text 1, the sub-vector similarity e between the first sub-vector a1 and the second sub-vector b1 is calculated. 11 Performing the exponential operation on e yields exp(e 11 ), the sub-vector similarity e between the first sub-vector a2 and the second sub-vector b1 21 Performing the exponential operation on e yields exp(e 21 ), the sub-vector similarity e between the first sub-vector a3 and the second sub-vector b1 31 Performing the exponential operation on e yields exp(e 31 ). Let the second weight of the first sub-vector a1 for the second sub-vector b1 be P 11 , the second weight of the first sub-vector a2 to the second sub-vector b1 is P 21 , the second weight of the first sub-vector a3 to the second sub-vector b is P 31 ,but:
[0173]
[0174]
[0175]
[0176] Step 504 , performing weighted summation on the first sub-vectors of each semantic vector subspace corresponding to the search text according to each second weight, to obtain a semantic interaction vector corresponding to the second sub-vector.
[0177] Optionally, for the second subvector of each semantic vector subspace corresponding to the recalled video text, the computer device performs weighted summation on the first subvectors of each semantic vector subspace corresponding to the search text according to each second weight to obtain a semantic interaction vector corresponding to the second subvector.
[0178] Exemplarily, for the second subvector of the i-th semantic vector subspace corresponding to the recalled video text, the semantic interaction vector corresponding to the second subvector is The calculation formula is as follows:
[0179]
[0180] In the above process, a j is the first subvector of the jth semantic vector subspace. ∑(.) is the summation function. exp(e ij ) is obtained by performing an exponential operation of e on the subvector similarity between the second subvector of the i-th semantic vector subspace and the first subvector of the j-th semantic vector subspace. exp(e ki ) is obtained by performing an exponential operation of e on the subvector similarity between the second subvector of the i-th semantic vector subspace and the first subvector of the k-th semantic vector subspace.
[0181] For example, we now need to take the second subvector b of the first semantic vector subspace 1 Semantic interaction vector It can be calculated using the following formula:
[0182]
[0183] Step 506: Determine the second semantic interaction vector corresponding to the recalled video text according to the semantic interaction vectors corresponding to the second sub-vectors.
[0184] The second semantic interaction vector includes semantic interaction vectors corresponding to each second sub-vector.
[0185] In this embodiment, for the second subvector of each semantic vector subspace corresponding to the recalled video text, the second weight of each first subvector for the second subvector is determined according to the similarity between the second subvector and the first subvector of each semantic vector subspace corresponding to the search text, that is, according to the actual similarity between the second subvector and each first subvector, the second weight matching it is determined, ensuring the validity and credibility of the second weight. In this way, according to each second weight, the first subvector of each semantic vector subspace corresponding to the search text is weighted and summed to obtain the semantic interaction vector corresponding to the second subvector. That is, the higher the similarity between the first subvector and the second subvector, the greater the probability of belonging to the same semantic vector subspace. Based on this, by increasing the weight of the first subvector corresponding to the high similarity, the accuracy of the semantic interaction vector obtained by the interaction is ensured, and then the accuracy of the second semantic interaction vector corresponding to the recalled video text is ensured. In addition, before the rough judgment and scoring, the interaction process is first performed, which can solve the problem of detail feature loss due to too late interaction timing, ensure the accuracy of the rough sorting score, and thus, accurately sort each recalled video.
[0186] In some embodiments, a coarse ranking score is determined based on the first semantic interaction vector and the second semantic interaction vector, including: enhancing the first semantic interaction vector based on each first sub-vector to determine a first enhanced interaction vector corresponding to the search text; enhancing the second semantic interaction vector based on each second sub-vector to determine a second enhanced interaction vector corresponding to the recalled video text; and mapping a spliced vector obtained by splicing the first enhanced interaction vector and the second enhanced interaction vector to a coarse ranking score.
[0187] Optionally, the computer device determines the semantic interaction vectors corresponding to each first subvector included in the first semantic interaction vector. For each semantic vector subspace, the computer device determines the first difference between the first subvector corresponding to the semantic vector subspace and the semantic interaction vector corresponding to the first subvector, and the computer device determines the first initial enhanced interaction vector corresponding to the search text based on the first subvector corresponding to the semantic vector subspace, the semantic interaction vector corresponding to the first subvector, and the corresponding first difference. The computer device performs a maximum pooling operation on the first initial enhanced interaction vector to determine the first enhanced interaction vector corresponding to the search text.
[0188] For each semantic vector subspace, the computer device determines a second difference between a second subvector corresponding to the semantic vector subspace and a semantic interaction vector corresponding to the second subvector, and the computer device determines a second initial enhanced interaction vector corresponding to the recalled video text according to the second subvector corresponding to the semantic vector subspace, the semantic interaction vector corresponding to the second subvector, and the corresponding second difference. The computer device performs a maximum pooling operation on the second initial enhanced interaction vector to determine a second enhanced interaction vector corresponding to the recalled video text.
[0189] The computer device concatenates the first enhanced interaction vector and the second enhanced interaction vector to obtain a concatenated vector, and performs activation processing after scoring through a scoring network to determine a coarse ranking score. The scoring network can be viewed as a two-layer feedforward neural network. Exemplarily, after obtaining an initial coarse ranking score through scoring through the scoring network, the initial coarse ranking score is processed through an activation function to obtain a coarse ranking score with a score between [-1, 1]. For example, the activation function can be a tanh function.
[0190] For example, for the mth semantic vector subspace, the corresponding first subvector is a m , and the first subvector a m The corresponding semantic interaction vector Computer equipment determines a m and at least one first difference between m , and at least one first difference to obtain the first subvector a m The computer device obtains the enhanced interaction vector corresponding to each first sub-vector and determines the first enhanced interaction vector corresponding to the search text. The first difference can be a m and The product of m and The difference between.
[0191] Similarly, for the mth semantic vector subspace, the corresponding second subvector is b m , and the second subvector b m The corresponding semantic interaction vector Computer equipment determination m and at least one second difference between m and and at least one second difference to obtain the second subvector b m The computer device obtains the enhanced interaction vector corresponding to each second sub-vector and determines the second enhanced interaction vector corresponding to the recalled video text. The second difference may be bm and The product of m and The difference between.
[0192] It should be noted that, by representing the difference between the first subvector of each semantic vector subspace and the semantic interaction vector corresponding to the first subvector, the information of the contradiction between the first subvector and the semantic interaction vector corresponding to the first subvector is reflected, and the detailed information about the vector of the search text (i.e., the first enhanced interaction vector) used to calculate the rough ranking score is further expanded. Similarly, by representing the difference between the second subvector of each semantic vector subspace and the semantic interaction vector corresponding to the second subvector, the information of the contradiction between the second subvector and the semantic interaction vector corresponding to the second subvector is reflected, and the detailed information about the vector of the recalled video text (i.e., the second enhanced interaction vector) used to calculate the rough ranking score is further expanded. Based on this, the effectiveness and accuracy of the rough ranking score are ensured according to the first enhanced interaction vector and the second enhanced interaction vector with rich detailed information.
[0193] Further, in some embodiments, the first semantic interaction vector is enhanced according to each first sub-vector to determine the first enhanced interaction vector corresponding to the search text, including: for each first sub-vector, calculating the first difference between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector, and calculating the first product between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector; concatenating the first sub-vector, the semantic interaction vector corresponding to the first sub-vector, the first difference and the first product to obtain the enhanced interaction vector corresponding to the first sub-vector; and determining the first enhanced interaction vector corresponding to the search text according to the enhanced interaction vectors corresponding to each first sub-vector.
[0194] For example, the first subvector corresponding to the mth semantic vector subspace is a m , and the first subvector a m The corresponding semantic interaction vector The computer device determines a first difference between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector, that is, And, after determining the first product between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector, that is, Then, the enhanced interaction vector E corresponding to the first sub-vector is determined m , that is
[0195] It can be seen that for each first sub-vector, the first difference between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector is calculated, and the first product between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector is calculated. Based on this, the first difference and the first product can further enrich the contradictory information between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector. By splicing the first sub-vector, the semantic interaction vector corresponding to the first sub-vector, the first difference and the first product, an enhanced interaction vector corresponding to the first sub-vector with richer detail information can be obtained; according to the enhanced interaction vectors corresponding to each first sub-vector, the first enhanced interaction vector corresponding to the search text is determined, and the detailed information of the first enhanced interaction vector about the search text used to calculate the rough ranking score is expanded, which is conducive to obtaining accurate rough ranking scores in the subsequent process and improves the accurate sorting of each recalled video.
[0196] In some embodiments, the second semantic interaction vector is enhanced according to each second sub-vector to determine the second enhanced interaction vector corresponding to the recalled video text, including: for each second sub-vector, calculating the second difference between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector, and calculating the second product between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector; concatenating the second sub-vector, the semantic interaction vector corresponding to the second sub-vector, the second difference and the second product to obtain the enhanced interaction vector corresponding to the second sub-vector; and determining the second enhanced interaction vector corresponding to the recalled video text according to the enhanced interaction vectors corresponding to each second sub-vector.
[0197] For example, the second subvector corresponding to the mth semantic vector subspace is b m , and the second subvector b m The corresponding semantic interaction vector The computer device determines the second difference between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector, that is, And, after determining the second product between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector, that is, Then, the enhanced interaction vector F corresponding to the second sub-vector is determined m , that is
[0198] It can be seen that for each second sub-vector, the second difference between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector is calculated, and the second product between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector is calculated. Based on this, the second difference and the second product can further enrich the contradictory information between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector. By splicing the second sub-vector, the semantic interaction vector corresponding to the second sub-vector, the second difference and the second product, an enhanced interaction vector corresponding to the second sub-vector with richer detail information can be obtained; according to the enhanced interaction vectors corresponding to each second sub-vector, the second enhanced interaction vector corresponding to the recalled video text is determined, and the detailed information about the second enhanced interaction vector of the recalled video text used to calculate the rough ranking score is expanded, which is conducive to obtaining an accurate rough ranking score in the subsequent process, and each recalled video can be accurately sorted.
[0199] In this embodiment, the first semantic interaction vector is enhanced according to each first sub-vector, the first enhanced interaction vector corresponding to the search text is determined, and the detailed information of the first enhanced interaction vector about the search text used to calculate the rough ranking score is expanded; according to each second sub-vector, the second semantic interaction vector is enhanced, the second enhanced interaction vector corresponding to the recalled video text is determined, and the detailed information of the second enhanced interaction vector about the recalled video text used to calculate the rough ranking score is expanded. In this way, by mapping the spliced vector obtained by splicing the first enhanced interaction vector and the second enhanced interaction vector into the rough ranking score, the accuracy of the rough ranking score is improved, so that each recalled video can be accurately sorted.
[0200] In one embodiment, Figure 6The above is a flow chart of determining a rough sorting score in one embodiment. The computer device obtains a first coding vector corresponding to the search text, and determines each first sub-vector corresponding to the first coding vector. The computer device obtains a second coding vector corresponding to the recalled video text, and determines each second sub-vector corresponding to the second coding vector. The computer device splices each first sub-vector to determine a first multi-semantic vector, and splices each second sub-vector to determine a second multi-semantic vector. The computer device determines a similarity matrix based on the similarities between each first sub-vector in the first multi-semantic vector and each second sub-vector in the second multi-semantic vector. The computer device determines a first semantic interaction vector corresponding to the search text based on each similarity in the similarity matrix and the second multi-semantic vector, and determines a second semantic interaction vector corresponding to the recalled video text based on each similarity in the similarity matrix and each first multi-semantic vector. The computer device enhances the first semantic interaction vector based on the first multi-semantic vector to obtain a first enhanced interaction vector corresponding to the search text, and the computer device enhances the second semantic interaction vector based on the second multi-semantic vector to obtain a second enhanced interaction vector corresponding to the recalled video text. The computer device determines the coarse sorting score according to the trained scoring network of the coarse sorting model and the first enhanced interaction vector and the second enhanced interaction vector.
[0201] In this embodiment, by mapping the first coding vector to multiple semantic vector subspaces to obtain multiple first subvectors, different semantics of the search text can be captured, thereby alleviating the problem of polysemy of the search text. The second coding vector is mapped to multiple semantic vector subspaces to obtain multiple second subvectors, which can capture different semantics of the recalled video text, thereby alleviating the problem of polysemy of the recalled video text. The similarity between each first subvector and each second subvector is determined, and the first semantic interaction vector corresponding to the search text is determined based on the similarity and each second subvector, and the second semantic interaction vector corresponding to the recalled video text is determined based on the similarity and each first subvector. In this way, before the rough sorting and scoring are performed, the first subvectors of the search text and the second subvectors of the recalled video text can be interacted in advance, thereby improving the accuracy of the subsequent rough sorting and scoring. The rough sorting score is determined according to the first semantic interaction vector and the second semantic interaction vector. Based on this, by interacting the first subvector and the second subvector in advance, the problem of loss of detail features due to too late interaction can be avoided, and the accuracy of the rough sorting score is ensured, thereby accurately sorting each recalled video.
[0202] In some instances, such as Figure 7 As shown, a model training method is provided, which is applied to a computer device (which may be Figure 1 The server 104 in may also be Figure 1 The terminal 102 in the example is used as an example to illustrate, and the following steps are included:
[0203] Step 702: Obtain training samples, where the training samples include sample search text and sample video text corresponding to the sample search text.
[0204] The sample search text involved in this embodiment refers to the search terms used for model training. The sample video text includes positive sample video text and negative sample video text.
[0205] Optionally, the computer device obtains training samples from historical exposure video click data. For example, based on the sample search text input by the user, multiple exposure videos are exposed on the search interface. At this time, based on the click data fed back by the user, the video text of the exposure video with high clicks can be used as the positive sample video text corresponding to the sample search text, and the video text of the exposure video with low clicks can be used as the positive sample video text corresponding to the sample search text. For another example, based on the sequence of user search click behavior, the similarity between the sample search text and the video text of each exposure video is determined, and the video text corresponding to the high similarity is used as the positive sample video text corresponding to the sample search text, and the video text corresponding to the low similarity is used as the positive sample video text corresponding to the sample search text.
[0206] Step 704, through the coarse sorting model, obtain the first encoding vector corresponding to the sample search text, map the first encoding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtain the second encoding vector corresponding to the sample video text, map the second encoding vector to multiple semantic vector subspaces to obtain multiple second subvectors.
[0207] Among them, the coarse-grained model is a pre-trained coarse-grained model, that is, a model to be trained.
[0208] Optionally, the computer device obtains a first coding vector corresponding to the sample search text and a second coding vector corresponding to the sample video text through a coarse sorting model. The computer device determines a plurality of preset semantic vector subspaces, and the computer device maps the first coding vector to each semantic vector subspace through a coarse sorting model to obtain a first subvector corresponding to each semantic vector subspace, and maps the second coding vector to each semantic vector subspace to obtain a second subvector corresponding to each semantic vector subspace.
[0209] Exemplarily, the computer device obtains the first coding vector corresponding to the sample search text and the second coding vector corresponding to the sample video text through the coding layer of the coarse-grained model. After determining the first coding vector corresponding to the sample search text and the second coding vector corresponding to the sample video text, for the same semantic vector subspace, the computer device maps the first coding vector and the second coding vector to the semantic vector subspace through the coarse-grained model, respectively, to obtain the first subvector and the second subvector corresponding to the semantic vector subspace.
[0210] In some embodiments, the first encoding vector is mapped to multiple semantic vector subspaces to obtain multiple first subvectors, including: mapping the first encoding vector to multiple semantic vector subspaces through a first mapping layer of a coarse sorting model, and obtaining the first subvectors of each semantic vector subspace corresponding to the sample search text.
[0211] Optionally, the computer device maps the first encoding vector to a plurality of semantic vector subspaces through a first mapping layer of a coarse-grained model, and obtains first vectors of respective semantic vector subspaces corresponding to the sample search text.
[0212] In this embodiment, the first encoding vector can be mapped to different semantic vector subspaces through the first mapping layer to capture the different semantics of the sample search text, thereby alleviating the problem of polysemy of the sample search text. In this way, the accuracy of the scoring of the subsequently trained coarse sorting model can be ensured.
[0213] In some embodiments, the second encoding vector is mapped to multiple semantic vector subspaces to obtain multiple second subvectors, including: mapping the second encoding vector to multiple semantic vector subspaces through a second mapping layer of a coarse-grained model to obtain second vectors of each semantic vector subspace corresponding to the sample video text.
[0214] Optionally, the computer device maps the second encoding vector to a plurality of semantic vector subspaces through a second mapping layer of the coarse-grained model, and obtains second vectors of respective semantic vector subspaces corresponding to the sample video text.
[0215] In this embodiment, the second encoding vector can be mapped to different semantic vector subspaces through the second mapping layer to capture the different semantics of the sample video text, thereby alleviating the problem of polysemy of the sample video text. In this way, the accuracy of the scoring of the subsequently trained coarse sorting model can be ensured.
[0216] Step 706, determine the similarity between each first sub-vector and each second sub-vector, determine the first semantic interaction vector corresponding to the sample search text based on the similarity and each second sub-vector, and determine the second semantic interaction vector corresponding to the sample video text based on the similarity and each first sub-vector.
[0217] Optionally, for each first sub-vector, the computer device calculates the similarity between the first sub-vector and each second sub-vector. For each first sub-vector, the computer device determines the third weight of each second sub-vector with respect to the first sub-vector according to the first similarity between the first sub-vector and each second sub-vector. The higher the first similarity, the greater the third weight corresponding to the first similarity.
[0218] For each second sub-vector, the computer device determines the fourth weight of each first sub-vector for the second sub-vector according to the second similarity between the second sub-vector and each first sub-vector. The higher the second similarity, the greater the fourth weight corresponding to the second similarity.
[0219] Optionally, for each first sub-vector, the computer device sorts the first sub-vector and each second sub-vector according to the first similarity, and obtains a first sorting result of the first similarity. The greater the first similarity, the smaller the corresponding sequence number in the first sorting result. The computer device determines the third weight of each second sub-vector for the first sub-vector from a plurality of preset weights according to the first sorting result. The smaller the sequence number in the first sorting result, the larger the corresponding third weight.
[0220] For each second sub-vector, the computer device sorts the second sub-vector and the second similarities between the first sub-vectors to obtain a second sorting result of the second similarity. The greater the second similarity, the smaller the corresponding sequence number in the second sorting result. The computer device determines the fourth weight of each first sub-vector for the second sub-vector from a plurality of preset weights according to the second sorting result. The smaller the sequence number in the second sorting result, the larger the corresponding fourth weight.
[0221] In some embodiments, the multiple semantic vector subspaces include m semantic vector subspaces, and determining the similarity between each first subvector and each second subvector includes: calculating the subvector similarity between the first subvector of the i-th semantic vector subspace corresponding to the sample search text and the second subvector of the j-th semantic vector subspace corresponding to the sample video text; wherein, 1≤i≤m, 1≤j≤m; and obtaining the similarity between the sample search text and the sample video text based on the subvector similarity.
[0222] In this embodiment, the similarity between the first subvector of the sample search text and the second subvector of the sample video text can be intuitively and accurately reflected through the similarity of each subvector. Based on this, the third weight and the fourth weight can be reasonably determined by referring to the similarity in the future, which is conducive to improving the accuracy of the model.
[0223] In some embodiments, the first semantic interaction vector corresponding to the sample search text is determined based on the similarity and each second sub-vector, including: for the first sub-vector of each semantic vector subspace corresponding to the sample search text, according to the similarity between the first sub-vector and the second sub-vector of each semantic vector subspace corresponding to the sample video text, determining the third weight of each second sub-vector with respect to the first sub-vector; according to each third weight, performing weighted summation on the second sub-vectors of each semantic vector subspace corresponding to the sample video text to obtain the semantic interaction vector corresponding to the first sub-vector; according to the semantic interaction vectors corresponding to each first sub-vector, determining the first semantic interaction vector corresponding to the sample search text.
[0224] Optionally, for the first subvector of each semantic vector subspace corresponding to the sample search text, the computer device superimposes the subvector similarities between the first subvector and the second subvectors of each semantic vector subspace corresponding to the sample video text to obtain a similarity sum value. The computer device determines the third weight of the second subvector for the first subvector based on the ratio of the subvector similarity between each second subvector and the first subvector to the similarity sum value. The computer device performs weighted summation of the second subvectors of each semantic vector subspace corresponding to the sample video text according to each third weight to obtain a semantic interaction vector corresponding to the first subvector. Based on the semantic interaction vectors corresponding to each first subvector, the first semantic interaction vector corresponding to the sample search text is determined.
[0225] In this embodiment, the third weight matching the first subvector corresponding to the sample search text and the second subvector corresponding to the sample video text is determined according to the actual similarity between them, thereby ensuring the validity and credibility of the third weight. In this way, the second subvectors of each semantic vector subspace corresponding to the sample video text are weighted and summed according to each third weight to obtain the semantic interaction vector corresponding to the first subvector.
[0226] In some embodiments, determining a second semantic interaction vector corresponding to a sample video text based on similarity and each first sub-vector includes: for the second sub-vector of each semantic vector subspace corresponding to the sample video text, determining a fourth weight of each first sub-vector with respect to the second sub-vector according to the similarity between the second sub-vector and the first sub-vector of each semantic vector subspace corresponding to the sample search text; performing weighted summation of the first sub-vectors of each semantic vector subspace corresponding to the sample search text according to each fourth weight to obtain a semantic interaction vector corresponding to the second sub-vector; and determining a second semantic interaction vector corresponding to the sample video text according to the semantic interaction vector corresponding to each second sub-vector.
[0227] Optionally, for the second subvector of each semantic vector subspace corresponding to the sample video text, the computer device superimposes the subvector similarities between the second subvector and the first subvector of each semantic vector subspace corresponding to the recalled video text to obtain a similarity sum value. The computer device determines the fourth weight of the first subvector for the second subvector based on the ratio of the subvector similarity between each first subvector and the second subvector to the similarity sum value. For the second subvector of each semantic vector subspace corresponding to the sample video text, the computer device performs weighted summation of the first subvectors of each semantic vector subspace corresponding to the search text according to each fourth weight to obtain a semantic interaction vector corresponding to the second subvector. Based on the semantic interaction vectors corresponding to each second subvector, the second semantic interaction vector corresponding to the sample video text is determined.
[0228] In this embodiment, the fourth weights that match the second sub-vectors corresponding to the sample video texts are determined based on the actual similarities between the first sub-vectors corresponding to the sample video texts, thereby ensuring the validity and credibility of the fourth weights. Thus, the first sub-vectors of the semantic vector subspaces corresponding to the sample search texts are weighted and summed according to the fourth weights to obtain the semantic interaction vectors corresponding to the second sub-vectors.
[0229] Step 708: Determine a coarse ranking score according to the first semantic interaction vector and the second semantic interaction vector; the coarse ranking score represents the degree of relevance between the sample search text and the sample video text.
[0230] In some embodiments, a coarse sorting score is determined based on the first semantic interaction vector and the second semantic interaction vector, including: enhancing the first semantic interaction vector based on each first sub-vector to determine a first enhanced interaction vector corresponding to the sample search text; enhancing the second semantic interaction vector based on each second sub-vector to determine a second enhanced interaction vector corresponding to the sample video text; and mapping a spliced vector obtained by splicing the first enhanced interaction vector and the second enhanced interaction vector to a coarse sorting score.
[0231] Furthermore, according to each first sub-vector, the first semantic interaction vector is enhanced to determine the first enhanced interaction vector corresponding to the sample search text, including: for each first sub-vector, calculating the third difference between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector, and calculating the third product between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector; concatenating the first sub-vector, the semantic interaction vector corresponding to the first sub-vector, the third difference and the third product to obtain the enhanced interaction vector corresponding to the first sub-vector; and determining the first enhanced interaction vector corresponding to the sample search text according to the enhanced interaction vectors corresponding to each first sub-vector.
[0232] Furthermore, according to each second sub-vector, the second semantic interaction vector is enhanced to determine the second enhanced interaction vector corresponding to the sample video text, including: for each second sub-vector, calculating the fourth difference between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector, and calculating the fourth product between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector; concatenating the second sub-vector, the semantic interaction vector corresponding to the second sub-vector, the fourth difference and the fourth product to obtain the enhanced interaction vector corresponding to the second sub-vector; and determining the second enhanced interaction vector corresponding to the sample video text according to the enhanced interaction vectors corresponding to each of the second sub-vectors.
[0233] In this embodiment, the first semantic interaction vector is enhanced according to each first sub-vector, the first enhanced interaction vector corresponding to the sample search text is determined, and the detailed information about the first enhanced interaction vector of the sample search text used to calculate the rough ranking score is expanded; according to each second sub-vector, the second semantic interaction vector is enhanced, the second enhanced interaction vector corresponding to the sample video text is determined, and the detailed information about the second enhanced interaction vector of the sample video text used to calculate the rough ranking score is expanded.
[0234] Step 710, determining the model loss according to the subspace similarity between each first subvector, the subspace similarity between each second subvector and the coarse sorting score, training the coarse sorting model according to the model loss, and using the trained coarse sorting model to perform video search response to the search text.
[0235] As mentioned above, the sample video text includes positive sample video text and negative sample video text. The model loss is positively correlated with the subspace similarity, negatively correlated with the coarse ranking score between the sample search text and the positive sample video text, and positively correlated with the coarse ranking score between the search text and the negative sample video text.
[0236] Optionally, the computer device determines the model loss according to the subspace similarity between each first subvector, the subspace similarity between each second subvector, and the coarse ranking score. The computer device determines the refined ranking score according to the sample search text and the video text through the online refined ranking model. The computer device determines the distillation loss according to the difference between the refined ranking score and the coarse ranking score. The model loss and the distillation loss are combined to perform model training on the coarse ranking model.
[0237] The above-mentioned model training method obtains training samples, and the training samples include sample search texts and sample video texts corresponding to the sample search texts; obtains the first encoding vector corresponding to the sample search texts through the coarse sorting model, maps the first encoding vector to multiple semantic vector subspaces to obtain multiple first subvectors, and uses multiple subvectors in different semantic vector subspaces to represent the same search text, so as to capture the different semantics of the sample search text in various aspects. Obtain the second encoding vector corresponding to the sample video text, map the second encoding vector to multiple semantic vector subspaces to obtain multiple second subvectors, and use multiple subvectors in different semantic vector subspaces to represent the same recall video text, so as to capture the different semantics of the sample video text in various aspects. Determine the similarity between each first subvector and each second subvector, determine the first semantic interaction vector corresponding to the sample search text based on the similarity and each second subvector, and determine the second semantic interaction vector corresponding to the sample video text based on the similarity and each first subvector. In this way, before the coarse sorting model is scored, the first subvectors of the sample search text and the second subvectors of the sample video text can be interacted in advance, and the interaction enhancement of the other party's own subvectors can be used to alleviate the problem of being unable to identify the polysemy of the search text as much as possible, and the representation vector of the search text and the representation vector of the recalled video text can be deeply interacted, thereby improving the accuracy of the coarse sorting score. According to the first semantic interaction vector and the second semantic interaction vector, the coarse sorting score is determined; the coarse sorting score represents the degree of correlation between the sample search text and the sample video text; according to the subspace vector similarity between the first subvectors, the subspace vector similarity between the second subvectors and the coarse sorting score, the model loss is determined, and the coarse sorting model is trained according to the model loss. The trained coarse sorting model is used to respond to the video search for the search text. In this way, similar samples can be brought closer through the coarse sorting score, and the semantic expression of the sentence can be optimized. At the same time, through the subspace vector similarity between the first subvectors and the subspace vector similarity between the second subvectors, the distance between the first semantic interaction vectors of different semantics can be increased, and the distance between the second semantic interaction vectors of different semantics can be increased, thereby ensuring the accuracy of the subsequent coarse sorting model scoring. Therefore, the trained coarse-grained ranking model can improve the semantic matching ability of the model and the accuracy of the coarse-grained ranking model scoring, so that each recalled video can be accurately sorted.
[0238] In some embodiments, before step 710, the method further includes: for the first subvectors of each semantic vector subspace corresponding to the sample search text, calculating the similarity between the two first subvectors to obtain the subspace similarity between the first subvectors; for the second subvectors of each semantic vector subspace corresponding to the sample video text, calculating the similarity between the two second subvectors to obtain the subspace similarity between the second subvectors.
[0239] Exemplarily, there are three semantic vector subspaces, and the first subvectors of the sample search text corresponding to each semantic vector subspace are x1, x2, and x3 respectively; the second subvectors of the sample video text corresponding to each semantic vector subspace are y1, y2, and y3 respectively. For the first subvector of each semantic vector subspace corresponding to the sample search text, the subspace similarity between the first subvector x1 and the first subvector x2, the subspace similarity between the first subvector x1 and the first subvector x3, and the subspace similarity between the first subvector x3 and the first subvector x2 are calculated. For the second subvector of each semantic vector subspace corresponding to the sample video text, the subspace similarity between the second subvector y1 and the second subvector y2, the subspace similarity between the second subvector y1 and the second subvector y3, and the subspace similarity between the second subvector y3 and the second subvector y2 are calculated.
[0240] Based on this, the subspace similarity refers to the subspace similarity of any two different first subvectors under the same sample search text, or refers to the subspace similarity of any two different second subvectors under the same sample video text.
[0241] In this embodiment, for the first subvectors of each semantic vector subspace corresponding to the sample search text, the similarity between the two first subvectors is calculated to obtain the subspace similarity between the first subvectors. In this way, according to the subspace similarity between the first subvectors, the distance between the two first subvectors can be timely and accurately reflected. For the second subvectors of each semantic vector subspace corresponding to the sample video text, the similarity between the two second subvectors is calculated to obtain the subspace similarity between the second subvectors. In this way, according to the subspace similarity between the second subvectors, the distance between the two second subvectors can be timely and accurately reflected. Based on this, the subsequent model training combined with the subspace similarity can ensure that the trained coarse-separated model increases the distance between the first semantic interaction vectors of different semantics, and increases the distance between the second semantic interaction vectors of different semantics, thereby improving the accuracy of the model.
[0242] In some embodiments, the sample video text includes a positive sample video text and a negative sample video text, and the coarse ranking score includes a positive sample coarse ranking score corresponding to the sample search text and the positive sample video text and a negative sample coarse ranking score corresponding to the sample search text and the negative sample video text; the model loss is determined according to the subspace similarity between each first subvector, the subspace similarity between each second subvector and the coarse ranking score, including: determining the model loss according to the positive sample coarse ranking score, the subspace similarity between each first subvector, the subspace similarity between each second subvector and the negative sample coarse ranking score; wherein the model loss is positively correlated with the subspace similarity, negatively correlated with the positive sample coarse ranking score, and positively correlated with the negative sample coarse ranking score.
[0243] Optionally, the computer device obtains each training sample, and determines a positive sample coarse ranking score, a subspace similarity between each first subvector, a subspace similarity between each second subvector, and a negative sample coarse ranking score corresponding to each training sample.
[0244] For each training sample, the computer device uses the sample video texts of other training samples except the training sample as the newly added negative samples of the training sample. For each newly added negative sample of each training sample, the computer device determines the coarse sorting score of the newly added negative sample according to the sample search text of the training sample and the newly added negative sample through the coarse sorting model.
[0245] For each training sample, the computer device uses the positive sample coarse ranking score of the training sample as the numerator, and uses the sum of the subspace similarity between each first subvector, the subspace similarity between each second subvector, the negative sample coarse ranking score, and the coarse ranking score of each newly added negative sample as the denominator. The computer device determines the sub-model loss corresponding to the training sample based on the numerator and denominator corresponding to the training sample. The computer device superimposes the sub-model losses corresponding to each training sample to obtain the model loss.
[0246] For example, if the number of training samples in the current iteration is B, each training sample includes a sample search text, a positive sample video text, and a negative sample video text. Take the sub-model loss of the hth training sample as an example for explanation:
[0247]
[0248] The above S hh It refers to the coarse ranking score of the positive sample of the hth training sample. It refers to the sum of the rough ranking scores of negative samples and the rough ranking scores of each newly added negative sample. g is not equal to h, that is, the rough ranking score of the positive sample excluding the h-th training sample. R refers to the sum of the subspace similarities between the first subvectors corresponding to the h-th training sample, and Q refers to the sum of the subspace similarities between the second subvectors corresponding to the h-th training sample.
[0249] In this embodiment, the model loss is constructed based on the coarse ranking score of the positive sample, the subspace similarity between each first subvector, the subspace similarity between each second subvector, and the coarse ranking score of the negative sample. Model training is performed based on the model loss, so that the trained coarse ranking model can pull in similar samples, pull out different samples, and optimize the semantic expression. In addition, the distance between the first semantic interaction vectors between different semantics can be increased, and the distance between the second semantic interaction vectors between different semantics can be increased, so as to ensure the accuracy of the subsequent coarse ranking model scoring. In this way, the trained coarse ranking model can improve the semantic matching ability of the model and the accuracy of the coarse ranking model scoring, so that each recalled video can be accurately sorted.
[0250] In order to optimize the training process of the coarse-ranking model and ensure the training effect, a multi-stage fine-tuning method is used to train the model. For example, the model training is carried out through two fine-tuning stages in sequence, namely the first fine-tuning stage and the second fine-tuning stage. In order to ensure the consistency of the scores of the trained coarse-ranking model and the online fine-ranking model, both fine-tuning stages involve the process of distillation learning based on the online fine-ranking model. In order to further improve the accuracy of the trained coarse-ranking model, the first fine-tuning stage also adds the learning of other tasks, such as named entity recognition tasks and search text classification tasks. Among them, the named entity recognition task is used to identify entities with specific meanings in the sample search text or sample video text, such as identifying place names and names in the sample search text or sample video text. The search text classification task is used to identify the type of the sample search text. Based on this, the first fine-tuning stage involves model loss, distillation learning loss, named entity recognition loss and search text classification loss.
[0251] In some embodiments, Figure 8 , which is a schematic diagram of determining a pre-trained coarse sorting model in one embodiment. The computer device processes the pre-trained video text into a word sequence, and embeds a CLS vector of a special classification character [CLS] representing the beginning of the word sequence before the word sequence, and embeds a SEP vector of a special classification character [SEP] for separating word sequences after the word sequence. The computer device processes the CLS vector, the word sequence ( Figure 8 The SEP vector in D) is input into the model to be trained for pre-training to obtain a trained pre-trained coarse-sequence model, that is, the coarse-sequence model used in the first fine-tuning stage.
[0252] In the first fine-tuning stage, after obtaining the training samples, the computer device searches for text according to the CLS vector and sample ( Figure 8 S11 in), SEP vector, sample video text ( Figure 8 The computer device inputs the rough sorting model in the order of S12) in step 704 to step 710, and executes steps 704 to 710. After determining the rough sorting score and the model loss, the computer device determines the refined sorting score according to the sample search text and the sample video text through the online refined sorting model. The computer device determines the distillation loss according to the difference between the refined sorting score and the rough sorting score. The computer device constructs the named entity recognition loss according to the first encoding vector and the second encoding vector, and constructs the search text classification loss according to the first encoding vector. The computer device jointly trains the rough sorting model with the model loss, the distillation loss, the named entity recognition loss and the search text classification loss until the first preset number of steps are trained to obtain a trained first fine-tuned rough sorting model.
[0253] In the second fine-tuning stage, the computer device obtains the labeled samples of the second fine-tuning stage, and each labeled sample of the second fine-tuning stage includes the sample search text of the second fine-tuning stage, the sample video text of the sample video, and the annotated relevance category. The annotated relevance category indicates the relevance between the sample search text and the sample video.
[0254] For each sample search text in the second fine-tuning stage, the computer device determines the training samples for the second fine-tuning stage based on the annotation correlation degree categories in each labeled sample corresponding to the sample search text. The training samples for the second fine-tuning stage include the sample search text and the sample video text. The sample video text includes the positive sample video text and the negative sample video text, wherein the correlation degree represented by the annotation correlation degree category of the positive sample video text is higher than the correlation degree represented by the annotation correlation degree category of the negative sample.
[0255] After obtaining the training samples for the second fine-tuning stage, the computer device searches for text according to the CLS vector and the samples in the training samples for the second fine-tuning stage ( Figure 8 S21 in ), SEP vector, sample video text in the training sample for the second fine-tuning stage ( Figure 8 The computer device inputs the first fine-tuning coarse ranking model in the order of S22) and executes steps 704 to 710. After determining the coarse ranking score for the first fine-tuning stage and the model loss corresponding to the second fine-tuning stage, the computer device determines the fine ranking score for the second fine-tuning stage through the online fine ranking model according to the sample search text and the sample video text in the training sample for the second fine-tuning stage. The computer device determines the distillation loss corresponding to the second fine-tuning stage based on the difference between the fine ranking score and the coarse ranking score in the second fine-tuning stage. The computer device combines the model loss and the distillation loss corresponding to the second fine-tuning stage to perform model training on the first fine-tuning coarse ranking model to obtain a trained coarse ranking model.
[0256] Among them, for each sample search text in the second fine-tuning stage, the computer device performs word segmentation processing on the sample search text in the second fine-tuning stage to obtain a first word segmentation result. The computer device arbitrarily selects a sample video and determines the sequence encoding of the sample video text of the sample video, and queries the sample video text of the sample video based on the sequence encoding, and performs word segmentation processing on the sample video text to obtain a second word segmentation result. The computer device determines each labeled sample in the second fine-tuning stage based on the sample search text in the second fine-tuning stage, the first word segmentation result, the sequence encoding of the sample video text of the sample video, the annotated relevance category, and the second word segmentation result. For example, Fig. 9As shown, it is a schematic diagram of the training sample in the second fine-tuning stage in an embodiment. The sample search text is "Xiaojun's Search for Parents Wang Wu". The sample search text consists of the names of actors and TV series. The word segmentation result 1 of the sample search text is "Wang Wu" with a corresponding word weight of a1 and a corresponding idf (inverse file frequency) field of b1. The word segmentation result 2 of the sample search text is "Xiaojun's Search for Parents" with a corresponding word weight of a2 and a corresponding idf field of b2. The sequence code of the sample video text of the sample video is H. Based on the sequence code H, the sample video text is determined, such as "Xiaojun is looking for parents". The word segmentation is performed, and the word weight and idf field corresponding to each word are obtained. The word weight corresponding to "Xiaojun" is a3, and the corresponding idf field is b3; the word weight corresponding to "search" is a4, and the corresponding idf field is b4; the word weight corresponding to "parents" is a5, and the corresponding idf field is b5. The computer device obtains the label of the sample video, which indicates whether the sample video belongs to the long video category or the short video category. For example, if the label is 1, it means that the sample video is a long video category, and if the label is 0, it means that the sample video is a short video category.
[0257] In this embodiment, multi-stage fine-tuning can optimize the model effect of the rough-ranking model, reduce the risk of overfitting, and ensure the accuracy of the scoring of the rough-ranking model.
[0258] The present application also provides an application scenario, which applies the above-mentioned video sorting method. Specifically, the application of the video sorting method in this application scenario is as follows: in a video push scenario, for the search text about the video to be searched input by the target user, determine the recalled videos participating in the rough sorting. The computer device inputs the search text and the recalled video text corresponding to the search text into the trained rough sorting model; through the trained rough sorting model, obtain the first encoding vector corresponding to the search text, map the first encoding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtain the second encoding vector corresponding to the recalled video text, map the second encoding vector to multiple semantic vector subspaces to obtain multiple second subvectors; determine the similarity between each first subvector and each second subvector, determine the first semantic interaction vector corresponding to the search text based on the similarity and each second subvector, and determine the second semantic interaction vector corresponding to the recalled video text based on the similarity and each first subvector; determine the rough sorting score according to the first semantic interaction vector and the second semantic interaction vector; the rough sorting score represents the degree of correlation between the search text and the recalled video text, and the rough sorting score is used to sort the recalled videos corresponding to the search text. In this way, each recalled video can be accurately sorted.
[0259] Of course, it is not limited to this. The video sorting method provided by the present application can also be applied in other application scenarios. For example, in a product interaction scenario, for the search text entered by the user about searching for interactive products, the video sorting method provided by the present application is executed to confirm the videos corresponding to the products to be interacted with that are sent to the fine sorting stage.
[0260] The above application scenarios are merely illustrative descriptions. It is to be understood that the application of the video sorting methods provided in the embodiments of the present application is not limited to the above scenarios.
[0261] In a specific embodiment, the present application provides a video sorting method, which is executed by a computer device. Fig.10 As shown, it is a schematic diagram of determining the exposure video in one embodiment. The target user enters the search text in the search box of the search interface, the computer device obtains the search text, and determines the target user's intention information through the term understanding stage processing based on the search text. Based on the intention information, the computer device recalls multiple recalled videos from the video library through the recall processing in the recall stage. After determining the recalled video corresponding to the search text, the video sorting method of the present application can be used to perform the rough sorting stage processing to sort each recalled video. Fig.11 FIG. 1 is a flow chart of a video sorting method in another embodiment, which is as follows:
[0262] Step 1: The computer device inputs the search text into the encoding layer of the trained coarse sorting model; through the word representation network of the encoding layer, the word vector corresponding to each word in the search text is determined. Fig.11 In the above, q1, q2, and q3 are all word vectors of the search text. The semantic weight of each word in the search text is determined according to the word vector through the sentence representation network of the encoding layer, and the word vectors are weighted and summed according to the semantic weight to obtain the first vector to be processed corresponding to the search text, and the first vector to be processed is normalized to obtain the first encoding vector corresponding to the search text.
[0263] Input the recalled video text into the encoding layer of the trained coarse sorting model; determine the word vector corresponding to each word in the recalled video text through the word representation network of the encoding layer. Fig.11 In the above, u1, u2, and u3 are all word vectors of the recalled video text. The semantic weight of each word in the recalled video text is determined according to the word vector through the sentence representation network of the encoding layer, and the word vectors are weighted and summed according to the semantic weight to obtain the second vector to be processed corresponding to the recalled video text, and the second vector to be processed is normalized to obtain the second encoding vector corresponding to the recalled video text.
[0264] Step 2: The computer device maps the first encoding vector to each first mapping network of the first mapping layer, respectively, to obtain the first initial vector of each semantic vector subspace corresponding to the search text, and normalizes each first initial vector, respectively, to obtain the first subvector of each semantic vector subspace corresponding to the search text. The computer device maps the second encoding vector to each second mapping network of the second mapping layer, respectively, to obtain the second initial vector of each semantic vector subspace corresponding to the recalled video text, and normalizes each second initial vector, respectively, to obtain the second subvector of each semantic vector subspace corresponding to the search text. The mapping layer includes a first mapping layer and a second mapping layer.
[0265] Step 3: The multiple semantic vector subspaces include m semantic vector subspaces. Calculate the subvector similarity between the first subvector of the i-th semantic vector subspace corresponding to the search text and the second subvector of the j-th semantic vector subspace corresponding to the recalled video text; where 1≤i≤m, 1≤j≤m; Based on the subvector similarity, obtain the similarity between the search text and the recalled video text.
[0266] For the first subvector of each semantic vector subspace corresponding to the search text, the first weights of each second subvector with respect to the first subvector are determined according to the similarities between the first subvector and the second subvector of each semantic vector subspace corresponding to the recalled video text; according to each first weight, the second subvector of each semantic vector subspace corresponding to the recalled video text is weightedly summed to obtain the semantic interaction vector corresponding to the first subvector; and according to the semantic interaction vectors corresponding to each first subvector, the first semantic interaction vector corresponding to the search text is determined.
[0267] For the second subvectors of each semantic vector subspace corresponding to the recalled video text, the second weights of each first subvector with respect to the second subvector are determined according to the similarities between the second subvectors and the first subvectors of each semantic vector subspace corresponding to the search text; according to each second weight, the weighted summation of the first subvectors of each semantic vector subspace corresponding to the search text is performed to obtain the semantic interaction vectors corresponding to the second subvectors; and according to the semantic interaction vectors corresponding to each second subvector, the second semantic interaction vector corresponding to the recalled video text is determined.
[0268] The computer device determines the semantic interaction vectors corresponding to each first subvector included in the first semantic interaction vector. For each semantic vector subspace, the computer device determines the first difference between the first subvector corresponding to the semantic vector subspace and the semantic interaction vector corresponding to the first subvector. The computer device determines the first initial enhanced interaction vector corresponding to the search text based on the first subvector corresponding to the semantic vector subspace, the semantic interaction vector corresponding to the first subvector, and the corresponding first difference. The computer device performs a maximum pooling operation on the first initial enhanced interaction vector to determine the first enhanced interaction vector corresponding to the search text.
[0269] For each semantic vector subspace, the computer device determines a second difference between a second subvector corresponding to the semantic vector subspace and a semantic interaction vector corresponding to the second subvector, and the computer device determines a second initial enhanced interaction vector corresponding to the recalled video text according to the second subvector corresponding to the semantic vector subspace, the semantic interaction vector corresponding to the second subvector, and the corresponding second difference. The computer device performs a maximum pooling operation on the second initial enhanced interaction vector to determine a second enhanced interaction vector corresponding to the recalled video text.
[0270] The computer device splices the first enhanced interaction vector and the second enhanced interaction vector to obtain a spliced vector, and performs post-scoring activation processing through a scoring network to determine a coarse ranking score.
[0271] Based on the first to third steps above, the rough ranking score of each recalled video is determined. The computer device sorts the rough ranking scores of each recalled video from large to small to obtain a sorting result. According to the sorting result, the computer device uses the video texts with a preset ranking number that are ranked at the top as the video texts to be sent to the fine sorting stage. Alternatively, according to the sorting result, the computer device uses the video texts that are higher than the fine sorting score threshold as the fine sorting texts to be sent to the fine sorting stage. The computer device determines the fine sorting score corresponding to the fine sorting text through the target search text and the fine sorting text according to the online fine sorting model. The computer device determines the rearranged text to be sent to the rearrangement stage according to the fine sorting score of each fine sorting text, and determines the exposure video for display according to each rearranged text.
[0272] In this embodiment, the search text and the recalled video text corresponding to the search text are input into a trained rough sorting model; the first coding vector corresponding to the search text is obtained through the trained rough sorting model, and the first coding vector is mapped to multiple semantic vector subspaces to obtain multiple first subvectors. The same search text is represented by multiple subvectors in different semantic vector subspaces, which can capture the different semantics of the search text in various aspects. The second coding vector corresponding to the recalled video text is obtained, and the second coding vector is mapped to multiple semantic vector subspaces to obtain multiple second subvectors. The same recalled video text is represented by multiple subvectors in different semantic vector subspaces, which can capture the different semantics of the recalled video text in various aspects. The similarity between each first subvector and each second subvector is determined, and the first semantic interaction vector corresponding to the search text is determined based on the similarity and each second subvector, and the second semantic interaction vector corresponding to the recalled video text is determined based on the similarity and each first subvector. In this way, before the rough ranking and scoring, the first sub-vectors of the search text and the second sub-vectors of the recalled video text can be interacted in advance, and the interaction and enhancement of each other's sub-vectors can be used to alleviate the problem of being unable to identify the polysemy of the search text as much as possible, thereby improving the accuracy of the subsequent rough ranking and scoring. The rough ranking score is determined according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of correlation between the search text and the recalled video text, and the rough ranking score is used to sort the recalled videos corresponding to the search text. Based on this, by interacting the first sub-vector and the second sub-vector in advance, the problem of loss of detailed features due to too late interaction can be avoided, and the representation vector of the search text and the representation vector of the recalled video text can be deeply interacted, ensuring the accuracy of the rough ranking score, so that each recalled video can be accurately sorted.
[0273] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0274] Based on the same inventive concept, the embodiment of the present application also provides a video sorting device for implementing the video sorting method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more video sorting device embodiments provided below can refer to the limitations on the video sorting method above, and will not be repeated here.
[0275] In one embodiment, Fig.12 As shown, a video sorting device 1200 is provided, comprising: a text input module 1202, a first mapping module 1204 and a first scoring module 1208, wherein:
[0276] A text input module 1202, used to input the search text and the recalled video text corresponding to the search text into the trained rough sorting model;
[0277] A first mapping module 1204 is used to obtain a first encoding vector corresponding to the search text through the trained rough sorting model, map the first encoding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtain a second encoding vector corresponding to the recalled video text, and map the second encoding vector to multiple semantic vector subspaces to obtain multiple second subvectors;
[0278] A first interaction vector determination module 1206, configured to determine the similarity between each first sub-vector and each second sub-vector, determine a first semantic interaction vector corresponding to the search text based on the similarity and each second sub-vector, and determine a second semantic interaction vector corresponding to the recalled video text based on the similarity and each first sub-vector;
[0279] The first scoring module 1208 is used to determine a rough ranking score according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of correlation between the search text and the recalled video text, and the rough ranking score is used to sort the recalled videos corresponding to the search text.
[0280] In some embodiments, the first mapping module 1204 is used to input the search text into the encoding layer of the trained coarse-grained model; determine the word vector corresponding to each word in the search text through the word representation network of the encoding layer; determine the semantic weight of each word in the search text according to the word vector through the sentence representation network of the encoding layer, and perform weighted summation of each word vector according to the semantic weight to obtain the first encoding vector corresponding to the search text.
[0281] In some embodiments, the first mapping module 1204 is used to map the first encoding vector to multiple semantic vector subspaces through the first mapping layer of the trained coarse sorting model, and obtain the first subvectors of the search text corresponding to each semantic vector subspace. The first mapping module is used to map the second encoding vector to multiple semantic vector subspaces through the second mapping layer of the trained coarse sorting model, and obtain the second vectors of the recalled video text corresponding to each semantic vector subspace.
[0282] In some embodiments, the multiple semantic vector subspaces include m semantic vector subspaces, and the first interaction vector determination module 1206 is used to calculate the subvector similarity between the first subvector of the i-th semantic vector subspace corresponding to the search text and the second subvector of the j-th semantic vector subspace corresponding to the recalled video text; wherein, 1≤i≤m, 1≤j≤m; based on the subvector similarity, the similarity between the search text and the recalled video text is obtained.
[0283] In some embodiments, the first interaction vector determination module 1206 is used to determine, for the first subvectors of each semantic vector subspace corresponding to the search text, the first weights of each second subvector with respect to the first subvector according to the similarities between the first subvectors and the second subvectors of each semantic vector subspace corresponding to the recalled video text; perform weighted summation of the second subvectors of each semantic vector subspace corresponding to the recalled video text according to the first weights to obtain the semantic interaction vectors corresponding to the first subvectors; and determine the first semantic interaction vector corresponding to the search text according to the semantic interaction vectors corresponding to the first subvectors.
[0284] In some embodiments, the first interaction vector determination module 1206 is used to determine the second weights of each first subvector with respect to the second subvector of each semantic vector subspace corresponding to the recalled video text according to the similarities between the second subvectors and the first subvectors of each semantic vector subspace corresponding to the search text; perform weighted summation of the first subvectors of each semantic vector subspace corresponding to the search text according to the second weights to obtain the semantic interaction vectors corresponding to the second subvectors; and determine the second semantic interaction vectors corresponding to the recalled video text according to the semantic interaction vectors corresponding to each second subvector.
[0285] In some embodiments, the first scoring module 1208 is used to enhance the first semantic interaction vector according to each first sub-vector to determine the first enhanced interaction vector corresponding to the search text; enhance the second semantic interaction vector according to each second sub-vector to determine the second enhanced interaction vector corresponding to the recalled video text; and map the spliced vector obtained by splicing the first enhanced interaction vector and the second enhanced interaction vector into a coarse ranking score.
[0286] In some embodiments, the first scoring module 1208 is used to calculate, for each first sub-vector, a first difference between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector, and a first product between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector; concatenate the first sub-vector, the semantic interaction vector corresponding to the first sub-vector, the first difference and the first product to obtain an enhanced interaction vector corresponding to the first sub-vector; and determine the first enhanced interaction vector corresponding to the search text according to the enhanced interaction vectors corresponding to each first sub-vector.
[0287] In some embodiments, the first scoring module 1208 is used to calculate, for each second sub-vector, a second difference between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector, and calculate a second product between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector; concatenate the second sub-vector, the semantic interaction vector corresponding to the second sub-vector, the second difference, and the second product to obtain an enhanced interaction vector corresponding to the second sub-vector; and determine the second enhanced interaction vector corresponding to the recalled video text based on the enhanced interaction vectors corresponding to each second sub-vector.
[0288] Based on the same inventive concept, the embodiment of the present application also provides a model training device for implementing the model training method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more model training device embodiments provided below can refer to the limitations on the model training method above, and will not be repeated here.
[0289] In one embodiment, Fig.13 As shown, a model training device 1300 is provided, comprising: a sample acquisition module 1302, a second mapping module 1304, a second interaction vector determination module 1306, a second scoring module 1308 and a training module 1310, wherein:
[0290] The sample acquisition module 1302 is used to acquire training samples, where the training samples include sample search texts and sample video texts corresponding to the sample search texts;
[0291] The second mapping module 1304 is used to obtain a first coding vector corresponding to the sample search text through a coarse sorting model, map the first coding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtain a second coding vector corresponding to the sample video text, and map the second coding vector to multiple semantic vector subspaces to obtain multiple second subvectors;
[0292] A second interaction vector determination module 1306 is used to determine the similarity between each first sub-vector and each second sub-vector, determine a first semantic interaction vector corresponding to the sample search text based on the similarity and each second sub-vector, and determine a second semantic interaction vector corresponding to the sample video text based on the similarity and each first sub-vector;
[0293] The second scoring module 1308 is used to determine a rough ranking score according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of relevance between the sample search text and the sample video text;
[0294] The training module 1310 is used to determine the model loss according to the subspace similarity between each first subvector, the subspace similarity between each second subvector and the coarse sorting score, and to train the coarse sorting model according to the model loss. The trained coarse sorting model is used to perform video search response to the search text.
[0295] In some embodiments, the device further comprises a subspace similarity determination module, the subspace similarity determination module being used to calculate the similarity between the first subvectors of each semantic vector subspace corresponding to the sample search text, and obtain the subspace similarity between the first subvectors; for the second subvectors of each semantic vector subspace corresponding to the sample video text, calculate the similarity between the second subvectors, and obtain the subspace similarity between the second subvectors.
[0296] In some embodiments, the second mapping module 1304 is used to map the first encoding vector to multiple semantic vector subspaces through the first mapping layer of the coarse sorting model, and obtain the first subvectors of each semantic vector subspace corresponding to the sample search text; the second mapping module is used to map the second encoding vector to multiple semantic vector subspaces through the second mapping layer of the coarse sorting model, and obtain the second vectors of each semantic vector subspace corresponding to the sample video text.
[0297] In some embodiments, the second interaction vector determination module 1306 is used to determine, for the first subvector of each semantic vector subspace corresponding to the sample search text, the third weights of each second subvector with respect to the first subvector according to the similarity between the first subvector and the second subvector of each semantic vector subspace corresponding to the sample video text; perform weighted summation of the second subvectors of each semantic vector subspace corresponding to the sample video text according to the third weights to obtain the semantic interaction vector corresponding to the first subvector; and determine the first semantic interaction vector corresponding to the sample search text according to the semantic interaction vectors corresponding to each first subvector.
[0298] In some embodiments, the second interaction vector determination module 1306 is used to determine, for the second subvectors of each semantic vector subspace corresponding to the sample video text, the fourth weights of each first subvector with respect to the second subvector according to the similarities between the second subvectors and the first subvectors of each semantic vector subspace corresponding to the sample search text; perform weighted summation of the first subvectors of each semantic vector subspace corresponding to the sample search text according to the fourth weights to obtain the semantic interaction vectors corresponding to the second subvectors; and determine the second semantic interaction vector corresponding to the sample video text according to the semantic interaction vectors corresponding to each second subvector.
[0299] In some embodiments, the second scoring module 1308 is used to enhance the first semantic interaction vector according to each first sub-vector to determine the first enhanced interaction vector corresponding to the sample search text; enhance the second semantic interaction vector according to each second sub-vector to determine the second enhanced interaction vector corresponding to the sample video text; and map the spliced vector obtained by splicing the first enhanced interaction vector and the second enhanced interaction vector into a coarse sorting score.
[0300] In some embodiments, the sample video text includes positive sample video text and negative sample video text, and the coarse ranking score includes the positive sample coarse ranking score corresponding to the sample search text and the positive sample video text and the negative sample coarse ranking score corresponding to the sample search text and the negative sample video text; the training module 1310 is used to determine the model loss according to the positive sample coarse ranking score, the subspace similarity between each first subvector, the subspace similarity between each second subvector and the negative sample coarse ranking score; wherein the model loss is positively correlated with the subspace similarity, negatively correlated with the positive sample coarse ranking score, and positively correlated with the negative sample coarse ranking score.
[0301] Each module in the above-mentioned video sorting device and model training device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0302] In one embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Fig.14As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a video sorting method and a model training method are implemented.
[0303] Those skilled in the art will understand that Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0304] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0305] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0306] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0307] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0308] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0309] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0310] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A video sorting method, characterized in that: The method comprises: Inputting the search text and the recalled video text corresponding to the search text into the trained coarse sorting model; Obtaining a first encoding vector corresponding to the search text through the trained rough sorting model, mapping the first encoding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtaining a second encoding vector corresponding to the recalled video text, and mapping the second encoding vector to multiple semantic vector subspaces to obtain multiple second subvectors; Determine the similarity between each of the first sub-vectors and each of the second sub-vectors, determine a first semantic interaction vector corresponding to the search text based on the similarity and each of the second sub-vectors, and determine a second semantic interaction vector corresponding to the recalled video text based on the similarity and each of the first sub-vectors; A rough ranking score is determined according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of relevance between the search text and the recalled video text, and the rough ranking score is used to sort the recalled videos corresponding to the search text.
2. The method according to claim 1, characterized in that The step of obtaining a first encoding vector corresponding to the search text through the trained coarse sorting model includes: Inputting the search text into the encoding layer of the trained coarse sorting model; Determining the word vector corresponding to each word in the search text through the word representation network of the encoding layer; The sentence representation network of the encoding layer is used to determine the semantic weight of each word in the search text according to the word vector, and the word vectors are weighted and summed according to the semantic weight to obtain a first encoding vector corresponding to the search text.
3. The method according to claim 1, characterized in that Mapping the first encoding vector to a plurality of semantic vector subspaces to obtain a plurality of first subvectors includes: Mapping the first encoding vector to a plurality of semantic vector subspaces through the first mapping layer of the trained coarse sorting model, and obtaining first subvectors of the semantic vector subspaces corresponding to the search text respectively; The mapping the second encoding vector to a plurality of semantic vector subspaces to obtain a plurality of second subvectors includes: The second encoding vector is mapped to a plurality of semantic vector subspaces through the second mapping layer of the trained coarse-grained model, and the second vectors of the recalled video text corresponding to each semantic vector subspace are obtained respectively.
4. The method according to claim 1, characterized in that: The multiple semantic vector subspaces include m semantic vector subspaces, and determining the similarity between each of the first subvectors and each of the second subvectors includes: Calculate the subvector similarity between the first subvector of the i-th semantic vector subspace corresponding to the search text and the second subvector of the j-th semantic vector subspace corresponding to the recalled video text; wherein 1≤i≤m, 1≤j≤m; The similarity between the search text and the recalled video text is obtained according to the sub-vector similarity.
5. The method according to claim 1, characterized in that The determining the first semantic interaction vector corresponding to the search text based on the similarity and each of the second sub-vectors includes: For the first subvectors of the semantic vector subspaces corresponding to the search text, determining first weights of the second subvectors with respect to the first subvectors according to the similarities between the first subvectors and the second subvectors of the semantic vector subspaces corresponding to the recalled video texts; According to each first weight, weighted summation is performed on the second subvectors of each semantic vector subspace corresponding to the recalled video text to obtain a semantic interaction vector corresponding to the first subvector; According to the semantic interaction vectors corresponding to the first sub-vectors, a first semantic interaction vector corresponding to the search text is determined.
6. The method according to claim 1, characterized in that The determining, based on the similarity and each of the first sub-vectors, a second semantic interaction vector corresponding to the recalled video text includes: For the second subvectors of the semantic vector subspaces corresponding to the recalled video texts, determining the second weights of the first subvectors for the second subvectors according to the similarities between the second subvectors and the first subvectors of the semantic vector subspaces corresponding to the search texts; According to each second weight, weighted summation is performed on the first subvectors of each semantic vector subspace corresponding to the search text to obtain a semantic interaction vector corresponding to the second subvector; According to the semantic interaction vectors corresponding to the second sub-vectors, a second semantic interaction vector corresponding to the recalled video text is determined.
7. The method according to claim 1, characterized in that The determining a coarse ranking score according to the first semantic interaction vector and the second semantic interaction vector includes: According to each of the first sub-vectors, the first semantic interaction vector is enhanced to determine a first enhanced interaction vector corresponding to the search text; According to each of the second sub-vectors, the second semantic interaction vector is enhanced to determine a second enhanced interaction vector corresponding to the recalled video text; A concatenated vector obtained by concatenating the first enhanced interaction vector and the second enhanced interaction vector is mapped into a coarse ranking score.
8. The method according to claim 7, characterized in that The step of enhancing the first semantic interaction vector according to each of the first sub-vectors to determine a first enhanced interaction vector corresponding to the search text includes: For each first sub-vector, calculating a first difference between the first sub-vector and a semantic interaction vector corresponding to the first sub-vector, and calculating a first product between the first sub-vector and the semantic interaction vector corresponding to the first sub-vector; concatenating the first sub-vector, the semantic interaction vector corresponding to the first sub-vector, the first difference, and the first product to obtain an enhanced interaction vector corresponding to the first sub-vector; A first enhanced interaction vector corresponding to the search text is determined according to the enhanced interaction vectors corresponding to the first sub-vectors.
9. The method according to claim 7, characterized in that: The step of enhancing the second semantic interaction vector according to each of the second sub-vectors to determine a second enhanced interaction vector corresponding to the recalled video text includes: For each second sub-vector, calculating a second difference between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector, and calculating a second product between the second sub-vector and the semantic interaction vector corresponding to the second sub-vector; concatenating the second sub-vector, the semantic interaction vector corresponding to the second sub-vector, the second difference, and the second product to obtain an enhanced interaction vector corresponding to the second sub-vector; According to the enhanced interaction vectors corresponding to the second sub-vectors, a second enhanced interaction vector corresponding to the recalled video text is determined.
10. A model training method, characterized in that: The method comprises: Acquire a training sample, wherein the training sample includes a sample search text and a sample video text corresponding to the sample search text; Obtaining a first coding vector corresponding to the sample search text through a coarse sorting model, mapping the first coding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtaining a second coding vector corresponding to the sample video text, and mapping the second coding vector to multiple semantic vector subspaces to obtain multiple second subvectors; Determine the similarity between each of the first sub-vectors and each of the second sub-vectors, determine a first semantic interaction vector corresponding to the sample search text based on the similarity and each of the second sub-vectors, and determine a second semantic interaction vector corresponding to the sample video text based on the similarity and each of the first sub-vectors; Determine a rough ranking score according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of relevance between the sample search text and the sample video text; The model loss is determined according to the subspace similarity between each of the first sub-vectors, the subspace similarity between each of the second sub-vectors and the coarse sorting score, and the coarse sorting model is trained according to the model loss. The trained coarse sorting model is used to perform video search response to the search text.
11. The method according to claim 10, characterized in that The method further comprises: For the first subvectors of each semantic vector subspace corresponding to the sample search text, calculating the similarity between the first subvectors in pairs, and obtaining the subspace similarity between the first subvectors; For the second subvectors of each semantic vector subspace corresponding to the sample video text, the similarities between the second subvectors are calculated to obtain the subspace similarities between the second subvectors.
12. The method according to claim 10, characterized in that Mapping the first encoding vector to a plurality of semantic vector subspaces to obtain a plurality of first subvectors includes: Mapping the first encoding vector to a plurality of semantic vector subspaces through the first mapping layer of the coarse sorting model, and obtaining first subvectors of the semantic vector subspaces corresponding to the sample search text respectively; The mapping the second encoding vector to a plurality of semantic vector subspaces to obtain a plurality of second subvectors includes: The second encoding vector is mapped to a plurality of semantic vector subspaces through the second mapping layer of the coarse sorting model, and the second vectors of the sample video text corresponding to the semantic vector subspaces are obtained respectively.
13. The method according to claim 10, characterized in that The determining the first semantic interaction vector corresponding to the sample search text based on the similarity and each of the second sub-vectors includes: For the first subvectors of the semantic vector subspaces corresponding to the sample search text, determining the third weights of the second subvectors with respect to the first subvectors according to the similarities between the first subvectors and the second subvectors of the semantic vector subspaces corresponding to the sample video texts; According to each third weight, weighted summation is performed on the second subvectors of each semantic vector subspace corresponding to the sample video text to obtain a semantic interaction vector corresponding to the first subvector; According to the semantic interaction vectors corresponding to the first sub-vectors, a first semantic interaction vector corresponding to the sample search text is determined.
14. The method according to claim 10, characterized in that The determining the second semantic interaction vector corresponding to the sample video text based on the similarity and each of the first sub-vectors includes: For the second subvectors of the semantic vector subspaces corresponding to the sample video text, determining fourth weights of the first subvectors for the second subvectors according to the similarities between the second subvectors and the first subvectors of the semantic vector subspaces corresponding to the sample search texts; According to each fourth weight, weighted summation is performed on the first subvectors of each semantic vector subspace corresponding to the sample search text to obtain a semantic interaction vector corresponding to the second subvector; According to the semantic interaction vectors corresponding to the second sub-vectors, the second semantic interaction vector corresponding to the sample video text is determined.
15. The method according to claim 10, characterized in that The determining a coarse ranking score according to the first semantic interaction vector and the second semantic interaction vector includes: According to each of the first sub-vectors, the first semantic interaction vector is enhanced to determine a first enhanced interaction vector corresponding to the sample search text; According to each of the second sub-vectors, the second semantic interaction vector is enhanced to determine a second enhanced interaction vector corresponding to the sample video text; A concatenated vector obtained by concatenating the first enhanced interaction vector and the second enhanced interaction vector is mapped into a coarse ranking score.
16. The method according to claim 10, characterized in that The sample video text includes a positive sample video text and a negative sample video text, and the rough ranking score includes a positive sample rough ranking score corresponding to the sample search text and the positive sample video text and a negative sample rough ranking score corresponding to the sample search text and the negative sample video text; The determining the model loss according to the subspace similarities between the first subvectors, the subspace similarities between the second subvectors, and the coarse ranking score includes: The model loss is determined according to the coarse ranking score of the positive sample, the subspace similarity between each of the first sub-vectors, the subspace similarity between each of the second sub-vectors, and the coarse ranking score of the negative sample; wherein the model loss is positively correlated with the subspace similarity, negatively correlated with the coarse ranking score of the positive sample, and positively correlated with the coarse ranking score of the negative sample.
17. A video sorting device, characterized in that: The device comprises: A text input module, used for inputting the search text and the recalled video text corresponding to the search text into the trained rough sorting model; A first mapping module is used to obtain a first encoding vector corresponding to the search text through the trained rough sorting model, map the first encoding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtain a second encoding vector corresponding to the recalled video text, and map the second encoding vector to multiple semantic vector subspaces to obtain multiple second subvectors; A first interaction vector determination module is used to determine the similarity between each of the first sub-vectors and each of the second sub-vectors, determine a first semantic interaction vector corresponding to the search text based on the similarity and each of the second sub-vectors, and determine a second semantic interaction vector corresponding to the recalled video text based on the similarity and each of the first sub-vectors; The first scoring module is used to determine a rough ranking score according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of correlation between the search text and the recalled video text, and the rough ranking score is used to sort the recalled videos corresponding to the search text.
18. A model training device, characterized in that: The device comprises: A sample acquisition module, used to acquire training samples, wherein the training samples include sample search texts and sample video texts corresponding to the sample search texts; A second mapping module is used to obtain a first coding vector corresponding to the sample search text through a coarse sorting model, map the first coding vector to multiple semantic vector subspaces to obtain multiple first subvectors, obtain a second coding vector corresponding to the sample video text, and map the second coding vector to multiple semantic vector subspaces to obtain multiple second subvectors; A second interaction vector determination module is used to determine the similarity between each of the first sub-vectors and each of the second sub-vectors, determine a first semantic interaction vector corresponding to the sample search text based on the similarity and each of the second sub-vectors, and determine a second semantic interaction vector corresponding to the sample video text based on the similarity and each of the first sub-vectors; A second scoring module is used to determine a rough ranking score according to the first semantic interaction vector and the second semantic interaction vector; the rough ranking score represents the degree of relevance between the sample search text and the sample video text; A training module is used to determine the model loss according to the subspace similarity between each of the first sub-vectors, the subspace similarity between each of the second sub-vectors and the coarse sorting score, and to train the coarse sorting model according to the model loss. The trained coarse sorting model is used to perform video search response to the search text.
19. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 16 are implemented.
20. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 16 are implemented.
