Video searching method and device, electronic equipment and readable medium

Through the intent recognition and statement conversion model, natural language search statements are converted into standard statements, which solves the recall problem of video search engines when dealing with natural language search statements, and improves the accuracy and user experience of search results.

CN119248960APending Publication Date: 2025-01-03BEIJING IQIYI TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411345047.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

When existing video search engines process search statements expressed in natural language, it is difficult for them to recall search results that are satisfactory for users, especially statements that cannot be recognized by the statement understanding module, resulting in inaccurate search results.

Method used

The intent recognition model and statement conversion model are used to convert the search statements entered by the user into standard statements so that the video search engine can understand and recall relevant video search results.

Benefits of technology

Through the combination of intention recognition and statement conversion model, search statements that cannot be processed by the statement understanding module can be processed, the ease of use of video search functions can be improved, the diverse search needs of users can be met, and the accurate video search results can be recalled.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248960A_ABST
    Figure CN119248960A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a video searching method and device, electronic equipment and a readable medium. The method comprises the steps of obtaining a user search statement input by a user; if a statement understanding module cannot recognize the user search statement, inputting the user search statement into an intention recognition model, and obtaining an intention recognition result output by the intention recognition model; if the intention recognition result is a film finding intention, inputting the user search statement into a statement conversion model, and obtaining a standard statement output by the statement conversion model; and inputting the standard statement into a video search engine to obtain a video search result recalled by the video search engine. Therefore, the user search statement which cannot be processed by the statement understanding module can also normally return the video search result, the usability of the video search function can be further improved, and the diversified search requirements of the user are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video technology, and in particular to a video search method, a video search device, an electronic device and a computer-readable medium. Background Art

[0002] In the prior art, search engines of video websites usually use keyword matching to recall relevant video information and display it to users. For example, users can enter information such as video titles or video types, and the search engine extracts keywords from the information entered by users, recalls relevant videos and displays them to users. However, the information entered by users can also be expressed in natural language, such as "recommend some costume dramas." In this case, it is difficult to obtain search results that satisfy users by only using keyword matching. Summary of the invention

[0003] The embodiments of the present invention provide a video search method, device, electronic device and computer-readable storage medium to solve the problem that search statements expressed in natural language are difficult to recall search results that satisfy users.

[0004] The embodiment of the present invention discloses a video search method, the method comprising:

[0005] Get the user search statement entered by the user;

[0006] If the sentence understanding module cannot recognize the user search sentence, input the user search sentence into the intention recognition model, and obtain the intention recognition result output by the intention recognition model;

[0007] If the intention recognition result is a movie search intention, input the user search sentence into a sentence conversion model, and obtain a standard sentence output by the sentence conversion model;

[0008] The standard sentence is input into a video search engine to obtain video search results recalled by the video search engine.

[0009] The embodiment of the present invention further discloses a video search device, the device comprising:

[0010] An input acquisition module is used to acquire a user search statement input by a user;

[0011] An intention recognition module, used for inputting the user search sentence into an intention recognition model if the sentence understanding module cannot recognize the user search sentence, and obtaining the intention recognition result output by the intention recognition model;

[0012] A sentence conversion module, for inputting the user search sentence into a sentence conversion model if the intention recognition result is a movie search intention, and obtaining a standard sentence output by the sentence conversion model;

[0013] The search module is used to input the standard sentence into a video search engine to obtain video search results recalled by the video search engine.

[0014] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0015] The memory is used to store computer programs;

[0016] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.

[0017] The embodiment of the present invention further discloses one or more computer-readable media on which instructions are stored. When executed by one or more processors, the processors are enabled to execute the method described in the embodiment of the present invention.

[0018] The embodiment of the present invention further discloses a computer program product, including a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the steps of the method described in the embodiment of the present invention are implemented.

[0019] The embodiments of the present invention include the following advantages:

[0020] Through the video search method provided in the embodiment of the present invention, the user search sentence input by the user is obtained; if the sentence understanding module cannot recognize the user search sentence, the user search sentence is input into the intention recognition model, and the intention recognition result output by the intention recognition model is obtained; if the intention recognition result is the intention to find a movie, the user search sentence is input into the sentence conversion model, and the standard sentence output by the sentence conversion model is obtained; the standard sentence is input into the video search engine to obtain the video search results recalled by the video search engine. The user search sentence that cannot be processed by the sentence understanding module can also return the video search results normally, which can further improve the usability of the video search function and meet the diverse search needs of users. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a flowchart of a video search method provided in an embodiment of the present invention;

[0022] Figure 2 is a flow chart of a video search method provided in an embodiment of the present invention;

[0023] Figure 3 It is a flowchart of a video search method provided by an embodiment of the present invention;

[0024] Figure 4 is a flow chart of another video search method provided by an embodiment of the present invention;

[0025] Figure 5 is a structural block diagram of a video search device provided in an embodiment of the present invention;

[0026] Figure 6 is a block diagram of an electronic device provided in an embodiment of the present invention;

[0027] Figure 7 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0029] Reference Figure 1 , shows a flow chart of the steps of a video search method provided in an embodiment of the present invention, which may specifically include the following steps:

[0030] Step 101, obtaining a user search statement input by a user;

[0031] When a user needs to search for a video, he or she may enter a user search sentence in the search function provided by the video website to search for the video. The user search sentence may record information related to the video that the user wants to search for, for example, the user search sentence may be "recommend some costume dramas", "movies suitable for children", "I want to watch TV series A", etc.

[0032] Step 102: If the sentence understanding module cannot recognize the user search sentence, the user search sentence is input into the intention recognition model, and the intention recognition result output by the intention recognition model is obtained;

[0033] Specifically, a video website may set up a sentence understanding module, which may be used to classify user search sentences to analyze the type of information recorded in the user search sentences. As a specific example of the present invention, the sentence understanding module may classify user search sentences into movie titles, stars, tags, roles, games, etc., and the present invention does not limit this.

[0034] Generally speaking, the sentence understanding module can only process part of the user search sentences. The remaining user search sentences cannot be recognized by the sentence understanding module, resulting in the inability to further recall search results. In order to better understand the user search sentences, the user search sentences that cannot be recognized by the sentence understanding module can be input into the intent recognition model to analyze the user intent.

[0035] Specifically, the intent recognition model may be a large language model that may have natural language processing capabilities. For example, during the training of the intent recognition model, user search sentence samples may be used as input and corresponding user intents may be used as output to train the intent recognition model. Thus, during the application process, the intent recognition model may output the user intent corresponding to the user search sentence based on the input user search sentence.

