A query method and related device
Recommend similar resources through feature extraction network and resource knowledge graph, which solves the problem that users cannot obtain the query resources and improves user experience and resource query effect.
Patent Information
- Application Number
- CN202111397842.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-19
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2041-11-19
AI Technical Summary
In the resource search scenario, when the user cannot obtain the query resources, the prior art leads to poor user experience and unable to provide satisfactory alternative resources, resulting in the user going through a meaningless query process.
By receiving user resource query requests, using pre-constructed feature extraction network and resource knowledge graphs, determining feature matching and attribute search data of resources to be queried, recommending alternative resources similar to resources to resources to be queried, and improving user experience.
When the original resources cannot be provided, provide similar resources to avoid users experiencing invalid queries and improve user experience and resource query results.
Smart Images

Figure CN114356979B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a query method and related equipment. Background Art
[0002] For some resource search scenarios (for example, film and television resource search scenarios, etc.), when a user uses a resource query device (for example, a TV voice assistant, etc.) to query certain resource data (for example, XXX movie), the resource data may not be fed back to the user (for example, XXX movie cannot be played) due to certain reasons (for example, no copyright, etc.), thereby failing to meet user demands, resulting in a poor user experience. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to provide a query method and related devices, which can improve user experience.
[0004] An embodiment of the present application provides a query method, which includes: receiving a resource query request triggered by a user; wherein the resource query request carries information to be queried; the information to be queried is used to describe the resource to be queried; obtaining a resource query result for the information to be queried; if the resource query result indicates that the resource to be queried cannot be provided to the user, determining at least one recommended resource based on the information to be queried; and providing the at least one recommended resource to the user.
[0005] In one possible implementation, determining at least one recommended resource based on the information to be queried includes: determining recommended representation data of at least one candidate resource based on the information to be queried; and determining at least one recommended resource from the at least one candidate resource based on the recommended representation data of the at least one candidate resource.
[0006] In a possible implementation manner, the recommendation characterization data includes feature matching characterization data and / or at least one attribute retrieval characterization data.
[0007] In one possible implementation, the process of determining the feature matching representation data includes: determining the information to be extracted based on the information to be queried; using a pre-constructed feature extraction network to perform feature extraction processing on the information to be extracted to obtain features to be matched; matching the features to be matched with the resource representation features of each of the candidate resources to obtain feature matching results for each of the candidate resources; and determining the feature matching representation data of at least one candidate resource based on the feature matching results of at least one candidate resource.
[0008] In a possible implementation manner, the resource characterization features of each of the candidate resources are determined using the feature extraction network.
[0009] In a possible implementation manner, the method further includes: determining at least one resource sample data according to the historical resource operation information of the user; and constructing the feature extraction network according to the at least one resource sample data.
[0010] In a possible implementation manner, the at least one resource sample data includes at least one positive sample data and at least one negative sample data.
[0011] In a possible implementation manner, the historical resource operation information is used to describe an operation behavior triggered by the user for at least one resource to be used;
[0012] The process of determining the at least one positive sample data includes: determining the at least one positive sample data according to the at least one resource to be used;
[0013] and / or,
[0014] The process of determining the at least one negative sample data includes: comparing the attribute information of at least one alternative resource with the attribute information of at least one resource to be used to obtain an attribute comparison result; determining at least one target resource from the at least one alternative resource based on the attribute comparison result, so that the attribute information of each target resource is different from the attribute information of the at least one resource to be used; and determining the at least one negative sample data based on the at least one target resource.
[0015] In a possible implementation manner, the at least one candidate resource includes at least one resource data that meets a preset resource condition within a time period to be used.
[0016] In one possible implementation, the process of constructing the feature extraction network includes: determining a predicted classification result of the at least one resource sample data based on the at least one resource sample data, the user's description information, and the model to be trained; updating the model to be trained based on the at least one resource sample data and the actual classification information of the at least one resource sample data, and continuing to execute the step of determining a predicted classification result of the at least one resource sample data based on the at least one resource sample data, the user's description information, and the model to be trained, until after a preset stop condition is reached, determining the feature extraction network based on the model to be trained.
[0017] In a possible implementation manner, the model to be trained includes a user feature extraction layer, a resource feature extraction layer, a feature splicing layer and a classification processing layer; wherein the input data of the classification processing layer includes the output data of the feature splicing layer; the input data of the feature splicing layer includes the output data of the user feature extraction layer and the output data of the resource feature extraction layer;
[0018] The determining the feature extraction network according to the model to be trained includes: determining the feature extraction network according to a resource feature extraction layer in the model to be trained.
[0019] In one possible implementation, the process of determining the at least one attribute retrieval representation data includes: obtaining at least one attribute corresponding to the information to be queried; performing retrieval processing according to the at least one attribute in a pre-constructed resource knowledge graph to obtain at least one attribute retrieval representation data for each of the candidate resources; wherein the resource knowledge graph is constructed based on the attribute information of at least one resource to be retrieved; and the at least one resource to be retrieved includes the at least one candidate resource.
[0020] In a possible implementation manner, the recommendation representation data includes feature matching representation data and Q attribute retrieval representation data; wherein Q is a positive integer;
[0021] The method of determining at least one recommended resource from the at least one candidate resource based on the recommendation representation data of the at least one candidate resource comprises: determining at least one feature matching resource that meets a first condition from the at least one candidate resource based on the feature matching representation data of the at least one candidate resource; retrieving representation data based on the qth attribute of the at least one candidate resource, and determining at least one attribute hit resource corresponding to the qth attribute from the at least one candidate resource; wherein each of the attribute hit resources corresponding to the qth attribute meets the qth attribute screening condition; q is a positive integer, q≤Q; determining at least one first resource based on the at least one feature matching resource, at least one attribute hit resource corresponding to the 1st attribute to at least one attribute hit resource corresponding to the Qth attribute; and determining at least one recommended resource from the at least one first resource based on the recommendation representation data of the at least one first resource.
[0022] In a possible implementation manner, the method further includes: determining at least one second resource satisfying a second condition from the at least one candidate resource;
[0023] The determining at least one recommended resource from the at least one candidate resource according to the recommended representation data of the at least one candidate resource comprises: determining at least one recommended resource from the at least one candidate resource according to the recommended representation data of the at least one second resource.
[0024] In a possible implementation, the process of determining the at least one recommended resource includes: determining the recommendation score of each third resource according to the recommendation representation data of each third resource; and determining at least one recommended resource that meets the first condition from the at least one third resource according to the recommendation score of the at least one third resource. It should be noted that the above-mentioned "third resource" can be the above-mentioned "candidate resource", "first resource", or "second resource".
[0025] An embodiment of the present application also provides a query device, including: a receiving unit, used to receive a resource query request triggered by a user; wherein the resource query request carries information to be queried; the information to be queried is used to describe the resource to be queried; a query unit, used to obtain a resource query result for the information to be queried; a determination unit, used to determine at least one recommended resource based on the information to be queried if the resource query result indicates that the resource to be queried cannot be provided to the user; and a recommendation unit, used to provide the at least one recommended resource to the user.
[0026] An embodiment of the present application also provides a device, which includes: a processor, a memory, and a system bus; the processor and the memory are connected via the system bus; the memory is used to store one or more programs, and the one or more programs include instructions, which, when executed by the processor, enable the processor to execute any implementation of the query method provided in the embodiment of the present application.
[0027] The embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes any implementation of the query method provided in the embodiment of the present application.
[0028] The embodiment of the present application also provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes any implementation of the query method provided in the embodiment of the present application.
[0029] Based on the above technical solution, this application has the following beneficial effects:
[0030] In the technical solution provided by the present application, after receiving a resource query request triggered by a user (for example, a request to query XXX movies), a resource query result for the information to be queried is determined based on the information to be queried carried by the resource query request and used to describe the resource to be queried, so that when it is determined that the resource query result indicates that the resource to be queried cannot be provided to the user, at least one recommended resource is first determined based on the information to be queried, so that there are certain similarities between these recommended resources and the resource to be queried (for example, certain attributes are the same, etc.); then these recommended resources are provided to the user, so that the user can select some resource data from these recommended resources for use, so that even if the resource to be queried cannot be provided to the user, some recommended resources (especially resources similar to the resource to be queried) can still be fed back to the user, thereby improving the resource query effect of the user and further improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0032] Figure 1 A flowchart of a query method provided in an embodiment of the present application;
[0033] Figure 2 A schematic diagram of a triple provided in an embodiment of the present application;
[0034] Figure 3 A schematic diagram of the structure of a model to be trained provided in an embodiment of the present application;
[0035] Figure 4 A schematic diagram of the working principle of a model to be trained provided in an embodiment of the present application;
[0036] Figure 5 A schematic diagram of the working principle of an encoding unit provided in an embodiment of the present application;
[0037] Figure 6 A schematic diagram of a film and television resource search process provided in an embodiment of the present application;
[0038] Figure 7 A schematic diagram of a film and television resource recommendation process provided in an embodiment of the present application;
[0039] Figure 8 A schematic diagram of a process for determining negative sample data provided in an embodiment of the present application;
[0040] Fig. 9 A schematic diagram of the structure of a query device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The inventor discovered during research on resource search processing that for a resource query device (e.g., a television device, a movie playback client, etc.), due to certain reasons (e.g., the resource query device does not have the playback copyright for certain resource data), the user is unable to obtain certain resource data (e.g., newly released movies, etc.) from the resource query device, so that when the user searches for these resource data from the resource query device, the resource query device can only feedback to the user the prompt message "unable to find the corresponding resource", which causes the user to experience a meaningless query process (i.e., a query process that does not obtain any resource data), resulting in a poor user experience.
[0042] Based on the above findings, in order to overcome the technical problems shown in the background technology part, an embodiment of the present application provides a query method, which includes: after receiving a resource query request triggered by a user (for example, a request to query XXX movies), determining a resource query result for the information to be queried based on the information to be queried carried by the resource query request for describing the resource to be queried, so that when it is determined that the resource query result indicates that the resource to be queried cannot be provided to the user, first determine at least one recommended resource based on the information to be queried, so that there are certain similarities between these recommended resources and the resource to be queried (for example, certain attributes are the same, etc.); then provide these recommended resources to the user, so that the user can select some resource data from these recommended resources for use, so that it can be achieved that some useful resources can still be fed back to the user when the resource to be queried cannot be provided to the user, thereby effectively avoiding the user from experiencing a meaningless query process, and then improving the user's resource query effect, which is conducive to improving user experience.
[0043] In addition, the embodiments of the present application do not limit the execution subject of the query method. For example, the execution subject of the query method provided in the embodiments of the present application may be a data processing device such as a terminal device or a server. The terminal device may be a television (e.g., a large-screen television), a smart phone, a computer, a personal digital assistant (PDA) or a tablet computer. The server may be an independent server, a cluster server or a cloud server.
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] Method Example 1
[0046] See also Figure 1 , which is a flowchart of a query method provided in an embodiment of the present application.
[0047] The query method provided in the embodiment of the present application includes S1-S4:
[0048] S1: Receive resource query requests triggered by users.
[0049] The above-mentioned "resource query request" carries the information to be queried, so that the "resource query request" is used to request to query resource data according to the information to be queried.
[0050] The above-mentioned "information to be queried" is used to describe the resource to be queried; and the embodiment of the present application does not limit the "information to be queried", for example, the "information to be queried" can be the name identifier of the resource to be queried. It can be seen that when the resource to be queried is a film and television resource, the information to be queried can be the name identifier of the film and television resource (for example, the name of a TV series, a movie, a variety show, etc.).
[0051] The above-mentioned “resources to be queried” refer to resource data that the user wants to obtain; and the embodiment of the present application does not limit the “resources to be queried”, for example, it can be book resource data, film and television resource data, or document resource data, etc.
[0052] The embodiments of the present application do not limit the implementation method of S1. For example, if the execution subject of the query method provided in the embodiments of the present application is a terminal device, S1 may specifically be: when a user triggers a resource query request on the terminal device, the terminal device may receive the resource query request triggered by the user. For another example, if the execution subject of the query method provided in the embodiments of the present application is a server, S1 may specifically be: when a user triggers a resource query request on the terminal device, the terminal device may forward the resource query request to the server so that the server can receive the resource query request triggered by the user.
[0053] Based on the relevant content of S1 above, it can be known that when a user wants to query for a resource to be queried (for example, XXX books, XXX movies, XXX papers, etc.), the user can trigger a resource query request on a resource query device (for example, a TV device, a film and television playback client, and other terminal devices), so that the resource query request carries the query information to be queried (for example, a name identifier, etc.) used to describe the resource to be queried, so that the resource query device or the server corresponding to the resource query device can subsequently perform resource query processing based on the resource query request.
[0054] S2: Obtain resource query results for the information to be queried carried in the resource query request.
[0055] In an embodiment of the present application, after obtaining a resource query request, a resource query process can be performed according to the information to be queried carried by the resource query request to obtain a resource query result for the information to be queried, so that the resource query result can indicate whether resource data with the information to be queried (that is, the above-mentioned "resource to be queried") can be found, and what the resource data with the information to be queried is specifically, so that when it is determined that the resource query result indicates that the resource to be queried has been found, the resource to be queried can be directly sent to the user so that the user can view the resource to be queried; however, when it is determined that the resource query result indicates that the resource to be queried cannot be found (that is, the resource to be queried cannot be provided to the user), some recommended resources can be sent to the user according to the resource recommendation process shown in S3-S4 below, so that the user can select some of his favorite resources from these recommended resources for viewing.
[0056] It should be noted that the embodiment of the present application does not limit the implementation method of S2, and can be implemented by using any existing or future resource query method (for example, a method of performing precise search processing or fuzzy search processing in a resource database).
[0057] S3: If the resource query result indicates that the resource to be queried cannot be provided to the user, at least one recommended resource is determined based on the information to be queried.
[0058] The above-mentioned “recommended resources” refer to resource data recommended to the user (that is, resource data fed back to the user in response to the above-mentioned “resource query request”).
[0059] In addition, the embodiment of the present application does not limit the determination process of the above-mentioned "at least one recommended resource". For example, any existing or future resource recommendation method can be used for implementation. Method Example 2 The process of determining "at least one recommended resource" shown is implemented.
[0060] Based on the relevant content of S3 above, it can be known that after obtaining the resource query result for the information to be queried, if the resource query result indicates that no resource data with the information to be queried (that is, the above-mentioned "resource to be queried") is found, it can be determined that the resource query result indicates that the resource to be queried cannot be provided to the user. Therefore, in order to improve the user's resource query experience, at least one recommended resource can be determined based on the information to be queried, so that there are certain similarities between these recommended resources and the resource to be queried (for example, certain attributes are the same, etc.), so that these recommended resources can meet the user's resource query needs as much as possible, and then these recommended resources can be favored by the user as much as possible.
[0061] S4: Provide at least one recommended resource to the user.
[0062] In an embodiment of the present application, after obtaining at least one recommended resource, these recommended resources can be provided to the user so that the user can select the resource data he wants to view from these recommended resources. This can avoid the user from experiencing a meaningless query process as much as possible, thereby helping to improve the user experience.
[0063] It should be noted that the embodiments of the present application do not limit the implementation of S4. For example, if the execution subject of the query method provided in the embodiments of the present application is a terminal device, then S4 may specifically be: displaying at least one recommended resource on the terminal device so that the user can view these recommended resources on the terminal device. For another example, if the execution subject of the query method provided in the embodiments of the present application is a server, then S4 may specifically be: firstly the server sends at least one recommended resource to the terminal device; then the terminal device displays the at least one recommended resource to the user so that the user can view these recommended resources on the terminal device.
[0064] Based on the relevant contents of S1 to S4 above, it can be known that for the query method provided in the embodiment of the present application, after receiving a resource query request triggered by a user (for example, a request to query XXX movies), the resource query result for the information to be queried is determined based on the information to be queried carried by the resource query request and used to describe the resource to be queried, so that when it is determined that the resource query result indicates that the resource to be queried cannot be provided to the user, at least one recommended resource is first determined based on the information to be queried, so that there are certain similarities between these recommended resources and the resource to be queried (for example, certain attributes are the same, etc.); then these recommended resources are provided to the user, so that the user can select some resource data from these recommended resources for use, so that it can be achieved that some useful resources can still be fed back to the user when the resource to be queried cannot be provided to the user, thereby effectively avoiding the user from experiencing a meaningless query process, and then improving the resource query effect of the user, which is conducive to improving the user experience.
[0065] Method Example 2
[0066] In addition, in order to improve the resource recommendation effect, the embodiment of the present application provides another possible implementation method for determining the above-mentioned "at least one recommended resource", which may specifically include step 11-step 12:
[0067] Step 11: Determine recommended representation data of at least one candidate resource according to the information to be queried.
[0068] The above-mentioned "at least one candidate resource" is used to represent the resource data that needs to be screened in the resource recommendation process; and the embodiment of the present application does not limit the above-mentioned "at least one candidate resource", for example, it may include: all resource data in a pre-built resource database. Among them, the "resource database" is used to record at least one resource data and resource description information of each resource data (for example, ID, at least one attribute, resource introduction content, etc.).
[0069] The recommended characterization data of the nth candidate resource is used to indicate the degree of association between the nth candidate resource and the above “resource to be queried”. Where n is a positive integer, n≤N, N is a positive integer, and N represents the number of candidate resources in the above “at least one candidate resource”.
[0070] In addition, the embodiments of the present application do not limit the above-mentioned "recommended characterization data of the nth candidate resource". For example, the "recommended characterization data of the nth candidate resource" may include feature matching characterization data of the nth candidate resource, the first attribute retrieval characterization data of the nth candidate resource, the second attribute retrieval characterization data of the nth candidate resource, ..., and at least one of the Qth attribute retrieval characterization data of the nth candidate resource. Where Q is a positive integer.
[0071] The above-mentioned “feature matching representation data of the nth candidate resource” is used to indicate the similarity between the nth candidate resource and the resource to be queried in terms of resource features.
[0072] In addition, the embodiment of the present application does not limit the determination process of the above-mentioned "feature matching characterization data of N candidate resources", for example, it may specifically include steps 21 to 24:
[0073] Step 21: Determine the information to be extracted based on the information to be queried.
[0074] The above-mentioned "information to be extracted" is used to describe the resource characteristics of the resource to be queried; and the embodiment of the present application does not limit the "information to be extracted", for example, it may include the identity document (ID) of the information to be extracted. For another example, it may also include at least one of the name identification, various attribute information, and resource introduction content of the information to be extracted.
[0075] In addition, the embodiment of the present application does not limit the implementation method of step 21. For example, when the above-mentioned "information to be queried" includes the name identifier of the resource to be queried, step 21 may specifically include: first querying the resource description information corresponding to the name identifier of the resource to be queried from the resource database; and then determining the resource description information as the information to be extracted.
[0076] Based on the relevant content of the above step 21, it can be known that after obtaining the information to be queried, the resource description information of the resource to be queried can be determined based on the information to be queried; then the information to be extracted can be determined from the resource description information, so that the information to be extracted can describe the resource characteristics of the resource to be queried.
[0077] Step 22: Use the pre-built feature extraction network to perform feature extraction processing on the information to be extracted to obtain the features to be matched.
[0078] The above-mentioned “feature extraction network” is used to perform feature extraction processing on the input data of the feature extraction network; and the embodiment of the present application does not limit the “feature extraction network”, for example, it can be any type of machine learning network.
[0079] In addition, the present application embodiment does not limit the construction process of the above-mentioned "feature extraction network". For example, any existing or future machine learning network construction method can be used for implementation. For another example, in order to improve the feature extraction performance of the above-mentioned "feature extraction network", it can be used Method Example 3 The construction process of the "feature extraction network" shown in FIG.
[0080] The above-mentioned “features to be matched” are used to represent resource features carried by the information to be extracted (that is, resource features possessed by the resources to be queried).
[0081] Based on the relevant content of the above step 22, it can be known that after obtaining the information to be extracted, the information to be extracted can be input into a pre-constructed feature extraction network, so that the feature extraction network can perform feature extraction processing on the information to be extracted, obtain and output the features to be matched, so that the features to be matched can represent the resource characteristics carried by the information to be extracted (that is, the resource characteristics of the resources to be queried).
[0082] Step 23: Match the feature to be matched with the resource representation feature of the nth candidate resource to obtain a feature matching result of the nth candidate resource, where n is a positive integer, n≤N.
[0083] The above-mentioned “resource characterization feature of the nth candidate resource” is used to represent the resource feature of the nth candidate resource.
[0084] In addition, the embodiments of the present application do not limit the acquisition process of the above-mentioned "resource characterization features of the nth candidate resource". For example, a pre-built feature extraction network can be used to perform feature extraction processing on the feature characterization information of the nth candidate resource to obtain the resource characterization features of the nth candidate resource. Among them, the "feature characterization information of the nth candidate resource" is used to describe the resource features of the nth candidate resource; and the "feature characterization information of the nth candidate resource" is similar to the above-mentioned "information to be extracted".
[0085] The above-mentioned "feature matching result of the nth candidate resource" is used to indicate the similarity in resource features between the nth candidate resource and the resource to be queried; and the embodiment of the present application does not limit the determination process of the "feature matching result of the nth candidate resource", for example, it may specifically include: according to a preset distance formula, calculating the feature distance between the feature to be matched and the resource representation feature of the nth candidate resource, and determining the inverse of the feature distance as the feature matching result of the nth candidate resource, so that the larger the feature matching result of the nth candidate resource, the more similar the resource features between the nth candidate resource and the resource to be queried are.
[0086] It should be noted that the above-mentioned “preset distance formula” can be pre-set, and the embodiment of the present application is not limited to the “preset distance formula”. For example, it can be implemented using any existing or future distance calculation method (for example, Euclidean distance calculation formula, cosine distance calculation formula, etc.).
[0087] Based on the relevant content of the above step 23, it can be known that after obtaining the feature to be matched, the similarity between the feature to be matched and the resource representation feature of the nth candidate resource (for example, the reciprocal of the feature distance between the feature to be matched and the resource representation feature of the nth candidate resource) can be determined as the feature matching result of the nth candidate resource, so that the "feature matching result of the nth candidate resource" can represent the similarity between the nth candidate resource and the resource to be queried in terms of resource features. Where n is a positive integer, n≤N.
[0088] Step 24: Determine feature matching representation data of the N candidate resources according to the feature matching results of the N candidate resources.
[0089] The embodiment of the present application does not limit the implementation method of step 24. For example, it may specifically include: directly determining the feature matching result of the nth candidate resource as the feature matching representation data of the nth candidate resource, so that the larger the "feature matching representation data of the nth candidate resource", the greater the similarity in resource features between the nth candidate resource and the resource to be queried; wherein n is a positive integer, n≤N.
[0090] In addition, an embodiment of the present application also provides another possible implementation of step 24, which may specifically include: first sorting the feature matching results of the N candidate resources from large to small to obtain a feature similarity sequence, so that the feature similarity sequence is used to record the N candidate resources sorted from large to small according to similarity; then determining the arrangement number of the nth candidate resource in the feature similarity sequence as the feature matching representation data of the nth candidate resource, so that the smaller the "feature matching representation data of the nth candidate resource", the greater the similarity in resource features between the nth candidate resource and the resource to be queried; wherein n is a positive integer, n≤N.
[0091] Based on the relevant contents of steps 21 to 24 above, it can be known that for N candidate resources, the feature matching representation data of each candidate resource can be determined with the help of a pre-constructed feature extraction network, so that the feature matching representation data of each candidate resource can accurately represent the degree of similarity in resource features between each candidate resource and the resource to be queried.
[0092] The above “qth attribute retrieval characterization data of the nth candidate resource” is used to indicate the similarity between the nth candidate resource and the resource to be queried in terms of the qth attribute, where q is a positive integer, q≤Q, and Q represents the number of attributes.
[0093] It should be noted that the embodiments of the present application do not limit Q attributes. For example, when the resource to be queried belongs to a film and television resource, the Q attributes may include: resource category (for example, comedy, war drama, etc.), director, actor, release year, language, country, award information, etc.
[0094] In addition, the embodiments of the present application do not limit the determination process of the above-mentioned "qth attribute retrieval representation data of N candidate resources". For example, it may specifically include: first, performing a search process in the resource database according to the qth attribute of the resource to be queried, and obtaining a search result corresponding to the qth attribute, so that the search result includes the relevance rankings of the N candidate resources (for example, the relevance rankings of each candidate resource obtained by arranging them from large to small according to the relevance); then, according to the relevance ranking of the nth candidate resource in the search result corresponding to the qth attribute, determining the qth attribute retrieval representation data of the nth candidate resource, so that the smaller the "qth attribute retrieval representation data of the nth candidate resource", the greater the similarity between the nth candidate resource and the resource to be queried in terms of the qth attribute; wherein n is a positive integer, n≤N.
[0095] It should be noted that the above “relevance ranking of the nth candidate resource” is used to indicate the degree of relevance (for example, same, different, similar, etc.) between the nth candidate resource and the resource to be queried in terms of the qth attribute.
[0096] In addition, in order to improve the retrieval effect, the embodiment of the present application also provides a possible implementation method for determining the above-mentioned "at least one attribute retrieval representation data of N candidate resources", which may specifically include steps 31 and 32:
[0097] Step 31: Obtain at least one attribute corresponding to the information to be queried.
[0098] The above-mentioned “at least one attribute corresponding to the information to be queried” refers to at least one attribute of the resource to be queried; and the embodiment of the present application does not limit the number of attributes in the “at least one attribute corresponding to the information to be queried”, for example, it can be Q.
[0099] In addition, the embodiments of the present application do not limit the implementation method of step 31. For example, when the above-mentioned "information to be queried" includes the name identifier of the resource to be queried, step 3 may specifically include: first querying at least one attribute corresponding to the name identifier of the resource to be queried from the resource database (or the "resource knowledge graph" below); then collectively processing these attributes to obtain at least one attribute corresponding to the information to be queried.
[0100] Step 32: Perform search processing according to at least one attribute in a pre-constructed resource knowledge graph to obtain at least one attribute search representation data of each candidate resource; wherein, the resource knowledge graph is constructed based on the attribute information of at least one resource to be searched; and at least one resource to be searched includes at least one candidate resource and a resource to be queried.
[0101] The above-mentioned “resource knowledge graph” includes the resource description information of each resource data (for example, resource name, resource category, director, actor, release year, language type, country, award information, etc.), and the association relationship between any two resource data (for example, having the same director, etc.); and the association relationship can be used to generate a triple (such as Figure 2 The triples shown are represented by
[0102] It should be noted that Figure 2 In the above, "ID1" refers to the ID of the first video resource; "ID2" refers to the ID of the second video resource; "ID3" refers to the ID of the third video resource; ... In addition, Figure 2 Here, "A" is the name of a director; "B" refers to the name of the first actor; "C" refers to the name of the second actor; and "D" refers to a film and television resource type (for example, comedy).
[0103] In addition, the embodiments of the present application do not limit the construction process of the above-mentioned "resource knowledge graph". For example, it may specifically include: first, each resource data (for example, each candidate resource) in the above-mentioned "resource database" is taken as a vertex, and each vertex has attributes such as resource category, director, actor, release year, language type, country, and award information; then, edges are constructed between any two resource data with the same attributes, so that the resource knowledge graph corresponding to the "resource database" can be obtained, so that information retrieval processing can be performed from the resource knowledge graph later.
[0104] In addition, the embodiment of the present application does not limit the implementation method of step 32. For example, it may specifically include: after obtaining the qth attribute corresponding to the information to be queried, perform a search process according to the qth attribute in the pre-constructed resource knowledge graph to obtain a search result corresponding to the qth attribute, so that the search result includes the relevance ranking of N candidate resources; then, according to the relevance ranking of the nth candidate resource in the search result corresponding to the qth attribute, determine to retrieve the representation data of the qth attribute of the nth candidate resource, so that the smaller the "qth attribute retrieval representation data of the nth candidate resource", the greater the similarity between the nth candidate resource and the resource to be queried in the qth attribute. Wherein, q is a positive integer, q≤Q, and Q is a positive integer.
[0105] Based on the relevant contents of the above steps 31 to 32, it can be known that with the help of a pre-constructed resource knowledge graph, at least one attribute retrieval representation data of each candidate resource can be determined, which is conducive to improving resource retrieval effects (for example, retrieval efficiency, etc.).
[0106] Based on the relevant content of the above step 11, it can be known that the information to be queried used to describe the resources to be queried can be used to determine the recommended representation data of each candidate resource, so that the recommended representation data of each candidate resource can represent the similarity between each candidate resource and the resources to be queried, thereby making the recommended representation data of each candidate resource able to represent the degree of association between each candidate resource and the above-mentioned "resources to be queried".
[0107] Step 12: Determine at least one recommended resource from the at least one candidate resource according to the recommendation representation data of the at least one candidate resource.
[0108] The embodiment of the present application does not limit the implementation method of step 12. For example, when the above-mentioned "at least one candidate resource" includes N candidate resources, step 12 may specifically include steps 41 and 42:
[0109] Step 41: Determine the recommendation score of the nth candidate resource according to the recommendation representation data of the nth candidate resource, where n is a positive integer, n≤N.
[0110] The above-mentioned “recommendation score of the nth candidate resource” is used to indicate the possibility of providing the nth candidate resource to the user (that is, the possibility of the user viewing the nth candidate resource); and the larger the “recommendation score of the nth candidate resource”, the greater the possibility of providing the nth candidate resource to the user.
[0111] In addition, the embodiment of the present application does not limit the implementation method of step 41. For example, when the above-mentioned "recommended representation data of the nth candidate resource" includes feature matching representation data of the nth candidate resource, the first attribute retrieval representation data of the nth candidate resource, the second attribute retrieval representation data of the nth candidate resource, ..., and the Qth attribute retrieval representation data of the nth candidate resource, step 41 may specifically include steps 411-412:
[0112] Step 411: Determine a feature matching score of the nth candidate resource according to the feature matching representation data of the nth candidate resource.
[0113] The embodiments of the present application do not limit the implementation method of step 411. For example, when the above-mentioned "feature matching representation data of the nth candidate resource" includes the arrangement number of the nth candidate resource in the above "feature similarity sequence", step 411 may specifically include: determining the inverse of the arrangement number of the nth candidate resource in the "feature similarity sequence" as the feature matching score of the nth candidate resource, so that the larger the "feature matching score of the nth candidate resource", the greater the possibility of recommending the nth candidate resource to the user in terms of resource features.
[0114] It should be noted that for the relevant content of the above-mentioned "feature similarity sequence", please refer to the relevant content of step 24 above.
[0115] Step 412: Retrieve characterization data according to the qth attribute of the nth candidate resource to determine the qth attribute score of the nth candidate resource, where q is a positive integer, q≤Q.
[0116] The embodiments of the present application do not limit the implementation method of step 412. For example, when the above-mentioned "qth attribute retrieval representation data of the nth candidate resource" includes the relevance ranking of the nth candidate resource in the above-mentioned "retrieval results corresponding to the qth attribute", step 412 may specifically include: determining the inverse of the relevance ranking of the nth candidate resource in the "retrieval results corresponding to the qth attribute" as the qth attribute score of the nth candidate resource, so that the larger the "qth attribute score of the nth candidate resource", the greater the possibility of recommending the nth candidate resource to the user in terms of the qth attribute.
[0117] Step 413: Add the feature matching score of the nth candidate resource, the first attribute score of the nth candidate resource, the second attribute score of the nth candidate resource, ..., and the Qth attribute score of the nth candidate resource to obtain the recommendation score of the nth candidate resource (as shown in formula (1)).
[0118]
[0119] In the formula, RankScore(Item n ) represents the recommendation score of the nth candidate resource; Indicates the ranking number of the nth candidate resource in the above “feature similarity sequence”; Indicates the relevance ranking of the nth candidate resource in the above “search result corresponding to the qth attribute”.
[0120] Based on the relevant content of the above step 41, it can be known that after obtaining the recommendation characterization data according to the nth candidate resource, the recommendation score of the nth candidate resource can be determined according to the recommendation characterization data of the nth candidate resource, so that the "recommendation score of the nth candidate resource" can represent the possibility of providing the nth candidate resource to the user. Wherein n is a positive integer, n≤N.
[0121] Step 42: Determine at least one recommended resource from the N candidate resources according to the recommendation scores of the N candidate resources.
[0122] The embodiment of the present application does not limit the implementation of step 42. For example, it may specifically include: according to the recommendation scores of the N candidate resources, each candidate resource among the N candidate resources whose recommendation score is higher than a preset score threshold is determined as a recommended resource. The "preset score threshold" may be preset.
[0123] For another example, step 42 may specifically include: first, according to the recommendation scores of the N candidate resources, the N candidate resources are sorted from large to small according to the recommendation scores to obtain a recommendation score sequence, so that the recommendation score sequence includes the recommendation ranking of each candidate resource; and then, each candidate resource among the N candidate resources whose recommendation ranking is lower than a preset ranking threshold is determined as a recommended resource. The "preset ranking threshold" may be preset.
[0124] Based on the relevant contents of steps 41 to 42 above, it can be known that after obtaining the recommendation representation data of at least one candidate resource, the recommendation score of each candidate resource can be determined based on the recommendation representation data of each candidate resource; and then, according to the recommendation score of each candidate resource, at least one recommended resource can be determined from the at least one candidate resource, so that the recommendation scores of these recommended resources are higher than the recommendation scores of any other resource data in the above "at least one candidate resource" except these recommended resources, which is conducive to improving the recommendation effect.
[0125] In addition, in order to improve the recommendation effect, the embodiment of the present application also provides another possible implementation of step 12. In this implementation, when the above-mentioned "recommended representation data" includes feature matching representation data and Q attribute retrieval representation data, step 12 may specifically include steps 51 to 54:
[0126] Step 51: According to feature matching characterization data of at least one candidate resource, determine at least one feature matching resource that meets a first condition from the at least one candidate resource.
[0127] The above-mentioned "first condition" can be preset; and the embodiment of the present application does not limit the "first condition". For example, when the above-mentioned "feature matching characterization data of the nth candidate resource" includes the arrangement sequence number of the nth candidate resource in the above "feature similarity sequence", the "first condition" may include: lower than a preset sequence number threshold. Among them, the "preset sequence number threshold" can be preset.
[0128] The above-mentioned “feature matching resource” is used to represent a candidate resource whose feature matching representation data satisfies the first condition.
[0129] In addition, the embodiments of the present application do not limit the determination process of the above-mentioned "at least one feature matching resource". For example, it may specifically include: determining whether the feature matching representation data of the nth candidate resource meets the first condition; if so, determining the nth candidate resource as the feature matching resource; if not, discarding the nth candidate resource.
[0130] Based on the relevant content of the above step 51, it can be known that after obtaining the feature matching representation data of N candidate resources, each feature matching resource whose feature matching representation data meets the first condition can be searched from the N candidate resources, so that resource data for recommendation to the user can be selected from these feature matching resources subsequently.
[0131] Step 52: Retrieve representation data according to the qth attribute of at least one candidate resource, and determine at least one attribute hit resource corresponding to the qth attribute from the at least one candidate resource. Wherein, each attribute hit resource corresponding to the qth attribute satisfies the qth attribute screening condition; q is a positive integer, q≤Q.
[0132] The above-mentioned "qth attribute screening condition" can be preset; and the embodiment of the present application does not limit the "qth attribute screening condition", for example, it can specifically be: resource data that is the same as the qth attribute of the resource to be queried. It can be seen that if the above-mentioned "qth attribute retrieval representation data of the nth candidate resource" indicates that the qth attribute of the nth candidate resource is the same as the qth attribute of the resource to be queried, then it can be determined that the nth candidate resource meets the qth attribute screening condition.
[0133] For another example, when the above-mentioned "qth attribute retrieval representation data of the nth candidate resource" includes the relevance ranking of the nth candidate resource in the above-mentioned "retrieval results corresponding to the qth attribute", the "qth attribute screening condition" can specifically be: resource data with a relevance ranking lower than the qth ranking threshold. Among them, the "qth ranking threshold" can be set in advance. It can be seen that if the relevance ranking of the nth candidate resource in the above-mentioned "retrieval results corresponding to the qth attribute" is lower than the qth ranking threshold, it can be determined that the nth candidate resource meets the qth attribute screening condition.
[0134] Based on the relevant contents of the above step 52, it can be known that after obtaining the qth attribute retrieval characterization data of the N candidate resources, first search for each candidate resource that meets the qth attribute screening condition from these candidate resources based on the qth attribute retrieval characterization data; then determine each candidate resource that meets the qth attribute screening condition as each attribute hit resource corresponding to the qth attribute, so that resource data for recommendation to the user can be selected from these attribute hit resources later. Wherein, q is a positive integer, q≤Q.
[0135] Step 53: Determine at least one first resource according to at least one feature matching resource, at least one attribute hit resource corresponding to the 1st attribute to at least one attribute hit resource corresponding to the Qth attribute.
[0136] In an embodiment of the present application, after obtaining at least one feature matching resource, at least one attribute hit resource corresponding to the first attribute, at least one attribute hit resource corresponding to the second attribute,..., and at least one attribute hit resource corresponding to the Qth attribute, each feature matching resource, each attribute hit resource corresponding to the first attribute, each attribute hit resource corresponding to the second attribute,..., and each attribute hit resource corresponding to the Qth attribute can be determined as a first resource, so that resource data can be selected from these first resources for recommendation to the user subsequently.
[0137] Step 54: Determine at least one recommended resource from the at least one first resource according to the recommendation representation data of the at least one first resource.
[0138] The embodiment of the present application does not limit the implementation method of step 54. For example, when the above-mentioned "at least one first resource" includes T first resources, step 54 can be implemented by adopting the determination process of "at least one recommended resource" shown in steps 41-42 above. It is only necessary to replace "candidate resource" with "first resource", "n" with "t", and "N" with "T" in the determination process of "at least one recommended resource" shown in steps 41-42 above. Wherein, t is a positive integer, t≤T, and T is a positive integer.
[0139] Based on the relevant contents of the above steps 51 to 53, it can be known that after obtaining the feature matching representation data of N candidate resources and the Q attribute retrieval representation data, at least one first resource can be screened out from the N candidate resources based on the feature matching representation data of the N candidate resources and the Q attribute retrieval representation data; and then at least one recommended resource can be determined from these first resources based on the recommended representation data of these first resources, which is conducive to improving the resource recommendation effect (for example, improving the resource recommendation efficiency).
[0140] In addition, in order to improve the resource recommendation effect, the embodiment of the present application also provides another possible implementation of step 12, which may specifically include steps 61 and 62:
[0141] Step 61: Determine at least one second resource satisfying a second condition from at least one candidate resource.
[0142] The above-mentioned "second condition" can be preset; and the embodiment of the present application does not limit the "second condition", for example, it can specifically include: resource data with resource use rights (for example, film and television resources with playback rights). For another example, the "second condition" can include: the screening conditions of the second resource shown in steps 611 to 614 below.
[0143] The above-mentioned “second resource” refers to a candidate resource that meets the second condition.
[0144] In addition, the embodiment of the present application does not limit the implementation method of step 61. For example, when the above-mentioned "second condition" is resource data with resource use authority, step 61 may specifically include: determining at least one second resource with resource use authority from at least one candidate resource. It can be seen that for the nth candidate resource, if the nth candidate resource does not have resource use authority, the user cannot view the nth candidate resource on the terminal device, so the nth candidate resource needs to be discarded; if the nth candidate resource has resource use authority, it can be determined that the user can view the nth candidate resource on the terminal device, so the nth candidate resource can be determined as the second resource. Wherein, n is a positive integer, n≤N.
[0145] In addition, in order to improve the resource recommendation effect, the embodiment of the present application also provides another possible implementation of step 61, which may specifically include steps 611 to 614:
[0146] Step 611: Determine at least one feature matching resource that meets a first condition from the at least one candidate resource according to the feature matching representation data of the at least one candidate resource.
[0147] Step 612: Retrieve representation data according to the qth attribute of at least one candidate resource, and determine at least one attribute hit resource corresponding to the qth attribute from the at least one candidate resource. Wherein, each attribute hit resource corresponding to the qth attribute satisfies the qth attribute screening condition; q is a positive integer, q≤Q.
[0148] Step 613: Determine at least one first resource according to at least one feature matching resource, at least one attribute hit resource corresponding to the 1st attribute to at least one attribute hit resource corresponding to the Qth attribute.
[0149] It should be noted that for the relevant contents of step 611 to step 613, please refer to the relevant contents of step 51 to step 53 above respectively.
[0150] Step 614: Determine at least one second resource that meets the third condition from the at least one first resource.
[0151] The above-mentioned "third condition" can be preset; and the embodiment of the present application does not limit the "third condition", for example, it can specifically include: resource data with resource use rights (for example, film and television resources with playback rights). It can be seen that for the t-th first resource, if the t-th first resource does not have resource use rights, the user will not be able to view the t-th first resource on the terminal device, so the t-th first resource needs to be discarded; if the t-th first resource has resource use rights, it can be determined that the user can view the t-th first resource on the terminal device, so the t-th first resource can be determined as the second resource. Wherein, t is a positive integer, t≤T, T is a positive integer, and T represents the number of first resources in the above-mentioned "at least one first resource".
[0152] Based on the relevant contents of step 61 above, it can be known that after obtaining N candidate resources, each second resource satisfying the second condition can be selected from these candidate resources first, so that resource data for recommendation to the user can be selected from these second resources later.
[0153] Step 62: Determine at least one recommended resource from at least one candidate resource according to the recommendation representation data of at least one second resource.
[0154] The embodiment of the present application does not limit the implementation method of step 62. For example, when the above-mentioned "at least one second resource" includes K second resources, step 62 can be implemented by adopting the determination process of "at least one recommended resource" shown in steps 41-42 above, and it is only necessary to replace "candidate resource" with "second resource", "n" with "k", and "N" with "K" in the determination process of "at least one recommended resource" shown in steps 41-42 above. Wherein, k is a positive integer, k≤K, and K is a positive integer.
[0155] Based on the relevant contents of steps 61 to 62 above, it can be known that after obtaining feature matching representation data of N candidate resources and Q attribute retrieval representation data, the recommended representation data of each second resource selected from the N candidate resources can be referred to, and at least one recommended resource can be determined from these second resources to ensure that these recommended resources can be viewed by the user on the terminal device. This is conducive to improving the resource recommendation effect, thereby helping to improve the user's resource query experience.
[0156] Method Example 3
[0157] In order to improve the resource recommendation effect, the embodiment of the present application also provides a possible implementation method of constructing the above-mentioned "feature extraction network", which may specifically include steps 71 and 72:
[0158] Step 71: Determine at least one resource sample data according to the user's historical resource operation information.
[0159] The above-mentioned “historical resource operation information” is used to describe the operation behaviors (for example, resource query operations, resource use operations, etc.) triggered by the user on resource data before the triggering moment of the above-mentioned “resource query request”.
[0160] In addition, the embodiment of the present application does not limit the method for obtaining the above-mentioned "historical resource operation information". For example, the historical resource operation information of the user can be summarized from the user's operation log on the resource data.
[0161] In addition, the above-mentioned "historical resource operation information" may include at least one historical resource operation record. The "historical resource operation record" is used to indicate the user's operation behavior on the historical resource data; and the "resource operation record" carries the description content of the historical resource data (for example, name identification, etc.). The "historical resource data" refers to the resource data involved in the above-mentioned "historical resource operation record" (that is, the resource data involved by the user's historical operation behavior).
[0162] The above-mentioned “resource sample data” refers to the resource description information of the above-mentioned “historical resource data”; and the above-mentioned “resource sample data” is similar to the above-mentioned “information to be extracted”.
[0163] In addition, the embodiment of the present application does not limit the implementation method of step 71. For example, when the above-mentioned "historical resource operation information" includes at least one historical resource operation record, and each historical resource operation record carries the description content of the historical resource data, step 71 may specifically include steps 711-713:
[0164] Step 711: extracting the description content of each historical resource data from each historical resource operation record.
[0165] Step 712: Determine resource description information of each historical resource data according to the description content of each historical resource data.
[0166] In the embodiment of the present application, when the above-mentioned "description content" includes a name identifier, after obtaining the description content of the e-th historical resource data, the resource description information corresponding to the name identifier of the e-th historical resource data can be queried from the resource database; and then the resource description information is determined as the resource description information of the e-th historical resource data. Wherein, e is a positive integer, e≤E, E is a positive integer, and E represents the number of historical resource data.
[0167] Step 713: Determine each resource sample data according to the resource description information of each historical resource data.
[0168] In the embodiment of the present application, after obtaining the resource description information of the e-th historical resource data, the resource description information of the e-th historical resource data can be determined as the e-th resource sample data, where e is a positive integer, e≤E, E is a positive integer, and E represents the number of historical resource data.
[0169] Based on the relevant contents of the above steps 711 to 713, it can be known that in some cases, various resource sample data can be determined based on the user's historical resource operation records so that these resource sample data can describe the user's resource usage preferences.
[0170] In addition, in order to improve the network construction effect, the embodiment of the present application also provides another possible implementation of step 71, which may specifically include: determining at least one positive sample data and at least one negative sample data according to the user's historical resource operation information.
[0171] The above-mentioned “positive sample data” refers to the resource description information of the above-mentioned “historical resource data”. It can be seen that the above-mentioned “positive sample data” refers to the resource description information of the resource data that the user has operated (that is, the resource description information of the resource data that the user likes).
[0172] In addition, the embodiments of the present application do not limit the determination process of "positive sample data". For example, when the above-mentioned "historical resource operation information" is used to describe the operation behavior triggered for at least one resource to be used, the determination process of the "positive sample data" may specifically include: determining at least one positive sample data according to at least one resource to be used. The above-mentioned "resource to be used" is used to represent a resource data that has been operated by the user (that is, the above-mentioned "historical resource data").
[0173] It should be noted that the embodiment of the present application does not limit the implementation method of the above step of "determining at least one positive sample data according to at least one resource to be used", for example, it may specifically include: the resource description information of the e-th resource to be used may be determined as the e-th positive sample data. Wherein, e is a positive integer, e≤E, and E is a positive integer.
[0174] The above-mentioned “negative sample data” refers to resource description information of resource data that the user does not like; and the embodiment of the present application does not limit the determination process of the above-mentioned “at least one negative sample data”. For example, when the above-mentioned “historical resource operation information” is used to describe the operation behavior triggered for at least one resource to be used, the determination process of the “negative sample data” may specifically include steps 81 to 83:
[0175] Step 81: Compare the attribute information of at least one candidate resource with the attribute information of at least one resource to be used to obtain an attribute comparison result.
[0176] The above-mentioned "at least one alternative resource" refers to the resource data required for reference when determining resource data that the user does not like; and the embodiment of the present application does not limit the "at least one alternative resource", for example, it may include the above-mentioned "at least one candidate resource".
[0177] In addition, in order to improve the efficiency of determining negative sample data, the "at least one candidate resource" can be determined by referring to the hot search resource data within a period of time. Based on this, it can be seen that the embodiment of the present application also provides another possible implementation of the "at least one candidate resource" mentioned above. In this implementation, the "at least one candidate resource" includes at least one resource data that meets the preset resource conditions within the time period to be used.
[0178] The above-mentioned "time period to be used" can be determined according to a pre-set preset duration (for example, 1 month, etc.); and the "time period to be used" can be expressed as [the triggering time of the above "resource query request" - the preset duration, the triggering time of the above "resource query request"].
[0179] The above-mentioned “preset resource conditions” can be pre-set; and the embodiment of the present application does not limit the “preset resource conditions”, for example, it can be: resource data that enters the hot search list.
[0180] The above-mentioned “attribute information” is used to describe at least one attribute of a resource data (for example, the above-mentioned “Q attributes”).
[0181] The above-mentioned "attribute comparison result" is used to describe the difference in attribute information between each candidate resource and each resource to be used; and the embodiment of the present application does not limit the "attribute comparison result". For example, when the number of the above-mentioned "candidate resources" is Y, the "attribute comparison result" may include the comparison result in attribute information between the first candidate resource and the e-th resource to be used, the comparison result in attribute information between the second candidate resource and the e-th resource to be used, ..., and the comparison result in attribute information between the Y-th candidate resource and the e-th resource to be used. Wherein, e is a positive integer, e≤E.
[0182] The above-mentioned “comparison result of attribute information between the yth candidate resource and the eth resource to be used” is used to indicate the difference in attribute information between the yth candidate resource and the eth resource to be used; and the “comparison result of attribute information between the yth candidate resource and the eth resource to be used” may include: the comparison result of the yth candidate resource and the eth resource to be used on the first attribute, the comparison result of the yth candidate resource and the eth resource to be used on the second attribute, ..., and the comparison result of the yth candidate resource and the eth resource to be used on the Qth attribute. Wherein, y is a positive integer, y≤Y, and Y is a positive integer.
[0183] It should be noted that the “comparison result of the qth attribute between the yth candidate resource and the eth resource to be used” is used to indicate whether the yth candidate resource and the eth resource to be used have the same attribute value for the qth attribute, where q is a positive integer, q≤Q.
[0184] Based on the relevant content of the above step 81, it can be known that after obtaining at least one resource to be used, the attribute information of these resources to be used can be used to describe the resource data liked by the above "user", so the attribute information of each resource to be used is compared with the attribute information of each alternative resource to obtain an attribute comparison result, so that the attribute comparison result can represent the differences in attribute information between each resource to be used and each alternative resource, so that the resource data that the above "user" does not like can be predicted with the help of the attribute comparison result.
[0185] Step 82: Determine at least one target resource from at least one candidate resource according to the attribute comparison result, so that the attribute information of each target resource is different from the attribute information of all resources to be used.
[0186] The embodiment of the present application does not limit the implementation method of step 82. For example, when the above-mentioned "attribute comparison result" includes the comparison result of the attribute information between the first candidate resource and the e-th resource to be used, the comparison result of the attribute information between the second candidate resource and the e-th resource to be used, ..., and the comparison result of the attribute information between the Y-th candidate resource and the e-th resource to be used, step 82 may specifically include steps 821-823:
[0187] Step 821: According to the comparison result of the attribute information between the yth candidate resource and the eth resource to be used, determine the same attribute analysis result between the yth candidate resource and the eth resource to be used, where y is a positive integer, y≤Y, Y is a positive integer; e is a positive integer, e≤E, E is a positive integer.
[0188] The above-mentioned "same attribute analysis results between the yth alternative resource and the eth resource to be used" is used to indicate whether there are the same attribute values between the attribute information of the yth alternative resource and the attribute information of the eth resource to be used (that is, whether there are the same attributes between the yth alternative resource and the eth resource to be used).
[0189] Step 822: Perform statistical analysis on the same attribute analysis results between the yth candidate resource and the first resource to be used, the same attribute analysis results between the yth candidate resource and the second resource to be used, ..., and the same attribute analysis results between the yth candidate resource and the Eth resource to be used, to obtain the same attribute summary results corresponding to the yth candidate resource. Where y is a positive integer, y≤Y, and Y is a positive integer.
[0190] The above-mentioned "summary result of the same attributes corresponding to the yth candidate resource" is used to indicate whether the attribute information of the yth candidate resource and the attribute information of E resources to be used have the same attribute value (that is, whether the yth candidate resource has the same attributes with all resources to be used).
[0191] Step 823: Determine whether the yth candidate resource is the target resource according to the summary result of the same attributes corresponding to the yth candidate resource, where y is a positive integer, y≤Y, and Y is a positive integer.
[0192] In the embodiment of the present application, after obtaining the above-mentioned "summary result of the same attribute corresponding to the yth candidate resource", if the "summary result of the same attribute corresponding to the yth candidate resource" indicates that there is no identical attribute value between the attribute information of the yth candidate resource and the attribute information of the E resources to be used, it can be determined that the yth candidate resource is likely to belong to resource data that the user does not like, so the yth candidate resource can be determined as the target resource; however, if the "summary result of the same attribute corresponding to the yth candidate resource" indicates that there is at least one identical attribute value between the attribute information of the yth candidate resource and the attribute information of the E resources to be used, it can be determined that it is likely to belong to resource data that the user likes, so the yth candidate resource can be directly discarded. Wherein, y is a positive integer, y≤Y, and Y is a positive integer.
[0193] Based on the relevant content of the above step 82, it can be known that after obtaining the above "attribute comparison result", the attribute comparison result can be referred to to select each target resource from some alternative resources whose attribute information is completely different from the attribute information of all resources to be used, so that there is no identical attribute value between the attribute information of each target resource and the attribute information of all resources to be used, thereby making it very likely that each target resource belongs to resource data that the user does not like.
[0194] Step 83: Determine at least one negative sample data according to at least one target resource.
[0195] The embodiment of the present application does not limit the implementation method of step 83. For example, it may include: determining the resource description information of each target resource as each negative sample data. For another example, in order to improve the network construction effect, step 83 may specifically include: first determining the number to be used according to the number of the above-mentioned "positive sample data"; then randomly selecting the target resources to be used from all target resources; finally, determining the resource description information of each selected target resource as each negative sample data, so that the ratio between the number of the above-mentioned "negative sample data" and the number of the above-mentioned "positive sample data" meets the preset ratio.
[0196] It should be noted that the above-mentioned "preset ratio" can be preset (for example, 1:1). The above-mentioned "number to be used" refers to the number of the above-mentioned "negative sample data"; and the "number to be used" can be determined according to the number of the above-mentioned "positive sample data" and the above-mentioned "preset ratio" (for example, when the above-mentioned "preset ratio" is 1:1, and the number of the above-mentioned "positive sample data" is E, the "number to be used" can be determined to be E).
[0197] Based on the relevant contents of the above steps 81 to 83, it can be known that after obtaining at least one resource to be used, the resource data liked by the above-mentioned "user" can be described with the help of the attribute information of these resources to be used. Therefore, the attribute comparison results between the attribute information of some alternative resources and the attribute information of each resource to be used can be referred to first, and each target resource whose attribute information is completely different from the attribute information of all resources to be used can be selected from these alternative resources; and then, based on the resource description information of these target resources, at least one negative sample data is determined, so that these negative sample data can represent the resource description information of the resource data that the user does not like.
[0198] Based on the relevant content of the above step 71, it can be known that in order to improve the feature extraction effect of the above "feature extraction network", the historical operation behavior records of the above "user" for resource data can be used to determine some resource sample data, so that these resource sample data can represent the personal preferences of the "user" for resource data, so that the personal preferences of the "user" for resource data can be learned from these resource sample data with the help of machine learning principles.
[0199] Step 72: Construct a feature extraction network based on the resource sample data.
[0200] The embodiment of the present application does not limit the implementation of step 72. For example, it may specifically include steps 721 to 724:
[0201] Step 721: Determine a predicted classification result of the at least one resource sample data according to the at least one resource sample data, the user's description information, and the model to be trained.
[0202] The above-mentioned "user description information" is used to describe the characteristics of the above-mentioned "user"; and the embodiment of the present application does not limit the "user description information", for example, it may include the ID of the user. For another example, it may also include: the user's personal information (for example, gender, age, resource data usage preferences, etc.).
[0203] The above-mentioned "model to be trained" is used to perform classification processing on the input data of the model to be trained (for example, whether it belongs to the resource data liked by the above-mentioned "user", etc. For example, whether it is positive sample data, or negative sample data, etc.).
[0204] In addition, the embodiments of the present application do not limit the network structure of the above-mentioned "model to be trained". For example, any existing or future classification model structure can be used for implementation.
[0205] In addition, in order to further improve the classification effect of the above-mentioned "model to be trained", the embodiment of the present application also provides a possible implementation of the network structure of the above-mentioned "model to be trained". In this implementation, Figure 3 As shown, the model to be trained 300 may include a user feature extraction layer 301, a resource feature extraction layer 302, a feature concatenation layer 303, and a classification processing layer 304. The input data of the classification processing layer 304 includes the output data of the feature concatenation layer 303; the input data of the feature concatenation layer 303 includes the output data of the user feature extraction layer 301 and the output data of the resource feature extraction layer 302.
[0206] In order to facilitate understanding of the working principle of the model to be trained 300, the following is an example of determining the prediction classification result of the hth resource sample data, where h is a positive integer, h≤H, H is a positive integer, and H represents the number of resource sample data.
[0207] As an example, the process of determining the above “prediction classification result of the h-th resource sample data” using the to-be-trained model 300 may specifically include steps 91 to 94:
[0208] Step 91: input the above “user description information” into the user feature extraction layer 301 to obtain the user representation features output by the user feature extraction layer 301 .
[0209] Among them, the user feature extraction layer 301 is used to perform feature extraction processing on the input data of the user feature extraction layer 301; and the embodiment of the present application does not limit the implementation method of the user feature extraction layer 301. For example, any existing or future feature extraction network can be used for implementation.
[0210] In addition, in order to improve the user feature extraction effect, the embodiment of the present application also provides a possible implementation of the user feature extraction layer 301. In this implementation, the user feature extraction layer 301 includes G feature extraction units and a feature fusion unit; and the input data of the feature fusion unit includes the output data of the G feature extraction units.
[0211] The g-th feature extraction unit is used to perform feature extraction processing on the above-mentioned "input data of the user feature extraction layer 301". In addition, the embodiment of the present application does not limit the implementation method of the g-th feature extraction unit. Figure 4 As shown, it may include an encoding unit and a decoding unit; and the input data of the decoding unit includes the output data of the encoding unit. Wherein, g is a positive integer, g≤G, and G is a positive integer.
[0212] The above-mentioned "encoding unit" is used to encode the input data of the encoding unit; and the present application does not limit the implementation method of the "encoding unit", for example, it can be implemented by any existing or future encoding network. Figure 5 The encoding network shown is implemented.
[0213] It should be noted that for Figure 5 For the encoding network shown in FIG. 1 , the encoding network includes a linear layer (e.g., a fully connected layer, etc.), a transformation layer, and a normalization layer. Among them, “LinearLayer(input, hidden)” is used to represent the linear layer; “input” represents the input data of the linear layer; and “hidden” represents the hidden data. “Switch(x)” is used to represent the transformation layer; and “Switch(x)” can be implemented according to formula (2). “LayerNorm” represents the normalization layer.
[0214]
[0215] In the formula, switch(x) represents the output result of the transformation layer; x represents the input data of the transformation layer.
[0216] The above-mentioned "decoding unit" is used to perform decoding processing on the input data of the decoding unit; and the embodiment of the present application does not limit the implementation method of the "decoding unit", for example, it can be implemented by using any existing or future decoding network. For another example, it can be implemented with the help of a two-dimensional linear layer.
[0217] The above-mentioned "feature fusion unit" is used to perform feature fusion processing on the input data of the feature fusion unit; and the embodiment of the present application does not limit the working principle of the "feature fusion unit", for example, it can be implemented in a feature splicing manner (that is, the output data of G feature extraction units are subjected to feature splicing processing).
[0218] The above-mentioned “user characterization features” are used to represent the user features carried by the above-mentioned “user description information”.
[0219] Based on the relevant content of the above step 91, it can be known that for the model 300 to be trained, after the above-mentioned "user description information" is input into the model 300 to be trained, the user feature extraction layer 301 in the model 300 to be trained can perform feature extraction processing on the "user description information" to obtain and output user characterization features, so that the user characterization features can represent the user features carried by the "user description information".
[0220] Step 92: input the hth resource sample data into the resource feature extraction layer 302 to obtain the hth resource sample feature output by the resource feature extraction layer 302.
[0221] The resource feature extraction layer 302 is used to perform feature extraction processing on the input data of the resource feature extraction layer 302 .
[0222] In addition, the embodiment of the present application does not limit the implementation method of the user feature extraction layer 301. For example, any existing or future feature extraction network can be used for implementation. For another example, in order to improve the classification effect, the network structure of the resource feature extraction layer 302 can be consistent with the network structure of the user feature extraction layer 301.
[0223] The above-mentioned “h-th resource sample feature” is used to represent the resource feature carried by the above-mentioned “h-th resource sample data”.
[0224] Based on the relevant content of the above step 92, it can be known that for the model 300 to be trained, after the above-mentioned "h-th resource sample data" is input into the model 300 to be trained, the resource feature extraction layer 302 in the model 300 to be trained can perform feature extraction processing on the "h-th resource sample data" to obtain and output the h-th resource sample feature, so that the user characterization feature can represent the resource feature carried by the "h-th resource sample data".
[0225] Step 93: Input the user characterization feature and the hth resource sample feature into the feature concatenation layer 303 to obtain the hth concatenation feature output by the feature concatenation layer 303 .
[0226] Among them, the feature stitching layer 303 is used to perform stitching processing on the input data of the feature stitching layer 303; and the embodiment of the present application does not limit the implementation method of the feature stitching layer 303. For example, any existing or future feature stitching method can be used for implementation.
[0227] Step 94: Input the hth concatenated feature into the classification processing layer 304 to obtain the predicted classification result of the hth resource sample data output by the classification processing layer 304.
[0228] Among them, the classification processing layer 304 is used to perform classification processing on the input data of the classification processing layer 304 (for example, whether it belongs to the resource data liked by the above-mentioned "user", etc. For example, whether it is positive sample data, or negative sample data, etc.).
[0229] In addition, the embodiment of the present application does not limit the implementation method of the classification processing layer 304. For example, it can be implemented by using any existing or future classification method (for example, Multi-Layer Perception (MLP)).
[0230] The above-mentioned "prediction classification result of the h-th resource sample data" refers to the classification result predicted for the h-th resource sample data. For example, the "prediction classification result of the h-th resource sample data" can be used to indicate whether the h-th resource sample data belongs to the resource data liked by the above-mentioned "user". For another example, the "prediction classification result of the h-th resource sample data" can also be used to indicate whether the h-th resource sample data belongs to positive sample data or negative sample data.
[0231] Based on the relevant contents of the above steps 91 to 94, it can be known that for the model 300 to be trained, the model 300 to be trained can first perform feature extraction on the above-mentioned "user description information" and a resource sample data respectively to obtain user features and resource features; then, with the help of reference user features and resource features, the resource sample data can be classified.
[0232] Based on the relevant content of the above step 721, it can be known that after obtaining each resource sample data, the model to be trained can refer to the above-mentioned "user" description information, perform classification processing on each resource sample data, and obtain and output the predicted classification results of each resource sample data, so that the predicted classification results of these resource sample data can be referred to later to determine the classification performance of the model to be trained.
[0233] Step 722: Determine whether the preset stop condition is met, if so, execute step 724; if not, execute step 723.
[0234] The above-mentioned "preset stop condition" can be preset; and the embodiment of the present application does not limit the "preset stop condition", for example, it can be specifically: the model loss value of the model to be trained is lower than the preset loss threshold. For another example, the "preset stop condition" can also be: the change rate of the model loss value of the model to be trained is lower than the preset change rate threshold. For another example, the "preset stop condition" can also be: the number of updates of the model to be trained reaches the preset number threshold.
[0235] It should be noted that the above-mentioned “model loss value of the model to be trained” is used to represent the classification performance of the model to be trained; and the embodiment of the present application does not limit the determination process of the “model loss value of the model to be trained”. For example, any existing or future loss function (for example, edge loss, etc.) can be used for implementation.
[0236] Step 723: Update the model to be trained according to the predicted classification result of at least one resource sample data and the actual classification information of the at least one resource sample data, and return to execute step 721.
[0237] The actual classification result of the h-th resource sample data refers to the label information actually marked on the h-th resource sample data (for example, whether it belongs to the resource data liked by the above-mentioned "user". For example, whether it belongs to positive sample data or negative sample data). Where h is a positive integer, h≤H, H is a positive integer, and H represents the number of resource sample data.
[0238] Based on the relevant content of the above step 723, it can be known that when it is determined that the current round of the model to be trained has not reached the preset stop condition, it can be determined that the classification performance of the model to be trained is relatively poor. Therefore, the model to be trained can be updated according to the difference between the predicted classification results of each resource sample data and the actual classification information, so that the updated model to be trained has better classification performance, so that based on the updated model to be trained, step 721 and its subsequent steps are executed to realize the next round of training process for the model to be trained.
[0239] Step 724: Determine a feature extraction network based on the model to be trained.
[0240] In an embodiment of the present application, when it is determined that the current round of the model to be trained reaches the preset stop condition, it can be determined that the classification performance of the model to be trained is relatively good, so the feature extraction network can be determined based on the model to be trained (for example, the resource feature extraction layer in the model to be trained is determined as the feature extraction network) so that the feature extraction network has better feature extraction performance for resource data.
[0241] Based on the relevant contents of steps 721 to 724 above, it can be known that in some cases, the above-mentioned "feature extraction network" can be constructed with the help of the training process of a classification model (for example, the above-mentioned "model to be trained"), so that the constructed "feature extraction network" has better resource feature extraction performance, so that the constructed "feature extraction network" can be used in the subsequent process to realize the resource feature extraction processing process for a resource data (for example, candidate resources, etc.).
[0242] Based on the relevant contents of steps 71 to 72 above, it can be known that in some application scenarios, in order to improve the feature extraction effect of the above-mentioned "feature extraction network", the feature extraction network can be constructed with the help of the historical operation behavior records of the above-mentioned "user" for resource data, so that the constructed feature extraction network has better feature extraction effect.
[0243] In addition, in order to further improve the feature extraction effect of the above-mentioned "feature extraction network", the operation behavior of the above-mentioned "user" on the resource data can be obtained and saved in real time, so that steps 71-72 can be executed once every period of time (for example, 1 day, 1 week, 1 month, etc.) to ensure that the above-mentioned "feature extraction network" always maintains a good feature extraction effect as much as possible.
[0244] Scenario Example
[0245] To facilitate understanding of the above “query method”, the following is an explanation using a film and television resource search scenario as an example.
[0246] like Figure 6 As shown, when the "query method" provided in the embodiment of the present application is applied to the field of voice search (for example, large-screen TVs, TV voice assistants, voice search, etc.), the search process for film and television resources (also known as film and television media resources) may specifically include steps 101 to 109:
[0247] Step 101: The user issues a voice command using a voice remote controller, so that the voice command is used to request query processing for a certain film and television media resource (eg, XXX movie).
[0248] Step 102: Use a preset speech recognition engine to perform speech recognition processing on the voice command to obtain a speech recognition text, so that the speech recognition text carries the search term (for example, the movie name of the above-mentioned "XXX movie").
[0249] Step 103: According to the above “search term”, in the pre-built resource database (such as Figure 6The "copyrighted media library" shown in the figure performs film and television resource search processing (for example, precise search processing or fuzzy search processing) to obtain resource search results, so that the resource search results are used to indicate whether the above-mentioned "certain film and television media asset" exists in the above-mentioned "resource database".
[0250] It should be noted that due to Figure 6 The film and television resources in the "copyrighted media library" shown are limited, which may cause the situation where the corresponding film and television resources cannot be searched.
[0251] Step 104: If the above-mentioned “resource search results” indicate that the above-mentioned “certain film and television media resource” exists in the above-mentioned “resource database”, the searched film and television resources can be directly fed back to the user.
[0252] Step 105: If the above-mentioned “resource search result” indicates that the above-mentioned “certain film and television media resource” does not exist in the above-mentioned “resource database”, then the resource recommendation system can be entered so that the resource recommendation system can refer to the above-mentioned “search term” to determine at least one recommended resource (such as Figure 7 As shown), and feed back these recommended resources to users.
[0253] It should be noted that the process of determining "at least one recommended resource" in step 105 is similar to the process of determining "at least one recommended resource" above. Figure 7 The "negative sample data" can be used Figure 8 The negative sample data determination process shown is implemented.
[0254] Based on the relevant contents of steps 101 to 105 above, it can be known that in the field of voice search, any implementation method of the query method provided in the embodiments of the present application can be used to implement a search feedback process for a certain film and television resource, so that users can view the above-mentioned "certain film and television resource" or some recommended resources similar to the "certain film and television resource" on the feedback page, which is conducive to improving the user's resource query experience.
[0255] It should be noted that Figure 6 "Netty" is a Java open source framework; "HDFS" is a distributed file system (Hadoop Distributed File System).
[0256] Based on the query method provided by the above method embodiment, the embodiment of the present application also provides a query device, which is explained and illustrated below in conjunction with the accompanying drawings.
[0257] Device Embodiment
[0258] The device embodiment introduces the query device, and related content can be found in the above method embodiment.
[0259] See also Fig. 9 , which is a structural diagram of a query device provided in an embodiment of the present application.
[0260] The query device 900 provided in the embodiment of the present application includes:
[0261] The receiving unit 901 is used to receive a resource query request triggered by a user; wherein the resource query request carries information to be queried; the information to be queried is used to describe the resource to be queried;
[0262] A query unit 902 is used to obtain a resource query result for the information to be queried;
[0263] A determining unit 903 is configured to determine at least one recommended resource according to the information to be queried if the resource query result indicates that the resource to be queried cannot be provided to the user;
[0264] The recommendation unit 904 is configured to provide the at least one recommended resource to the user.
[0265] In a possible implementation manner, the determining unit 903 includes:
[0266] A first determining subunit, configured to determine recommended representation data of at least one candidate resource according to the information to be queried;
[0267] The second determining subunit is configured to determine at least one recommended resource from the at least one candidate resource according to the recommendation representation data of the at least one candidate resource.
[0268] In a possible implementation, the recommendation characterization data includes feature matching characterization data and / or at least one attribute retrieval characterization data.
[0269] In a possible implementation manner, the first determining subunit includes:
[0270] The third determination subunit is used to determine the information to be extracted based on the information to be queried; use a pre-constructed feature extraction network to perform feature extraction processing on the information to be extracted to obtain features to be matched; match the features to be matched with the resource representation features of each of the candidate resources to obtain feature matching results of each of the candidate resources; and determine the feature matching representation data of at least one candidate resource based on the feature matching result of at least one candidate resource.
[0271] In a possible implementation manner, the resource representation feature of each of the candidate resources is determined using the feature extraction network.
[0272] In a possible implementation manner, the query device 900 further includes:
[0273] A generating unit, configured to determine at least one resource sample data according to the historical resource operation information of the user;
[0274] A construction unit is used to construct the feature extraction network according to the at least one resource sample data.
[0275] In a possible implementation manner, the at least one resource sample data includes at least one positive sample data and at least one negative sample data.
[0276] In a possible implementation manner, the historical resource operation information is used to describe the operation behavior triggered by the user for at least one resource to be used; the generating unit includes a fourth determining subunit and / or a fifth determining subunit;
[0277] The fourth determining subunit is used to determine the at least one positive sample data according to the at least one resource to be used;
[0278] The fifth determination subunit is used to compare the attribute information of at least one alternative resource with the attribute information of at least one resource to be used to obtain an attribute comparison result; determine at least one target resource from the at least one alternative resource based on the attribute comparison result, so that the attribute information of each target resource is different from the attribute information of the at least one resource to be used; and determine at least one negative sample data based on the at least one target resource.
[0279] In a possible implementation manner, the at least one candidate resource includes at least one resource data that meets a preset resource condition within a time period to be used.
[0280] In a possible implementation, the construction unit is specifically used to: determine the predicted classification result of the at least one resource sample data based on the at least one resource sample data, the user's description information, and the model to be trained; update the model to be trained based on the at least one resource sample data and the actual classification information of the at least one resource sample data, and continue to execute the step of determining the predicted classification result of the at least one resource sample data based on the at least one resource sample data, the user's description information, and the model to be trained, until after a preset stop condition is reached, the feature extraction network is determined according to the model to be trained.
[0281] In a possible implementation, the model to be trained includes a user feature extraction layer, a resource feature extraction layer, a feature splicing layer and a classification processing layer; wherein the input data of the classification processing layer includes the output data of the feature splicing layer; the input data of the feature splicing layer includes the output data of the user feature extraction layer and the output data of the resource feature extraction layer;
[0282] The construction unit is specifically used to: determine the predicted classification result of the at least one resource sample data according to the at least one resource sample data, the user's description information, and the model to be trained; update the model to be trained according to the at least one resource sample data and the actual classification information of the at least one resource sample data, and continue to execute the step of determining the predicted classification result of the at least one resource sample data according to the at least one resource sample data, the user's description information, and the model to be trained, until after reaching a preset stop condition, determine the feature extraction network according to the resource feature extraction layer in the model to be trained.
[0283] In a possible implementation manner, the first determining subunit includes:
[0284] The sixth determination subunit is used to obtain at least one attribute corresponding to the information to be queried; perform retrieval processing according to the at least one attribute in the pre-constructed resource knowledge graph to obtain at least one attribute retrieval representation data of each of the candidate resources; wherein the resource knowledge graph is constructed based on the attribute information of at least one resource to be retrieved; the at least one resource to be retrieved includes the at least one candidate resource.
[0285] In a possible implementation, the recommendation representation data includes feature matching representation data and Q attribute retrieval representation data; wherein Q is a positive integer;
[0286] The second determination subunit is specifically used to determine at least one feature matching resource that meets the first condition from the at least one candidate resource based on the feature matching representation data of the at least one candidate resource; retrieve the representation data based on the qth attribute of the at least one candidate resource, and determine at least one attribute hit resource corresponding to the qth attribute from the at least one candidate resource; wherein each of the attribute hit resources corresponding to the qth attribute satisfies the qth attribute screening condition; q is a positive integer, q≤Q; determine at least one first resource based on the at least one feature matching resource, at least one attribute hit resource corresponding to the 1st attribute to at least one attribute hit resource corresponding to the Qth attribute; and determine at least one recommended resource from the at least one first resource based on the recommended representation data of the at least one first resource.
[0287] In a possible implementation, the second determination subunit is specifically configured to determine at least one second resource satisfying a second condition from the at least one candidate resource; and determine at least one recommended resource from the at least one candidate resource based on the recommended representation data of the at least one second resource.
[0288] In a possible implementation, the process of determining the at least one recommended resource includes: determining a recommendation score for each of the third resources based on recommendation representation data of each of the third resources; and determining at least one recommended resource that meets the first condition from the at least one third resource based on the recommendation score of the at least one third resource.
[0289] Furthermore, an embodiment of the present application also provides a device, including: a processor, a memory, and a system bus;
[0290] The processor and the memory are connected via the system bus;
[0291] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes any one of the implementation methods of the above query method.
[0292] Furthermore, an embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes any implementation method of the above-mentioned query method.
[0293] Furthermore, an embodiment of the present application also provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute any one of the implementation methods of the above-mentioned query method.
[0294] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the method of each embodiment of the present application or some parts of the embodiments.
[0295] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0296] It should also 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, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0297] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A query method, characterized in that: The method comprises: Receive a resource query request triggered by a user; wherein the resource query request carries information to be queried; the information to be queried is used to describe the resource to be queried; Obtaining resource query results for the information to be queried; If the resource query result indicates that the resource to be queried cannot be provided to the user, determining at least one recommended resource according to the information to be queried; providing the at least one recommended resource to the user; The determining at least one recommended resource according to the information to be queried includes: According to the information to be queried, the recommended representation data of at least one candidate resource is determined, and the recommended representation data includes feature matching representation data and / or at least one attribute retrieval representation data. The process of determining the feature matching representation data includes: determining the information to be extracted according to the information to be queried; using a pre-constructed feature extraction network to perform feature extraction processing on the information to be extracted to obtain features to be matched; matching the features to be matched with the resource representation features of each of the candidate resources to obtain feature matching results of each of the candidate resources; determining the feature matching representation data of the at least one candidate resource according to the feature matching results of the at least one candidate resource; the process of determining the at least one attribute retrieval representation data includes: obtaining at least one attribute corresponding to the information to be queried; performing retrieval processing according to the at least one attribute in a pre-constructed resource knowledge graph to obtain at least one attribute retrieval representation data of each of the candidate resources; wherein the resource knowledge graph is constructed based on the attribute information of at least one resource to be retrieved; the at least one resource to be retrieved includes the at least one candidate resource; At least one recommended resource is determined from the at least one candidate resource according to the recommendation representation data of the at least one candidate resource.
2. The method according to claim 1, characterized in that The method further comprises: Determine at least one resource sample data according to the historical resource operation information of the user; wherein the at least one resource sample data includes at least one positive sample data and at least one negative sample data; The feature extraction network is constructed according to the at least one resource sample data.
3. The method according to claim 2, characterized in that The historical resource operation information is used to describe the operation behavior triggered by the user on at least one resource to be used; The process of determining the at least one positive sample data includes: Determining the at least one positive sample data according to the at least one resource to be used; and / or, The process of determining the at least one negative sample data includes: Comparing the attribute information of at least one candidate resource with the attribute information of the at least one resource to be used to obtain an attribute comparison result; Determine at least one target resource from the at least one candidate resource according to the attribute comparison result, so that the attribute information of each of the target resources is different from the attribute information of the at least one resource to be used; The at least one negative sample data is determined according to the at least one target resource.
4. The method according to claim 3, characterized in that: The at least one candidate resource includes at least one resource data that meets a preset resource condition within a time period to be used.
5. The method according to any one of claims 2 to 4, characterized in that: The construction process of the feature extraction network includes: Determine a prediction classification result of the at least one resource sample data according to the at least one resource sample data, the description information of the user, and the model to be trained; According to the at least one resource sample data and the actual classification information of the at least one resource sample data, the model to be trained is updated, and the step of determining the predicted classification result of the at least one resource sample data according to the at least one resource sample data, the user's description information, and the model to be trained is continued until the feature extraction network is determined according to the model to be trained after a preset stop condition is reached.
6. The method according to claim 5, characterized in that The model to be trained includes a user feature extraction layer, a resource feature extraction layer, a feature splicing layer and a classification processing layer; wherein the input data of the classification processing layer includes the output data of the feature splicing layer; the input data of the feature splicing layer includes the output data of the user feature extraction layer and the output data of the resource feature extraction layer; Determining the feature extraction network according to the model to be trained includes: The feature extraction network is determined according to the resource feature extraction layer in the model to be trained.
7. The method according to claim 1, characterized in that The recommended representation data includes feature matching representation data and Q attribute retrieval representation data; wherein Q is a positive integer; The determining at least one recommended resource from the at least one candidate resource according to the recommendation representation data of the at least one candidate resource comprises: Determining at least one feature matching resource that meets a first condition from the at least one candidate resource according to the feature matching characterization data of the at least one candidate resource; Retrieving representation data according to the qth attribute of the at least one candidate resource, and determining at least one attribute hit resource corresponding to the qth attribute from the at least one candidate resource; wherein each of the attribute hit resources corresponding to the qth attribute satisfies the qth attribute screening condition; q is a positive integer, q≤Q; Determine at least one first resource according to the at least one feature matching resource, at least one attribute hit resource corresponding to the first attribute to at least one attribute hit resource corresponding to the Qth attribute; At least one recommended resource is determined from the at least one first resource according to the recommendation representation data of the at least one first resource.
8. The method according to claim 1, characterized in that The method further comprises: Determine at least one second resource satisfying a second condition from the at least one candidate resource; The determining at least one recommended resource from the at least one candidate resource according to the recommendation representation data of the at least one candidate resource comprises: At least one recommended resource is determined from the at least one candidate resource according to the recommendation representation data of the at least one second resource.
9. The method according to claim 2, 7 or 8, characterized in that: The process of determining the at least one recommended resource includes: Determining a recommendation score for each of the third resources according to the recommendation representation data of each of the third resources; At least one recommended resource satisfying the first condition is determined from the at least one third resource according to the recommendation score of the at least one third resource.
10. A query device, characterized in that: include: A receiving unit, configured to receive a resource query request triggered by a user; wherein the resource query request carries information to be queried; the information to be queried is used to describe the resource to be queried; A query unit, used to obtain a resource query result for the information to be queried; a determining unit, configured to determine at least one recommended resource according to the information to be queried if the resource query result indicates that the resource to be queried cannot be provided to the user; A recommendation unit, configured to provide the at least one recommended resource to the user; The determination unit is specifically used to determine the recommended representation data of at least one candidate resource according to the information to be queried, the recommended representation data including feature matching representation data and / or at least one attribute retrieval representation data, and the determination process of the feature matching representation data includes: determining the information to be extracted according to the information to be queried; performing feature extraction processing on the information to be extracted using a pre-constructed feature extraction network to obtain features to be matched; matching the features to be matched with the resource representation features of each of the candidate resources to obtain feature matching results of each of the candidate resources; determining the feature matching representation data of the at least one candidate resource according to the feature matching results of the at least one candidate resource; the determination process of the at least one attribute retrieval representation data includes: obtaining at least one attribute corresponding to the information to be queried; performing retrieval processing according to the at least one attribute in a pre-constructed resource knowledge graph to obtain at least one attribute retrieval representation data of each of the candidate resources; wherein the resource knowledge graph is constructed according to the attribute information of at least one resource to be retrieved; the at least one resource to be retrieved includes the at least one candidate resource; and determining at least one recommended resource from the at least one candidate resource according to the recommended representation data of the at least one candidate resource.
11. A device, characterized in that: The device includes: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store one or more programs, wherein the one or more programs include instructions, and when the instructions are executed by the processor, the processor executes the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Medical resource recommendation method and device, equipment and storage medium
CN112860997A
System and method for matching resource capacity with resource needs
US20170060985A1
