Resource processing method, device, equipment and computer-readable storage medium
By obtaining and integrating the feature vectors of multimedia resource sub-resources, the problem of low accuracy of multimedia resource feature vectors is solved, resource matching and label accuracy are improved, and better resource recommendation effects are achieved.
Patent Information
- Application Number
- CN202210093667.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-01-26
AI Technical Summary
The accuracy of determining the feature vectors of multimedia resources in the prior art is low, resulting in low matching of multimedia resources, which in turn affects the accuracy of resource tags.
By obtaining sub-resource feature vectors in multimedia resources, extracting activation vectors of sub-resources, determining target feature vectors based on these vectors, and fusing sub-resource features to improve the accuracy of feature expression of multimedia resources.
It improves the accuracy and matching degree of feature vectors of multimedia resources and enhances the accuracy of resource tags, thereby better recommending multimedia resources.
Smart Images

Figure CN114417030B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Internet technology, and in particular to a resource processing method, device, equipment, and computer-readable storage medium. Background Art
[0002] With the rapid development of Internet technology, the number of multimedia resources such as audio resources, video resources, and text resources is increasing. In order to facilitate the management of multimedia resources, the feature vector of the multimedia resources is usually determined, and then the label of the multimedia resources is determined based on the feature vector of the multimedia resources. Therefore, the premise of determining the label of the multimedia resources is to determine the feature vector of the multimedia resources. Therefore, a resource processing method is urgently needed to determine the feature vector of the multimedia resources.
[0003] In the related art, when a multimedia resource includes at least two sub-resources, the process of determining a feature vector of the multimedia resource is: determining a feature vector corresponding to each sub-resource; and concatenating the feature vectors corresponding to each sub-resource to obtain a feature vector of the multimedia resource.
[0004] However, the feature vector determined in the above resource processing method has low accuracy and low matching degree with the multimedia resource, resulting in low accuracy of the label of the multimedia resource determined based on the feature vector of the multimedia resource. Summary of the invention
[0005] The embodiments of the present application provide a resource processing method, apparatus, device and computer-readable storage medium, which can be used to solve the problem that the feature vector of the multimedia resource determined in the related art is of low accuracy and low matching degree with the multimedia resource. The technical solution is as follows:
[0006] On the one hand, an embodiment of the present application provides a resource processing method, the method comprising:
[0007] Acquire a multimedia resource, wherein the multimedia resource includes at least two sub-resources;
[0008] Determine a feature vector corresponding to each sub-resource, wherein the feature vector is used to characterize the sub-resource;
[0009] Extracting features corresponding to a partial region from feature vectors corresponding to each of the sub-resources to obtain activation vectors corresponding to each of the sub-resources;
[0010] Based on the feature vectors respectively corresponding to the sub-resources and the activation vectors respectively corresponding to the sub-resources, a target feature vector is determined, the target feature vector is used to characterize the multimedia resource, and the target feature vector is used to recommend resources.
[0011] On the other hand, an embodiment of the present application provides a resource processing device, the device comprising:
[0012] An acquisition module, used to acquire a multimedia resource, wherein the multimedia resource includes at least two sub-resources;
[0013] A determination module, used to determine the feature vectors corresponding to each sub-resource, wherein the feature vectors are used to characterize the sub-resources;
[0014] An extraction module, used to extract features corresponding to a partial area from the feature vectors corresponding to each sub-resource, to obtain activation vectors corresponding to each sub-resource;
[0015] The determination module is further used to determine a target feature vector based on the feature vectors corresponding to each sub-resource and the activation vectors corresponding to each sub-resource, wherein the target feature vector is used to characterize the multimedia resource and is used to recommend resources.
[0016] In a possible implementation, the determination module is used to determine an intermediate feature vector based on an activation vector corresponding to a first sub-resource and a feature vector corresponding to a second sub-resource, wherein the intermediate feature vector is a feature vector obtained by fusing the second sub-resource with the first sub-resource, the number of the intermediate feature vectors is the same as the number of the sub-resources, the first sub-resource is any sub-resource included in the multimedia resource, and the second sub-resource is a sub-resource included in the multimedia resource except the first sub-resource; based on the intermediate feature vector, the target feature vector is determined.
[0017] In a possible implementation, the determination module is used to multiply the values of the same vector dimension in the activation vector corresponding to the first sub-resource and the feature vector corresponding to the second sub-resource to obtain a reference feature vector; and add the values of each vector dimension in the reference feature vector to obtain the intermediate feature vector.
[0018] In a possible implementation, the extraction module is used to input the feature vector corresponding to the first sub-resource into a target activation model corresponding to the first sub-resource, the target activation model is obtained by training an initial activation model through a sample sub-resource and the activation vector of the sample sub-resource, the sample sub-resource has the same resource type as the first sub-resource, and the first sub-resource is any sub-resource included in the multimedia resource; based on the output result of the target activation model corresponding to the first sub-resource, the activation vector corresponding to the first sub-resource is obtained.
[0019] In a possible implementation, the acquisition module is further used to acquire tags of the multimedia resource, and the number of tags of the multimedia resource is at least two;
[0020] The determination module is also used to determine the feature vector corresponding to the label of the multimedia resource; based on the feature vector corresponding to the label of the multimedia resource and the target feature vector, determine the matching degree between the label of the multimedia resource and the multimedia resource; and use the label of the multimedia resource whose matching degree with the multimedia resource meets the matching requirements as the resource label of the multimedia resource.
[0021] In a possible implementation manner, the device further includes:
[0022] The storage module is used to store the multimedia resources and the resource tags of the multimedia resources in correspondence.
[0023] In a possible implementation manner, the device further includes:
[0024] A receiving module, configured to receive a content recommendation request, wherein the content recommendation request carries a recommendation tag;
[0025] The determination module is further configured to determine the multimedia resource to be recommended based on the recommendation tag, the multimedia resource and the resource tag of the multimedia resource;
[0026] The recommendation module is used to recommend the multimedia resource to be recommended.
[0027] In a possible implementation, the determination module is used to input the first sub-resource into a target vector determination model corresponding to the first sub-resource, and the target vector determination model is obtained by training an initial vector determination model through sample sub-resources and feature vectors corresponding to the sample sub-resources, the sample sub-resources have the same resource type as the first sub-resource, and the first sub-resource is any sub-resource included in the multimedia resource; based on the output result of the target vector determination model, the feature vector corresponding to the first sub-resource is obtained.
[0028] In a possible implementation, the first sub-resource is a video resource, and the determination module is used to capture a video image from the video resource; and input the video image into a target vector determination model corresponding to the video resource.
[0029] In a possible implementation manner, the device further includes:
[0030] A training module is used to obtain the sample sub-resource, the activation vector of the sample sub-resource and the initial activation model; input the sample sub-resource into the initial activation model to obtain a first feature vector of the sample sub-resource; determine a first loss value between the activation vector of the sample sub-resource and the first feature vector; in response to the first loss value being not greater than a first loss threshold, use the initial activation model as the target activation model.
[0031] In a possible implementation, the training module is further used to, in response to the first loss value being greater than the first loss threshold, adjust the initial activation model to obtain an adjusted activation model; input the sample sub-resource into the adjusted activation model to obtain a second feature vector of the sample sub-resource; determine a second loss value between the activation vector of the sample sub-resource and the second feature vector; and in response to the second loss value being not greater than the first loss threshold, use the adjusted activation model as the target activation model.
[0032] On the other hand, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one program code, and the at least one program code is loaded and executed by the processor to enable the electronic device to implement any of the resource processing methods described above.
[0033] On the other hand, a computer-readable storage medium is provided, in which at least one program code is stored. The at least one program code is loaded and executed by a processor so that a computer implements any of the resource processing methods described above.
[0034] On the other hand, a computer program or a computer program product is also provided, wherein at least one computer instruction is stored in the computer program or the computer program product, and the at least one computer instruction is loaded and executed by a processor so that the computer implements any one of the above-mentioned resource processing methods.
[0035] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0036] The target feature vector of the multimedia resource determined by the technical solution provided in the embodiment of the present application is a feature vector obtained after integrating the features of each sub-resource included in the multimedia resource. The target feature vector of the multimedia resource determined has a high accuracy, a high degree of matching with the multimedia resource, and can better express the multimedia resource. Since the target feature vector of the multimedia resource determined has a higher accuracy, when determining the resource tag of the multimedia resource based on the target feature vector of the multimedia resource, the accuracy of the resource tag of the multimedia resource determined can be improved, and the multimedia resource can be further better recommended. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0038] Figure 1 It is a schematic diagram of an implementation environment of a resource processing method provided in an embodiment of the present application;
[0039] Figure 2 is a flow chart of a resource processing method provided by an embodiment of the present application;
[0040] Figure 3 is a schematic diagram of a process of determining a label corresponding to a video resource provided in an embodiment of the present application;
[0041] Figure 4 It is a schematic diagram of a process of determining a label corresponding to a text resource provided in an embodiment of the present application;
[0042] Figure 5 is a schematic diagram of a resource processing process provided by an embodiment of the present application;
[0043] Figure 6 is a structural diagram of a resource processing device provided in an embodiment of the present application;
[0044] Figure 7 It is a structural diagram of a terminal device provided in an embodiment of the present application;
[0045] Figure 8 It is a structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0047] Figure 1 is a schematic diagram of an implementation environment of a resource processing method provided in an embodiment of the present application, such as Figure 1 As shown, the implementation environment includes: a terminal device 101 and a server 102 .
[0048] The resource processing method provided in the embodiment of the present application can be independently implemented by the terminal device 101, can also be independently implemented by the server 102, and can also be implemented through interaction between the terminal device and the server 102.
[0049] Among them, the terminal device 101 includes but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. The terminal device 101 can generally refer to one of multiple terminal devices. This embodiment only uses the terminal device 101 as an example. Those skilled in the art can know that the number of the above-mentioned terminal devices 101 can be more or less. For example, the above-mentioned terminal device 101 can be only one, or the above-mentioned terminal device 101 can be dozens or hundreds, or more. The embodiment of this application does not limit the number and device type of terminal devices.
[0050] The server 102 is a single server, or a server cluster consisting of multiple servers, or any one of a cloud computing platform and a virtualization center, which is not limited in the embodiments of the present application. The server 102 is connected to the terminal device 101 through a wired network or a wireless network. The server 102 has a data receiving function, a data processing function, and a data sending function. Of course, the server 102 may also have other functions, which are not limited in the embodiments of the present application.
[0051] The embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, traffic control, assisted driving, etc.
[0052] Based on the above implementation environment, the present application embodiment provides a resource processing method. Figure 2 As an example, the flowchart of a resource processing method provided in the embodiment of the present application is shown in FIG. Figure 1 The terminal device 101 in the embodiment is executed. Figure 2 As shown, the method comprises the following steps:
[0053] In step 201, a multimedia resource is obtained, where the multimedia resource includes at least two sub-resources.
[0054] In the exemplary embodiment of the present application, the multimedia resource can be any resource that needs to be classified. Before classifying the multimedia resource, it is necessary to first determine the feature vector of the multimedia resource, and then determine the resource tag of the multimedia resource based on the feature vector of the multimedia resource, that is, to achieve the purpose of classifying the multimedia resource. The multimedia resources that need to be classified can be food resources, life resources, or other resources, which are not limited in the embodiment of the present application. Among them, the multimedia resource includes at least two sub-resources, and the sub-resources included in the multimedia resource can be at least two of text resources, video resources and audio resources, which are not limited in the embodiment of the present application.
[0055] In a possible implementation, the multimedia resource may be a multimedia resource uploaded by a user, a multimedia resource obtained from the Internet, or a multimedia resource stored in the storage space of a terminal device. The embodiment of the present application does not limit the source of the multimedia resource.
[0056] In step 202, feature vectors corresponding to respective sub-resources are determined, and the feature vectors are used to characterize the sub-resources.
[0057] In a possible implementation, the process of determining the feature vectors corresponding to each sub-resource includes: inputting the first sub-resource into the target vector determination model corresponding to the first sub-resource, the target vector determination model is obtained by training the initial vector determination model through the sample sub-resource and the feature vector corresponding to the sample sub-resource, the sample sub-resource and the first sub-resource are of the same resource type, and the first sub-resource is any resource included in the multimedia resource. Based on the output result of the target vector determination model, the feature vector corresponding to the first sub-resource is obtained. The process of determining the feature vectors corresponding to other sub-resources included in the multimedia resource is similar to the process of determining the feature vector corresponding to the first sub-resource, and will not be repeated here.
[0058] Among them, when the resource type of the first subresource is video resource, the resource type of the sample subresource is also video resource; when the resource type of the first subresource is text resource, the resource type of the sample subresource is also text resource; when the resource type of the first subresource is audio resource, the resource type of the sample subresource is also audio resource.
[0059] Optionally, in response to the first sub-resource being a text resource, the text resource can be directly input into the target vector determination model corresponding to the text resource. In response to the first sub-resource being an audio resource, the audio resource can be directly input into the target vector determination model corresponding to the audio resource. In response to the first sub-resource being a video resource, a video image is captured from the video resource, and the video image is input into the target vector determination model corresponding to the video resource.
[0060] Before inputting the first sub-resource into the target vector determination model corresponding to the first sub-resource, it is necessary to first train the target vector determination model corresponding to the first sub-resource. The process of training the target vector determination model corresponding to the first sub-resource includes: obtaining a sample sub-resource, a sample vector corresponding to the sample sub-resource, and an initial vector determination model; inputting the sample sub-resource into the initial vector determination model to obtain a third feature vector corresponding to the sample sub-resource. Determine the third loss value between the third feature vector and the sample vector corresponding to the sample sub-resource; in response to the third loss value being not greater than the second loss threshold, use the initial vector determination model as the target vector determination model corresponding to the first sub-resource. Among them, the resource type of the sample sub-resource is the same as the resource type of the first sub-resource.
[0061] In response to the third loss value being greater than the second loss threshold, the initial vector determination model is adjusted to obtain the adjusted vector determination model; the sample sub-resource is input into the adjusted vector determination model to obtain a fourth eigenvector corresponding to the sample sub-resource; a fourth loss value between the fourth eigenvector and the sample vector corresponding to the sample sub-resource is determined; in response to the fourth loss value being not greater than the second loss threshold, the adjusted vector determination model is used as the target vector determination model corresponding to the first sub-resource.
[0062] In response to the fourth loss value still being greater than the second loss threshold, the initial vector determination model is adjusted again until the loss value between the feature vector of the sample sub-resource obtained based on the re-adjusted vector determination model and the sample vector of the sample sub-resource is no greater than the second loss threshold, and the re-adjusted vector determination model is used as the target vector determination model corresponding to the first sub-resource.
[0063] The second loss threshold is set based on experience or adjusted according to the application scenario, which is not limited in the embodiment of the present application. The initial vector determination model can be any type of model, which is not limited in the embodiment of the present application. Exemplarily, the initial vector determination model is a residual neural network (RESNET) model.
[0064] The process of determining the third loss value between the third feature vector and the sample vector corresponding to the sample sub-resource includes: calling the loss function to process the third feature vector and the sample vector corresponding to the sample sub-resource to obtain the third loss value. The loss function may be any one of an absolute value loss function, a log (logarithmic) loss function, a square loss function, an exponential loss function, and a Hinge loss function (a loss function), which is not limited in the embodiments of the present application.
[0065] Optionally, taking the first sub-resource as a video resource as an example, the process of determining the feature vector corresponding to the video resource includes: intercepting a video image in the video resource, inputting the video image into a target vector determination model corresponding to the video resource, and the target vector determination model corresponding to the video resource is obtained by training an initial vector determination model through a sample video and a sample vector corresponding to the sample video. Based on the output result of the target vector determination model, the feature vector corresponding to the video resource is obtained. Since the feature vector corresponding to the video resource is determined based on the video image in the video resource, the feature vector corresponding to the video resource can characterize the video resource.
[0066] Optionally, taking the first sub-resource as a text resource as an example, the process of determining the feature vector corresponding to the text resource includes: inputting the text resource into a target vector determination model corresponding to the text resource, and the target vector determination model corresponding to the text resource is obtained by training an initial vector determination model through sample text and a sample vector corresponding to the sample text. Based on the output result of the target vector determination model corresponding to the text resource, the feature vector corresponding to the text resource is obtained. Since the feature vector corresponding to the text resource is determined based on the text resource, the feature vector corresponding to the text resource can characterize the text resource.
[0067] It should be noted that when the first sub-resource is other types of resources, the process of determining the feature vector corresponding to the first sub-resource is similar to the process of determining the feature vector corresponding to the video resource and the process of determining the feature vector corresponding to the text resource, and will not be repeated here.
[0068] In step 203, features corresponding to the partial regions are extracted from the feature vectors corresponding to the sub-resources to obtain activation vectors corresponding to the sub-resources.
[0069] Optionally, the process of extracting features corresponding to a partial region from feature vectors corresponding to each sub-resource to obtain activation vectors corresponding to each sub-resource includes: inputting the feature vector corresponding to the first sub-resource into a target activation model corresponding to the first sub-resource, the target activation model is obtained by training an initial activation model through a sample sub-resource and the activation vector of the sample sub-resource, the sample sub-resource is of the same resource type as the first sub-resource, and the first sub-resource is any sub-resource included in the multimedia resource. Based on the output result of the target activation model corresponding to the first sub-resource, the activation vector corresponding to the first sub-resource is obtained.
[0070] The process of determining the target activation model corresponding to other sub-resources included in the multimedia resource is similar to the process of determining the target activation model corresponding to the first sub-resource, and will not be repeated here.
[0071] Before inputting the feature vector corresponding to the first sub-resource into the target activation model corresponding to the first sub-resource, the target activation model corresponding to the first sub-resource needs to be trained first. The process of training the target activation model corresponding to the first sub-resource includes: obtaining a sample sub-resource, an activation vector of the sample sub-resource, and an initial activation model; inputting the sample sub-resource into the initial activation model to obtain a first feature vector of the sample sub-resource; determining a first loss value between the activation vector of the sample sub-resource and the first feature vector; and in response to the first loss value being not greater than a first loss threshold, using the initial activation model as the target activation model.
[0072] In response to the first loss value being greater than the first loss threshold, the initial activation model is adjusted to obtain an adjusted activation model; the sample sub-resource is input into the adjusted activation model to obtain a second feature vector of the sample sub-resource. A second loss value between the activation vector and the second feature vector of the sample sub-resource is determined; in response to the second loss value being not greater than the first loss threshold, the adjusted activation model is used as a target activation model.
[0073] In response to the second loss value still being greater than the first loss threshold, the initial activation model is adjusted again until the loss value between the vector of the sample sub-resource obtained based on the re-adjusted activation model and the activation vector of the sample sub-resource is no greater than the first loss threshold, and the re-adjusted activation model is used as the target activation model.
[0074] Among them, the first loss threshold is set based on experience, or adjusted according to the application scenario, which is not limited in the embodiments of the present application. The initial activation model can be any type of model, which is not limited in the embodiments of the present application. Exemplarily, the initial activation model can be a RESNET model, the initial activation model can be a Bert (Bidirectional Encoder Representations from Transformers, pre-trained language representation network) model, or the initial activation model can also be an LSTM (Long short-term memory, long short-term memory network) model.
[0075] Optionally, taking the first sub-resource as a video resource as an example, the process of extracting features corresponding to a partial area in the feature vector corresponding to the first sub-resource and obtaining an activation vector corresponding to the first sub-resource includes: inputting the feature vector corresponding to the video resource into a target activation model corresponding to the video resource, and the target activation model corresponding to the video resource is obtained by training an initial activation model with sample videos and activation vectors of the sample videos. Based on the output result of the target activation model corresponding to the video resource, the activation vector corresponding to the video resource is obtained. Since the activation vector corresponding to the video resource is a feature vector obtained by focusing on a partial area of the video resource, the activation vector corresponding to the video resource is more targeted, so that the activation vector corresponding to the video resource can better express the video resource.
[0076] Optionally, based on the following formula (1), features corresponding to a partial region are extracted from a feature vector corresponding to the video resource to obtain an activation vector Z1 corresponding to the video resource.
[0077] Z1=σ(W1 T X1+B1) (1)
[0078] In the above formula (1), σ is the activation function, W1 is the parameter mapping matrix, T is the transposed matrix, X1 is the feature vector corresponding to the video resource, and B1 is the bias vector.
[0079] Optionally, taking the first sub-resource as a text resource as an example, the process of extracting features corresponding to a partial area in a feature vector corresponding to the text resource to obtain an activation vector corresponding to the text resource includes: inputting the feature vector corresponding to the text resource into a target activation model corresponding to the text resource, the target activation model corresponding to the text resource is obtained by training an initial activation model with sample text and the activation vector of the sample text, and obtaining an activation vector corresponding to the text resource based on the output result of the target activation model corresponding to the text resource. Since the activation vector corresponding to the text resource is a feature vector obtained by focusing on a part of the text resource, the activation vector corresponding to the text resource is more targeted, so that the activation vector corresponding to the text resource can better express the text resource.
[0080] Optionally, based on the following formula (2), features corresponding to the partial region are extracted from the feature vector corresponding to the text resource to obtain an activation vector Z2 corresponding to the text resource.
[0081] Z2=σ(W2 T X2+B2) (2)
[0082] In the above formula (2), σ is the activation function, W2 is the parameter mapping matrix, T is the transposed matrix, X2 is the feature vector corresponding to the text resource, and B2 is the bias vector.
[0083] It should be noted that when the first sub-resource is other types of sub-resources, the process of determining the activation vector corresponding to the first sub-resource is similar to the process of determining the activation vector corresponding to the above-mentioned video resource and the process of determining the activation vector corresponding to the text resource, and will not be repeated here.
[0084] In step 204, based on the feature vectors corresponding to each sub-resource and the activation vectors corresponding to each sub-resource, a target feature vector is determined, the target feature vector is used to characterize the multimedia resource, and the target feature vector is used to recommend the resource.
[0085] In a possible implementation, the process of determining the target feature vector based on the feature vectors corresponding to each sub-resource and the activation vectors corresponding to each sub-resource includes: determining an intermediate feature vector based on the activation vector corresponding to the first sub-resource and the feature vector corresponding to the second sub-resource, the intermediate feature vector being a feature vector obtained by fusing the second sub-resource on the basis of the first sub-resource, the number of intermediate feature vectors being the same as the number of sub-resources, the first sub-resource being any sub-resource included in the multimedia resource, and the second sub-resource being a sub-resource other than the first sub-resource included in the multimedia resource. Determine the target feature vector based on the intermediate feature vector.
[0086] Exemplarily, if the number of sub-resources included in the multimedia resource is 2, the number of intermediate feature vectors determined is 2. If the number of sub-resources included in the multimedia resource is 3, the number of intermediate feature vectors determined is 3.
[0087] The process of determining the intermediate feature vector based on the activation vector corresponding to the first sub-resource and the feature vector corresponding to the second sub-resource includes: multiplying the values of the same vector dimension in the activation vector corresponding to the first sub-resource and the feature vector corresponding to the second sub-resource to obtain a reference feature vector. Adding the values of each vector dimension in the reference feature vector to obtain an intermediate feature vector.
[0088] Optionally, taking the case where the number of sub-resources included in the multimedia resource is two as an example, based on the activation vector corresponding to the first sub-resource and the feature vector corresponding to the second sub-resource, an intermediate feature vector f1 is determined according to the following formula (3).
[0089] f1=Z1*X2 (3)
[0090] In the above formula (3), Z1 is the activation vector corresponding to the first sub-resource, X2 is the feature vector corresponding to the second sub-resource, and * is the dot product operation.
[0091] In a possible implementation, after the intermediate feature vectors are determined, the process of determining the target feature vector based on the intermediate feature vectors includes: concatenating the intermediate feature vectors to obtain the target feature vector.
[0092] Optionally, after determining the target feature vector of the multimedia resource, resource recommendation can be performed based on the target feature vector, that is, based on the target feature vector, the resource tag of the multimedia resource is determined. Then, resource recommendation is performed based on the resource tag of the multimedia resource. The process of determining the resource tag of the multimedia resource is as follows: obtaining the tag of the multimedia resource, the number of the tags of the multimedia resource is at least two, and determining the feature vector corresponding to the tag of the multimedia resource. Based on the target feature vector of the multimedia resource and the feature vector corresponding to the tag of the multimedia resource, the resource tag corresponding to the multimedia resource is determined.
[0093] Among them, the label corresponding to the multimedia resource is the label corresponding to the sub-resource included in the multimedia resource, and the process of obtaining the label corresponding to the sub-resource includes: inputting the first sub-resource into the label determination model, and obtaining the label corresponding to the first sub-resource based on the output result of the label model. Among them, the first sub-resource is any sub-resource included in the multimedia resource. Optionally, the label determination model can be any type of model, which is not limited in the embodiment of the present application. Exemplarily, the label determination model can be a RESNET model, and the label determination model can also be an LSTM model.
[0094] The process of determining the feature vector corresponding to the label corresponding to the sub-resource includes: inputting the label corresponding to the sub-resource into the vector determination model, and obtaining the feature vector corresponding to the label corresponding to the sub-resource based on the output result of the vector determination model. Optionally, the vector determination model can be any type of model, and the embodiments of the present application are not limited to this. Exemplarily, the vector determination model can be an LSTM model.
[0095] In response to the sub-resource being a video resource, the process of obtaining a label corresponding to the video resource includes: inputting the video resource into a label determination model, and obtaining a label corresponding to the video resource based on an output result of the label model. Optionally, the label determination model can be any type of model, which is not limited in the embodiments of the present application. Exemplarily, the label determination model is a RESNET model. The process of determining a feature vector corresponding to a label includes: inputting the label into a vector determination model, and obtaining a feature vector corresponding to the label based on an output result of the vector determination model.
[0096] Take the first sub-resource as a video resource as an example. Figure 3 FIG. 1 is a schematic diagram of a process for determining a label corresponding to a video resource provided by an embodiment of the present application. Figure 3 In the example, the video resources are input into the RESNET model, and the labels corresponding to the video resources are obtained as "beauty" and "pig's trotter".
[0097] When the sub-resource is a text resource, the process of obtaining the label corresponding to the text resource includes: inputting the text resource into a label determination model, and based on the output result of the label model, obtaining the label corresponding to the text resource. Optionally, the label determination model can be any type of model, and the embodiments of the present application do not limit this. Exemplarily, the label determination model is an LSTM model. The process of determining the feature vector corresponding to the label includes: inputting the label into a vector determination model, and based on the output result of the vector determination model, obtaining the feature vector corresponding to the label.
[0098] As Figure 4 shown in the schematic diagram of the process for determining the label corresponding to a text resource provided by an embodiment of the present application. In this Figure 4 example, the text resource "Everyone says that eating meat can get on the hot search, so I'll give it a try." is input into the LSTM model, and the label corresponding to the text resource obtained is "Food".
[0099] The process of determining the resource label of the multimedia resource includes: determining the matching degree between the label of the multimedia resource and the multimedia resource based on the feature vector corresponding to the label of the multimedia resource and the target feature vector. The label in the label of the multimedia resource that meets the matching requirement for the matching degree is used as the resource label of the multimedia resource.
[0100] Among them, the label that meets the matching requirement for the matching degree can be the label with the highest matching degree or the label with a matching degree greater than the matching threshold. The embodiments of the present application do not limit this. Optionally, the matching threshold is set based on experience and can also be adjusted according to the application scenario. The embodiments of the present application do not limit this. Exemplarily, the matching threshold is 85.
[0101] Optionally, based on the feature vector corresponding to the label of the multimedia resource and the target feature vector, the matching degree S1 between the label corresponding to the multimedia resource and the multimedia resource is determined according to the following formula (4):
[0102]
[0103] In the above formula (4), Y1 is the value of the first vector dimension in the target feature vector, Z1 is the value of the first vector dimension in the feature vector corresponding to the label of the multimedia resource; Y2 is the value of the second vector dimension in the target feature vector, Z2 is the value of the second vector dimension in the feature vector corresponding to the label of the multimedia resource; Y n is the value of the nth vector dimension in the target feature vector, and Z n is the value of the nth vector dimension in the feature vector corresponding to the label of the multimedia resource.
[0104] It should be noted that other methods may be selected to determine the matching degree between the label corresponding to the multimedia resource and the multimedia resource, and the embodiments of the present application are not limited to this.
[0105] Exemplarily, the labels corresponding to the multimedia resources include "beauty", "pig's trotter", and "food". The label that meets the matching requirements is the label with the highest matching degree. Among them, the matching degree between the label "beauty" and the multimedia resource is 70, the matching degree between the label "pig's trotter" and the multimedia resource is 90, and the matching degree between the label "food" and the multimedia resource is 80. Since the label "pig's trotter" has the highest matching degree with the multimedia resource, the label "pig's trotter" is used as the resource label of the multimedia resource.
[0106] In a possible implementation, after determining the resource tag of the multimedia resource, the multimedia resource and the resource tag of the multimedia resource are stored correspondingly. Optionally, the multimedia resource and the resource tag of the multimedia resource can be stored correspondingly in the storage space of the terminal device, or the multimedia resource and the resource tag of the multimedia resource can be sent to the server, and the server stores the multimedia resource and the resource tag of the multimedia resource correspondingly in the storage space of the server. The embodiment of the present application does not limit the storage location of the multimedia resource and the resource tag of the multimedia resource.
[0107] Optionally, when storing multimedia resources and resource tags of multimedia resources, they can be stored in a KEY-VALUE (key-value) storage format. That is, the multimedia resource is KEY, the resource tag of the multimedia resource is VALUE, or the multimedia resource is VALUE, the resource tag of the multimedia resource is KEY. This embodiment of the application does not limit this.
[0108] In a possible implementation, after the multimedia resources and the resource tags of the multimedia resources are stored correspondingly, a content recommendation request may be received, the content recommendation request carrying the recommendation tag. Based on the recommendation tag, the multimedia resources and the resource tags of the multimedia resources, the multimedia resources to be recommended are determined, and the multimedia resources to be recommended are recommended.
[0109] Wherein, based on the recommendation tag, the multimedia resource and the resource tag of the multimedia resource, the process of determining the multimedia resource to be recommended includes: taking the multimedia resource whose resource tag is consistent with the recommendation tag as the multimedia resource to be recommended. Alternatively, determining the similarity between the resource tag and the recommendation tag, and taking the multimedia resource corresponding to the resource tag whose similarity meets the similarity threshold as the multimedia resource to be recommended. Optionally, the similarity threshold is set based on experience, or adjusted according to the implementation environment, which is not limited in the embodiments of the present application. Exemplarily, the similarity threshold is 90.
[0110] For example, the recommendation tag carried in the content recommendation request is "pig's trotter", the resource tag corresponding to multimedia resource one is "pig's trotter", the resource tag corresponding to multimedia resource two is "pig's feet", and the resource tag corresponding to multimedia resource three is "pork". Since the resource tag corresponding to multimedia resource one is consistent with the recommendation tag carried in the content recommendation request, multimedia resource one is used as the multimedia resource to be recommended.
[0111] For another example, the recommendation tag carried in the content recommendation request is "pig's trotter", the resource tag corresponding to multimedia resource one is "pig's trotter", the resource tag corresponding to multimedia resource two is "pig's feet", and the resource tag corresponding to multimedia resource three is "pork". The similarity between "pig's trotter" and "pig's trotter" is 100, the similarity between "pig's feet" and "pig's trotter" is 95, and the similarity between "pork" and "pig's trotter" is 70. The similarity threshold is 90. Since the similarity between "pig's trotter" and "pig's trotter" exceeds 90, and the similarity between "pig's feet" and "pig's trotter" exceeds 90, multimedia resource one and multimedia resource two are used as multimedia resources to be recommended.
[0112] The target feature vector of the multimedia resource determined by the above method is a feature vector obtained after integrating the features of each sub-resource included in the multimedia resource. The target feature vector of the multimedia resource determined has a high accuracy, a high degree of matching with the multimedia resource, and can better express the multimedia resource. Since the target feature vector of the multimedia resource determined has a higher accuracy, when determining the resource tag of the multimedia resource based on the target feature vector of the multimedia resource, the accuracy of the resource tag of the multimedia resource determined can be improved, and the multimedia resource can be further better recommended.
[0113] Figure 5 FIG. 1 is a schematic diagram of a resource processing process provided by an embodiment of the present application. Figure 5In the example, the multimedia resource includes two sub-resources, namely, video resource and text resource. The video resource is input into the target vector determination model (RESNET model) corresponding to the video resource to obtain the feature vector corresponding to the video resource. The text resource "It is said that eating meat can be popular on the hot search, I will try it too." is input into the target vector determination model (LSTM model) corresponding to the text resource to obtain the feature vector corresponding to the text resource. The feature vector corresponding to the text resource is input into the activation model (module 1) corresponding to the text resource to obtain the activation vector corresponding to the text resource. The feature vector corresponding to the video resource is input into the activation model (module 2) corresponding to the video resource to obtain the activation vector corresponding to the video resource. Based on the activation vector corresponding to the video resource and the feature vector corresponding to the text resource, the first intermediate feature vector is determined. The first intermediate feature vector is the feature vector obtained by fusing the video resource on the basis of the text resource. Based on the activation vector corresponding to the text resource and the feature vector corresponding to the video resource, the second intermediate feature vector is determined. The second intermediate feature vector is the feature vector obtained by fusing the text resource on the basis of the video resource. The first intermediate feature vector and the second intermediate feature vector are concatenated to obtain the target feature vector corresponding to the multimedia resource. The first intermediate feature vector and the second intermediate feature vector are jointly generated by the vectors of the video resource and the text resource, so the features of each sub-resource are integrated to achieve the purpose of mutual search between pictures and texts.
[0114] Optionally, the label of the video resource and the label of the text resource can also be obtained, and the label of the video resource and the label of the text resource are used as the label of the multimedia resource, and the number of the labels of the multimedia resource is at least two. Determine the feature vector corresponding to the label of the multimedia resource. Based on the feature vector corresponding to the label of the multimedia resource and the target feature vector corresponding to the multimedia resource, determine the matching degree between the label of the multimedia resource and the multimedia resource. Among the labels of the multimedia resource, the label whose matching degree with the multimedia resource meets the matching requirement is used as the resource label of the multimedia resource. The multimedia resource and the resource label of the multimedia resource are stored correspondingly.
[0115] Optionally, a resource recommendation request may be received, the resource recommendation request carrying a recommendation tag. Based on the recommendation tag, the resource tag of the multimedia resource and the multimedia resource, the multimedia resource to be recommended is determined, and then the multimedia resource to be recommended is recommended.
[0116] Figure 6 FIG. 1 is a schematic diagram of a resource processing device provided in an embodiment of the present application. Figure 6 As shown, the device comprises:
[0117] An acquisition module 601 is used to acquire a multimedia resource, where the multimedia resource includes at least two sub-resources;
[0118] A determination module 602 is used to determine the feature vectors corresponding to each sub-resource, where the feature vectors are used to characterize the sub-resources;
[0119] An extraction module 603 is used to extract features corresponding to a partial region from feature vectors corresponding to each sub-resource, and obtain activation vectors corresponding to each sub-resource;
[0120] The determination module 602 is further used to determine a target feature vector based on the feature vectors corresponding to each sub-resource and the activation vectors corresponding to each sub-resource. The target feature vector is used to characterize the multimedia resource and is used to recommend the resource.
[0121] In one possible implementation, a determination module 602 is used to determine an intermediate feature vector based on an activation vector corresponding to the first sub-resource and a feature vector corresponding to the second sub-resource, where the intermediate feature vector is a feature vector obtained by fusing the second sub-resource on the basis of the first sub-resource, and the number of intermediate feature vectors is the same as the number of sub-resources. The first sub-resource is any sub-resource included in the multimedia resource, and the second sub-resource is a sub-resource other than the first sub-resource included in the multimedia resource; based on the intermediate feature vector, a target feature vector is determined.
[0122] In one possible implementation, the determination module 602 is used to multiply the values of the same vector dimension in the activation vector corresponding to the first sub-resource and the feature vector corresponding to the second sub-resource to obtain a reference feature vector; and add the values of each vector dimension in the reference feature vector to obtain an intermediate feature vector.
[0123] In one possible implementation, the extraction module 603 is used to input the feature vector corresponding to the first sub-resource into the target activation model corresponding to the first sub-resource, the target activation model is obtained by training the initial activation model through the sample sub-resource and the activation vector of the sample sub-resource, the sample sub-resource and the first sub-resource have the same resource type, and the first sub-resource is any sub-resource included in the multimedia resource; based on the output result of the target activation model corresponding to the first sub-resource, the activation vector corresponding to the first sub-resource is obtained.
[0124] In a possible implementation, the acquisition module 601 is further used to acquire a label of the multimedia resource, and the number of the labels of the multimedia resource is at least two;
[0125] The determination module 602 is also used to determine the feature vector corresponding to the label of the multimedia resource; based on the feature vector corresponding to the label of the multimedia resource and the target feature vector, determine the matching degree between the label of the multimedia resource and the multimedia resource; and use the label of the multimedia resource whose matching degree with the multimedia resource meets the matching requirements as the resource label of the multimedia resource.
[0126] In a possible implementation, the device further includes:
[0127] The storage module is used to store multimedia resources and resource tags of the multimedia resources in correspondence.
[0128] In a possible implementation, the device further includes:
[0129] A receiving module, used for receiving a content recommendation request, wherein the content recommendation request carries a recommendation tag;
[0130] The determination module 602 is further used to determine the multimedia resource to be recommended based on the recommendation tag, the multimedia resource and the resource tag of the multimedia resource;
[0131] The recommendation module is used to recommend multimedia resources to be recommended.
[0132] In one possible implementation, the determination module 602 is used to input the first sub-resource into a target vector determination model corresponding to the first sub-resource, where the target vector determination model is obtained by training an initial vector determination model through sample sub-resources and feature vectors corresponding to the sample sub-resources, where the sample sub-resources have the same resource type as the first sub-resource, and the first sub-resource is any sub-resource included in the multimedia resource; based on the output result of the target vector determination model, a feature vector corresponding to the first sub-resource is obtained.
[0133] In a possible implementation, the first sub-resource is a video resource, and the determination module 602 is used to capture a video image from the video resource; and input the video image into a target vector determination model corresponding to the video resource.
[0134] In a possible implementation, the device further includes:
[0135] A training module is used to obtain a sample sub-resource, an activation vector of the sample sub-resource and an initial activation model; input the sample sub-resource into the initial activation model to obtain a first feature vector of the sample sub-resource; determine a first loss value between the activation vector of the sample sub-resource and the first feature vector; in response to the first loss value being not greater than a first loss threshold, use the initial activation model as a target activation model.
[0136] In one possible implementation, the training module is further used to, in response to a first loss value being greater than a first loss threshold, adjust the initial activation model to obtain an adjusted activation model; input the sample sub-resource into the adjusted activation model to obtain a second feature vector of the sample sub-resource; determine a second loss value between the activation vector and the second feature vector of the sample sub-resource; and, in response to the second loss value being not greater than the first loss threshold, use the adjusted activation model as the target activation model.
[0137] The target feature vector of the multimedia resource determined by the above device is a feature vector obtained after integrating the features of each sub-resource included in the multimedia resource. The target feature vector of the determined multimedia resource has a high accuracy, a high degree of matching with the multimedia resource, and can better express the multimedia resource. Since the target feature vector of the determined multimedia resource has a higher accuracy, when determining the resource tag of the multimedia resource based on the target feature vector of the multimedia resource, the accuracy of the resource tag of the determined multimedia resource can be improved, and the multimedia resource can be further better recommended.
[0138] It should be understood that the above-mentioned device only uses the division of the above-mentioned functional modules as an example to illustrate when implementing its functions. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0139] Figure 7 The structure block diagram of a terminal device 700 provided by an exemplary embodiment of the present application is shown. The terminal device 700 may be a portable mobile terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The terminal device 700 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0140] Typically, the terminal device 700 includes: a processor 701 and a memory 702 .
[0141] The processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 701 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 701 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 701 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 701 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0142] The memory 702 may include one or more computer-readable storage media, which may be non-transitory. The memory 702 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 702 is used to store at least one instruction, which is used to be executed by the processor 701 to implement the resource processing method provided in the method embodiment of the present application.
[0143] In some embodiments, the terminal device 700 may further optionally include: a peripheral device interface 703 and at least one peripheral device. The processor 701, the memory 702 and the peripheral device interface 703 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 703 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 704, a display screen 705, a camera assembly 706, an audio circuit 707 and a power supply 709.
[0144] The peripheral device interface 703 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 701 and the memory 702. In some embodiments, the processor 701, the memory 702, and the peripheral device interface 703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 701, the memory 702, and the peripheral device interface 703 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0145] The radio frequency circuit 704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 704 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 704 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The radio frequency circuit 704 can communicate with other terminal devices through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 704 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0146] The display screen 705 is used to display a UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 705 is a touch display screen, the display screen 705 also has the ability to collect touch signals on the surface or above the surface of the display screen 705. The touch signal can be input to the processor 701 as a control signal for processing. At this time, the display screen 705 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 705 can be one, set on the front panel of the terminal device 700; in other embodiments, the display screen 705 can be at least two, respectively set on different surfaces of the terminal device 700 or in a folding design; in other embodiments, the display screen 705 can be a flexible display screen, set on a curved surface or a folding surface of the terminal device 700. Even, the display screen 705 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 705 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.
[0147] The camera assembly 706 is used to capture images or videos. Optionally, the camera assembly 706 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal device 700, and the rear camera is arranged on the back of the terminal device 700. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 706 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0148] The audio circuit 707 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 701 for processing, or input them into the radio frequency circuit 704 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal device 700. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 701 or the radio frequency circuit 704 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 707 may also include a headphone jack.
[0149] The power supply 709 is used to power various components in the terminal device 700. The power supply 709 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 709 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0150] In some embodiments, the terminal device 700 further includes one or more sensors 710 , including but not limited to: an acceleration sensor 711 , a gyroscope sensor 712 , a pressure sensor 713 , an optical sensor 715 , and a proximity sensor 716 .
[0151] The acceleration sensor 711 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal device 700. For example, the acceleration sensor 711 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 701 can control the display screen 705 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 711. The acceleration sensor 711 can also be used for collecting game or user motion data.
[0152] The gyroscope sensor 712 can detect the body direction and rotation angle of the terminal device 700, and the gyroscope sensor 712 can cooperate with the acceleration sensor 711 to collect the user's 3D actions on the terminal device 700. The processor 701 can implement the following functions based on the data collected by the gyroscope sensor 712: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0153] The pressure sensor 713 can be set on the side frame of the terminal device 700 and / or the lower layer of the display screen 705. When the pressure sensor 713 is set on the side frame of the terminal device 700, it can detect the user's holding signal of the terminal device 700, and the processor 701 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 713. When the pressure sensor 713 is set on the lower layer of the display screen 705, the processor 701 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 705. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0154] The optical sensor 715 is used to collect the ambient light intensity. In one embodiment, the processor 701 can control the display brightness of the display screen 705 according to the ambient light intensity collected by the optical sensor 715. Specifically, when the ambient light intensity is high, the display brightness of the display screen 705 is increased; when the ambient light intensity is low, the display brightness of the display screen 705 is reduced. In another embodiment, the processor 701 can also dynamically adjust the shooting parameters of the camera assembly 706 according to the ambient light intensity collected by the optical sensor 715.
[0155] The proximity sensor 716, also called a distance sensor, is usually arranged on the front panel of the terminal device 700. The proximity sensor 716 is used to collect the distance between the user and the front of the terminal device 700. In one embodiment, when the proximity sensor 716 detects that the distance between the user and the front of the terminal device 700 is gradually decreasing, the processor 701 controls the display screen 705 to switch from the screen-on state to the screen-off state; when the proximity sensor 716 detects that the distance between the user and the front of the terminal device 700 is gradually increasing, the processor 701 controls the display screen 705 to switch from the screen-off state to the screen-on state.
[0156] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on the terminal device 700, and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0157] Figure 8The schematic diagram of the structure of the server provided in the embodiment of the present application, the server 800 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 801 and one or more memories 802, wherein the one or more memories 802 store at least one program code, and the at least one program code is loaded and executed by the one or more processors 801 to implement the resource processing methods provided by the above-mentioned various method embodiments. Of course, the server 800 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the server 800 may also include other components for implementing device functions, which will not be described in detail here.
[0158] In an exemplary embodiment, a computer-readable storage medium is further provided, in which at least one program code is stored. The at least one program code is loaded and executed by a processor to enable a computer to implement any of the above-mentioned resource processing methods.
[0159] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0160] In an exemplary embodiment, a computer program or a computer program product is also provided. The computer program or the computer program product stores at least one computer instruction, and the at least one computer instruction is loaded and executed by a processor to enable a computer to implement any of the above-mentioned resource processing methods.
[0161] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0162] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0163] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A resource processing method, It is characterized in that The method comprises: Acquire a multimedia resource, wherein the multimedia resource includes at least two sub-resources; Determine a feature vector corresponding to each sub-resource, wherein the feature vector is used to characterize the sub-resource; Extracting features corresponding to a partial region from feature vectors corresponding to each of the sub-resources to obtain activation vectors corresponding to each of the sub-resources; Based on the activation vector corresponding to the first sub-resource and the feature vector corresponding to the second sub-resource, determine an intermediate feature vector, where the intermediate feature vector is used to characterize a resource obtained by fusing the second sub-resource on the basis of the first sub-resource, the first sub-resource being any sub-resource included in the multimedia resource, and the second sub-resource being the remaining sub-resources in the sub-resources included in the multimedia resource except the first sub-resource; Based on the intermediate feature vector, a target feature vector is determined, where the target feature vector is used to characterize the multimedia resource, and the target feature vector is used to recommend resources.
2. The method according to claim 1, It is characterized in that The number of the intermediate feature vectors is the same as the number of the sub-resources.
3. The method according to claim 1, It is characterized in that The determining of the intermediate feature vector based on the activation vector corresponding to the first sub-resource and the feature vector corresponding to the second sub-resource includes: Multiplying values of the same vector dimension in the activation vector corresponding to the first sub-resource and the feature vector corresponding to the second sub-resource to obtain a reference feature vector; The values of the dimensions of each vector in the reference feature vector are added together to obtain the intermediate feature vector.
4. The method according to claim 1, It is characterized in that The extracting features corresponding to the partial regions from the feature vectors corresponding to the sub-resources to obtain activation vectors corresponding to the sub-resources includes: Inputting a feature vector corresponding to a first sub-resource into a target activation model corresponding to the first sub-resource, the target activation model being obtained by training an initial activation model through a sample sub-resource and an activation vector of the sample sub-resource, the sample sub-resource being of the same resource type as the first sub-resource, and the first sub-resource being any sub-resource included in the multimedia resource; Based on an output result of the target activation model corresponding to the first sub-resource, an activation vector corresponding to the first sub-resource is obtained.
5. The method according to any one of claims 1 to 4, It is characterized in that After acquiring the multimedia resources, the method further includes: Obtaining tags of the multimedia resource, where the number of tags of the multimedia resource is at least two; Determining a feature vector corresponding to the label of the multimedia resource; After determining the target feature vector based on the feature vectors corresponding to the sub-resources and the activation vectors corresponding to the sub-resources, the method further includes: Determining a matching degree between the multimedia resource label and the multimedia resource based on a feature vector corresponding to the multimedia resource label and the target feature vector; Among the tags of the multimedia resource, a tag whose matching degree with the multimedia resource meets the matching requirement is used as the resource tag of the multimedia resource.
6. The method according to claim 5, It is characterized in that After taking the tag of the multimedia resource whose matching degree with the multimedia resource meets the matching requirement as the resource tag of the multimedia resource, the method further includes: The multimedia resources and the resource tags of the multimedia resources are stored correspondingly.
7. The method according to claim 6, It is characterized in that After storing the multimedia resources and the resource tags of the multimedia resources in correspondence, the method further includes: receiving a content recommendation request, wherein the content recommendation request carries a recommendation tag; Determining a multimedia resource to be recommended based on the recommendation tag, the multimedia resource and the resource tag of the multimedia resource; The multimedia resource to be recommended is recommended.
8. The method according to any one of claims 1 to 4, It is characterized in that The determining of the feature vectors corresponding to the sub-resources includes: Inputting the first sub-resource into a target vector determination model corresponding to the first sub-resource, the target vector determination model being obtained by training an initial vector determination model through a sample sub-resource and a feature vector corresponding to the sample sub-resource, the sample sub-resource being of the same resource type as the first sub-resource, and the first sub-resource being any sub-resource included in the multimedia resource; An output result of a model is determined based on the target vector to obtain a feature vector corresponding to the first sub-resource.
9. The method according to claim 8, It is characterized in that The first sub-resource is a video resource, and the step of inputting the first sub-resource into a target vector determination model corresponding to the first sub-resource includes: Capturing a video image from the video resource; The video image is input into a target vector determination model corresponding to the video resource.
10. The method according to claim 4, It is characterized in that Before inputting the feature vector corresponding to the first sub-resource into the target activation model corresponding to the first sub-resource, the method further includes: Acquire the sample sub-resource, the activation vector of the sample sub-resource and the initial activation model; Inputting the sample sub-resource into the initial activation model to obtain a first feature vector of the sample sub-resource; determining a first loss value between an activation vector of the sample sub-resource and the first feature vector; In response to the first loss value being not greater than a first loss threshold, the initial activation model is used as the target activation model.
11. The method according to claim 10, It is characterized in that The method further comprises: In response to the first loss value being greater than the first loss threshold, adjusting the initial activation model to obtain an adjusted activation model; Inputting the sample sub-resource into the adjusted activation model to obtain a second feature vector of the sample sub-resource; determining a second loss value between the activation vector of the sample sub-resource and the second feature vector; In response to the second loss value being not greater than the first loss threshold, the adjusted activation model is used as the target activation model.
12. A resource processing device, It is characterized in that The device comprises: An acquisition module, used to acquire a multimedia resource, wherein the multimedia resource includes at least two sub-resources; A determination module, used to determine the feature vectors corresponding to each sub-resource, wherein the feature vectors are used to characterize the sub-resources; An extraction module, used to extract features corresponding to a partial area from the feature vectors corresponding to each sub-resource, to obtain activation vectors corresponding to each sub-resource; The determination module is further used to determine an intermediate feature vector based on the activation vector corresponding to the first sub-resource and the feature vector corresponding to the second sub-resource, wherein the intermediate feature vector is used to characterize the resource obtained after fusing the second sub-resource on the basis of the first sub-resource, the first sub-resource is any sub-resource included in the multimedia resource, and the second sub-resource is the remaining sub-resources in the multimedia resource except the first sub-resource; based on the intermediate feature vector, determine a target feature vector, wherein the target feature vector is used to characterize the multimedia resource, and the target feature vector is used to recommend resources.
13. The device according to claim 12, It is characterized in that The number of the intermediate feature vectors is the same as the number of the sub-resources.
14. The device according to claim 12, It is characterized in that The determination module is used to multiply the values of the same vector dimension in the activation vector corresponding to the first sub-resource and the feature vector corresponding to the second sub-resource to obtain a reference feature vector; and add the values of each vector dimension in the reference feature vector to obtain the intermediate feature vector.
15. The device according to claim 12, It is characterized in that The extraction module is used to input the feature vector corresponding to the first sub-resource into the target activation model corresponding to the first sub-resource, the target activation model is obtained by training the initial activation model through the sample sub-resource and the activation vector of the sample sub-resource, the sample sub-resource is the same as the first sub-resource, and the first sub-resource is any sub-resource included in the multimedia resource; Based on an output result of the target activation model corresponding to the first sub-resource, an activation vector corresponding to the first sub-resource is obtained.
16. The device according to any one of claims 12 to 15, It is characterized in that The acquisition module is further used to acquire the tags of the multimedia resource, and the number of the tags of the multimedia resource is at least two; The determination module is also used to determine the feature vector corresponding to the label of the multimedia resource; based on the feature vector corresponding to the label of the multimedia resource and the target feature vector, determine the matching degree between the label of the multimedia resource and the multimedia resource; and use the label of the multimedia resource whose matching degree with the multimedia resource meets the matching requirements as the resource label of the multimedia resource.
17. The device according to claim 16, It is characterized in that The device also includes: The storage module is used to store the multimedia resources and the resource tags of the multimedia resources in correspondence.
18. The device according to claim 17, It is characterized in that The device also includes: A receiving module, configured to receive a content recommendation request, wherein the content recommendation request carries a recommendation tag; The determination module is further configured to determine the multimedia resource to be recommended based on the recommendation tag, the multimedia resource and the resource tag of the multimedia resource; The recommendation module is used to recommend the multimedia resource to be recommended.
19. The device according to any one of claims 12 to 15, It is characterized in that The determination module is used to input the first sub-resource into a target vector determination model corresponding to the first sub-resource, the target vector determination model is obtained by training an initial vector determination model through a sample sub-resource and a feature vector corresponding to the sample sub-resource, the sample sub-resource is of the same resource type as the first sub-resource, and the first sub-resource is any sub-resource included in the multimedia resource; An output result of a model is determined based on the target vector to obtain a feature vector corresponding to the first sub-resource.
20. The device according to claim 19, It is characterized in that The first sub-resource is a video resource, and the determination module is used to capture a video image from the video resource; and input the video image into a target vector determination model corresponding to the video resource.
21. The device according to claim 15, It is characterized in that The device also includes: A training module is used to obtain the sample sub-resource, the activation vector of the sample sub-resource and the initial activation model; input the sample sub-resource into the initial activation model to obtain a first feature vector of the sample sub-resource; determine a first loss value between the activation vector of the sample sub-resource and the first feature vector; in response to the first loss value being not greater than a first loss threshold, use the initial activation model as the target activation model.
22. The device according to claim 21, It is characterized in that The training module is further used to, in response to the first loss value being greater than the first loss threshold, adjust the initial activation model to obtain an adjusted activation model; input the sample sub-resource into the adjusted activation model to obtain a second feature vector of the sample sub-resource; determine a second loss value between the activation vector of the sample sub-resource and the second feature vector; and in response to the second loss value being not greater than the first loss threshold, use the adjusted activation model as the target activation model.
23. An electronic device, It is characterized in that The electronic device comprises a processor and a memory, wherein at least one program code is stored in the memory, and the at least one program code is loaded and executed by the processor so that the electronic device implements the resource processing method as claimed in any one of claims 1 to 11.
24. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores at least one program code, and the at least one program code is loaded and executed by a processor so that a computer implements the resource processing method according to any one of claims 1 to 11.
25. A computer program product, It is characterized in that The computer program product stores at least one computer instruction, and the at least one computer instruction is loaded and executed by a processor so that a computer implements the resource processing method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and computer readable storage medium
CN112100437A
Multimedia resource classification model training method and multimedia resource recommendation method
CN113590849A