[0036] The user intention may at least include the intention to find a movie and other intentions. Optionally, the other intentions may be further classified into game intentions, activity intentions, comment intentions, etc. according to actual needs, and the present invention does not limit this.

[0037] As a specific example of the present invention, Figure 2 It is a flow chart of an intent recognition method provided by an embodiment of the present invention. In an embodiment of the present invention, after obtaining the user search statement 201 input by the user, the user search statement 201 can be input into the semantic understanding module 202, and the language understanding module 202 classifies the user search statement to analyze the type of information recorded in the user search statement. Among them, the type of information recorded in the user search statement may include movie titles, stars, tags, characters, games, other categories, etc. In the case that the semantic understanding module 202 cannot correctly identify the type of information recorded in the user search statement, the user search statement can be further input into the intent recognition model 203, and the intent recognition result output by the intent recognition model 203 can be obtained. Among them, the intent recognition model 203 can identify that the user search statement is a movie search intent or other intent.

[0038] Step 103: If the intent recognition result is a movie search intent, the user search sentence is input into a sentence conversion model, and a standard sentence output by the sentence conversion model is obtained;

[0039] When the intent recognition result is the intent to find a movie, it can be considered that the user needs to obtain video search results at this time. In this case, in order to facilitate the video search engine to recall the search results normally, the user's search sentence needs to be converted into a standard sentence that the video search engine can understand.

[0040] Among them, the standard sentence can record entity information related to the video, and its expression is easier to understand than the user search sentence, so that the video search engine can extract the entity information from the standard sentence and return the corresponding video search results based on the entity information. As a specific example of the present invention, the standard sentence can be a combination of several words, such as "latest movies", "movies starring star A", etc.; it can also be a sentence with a simple language structure, such as "2020 costume TV series", "TV series with popularity greater than 5000", etc., and the present invention does not limit this.

[0041] In a specific implementation, a sentence conversion model may be set, which may be a large language model with natural language processing capabilities. Exemplarily, in the training process of the sentence conversion model, the sentence conversion model may be trained with user search sentence samples as input and corresponding standard sentences as output. Thus, in the application process, the user search sentence is input into the sentence conversion model, and the standard sentence output by the sentence conversion model may be obtained.

[0042] Step 104: input the standard sentence into the video search engine to obtain the video search results recalled by the video search engine.

[0043] Video search engines can usually extract entity information from search statements by word segmentation, and recall search results based on the entity information. In this case, if the search statement entered by the user is expressed in complex natural language such as "recommend some costume dramas", "movies suitable for children", "I want to watch TV series A", then if the video search engine uses word segmentation, in addition to the entity information related to the video search "costume drama", "children", "movies", "TV series A", it may also obtain keywords such as "recommend", "some", "suitable", "I", "want to watch" and other keywords that are not related to the video search, making it difficult for the video search engine to recall the search results expected by the user.

[0044] By converting the video search engine into a standard sentence, the standard sentence can mainly contain entity information related to the video search, and contain fewer keywords irrelevant to the video search. Therefore, the video search engine can extract entity information from the standard sentence and return corresponding video search results based on the entity information.

[0045] As a specific example of the present invention, Figure 3 It is a flowchart of a video search method provided by an embodiment of the present invention.

[0046] In the embodiment of the present invention, after obtaining the user search sentence 301 input by the user, the user search sentence 301 can be input into the semantic understanding module 302, and the language understanding module 302 classifies the user search sentence to analyze the type of information recorded in the user search sentence. The type of information recorded in the user search sentence may include movie titles, stars, tags, roles, games, other categories, etc.

[0047] When the semantic understanding module 302 can correctly identify the type of information recorded in the user search statement 301, it can be considered that the user search statement 301 is a standard statement that the video search engine can normally recall search results, and the user search statement 301 can be input into the video search engine as a standard statement 305 to obtain a recall result 306.

[0048] In the case where the semantic understanding module 302 cannot correctly identify the type of information recorded in the user search sentence 301, the user search sentence 301 can be further input into the intent recognition model 303, and the intent recognition result output by the intent recognition model 303 can be obtained. Among them, the intent recognition model 303 can identify that the user search sentence is a movie search intent or other intent.

[0049] When the recognition result of the intention recognition model is the intention of finding a movie, the user search sentence 301 can be further input into the sentence conversion model 304, and the sentence conversion model 304 converts the user search sentence 301 into a standard sentence 305. Thereafter, the standard sentence 305 can be input into the video search engine to obtain the recall result 306.

[0050] Through the video search method provided in the embodiment of the present invention, the user search sentence input by the user is obtained; if the sentence understanding module cannot recognize the user search sentence, the user search sentence is input into the intention recognition model, and the intention recognition result output by the intention recognition model is obtained; if the intention recognition result is the intention to find a movie, the user search sentence is input into the sentence conversion model, and the standard sentence output by the sentence conversion model is obtained; the standard sentence is input into the video search engine, and the video search result recalled by the video search engine is obtained. The user search sentence that cannot be processed by the sentence understanding module can also return the video search result normally, which can further improve the usability of the video search function and meet the diverse search needs of users.

[0051] Reference Figure 4 , shows a flowchart of another video search method provided in an embodiment of the present invention, which may specifically include the following steps:

[0052] Step 401, obtaining a user search statement input by a user;

[0053] When a user needs to search for a video, he can enter a user search sentence in the search function provided by the video website to search for the video. The user search sentence can record information associated with the video that the user wants to search for.

[0054] Step 402, extracting entity information from the user's search statement through a language understanding module;

[0055] Specifically, the video website can set up a sentence understanding module, which can be used to classify user search sentences to analyze the type of information recorded in the user search sentences. Specifically, the language understanding module can extract entity information in the user search sentences, that is, words with specific meanings in the sentences, such as names of people, places, institutions, proper nouns, etc., to further classify the user search sentences based on the entity information.

[0056] Step 403: Identify the search category corresponding to the user's search statement based on the entity information.

[0057] After obtaining the entity information, the sentence understanding module can identify the search category corresponding to the user search sentence based on the entity information. The search category may include movie titles, stars, tags, roles, games, etc., which are not limited in the present invention.

[0058] Step 404: if the sentence understanding module cannot recognize the user search sentence, the user search sentence is input into the intention recognition model, and the intention recognition result output by the intention recognition model is obtained;

[0059] Generally speaking, the sentence understanding module can only process part of the user search sentences. The remaining user search sentences cannot be recognized by the sentence understanding module, resulting in the inability to further recall search results. In order to better understand the user search sentences, the user search sentences that cannot be recognized by the sentence understanding module can be input into the intent recognition model to analyze the user intent.

[0060] Specifically, the intent recognition model may be a large language model that may have natural language processing capabilities. For example, during the training of the intent recognition model, user search sentence samples may be used as input and corresponding user intents may be used as output to train the intent recognition model. Thus, during the application process, the intent recognition model may output the user intent corresponding to the user search sentence based on the input user search sentence.

[0061] The user intention may at least include the intention to find a movie and other intentions. Optionally, the other intentions may be further classified into game intentions, activity intentions, comment intentions, etc. according to actual needs, and the present invention does not limit this.

[0062] In one embodiment of the present invention, the method further comprises:

[0063] S11, obtaining video description information from a video website;

[0064] Specifically, the intent recognition model can be trained based on existing large language models such as OPT, BLOOM, LLaMA2, etc. Generally speaking, large language models can handle language processing tasks in general situations, but they are not optimized for video search scenarios. Further optimization of large languages ​​is needed so that they can better handle intent recognition tasks in video search scenarios.

[0065] Thus, video description information can be obtained from video websites and used as training samples for large language models. The video description information can be information such as video titles, video introductions, and video comments on video websites.

[0066] S12, training a preset first model to be trained to predict context information following the context information based on context information extracted from the video description information, and obtaining a first language model after the training is completed;

[0067] Generally speaking, the training process of a large language model can be divided into two stages. The first stage is the pre-training stage, the goal of which is to enable the model to learn new knowledge. The model will learn how to understand and generate text from a large amount of text data. The second stage is the fine-tuning stage, the goal of which is to enable the model to have the ability to handle specific tasks.

[0068] Specifically, a large language model can usually include a word embedding module and a decoder module. The word embedding module is used to convert text into a token sequence represented by a number. The decoder module is used to perform word-by-word reasoning on the output based on the token sequence, and finally output an answer to the input text.

[0069] During the pre-training process, the decoder module in the large language model can be kept unchanged, and the word vector conversion module can be trained mainly so that it can understand and adapt to the newly added video description information. The model as a whole, that is, the word vector conversion module and the decoder module can be trained at the same time, and the present invention does not limit this.

[0070] Therefore, a general large language model can be selected as the first model to be trained, and part of the information in the video description information can be extracted as the above context information. The training of the first model to be trained can be based on the above context information to infer the context information following the above context information. If the similarity between the context information output by the first model to be trained and the context information following the above context information in the video description information meets the preset first similarity condition, it can be considered that the training effect of the model meets the requirements. At this time, it can be considered that the model training is completed and the first language model is obtained. Otherwise, it is necessary to continue to iteratively train the first model to be trained. In this way, the model can learn the knowledge in the video description information so that it can better handle the intent recognition task later.

[0071] The similarity between the context information output by the first model to be trained and the context information following the preceding context information in the video description information may be calculated by using methods such as cosine similarity and Euclidean distance. When the similarity between the context information output by the first model to be trained and the context information following the preceding context information in the video description information is greater than a preset threshold, it may be considered that the similarity between the context information output by the first model to be trained and the context information following the preceding context information in the video description information meets a preset first similarity condition.

[0072] In a specific implementation, since the model in the pre-training stage achieves a higher training effect, that is, the following information output by the first model to be trained is highly similar to the following information in the video description information following the above information, it takes a long training time. Therefore, the training batch (epoch) of the pre-training stage can be set according to actual needs, and each training batch represents the use of all training samples for training. After the training of the set training batch is completed, it is considered that the model has been trained to obtain a higher effect, and the training can be terminated. The training batch can be determined according to actual needs, for example, 1, 2, 5, 10, etc., and the present invention does not limit this. At the same time, the batch size (batch size) of each training can also be set, which represents the number of samples for a single training. The batch size is usually selected based on the balance between memory efficiency and memory capacity. As an example of the present invention, when a single machine with 8 GPU (Graphics Processing Unit, graphics processor) cards is selected, and the model of each GPU card is A100 (40g video memory), the batch size can be selected as 32.

[0073] S13, obtaining an input intent recognition sample; the intent recognition sample includes a search sentence sample and an intent recognition result corresponding to the search sentence sample; wherein the intent recognition result includes a movie search intent and other intents;

[0074] After completing pre-training and the model has learned the knowledge in the video description information, the model can be further fine-tuned so that it can handle specific intent recognition tasks.

[0075] Thus, several intent recognition samples can be input for the intent recognition task. Among them, the intent recognition samples may include search sentence samples and their corresponding intent recognition results. The search sentence samples may be generated by artificially imitating user search sentences, or they may be user search sentences that cannot be recognized by the sentence understanding module of historical input as search sentence samples. The intent recognition results corresponding to the search sentence samples may be obtained by manual annotation, which may include the intent to find a movie and other intents. According to actual needs, other intents may also be further classified into game intent, activity intent, comment intent, etc., which is not limited by the present invention.

[0076] In the specific implementation, in order to further improve the training effect of the intent recognition model, in the process of constructing search statement samples, search statement samples and their corresponding intent recognition results can be constructed respectively for a variety of different movie-finding scenarios commonly used by users, so that the intent recognition model finally trained can have relatively accurate recognition capabilities for search statements in different movie-finding scenarios, and the intent recognition results corresponding to search statements in different movie-finding scenarios can all be movie-finding intentions.

[0077] As a specific example of the present invention, the film-finding scene may include searching for films by subject, searching for films by stars, searching for films by roles, searching for films by years, searching for films by crowds, searching for films by festivals, searching for films by heads, searching for films by ranges, etc., and the present invention does not impose any limitation on this.

[0078] Among them, the theme search can be to search for videos of a specified theme type, and the corresponding search sentence sample can be such as "Hello, can you recommend some costume dramas to me?"

[0079] Celebrity movie search can be to search for videos of a specified celebrity, and the corresponding search sentence sample can be "What movies are starred in by celebrity A?"

[0080] Finding movies by role can be searching for videos with the name of a specified role in a film or TV series, and the corresponding search sentence sample can be "give me some movies related to Sun Wukong".

[0081] Searching for movies by year can be searching for videos released in a specified year, and the corresponding search sentence sample can be "I want to watch costume TV series in 2020."

[0082] Crowd-based movie search can be searching for videos that meet the preferences of a specified group of people, and the corresponding search sentence sample can be "movies suitable for high school students."

[0083] Holiday movie search can be to search for videos that meet the preferences of a specified holiday. The corresponding search sentence sample can be "recommend some movies to watch on Valentine's Day"

[0084] Head search can be to search for videos ranked top in a specified category. The corresponding search sentence sample can be "What are the latest movies?"

[0085] Range search can be to search for videos that meet specified conditions, and the corresponding search sentence sample can be such as "What are the TV series with popularity greater than 5000 this year?"

[0086] S14, taking the search sentence sample as input, and the intent recognition result corresponding to the search sentence sample as output, the first language model is trained using the intent recognition sample, and an intent recognition model is obtained after the training is completed.

[0087] Afterwards, the search sentence sample can be used as the model input, and the intent recognition result corresponding to the search sentence sample can be used as the model output to train the first language model. At this time, the word vector conversion module and the decoder module in the first language model can be trained together. When the similarity between the intent recognition result output by the first language model and the intent recognition result corresponding to the search sentence sample meets the preset second similarity condition, the model training can be considered to be completed and the intent recognition model is obtained. In this way, the model can learn how to handle intent recognition tasks, and when the user search sentence is input, the model can return intent recognition results that meet the requirements of the intent recognition task.

[0088] The similarity between the intent recognition result output by the first language model and the intent recognition result corresponding to the search sentence sample can be calculated by using methods such as cosine similarity, Euclidean distance, etc. When the similarity between the intent recognition result output by the first language model and the intent recognition result corresponding to the search sentence sample is greater than a preset threshold, it can be considered that the similarity between the intent recognition result output by the first language model and the intent recognition result corresponding to the search sentence sample meets the preset second similarity condition.

[0089] In a specific implementation, since the model in the fine-tuning stage achieves a higher training effect, that is, the intent recognition result output by the first language model is highly similar to the intent recognition result corresponding to the search sentence sample, a longer training time is required. Therefore, the training batch (epoch) of the pre-training stage can be set according to actual needs. After the training of the set training batch is completed, it is considered that the model has been trained to obtain a higher effect and the training can be ended. The training batch can be determined according to actual needs, for example, 1, 2, 5, 10, etc., and the present invention does not limit this. At the same time, the batch size (batchsize) of each training can also be set. The batch size is usually selected based on the balance between memory efficiency and memory capacity. As an example of the present invention, when a single machine with 8 GPU (Graphics Processing Unit, graphics processor) cards is selected, and the model of each GPU card is A100 (40g video memory), the batch size can be selected as 32.

[0090] In one embodiment of the present invention, the step of training a preset first model to be trained to predict context information following the context information based on context information extracted from video description information, and obtaining a first language model after the training is completed includes:

[0091] S21, freezing the model weight matrix in the preset first model to be trained;

[0092] Specifically, the word vector conversion module and the decoder module in the large language model may have at least one model weight matrix, which includes several model weight parameters. The model training process can essentially be considered as updating the model weight parameters so that the model can achieve better performance.

[0093] For a large language model, it can usually have a large number of model weight parameters. The more model weight parameters there are, the easier it is to increase the difficulty of model training, and the more difficult it is to train the model to achieve the target effect. However, in general, the difference in the model weight matrix between the trained model and the initial model can show a "low inherent rank" difference, that is, the difference in the model weight matrix before and after training can be expressed by a low-rank matrix with fewer linearly independent columns. The complexity of this low-rank matrix is ​​relatively low compared to the model weight matrix. Therefore, during the model training process, the model weight matrix can be adjusted instead of adding an additional low-rank matrix. Adjusting the low-rank matrix during the training process can usually achieve the target effect of model training. At the same time, because the low-rank matrix is ​​less complex than the model weight matrix, it can more efficiently enable the model to achieve the target effect.

[0094] Therefore, in the pre-training stage of the model, the model weight matrix in the first model to be trained can be frozen first, that is, the model weight matrix in the first model to be trained can be kept unchanged. Specifically, if only the word vector conversion module in the first model to be trained is trained in the pre-training stage, and the decoder module is kept unchanged, then only the model weight matrix in the word vector conversion module needs to be frozen. If the word vector conversion module and the decoder module in the first model to be trained are trained at the same time in the pre-training stage, then the model weight matrices in both the word vector conversion module and the decoder module need to be frozen.

[0095] S22, adding a first low-rank matrix in parallel with the model weight matrix to the first model to be trained;

[0096] Afterwards, in the first model to be trained, the corresponding first low-rank matrix can be added to the frozen model weight matrix respectively, and the first low-rank matrix can be parallel to the frozen model weight matrix. If there is information that needs to be processed by the model weight matrix, after adding the first low-rank matrix, the information can be processed in parallel by the model weight matrix and the first low-rank matrix, and finally the combination of the output of the model weight matrix and the first low-rank matrix is ​​used as the final output. Therefore, when adding the first low-rank matrix, adjusting the first low-rank matrix can also achieve adjustment of the model output, so that the model output can achieve better results.

[0097] S23, training the first to-be-trained model to predict context information following the context information based on the context information extracted from the video description information;

[0098] After adding the first low-rank matrix, the first model to be trained can be trained. The training of the first model to be trained can be based on the previous information to infer the following information following the previous information. If the similarity between the following information output by the first model to be trained and the following information following the previous information in the video description information meets the preset first similarity condition, it can be considered that the training effect of the model meets the requirements, and at this time, it can be considered that the model training is completed and the first language model is obtained. Otherwise, it is necessary to continue to iteratively train the first model to be trained.

[0099] S24, in the process of training the first model to be trained, adjusting the parameters in the first low-rank matrix until the following information output by the first model to be trained is similar to the following information following the above information in the video description information, thereby obtaining a first language model.

[0100] Afterwards, there is no need to adjust the model weight matrix, but only the parameters in the first low-rank matrix are adjusted, and the first model to be trained is iteratively trained until the similarity between the context information output by the first model to be trained and the context information following the previous information in the video description information meets the preset first similarity condition. At this time, it can be considered that the training effect of the first model to be trained meets the requirements, and the trained model is used as the first language model.

[0101] In one embodiment of the present invention, a search sentence sample is used as input, an intent recognition result corresponding to the search sentence sample is used as output, and the first language model is trained using the intent recognition sample. After the training is completed, the steps of obtaining the intent recognition model include:

[0102] S31, taking a search sentence sample as input, taking an intent recognition result corresponding to the search sentence sample as output, and using the intent recognition sample to train a first language model;

[0103] Later, in the fine-tuning stage, it is also possible to adjust the first low-rank matrix without adjusting the model weight matrix, so that the model reaches the training target. At this time, the search sentence sample can be used as input, the intent recognition result corresponding to the search sentence sample can be used as output, and the intent recognition sample can be used to train the first language model.

[0104] S32, during the training of the first language model, the parameters in the first low-rank matrix are adjusted until the similarity between the intent recognition result output by the first language model based on the search sentence sample and the intent recognition result corresponding to the search sentence sample meets a preset second similarity condition, thereby obtaining an intent recognition model.

[0105] During the iteration process, there is no need to adjust the model weight matrix, but only the parameters in the first low-rank matrix are adjusted, and the first language model is iteratively trained until the similarity between the intent recognition result output by the first language model based on the search sentence sample and the intent recognition result corresponding to the search sentence sample meets the preset second similarity condition. At this time, it can be considered that the training effect of the first language model meets the requirements, and the trained model is used as the intent recognition model.

[0106] Step 405: If the intent recognition result is a movie search intent, the user search sentence is input into a sentence conversion model, and a standard sentence output by the sentence conversion model is obtained;

[0107] When the intent recognition result is the intent to find a movie, it can be considered that the user needs to obtain video search results at this time. In this case, in order to facilitate the video search engine to recall the search results normally, the user's search sentence needs to be converted into a standard sentence that the video search engine can understand.

[0108] Among them, the standard sentence can record entity information related to the video, and its expression is easier to understand than the user search sentence, so that the video search engine can extract the entity information from the standard sentence and return the corresponding video search results based on the entity information.

[0109] In a specific implementation, a sentence conversion model may be set, which may be a large language model with natural language processing capabilities. Exemplarily, in the training process of the sentence conversion model, the sentence conversion model may be trained with user search sentence samples as input and corresponding standard sentences as output. Thus, in the application process, the user search sentence is input into the sentence conversion model, and the standard sentence output by the sentence conversion model may be obtained.

[0110] In one embodiment of the present invention, the method further comprises:

[0111] S41, obtaining video description information from a video website;

[0112] Generally speaking, the large language model can handle language processing tasks in general situations, but it is not optimized for video search scenarios. Further optimization of the large language is needed to better handle sentence conversion tasks in video search scenarios.

[0113] Thus, video description information can be obtained from video websites and used as training samples for large language models. The video description information can be information such as video titles, video introductions, and video comments on video websites.

[0114] S42, training a preset second model to be trained to predict context information following the context information based on context information extracted from the video description information, and obtaining a second language model after the training is completed;

[0115] Generally speaking, the training process of a large language model can be divided into two stages. The first stage is the pre-training stage, the goal of which is to enable the model to learn new knowledge. The model will learn how to understand and generate text from a large amount of text data. The second stage is the fine-tuning stage, the goal of which is to enable the model to have the ability to handle specific tasks.

[0116] Specifically, a large language model can usually include a word embedding module and a decoder module. The word embedding module is used to convert text into a token sequence represented by a number. The decoder module is used to perform word-by-word reasoning on the output based on the token sequence, and finally output an answer to the input text.

[0117] During the pre-training process, the decoder module in the large language model can be kept unchanged, and the word vector conversion module can be trained mainly so that it can understand and adapt to the newly added video description information. The model as a whole, that is, the word vector conversion module and the decoder module can be trained at the same time, and the present invention does not limit this.

[0118] Therefore, a general large language model can be selected as the second model to be trained, and part of the information in the video description information can be extracted as the above information. The training of the second model to be trained can be based on the above information to infer the context information following the above information. If the similarity between the context information output by the second model to be trained and the context information following the above information in the video description information meets the preset third similarity condition, it can be considered that the training effect of the model meets the requirements. At this time, it can be considered that the model training is completed and the second language model is obtained. Otherwise, it is necessary to continue to iterate the training of the second model to be trained. In this way, the model can learn the knowledge in the video description information so that it can better handle the sentence conversion task later.

[0119] The similarity between the context information output by the second model to be trained and the context information following the preceding context information in the video description information may be calculated by using methods such as cosine similarity and Euclidean distance. When the similarity between the context information output by the second model to be trained and the context information following the preceding context information in the video description information is greater than a preset threshold, it may be considered that the similarity between the context information output by the second model to be trained and the context information following the preceding context information in the video description information satisfies a preset third similarity condition.

[0120] In a specific implementation, since both the first language model and the second language model learn the same video description information, the trained first language model can be directly used as the second language model according to actual needs.

[0121] S43, obtaining an input sentence conversion sample; the sentence conversion sample includes a search sentence sample and a standard sentence sample corresponding to the search sentence sample;

[0122] After completing pre-training and the model has learned the knowledge in the video description information, the model can be further fine-tuned so that it can handle specific sentence conversion tasks.

[0123] Thus, for the sentence conversion task, several sentence conversion samples can be input, wherein the sentence conversion samples can include search sentence samples and standard sentence samples corresponding to the search sentence samples. The search sentence samples can be generated by artificially imitating user search sentences, or can be user search sentences that cannot be recognized by the sentence understanding module extracted from historical input as search sentence samples, and the standard sentence samples corresponding to the search sentence samples can be input and can be processed normally by the video search engine.

[0124] S44, taking the search sentence sample as input and the standard sentence sample corresponding to the search sentence sample as output, the sentence conversion sample is used to train the second language model, and a sentence conversion model is obtained after the training is completed.

[0125] Afterwards, the search sentence sample can be used as the model input, and the standard sentence sample corresponding to the search sentence sample can be used as the model output to train the second language model. At this time, the word vector conversion module and the decoder module in the second language model can be trained together. When the similarity between the standard sentence output by the second language model and the standard sentence sample corresponding to the search sentence sample meets the preset fourth similarity condition, the model training can be considered to be completed and the sentence conversion model is obtained. In this way, the model can learn how to handle the sentence conversion task. When the user search sentence is input, the model can return a standard sentence sample that meets the requirements of the sentence conversion task.

[0126] The similarity between the standard sentence output by the second language model and the standard sentence sample corresponding to the search sentence sample may be calculated by using methods such as cosine similarity and Euclidean distance. When the similarity between the standard sentence output by the second language model and the standard sentence sample corresponding to the search sentence sample is greater than a preset threshold, it can be considered that the similarity between the standard sentence output by the second language model and the standard sentence sample corresponding to the search sentence sample meets a preset third similarity condition.

[0127] In a specific implementation, since the model in the fine-tuning stage achieves a higher training effect, that is, the standard sentence samples output by the second language model are highly similar to the standard sentence samples corresponding to the search sentence samples, a longer training time is required. Therefore, the training batch (epoch) of the pre-training stage can be set according to actual needs. After the training of the set training batch is completed, it is considered that the model has been trained to obtain a higher effect and the training can be terminated. The training batch can be determined according to actual needs, for example, 1, 2, 5, 10, etc., and the present invention does not limit this. At the same time, the batch size (batchsize) of each training can also be set. The batch size is usually selected based on the balance between memory efficiency and memory capacity. As an example of the present invention, when a single machine with 8 GPU (Graphics Processing Unit, graphics processor) cards is selected, and the model of each GPU card is A100 (40g video memory), the batch size can be selected as 32.

[0128] In one embodiment of the present invention, the step of training a preset second model to be trained to predict context information following the context information based on context information extracted from the video description information, and obtaining a second language model after the training is completed includes:

[0129] S51, freezing the model weight matrix in the preset second model to be trained;

[0130] Specifically, during the model training process, the model weight matrix does not need to be adjusted. Instead, a low-rank matrix is ​​added. Adjusting the low-rank matrix during the training process can usually enable the model training to achieve the target effect. At the same time, because the low-rank matrix is ​​less complex than the model weight matrix, it can more efficiently enable the model to achieve the target effect.

[0131] Therefore, in the pre-training stage of the model, the model weight matrix in the second model to be trained can be frozen first, that is, the model weight matrix in the second model to be trained can be kept unchanged. Specifically, if only the word vector conversion module in the second model to be trained is trained in the pre-training stage, and the decoder module is kept unchanged, then only the model weight matrix in the word vector conversion module needs to be frozen. If the word vector conversion module and the decoder module in the second model to be trained are trained at the same time in the pre-training stage, then the model weight matrices in both the word vector conversion module and the decoder module need to be frozen.

[0132] S52, adding a second low-rank matrix to the second model to be trained;

[0133] Afterwards, in the second model to be trained, the corresponding second low-rank matrix can be added to the frozen model weight matrix respectively, and the second low-rank matrix can be parallel to the frozen model weight matrix. If there is information that needs to be processed by the model weight matrix, after adding the second low-rank matrix, the information can be processed in parallel by the model weight matrix and the second low-rank matrix, and finally the combination of the output of the model weight matrix and the second low-rank matrix is ​​used as the final output. Therefore, when adding the second low-rank matrix, adjusting the second low-rank matrix can also achieve adjustment of the model output, so that the model output can achieve better results.

[0134] S53, training a second to-be-trained model to predict context information following the context information based on context information extracted from the video description information;

[0135] After adding the second low-rank matrix, the second model to be trained can be trained. The training of the second model to be trained can infer the context information following the context information based on the previous information. If the similarity between the context information output by the second model to be trained and the context information following the previous information in the video description information meets the preset third similarity condition, it can be considered that the training effect of the model meets the requirements. At this time, it can be considered that the model training is completed and the second language model is obtained. Otherwise, it is necessary to continue to iteratively train the second model to be trained.

[0136] S54, in the process of training the second model to be trained, adjusting the parameters in the second low-rank matrix until the second model to be trained outputs context information similar to the context information following the previous context information in the video description information, thereby obtaining a second language model.

[0137] Thereafter, there is no need to adjust the model weight matrix, but only the parameters in the second low-rank matrix are adjusted, and the second model to be trained is iteratively trained until the similarity between the context information output by the second model to be trained and the context information following the above information in the video description information meets the preset third similarity condition. At this time, it can be considered that the training effect of the second model to be trained meets the requirements, and the trained model is used as the second language model.

[0138] In one embodiment of the present invention, the steps of taking a search sentence sample as input, taking a standard sentence sample corresponding to the search sentence sample as output, and using the sentence conversion sample to train the second language model, and obtaining the sentence conversion model after the training is completed, include:

[0139] S61, taking the search sentence sample as input, taking the standard sentence sample corresponding to the search sentence sample as output, and using the sentence conversion sample to train the second language model;

[0140] Later, in the fine-tuning stage, it is also possible to adjust the second low-rank matrix without adjusting the model weight matrix, so that the model reaches the training target. At this time, the search sentence sample can be used as input, the standard sentence sample corresponding to the search sentence sample can be used as output, and the sentence conversion sample can be used to train the second language model.

[0141] S62, in the process of training the second language model, adjusting the parameters in the second low-rank matrix until the similarity between the standard sentence sample output by the second language model based on the search sentence sample and the standard sentence sample corresponding to the search sentence sample meets a preset fourth similarity condition, thereby obtaining a sentence conversion model.

[0142] During the iteration process, there is no need to adjust the model weight matrix, but only the parameters in the second low-rank matrix are adjusted, and the second language model is iteratively trained until the similarity between the standard sentence sample output by the second language model based on the search sentence sample and the standard sentence sample corresponding to the search sentence sample meets the preset fourth similarity condition. At this time, it can be considered that the training effect of the second language model meets the requirements, and the trained model is used as the sentence conversion model.

[0143] Step 406: input the standard sentence into the video search engine to obtain the video search results recalled by the video search engine.

[0144] The video search engine may have the ability to process standard sentences. The standard sentences may be input into the video search engine, and the video search engine may extract entity information from the standard sentences and return corresponding video search results based on the entity information.

[0145] Through the video search method provided in the embodiment of the present invention, the user search sentence input by the user is obtained; if the sentence understanding module cannot recognize the user search sentence, the user search sentence is input into the intention recognition model, and the intention recognition result output by the intention recognition model is obtained; if the intention recognition result is the intention to find a movie, the user search sentence is input into the sentence conversion model, and the standard sentence output by the sentence conversion model is obtained; the standard sentence is input into the video search engine, and the video search result recalled by the video search engine is obtained. The user search sentence that cannot be processed by the sentence understanding module can also return the video search result normally, which can further improve the usability of the video search function and meet the diverse search needs of users.

[0146] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0147] Reference Figure 5 , shows a structural block diagram of a video search device provided in an embodiment of the present invention, which may specifically include the following modules:

[0148] An input acquisition module 501 is used to acquire a user search statement input by a user;

[0149] The intention recognition module 502 is used to input the user search sentence into the intention recognition model if the sentence understanding module cannot recognize the user search sentence, and obtain the intention recognition result output by the intention recognition model;

[0150] The sentence conversion module 503 is used to input the user search sentence into the sentence conversion model if the intention recognition result is the intention of finding a movie, and obtain the standard sentence output by the sentence conversion model;

[0151] The search module 504 is used to input the standard sentence into the video search engine to obtain the video search results recalled by the video search engine.

[0152] Optionally, the device further comprises:

[0153] An entity extraction module is used to extract entity information from user search statements through a language understanding module;

[0154] The category entity module is used to identify the search category corresponding to the user's search statement based on entity information.

[0155] Optionally, the device further comprises:

[0156] A first video description acquisition module, used to acquire video description information from a video website;

[0157] A first language training module is used to train a preset first to-be-trained model to predict context information following the context information based on context information extracted from the video description information, and obtain a first language model after the training is completed;

[0158] The first sample acquisition module is used to acquire an input intent recognition sample; the intent recognition sample includes a search sentence sample and an intent recognition result corresponding to the search sentence sample; wherein the intent recognition result includes a movie search intent and other intents;

[0159] The intent recognition training module is used to take the search sentence samples as input and the intent recognition results corresponding to the search sentence samples as output, and use the intent recognition samples to train the first language model, and obtain the intent recognition model after the training is completed.

[0160] Optionally, the first language training module includes:

[0161] A first matrix freezing submodule, used to freeze a model weight matrix in a preset first model to be trained;

[0162] A first matrix adding submodule, used for adding a first low-rank matrix in parallel with the model weight matrix in the first model to be trained;

[0163] A first language training submodule is used to train a first to-be-trained model to predict context information following the context information based on context information extracted from the video description information;

[0164] The first language model generation submodule is used to adjust the parameters in the first low-rank matrix during the training of the first model to be trained, until the similarity between the context information output by the first model to be trained and the context information following the previous information in the video description information meets a preset first similarity condition, thereby obtaining a first language model.

[0165] Optionally, the intent recognition training module includes:

[0166] An intention recognition training submodule is used to take a search sentence sample as input, and the intention recognition result corresponding to the search sentence sample as output, and use the intention recognition sample to train the first language model;

[0167] The intent recognition model generation submodule is used to adjust the parameters in the first low-rank matrix during the training of the first language model until the similarity between the intent recognition result output by the first language model based on the search sentence sample and the intent recognition result corresponding to the search sentence sample meets a preset second similarity condition, thereby obtaining the intent recognition model.

[0168] Optionally, the device further comprises:

[0169] A second video description acquisition module is used to acquire video description information from a video website;

[0170] A second language training module, used for training a preset second model to be trained to predict context information following the context information based on context information extracted from the video description information, and obtaining a second language model after the training is completed;

[0171] The second sample acquisition module is used to acquire an input sentence conversion sample; the sentence conversion sample includes a search sentence sample and a standard sentence sample corresponding to the search sentence sample;

[0172] The sentence conversion training module is used to take the search sentence sample as input and the standard sentence sample corresponding to the search sentence sample as output, and use the sentence conversion sample to train the second language model, and obtain the sentence conversion model after the training is completed.

[0173] Optionally, the statement conversion sample includes a search statement sample in at least one search scenario and a standard statement sample corresponding to the search statement sample.

[0174] Optionally, the second language training module includes:

[0175] A second matrix freezing submodule, used to freeze the model weight matrix in the preset second model to be trained;

[0176] A second matrix adding submodule, used for adding a second low-rank matrix to the second to-be-trained model;

[0177] A second language training submodule, used for training a second to-be-trained model to predict context information following the context information based on context information extracted from the video description information;

[0178] The second language model generation submodule is used to adjust the parameters in the second low-rank matrix during the training of the second model to be trained, until the similarity between the context information output by the second model to be trained and the context information following the previous information in the video description information meets a preset third similarity condition, thereby obtaining the second language model.

[0179] Optionally, the sentence conversion training module includes:

[0180] A sentence conversion training submodule is used to take a search sentence sample as input, and a standard sentence sample corresponding to the search sentence sample as output, and use the sentence conversion sample to train the second language model;

[0181] The sentence conversion model generation submodule is used to adjust the parameters in the second low-rank matrix during the training of the second language model until the similarity between the standard sentence sample output by the second language model based on the search sentence sample and the standard sentence sample corresponding to the search sentence sample meets the preset fourth similarity condition, thereby obtaining the sentence conversion model.

[0182] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0183] In addition, an embodiment of the present invention further provides an electronic device, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604.

[0184] Memory 603, used for storing computer programs;

[0185] The processor 601 is used to execute the program stored in the memory 603 to implement the following steps:

[0186] Get the user search statement entered by the user;

[0187] If the sentence understanding module cannot recognize the user search sentence, the user search sentence is input into the intent recognition model, and the intent recognition result output by the intent recognition model is obtained;

[0188] If the intent recognition result is the intent to find a movie, the user's search sentence is input into the sentence conversion model, and a standard sentence output by the sentence conversion model is obtained;

[0189] The standard sentence is input into the video search engine to obtain the video search results recalled by the video search engine.

[0190] Optionally, before the step of inputting the user search sentence into the intent recognition model if the sentence understanding module cannot recognize the user search sentence and obtaining the intent recognition result output by the intent recognition model, the method further includes:

[0191] Through the language understanding module, the entity information in the user's search sentence is extracted;

[0192] Based on the entity information, the search category corresponding to the user's search statement is identified.

[0193] Optionally, the method further comprises:

[0194] Get video description information from video websites;

[0195] The first model to be trained is preset to predict the context information following the context information based on the context information extracted from the video description information, and a first language model is obtained after the training is completed;

[0196] Obtaining an input intent recognition sample; the intent recognition sample includes a search sentence sample and an intent recognition result corresponding to the search sentence sample; wherein the intent recognition result includes a movie search intent and other intents;

[0197] The search sentence samples are taken as input, and the intent recognition results corresponding to the search sentence samples are taken as output. The intent recognition samples are used to train the first language model, and the intent recognition model is obtained after the training is completed.

[0198] Optionally, the step of training a preset first model to be trained to predict context information following the context information based on context information extracted from the video description information, and obtaining a first language model after the training is completed includes:

[0199] Freeze the model weight matrix in the preset first model to be trained;

[0200] Add a first low-rank matrix in parallel with the model weight matrix to the first model to be trained;

[0201] Training the first to-be-trained model to predict context information following the context information based on context information extracted from the video description information;

[0202] During the process of training the first model to be trained, the parameters in the first low-rank matrix are adjusted until the similarity between the context information output by the first model to be trained and the context information following the previous context information in the video description information meets a preset first similarity condition, thereby obtaining a first language model.

[0203] Optionally, the step of taking a search sentence sample as input, taking an intent recognition result corresponding to the search sentence sample as output, using the intent recognition sample to train the first language model, and obtaining the intent recognition model after the training is completed includes:

[0204] Taking the search sentence sample as input and the intent recognition result corresponding to the search sentence sample as output, the first language model is trained using the intent recognition sample;

[0205] During the process of training the first language model, the parameters in the first low-rank matrix are adjusted until the similarity between the intent recognition result output by the first language model based on the search sentence sample and the intent recognition result corresponding to the search sentence sample meets a preset second similarity condition, thereby obtaining an intent recognition model.

[0206] Optionally, the method further comprises:

[0207] Get video description information from video websites;

[0208] The second model to be trained is preset to predict the context information following the context information based on the context information extracted from the video description information, and a second language model is obtained after the training is completed;

[0209] Obtaining an input sentence conversion sample; the sentence conversion sample includes a search sentence sample and a standard sentence sample corresponding to the search sentence sample;

[0210] The search sentence samples are taken as input, the standard sentence samples corresponding to the search sentence samples are taken as output, and the second language model is trained with the sentence conversion samples. After the training is completed, the sentence conversion model is obtained.

[0211] Optionally, the statement conversion sample includes a search statement sample in at least one search scenario and a standard statement sample corresponding to the search statement sample.

[0212] Optionally, the step of training a preset second model to be trained to predict context information following the context information based on context information extracted from the video description information, and obtaining a second language model after the training is completed includes:

[0213] Freeze the model weight matrix in the preset second model to be trained;

[0214] Add a second low-rank matrix to the second model to be trained;

[0215] Training the second to-be-trained model to predict context information following the context information based on context information extracted from the video description information;

[0216] During the process of training the second model to be trained, the parameters in the second low-rank matrix are adjusted until the similarity between the context information output by the second model to be trained and the context information following the previous context information in the video description information meets a preset third similarity condition, thereby obtaining a second language model.

[0217] Optionally, the step of taking the search sentence sample as input, the standard sentence sample corresponding to the search sentence sample as output, and using the sentence conversion sample to train the second language model, and obtaining the sentence conversion model after the training is completed, includes:

[0218] Using the search sentence sample as input and the standard sentence sample corresponding to the search sentence sample as output, the second language model is trained using the sentence conversion sample;

[0219] During the training of the second language model, the parameters in the second low-rank matrix are adjusted until the similarity between the standard sentence sample output by the second language model based on the search sentence sample and the standard sentence sample corresponding to the search sentence sample meets a preset fourth similarity condition, thereby obtaining a sentence conversion model.

[0220] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0221] The communication interface is used for communication between the above terminal and other devices.

[0222] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0223] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0224] like Figure 7 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 701 is further provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the video search method in the above embodiment.

[0225] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the video search method in the above embodiment.

[0226] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0227] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0228] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0229] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A video search method, characterized in that: The method comprises: Get the user search statement entered by the user; If the sentence understanding module cannot recognize the user search sentence, input the user search sentence into the intention recognition model, and obtain the intention recognition result output by the intention recognition model; If the intention recognition result is a movie search intention, input the user search sentence into a sentence conversion model, and obtain a standard sentence output by the sentence conversion model; The standard sentence is input into a video search engine to obtain video search results recalled by the video search engine.

2. The method according to claim 1, characterized in that Before the step of inputting the user search sentence into an intention recognition model if the sentence understanding module cannot recognize the user search sentence and obtaining the intention recognition result output by the intention recognition model, the method further includes: Extracting entity information from the user's search statement through the language understanding module; Based on the entity information, a search category corresponding to the user search statement is identified.

3. The method according to claim 1, characterized in that The method further comprises: Get video description information from video websites; Training a preset first model to be trained to predict context information following the context information based on context information extracted from the video description information, and obtaining a first language model after the training is completed; Obtaining an input intention recognition sample; the intention recognition sample includes a search sentence sample and an intention recognition result corresponding to the search sentence sample; wherein the intention recognition result includes a movie search intention and other intentions; The search sentence sample is used as input, the intention recognition result corresponding to the search sentence sample is used as output, the first language model is trained using the intention recognition sample, and an intention recognition model is obtained after the training is completed.

4. The method according to claim 3, characterized in that The first model to be trained, which is preset in the training, predicts the context information following the context information based on the context information extracted from the video description information, and the step of obtaining the first language model after the training is completed includes: Freeze the model weight matrix in the preset first model to be trained; Adding a first low-rank matrix in parallel with the model weight matrix to the first model to be trained; Training the first to-be-trained model to predict context information following the context information based on context information extracted from the video description information; During the process of training the first model to be trained, the parameters in the first low-rank matrix are adjusted until the similarity between the following information output by the first model to be trained and the following information following the above information in the video description information meets a preset first similarity condition, thereby obtaining a first language model.

5. The method according to claim 4, characterized in that The step of taking the search sentence sample as input, taking the intent recognition result corresponding to the search sentence sample as output, using the intent recognition sample to train the first language model, and obtaining the intent recognition model after the training is completed comprises: Taking the search sentence sample as input and the intent recognition result corresponding to the search sentence sample as output, the first language model is trained using the intent recognition sample; During the process of training the first language model, the parameters in the first low-rank matrix are adjusted until the similarity between the intent recognition result output by the first language model based on the search sentence sample and the intent recognition result corresponding to the search sentence sample meets a preset second similarity condition, thereby obtaining an intent recognition model.

6. The method according to claim 1, characterized in that The method further comprises: Get video description information from video websites; Training a preset second model to be trained to predict context information following the context information based on context information extracted from the video description information, and obtaining a second language model after the training is completed; Acquire an input sentence conversion sample; the sentence conversion sample includes a search sentence sample and a standard sentence sample corresponding to the search sentence sample; The search sentence sample is used as input, the standard sentence sample corresponding to the search sentence sample is used as output, the sentence conversion sample is used to train the second language model, and a sentence conversion model is obtained after the training is completed.

7. The method according to claim 6, characterized in that The sentence conversion samples include search sentence samples in at least one search scenario and standard sentence samples corresponding to the search sentence samples.

8. A video search device, characterized in that: The device comprises: An input acquisition module is used to acquire a user search statement input by a user; An intention recognition module, used for inputting the user search sentence into an intention recognition model if the sentence understanding module cannot recognize the user search sentence, and obtaining the intention recognition result output by the intention recognition model; A sentence conversion module, for inputting the user search sentence into a sentence conversion model if the intention recognition result is a movie search intention, and obtaining a standard sentence output by the sentence conversion model; The search module is used to input the standard sentence into a video search engine to obtain video search results recalled by the video search engine.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 7 when executing the program stored in the memory.

10. One or more computer-readable media having instructions stored thereon, which when executed by one or more processors cause the processors to perform the method according to any one of claims 1 to 7.

11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Intention recognition model training method for retrieval, retrieval method and electronic equipment

    CN120849573A