Resource recall method and device, storage medium and electronic equipment

By fine-tuning the pre-trained double tower model, the target loss function is constructed using multiple sample data, the problem of inconsistent goals in the recall, rough and fine placing stages in e-commerce scenarios is solved, and the matching and accuracy of resource recall is improved .

CN119228463APending Publication Date: 2024-12-31BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310777407.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In the e-commerce scenario, due to the inconsistent goals of the recall, rough and fine placing stages, the semantics and goals in the measurement space are inconsistent, resulting in low matching and accuracy of resource recall.

Method used

By obtaining multiple sample data, the target loss function is constructed to fine-tune the pre-trained double tower model. Based on the fine-tuned model, the retrieval resource is recalled by the user input query word, and the relationship between different samples is used to build the loss function to improve the accuracy of the recall. sex.

Benefits of technology

The semantic and target consistency problems in the measurement space are solved, and the matching and accuracy of resource recalls are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119228463A_ABST
    Figure CN119228463A_ABST
Patent Text Reader

Abstract

The invention provides a resource recall method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of data processing. The method comprises the steps of obtaining sample data, wherein the sample data comprises multiple types of samples obtained according to operation of a user on resources; constructing a target loss function according to the sample data, and performing fine tuning on a double-tower model obtained by pre-training through the target loss function; and recalling resources according to the query term input by the user based on the fine-tuned double-tower model. According to the embodiment of the invention, the loss function is constructed through the sample data, and the pre-trained double-tower model is finely adjusted based on the loss function, so that the problem of semantic and target consistency in a measurement space is solved, and the accuracy of resource recall is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a resource recall method, a resource recall device, an electronic device, and a computer-readable storage medium. Background Art

[0002] In e-commerce scenarios, accurately recalling specific collection products from a large number of candidates based on the user's search terms can improve order conversion rates. Existing technologies usually achieve matching and retrieval of related products based on the dual-tower semantic model of text information.

[0003] However, in actual implementation scenarios, considering factors such as performance, a multi-level funnel structure system is usually used to implement the matching and retrieval process of the above-mentioned products, including the recall, coarse ranking and fine ranking stages. However, due to the inconsistent goals of each stage, for example, the recall stage focuses on clicks, the coarse ranking stage focuses on clicks and conversions, and the fine ranking stage focuses on conversions and diversity, which leads to inconsistency between semantics and goals in the measurement space, resulting in low matching degree and accuracy of recall.

[0004] In order to solve the above problems, the embodiments of the present disclosure provide a resource recall method, a resource recall device, an electronic device, and a computer-readable storage medium. Summary of the invention

[0005] The purpose of the embodiments of the present disclosure is to provide a resource recall method, a resource recall device, an electronic device and a computer-readable storage medium, thereby solving to a certain extent the problem in the related art that due to the inconsistency of objectives in each stage, the semantics and objectives in the metric space are inconsistent, resulting in low matching degree and accuracy of the recall.

[0006] According to a first aspect of the present disclosure, a resource recall method is provided, comprising: obtaining sample data, the sample data comprising multiple categories of samples obtained according to user operations on resources; constructing a target loss function according to the sample data, and fine-tuning a pre-trained dual-tower model through the target loss function; and recalling resources according to the query terms input by the user based on the fine-tuned dual-tower model.

[0007] In an exemplary embodiment of the present disclosure, the dual-tower model includes a user tower and a resource tower, and the pre-training stage of the dual-tower model includes: acquiring user data and resource data, the user data including the query term and user information input by the user, and the resource data including resource titles; inputting the user data into the user tower and the resource data into the resource tower to pre-train the dual-tower model, and the dual-tower model recalls resources by comparing the similarity between the query term and the resource title.

[0008] In an exemplary embodiment of the present disclosure, the method further includes: obtaining the resource title and extracting a target field from the resource title; inputting the target field into the user tower as the query term, inputting the resource title after extracting the target field into the resource tower, and pre-training the dual-tower model.

[0009] In an exemplary embodiment of the present disclosure, the sample data includes order samples, click samples, exposed but not clicked samples, and random negative samples; constructing the target loss function based on the sample data includes: determining a first loss function based on the order samples and the exposed but not clicked samples; determining a second loss function based on the click samples and the exposed but not clicked samples; determining a third loss function based on the click samples and the random negative samples; determining a fourth loss function based on the exposed but not clicked samples and the random negative samples; and constructing the target loss function based on the first loss function, the second loss function, the third loss function, and the fourth loss function.

[0010] In an exemplary embodiment of the present disclosure, recalling resources according to the query term input by the user based on the fine-tuned twin-tower model includes: receiving the query term input by the user; determining the similarity between the query term and the resource title of each resource in the resource library through the twin-tower model, and recalling resources based on the similarity.

[0011] In an exemplary embodiment of the present disclosure, determining the similarity between the query term and the resource title of each resource in the resource library through the dual-tower model includes: obtaining a feature vector of the user tower side input information through the dual-tower model, the user tower side input information including the query term and user information of the user; predetermining a feature vector of the resource tower side input information through the dual-tower model, the resource tower side input information including attribute information of the resource and the resource title; calculating the vector inner product of the feature vector of the user tower side input information and the feature vector of the resource tower side input information, and determining the similarity based on the vector inner product.

[0012] According to a second aspect of the present disclosure, a resource recall device is provided, comprising: a data acquisition module for acquiring sample data, wherein the sample data comprises multiple categories of samples obtained according to user operations on resources; a model fine-tuning module for constructing a target loss function according to the sample data, and fine-tuning a pre-trained dual-tower model through the target loss function; and a resource recall module for recalling resources according to the query terms input by the user based on the fine-tuned dual-tower model.

[0013] In an exemplary embodiment of the present disclosure, the sample data includes order samples, click samples, exposed but not clicked samples, and random negative samples; the model fine-tuning module is used to: determine a first loss function based on the order samples and the exposed but not clicked samples; determine a second loss function based on the click samples and the exposed but not clicked samples; determine a third loss function based on the click samples and the random negative samples; determine a fourth loss function based on the exposed but not clicked samples and the random negative samples; and construct the target loss function based on the first loss function, the second loss function, the third loss function, and the fourth loss function.

[0014] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned methods by executing the executable instructions.

[0015] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, any one of the methods described above is implemented.

[0016] The exemplary embodiments of the present disclosure may have some or all of the following beneficial effects:

[0017] In the resource recall method provided in the example implementation of the present disclosure, sample data is obtained, and the sample data includes multiple types of samples obtained according to the user's operation on the resource; a target loss function is constructed according to the sample data, and the pre-trained dual-tower model is fine-tuned by the target loss function; and resources are recalled according to the query terms input by the user based on the fine-tuned dual-tower model. The present disclosure constructs a target loss function according to the relationship between different samples, and fine-tunes the dual-tower model by the target loss function. By recalling resources through the fine-tuned dual-tower model, the semantic and target consistency problems in the metric space can be solved, and the matching degree and accuracy of resource recall can be improved.

[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0020] Figure 1A schematic diagram schematically shows a flow chart of a resource recall method according to an embodiment of the present disclosure;

[0021] Figure 2 A model structure diagram for fine-tuning a twin-tower model according to an embodiment of the present disclosure is schematically shown;

[0022] Figure 3 A block diagram of a resource recall device according to an embodiment of the present disclosure is schematically shown;

[0023] Figure 4 A schematic structural diagram of an electronic device in an embodiment of the present disclosure is shown schematically. DETAILED DESCRIPTION

[0024] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0025] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0026] In e-commerce scenarios, accurately recalling specific collection products from a large number of candidates based on the user's search terms can improve order conversion rates. Related technologies usually implement the above retrieval process based on the double-tower semantic model of text information, that is, through massive user click data, the query terms and product text information are mapped to the same semantic space, and then the matching and retrieval of related products are achieved through calculations such as inner product or cosine similarity.

[0027] However, in actual implementation scenarios, considering factors such as performance, a multi-level funnel structure system is usually used to implement the retrieval process of the above-mentioned products, including the stages of recall, rough ranking and fine ranking. However, due to the inconsistency of the goals of each stage, for example, the recall stage focuses on clicks, the rough ranking stage focuses on clicks and conversions, and the fine ranking stage focuses on conversions and diversity, which results in the accuracy of the front link (ie, the recall stage) being limited. In addition, the inconsistency of data goals in each stage will result in the products revealed in the recall stage not being able to be revealed in the back link (ie, the rough and fine ranking stages). Specifically, the recall stage focuses more on exposed, clicked, and unclicked products, while the sorting stage considers orders, clicks, and unconverted products. The data distribution and training goals of the two stages are inconsistent, resulting in the inability to align the semantic space and low accuracy.

[0028] In order to solve the problems existing in the above method, this example embodiment proposes a resource recall method, a resource recall device, an electronic device and a computer-readable storage medium. The technical solution of the embodiment of the present disclosure is described in detail below:

[0029] This example implementation first provides a resource recall method. Figure 1 As shown, the resource recall method specifically includes the following steps:

[0030] Step S110: Acquire sample data, where the sample data includes multiple types of samples obtained according to user operations on resources;

[0031] Step S120: constructing a target loss function based on the sample data, and fine-tuning the pre-trained dual-tower model through the target loss function;

[0032] Step S130: Recalling resources based on the fine-tuned dual-tower model according to the query term input by the user.

[0033] In the resource recall method provided in the example implementation mode of the present disclosure, a target loss function is constructed based on the relationship between different samples, and the dual-tower model is fine-tuned through the target loss function. Resource recall is performed through the fine-tuned dual-tower model, which can solve the semantic and target consistency problems in the metric space and improve the matching degree and accuracy of resource recall.

[0034] Next, in another embodiment, the above steps are described in more detail.

[0035] In step S110, sample data is obtained, where the sample data includes multiple types of samples obtained according to user operations on resources.

[0036] The resource recall method provided in the embodiment of the present disclosure can be used in e-commerce scenarios. Specifically, it can recall products that match the query words entered by the user from a large number of products. For example, a user can enter the name, purpose, appearance and other related information of the product in the search bar of the e-commerce platform. The e-commerce platform uses the above resource recall method to recall the corresponding products for the user based on the query words entered by the user, combined with the user information and the product information, and displays them on the display page.

[0037] The resource recall method is implemented based on a dual-tower model, which includes a product tower and a user tower. The structure of each tower is divided into an input layer, a coding layer, and an output layer. The input layer encodes the original input information into a vector of a fixed length, and the coding layer transforms and fuses the input information, which can be any deep or shallow network structure. The output layer transforms the encoded information into a vector of a fixed length and normalizes it. Among them, the input information of the product tower can include product title information and attribute information such as store, price, brand, etc., and the input information of the user tower can include the query word information entered by the user and the demographic characteristics of the user, for example, it can include personalized characteristics such as the user's gender and age.

[0038] The resource recall method provided in the embodiment of the present disclosure includes two stages of pre-training and fine-tuning for the training of the above-mentioned dual-tower model. Exemplarily, the pre-training stage can be implemented through the following process: obtaining user data and resource data, the user data at least includes the query words and user information input by the user, that is, the demographic characteristics of the above-mentioned user, and the resource data at least includes the resource title, in the e-commerce scenario, that is, the above-mentioned product title information; inputting the user data into the user tower and the resource data into the resource tower to pre-train the dual-tower model, and the pre-trained dual-tower model performs resource recall by comparing the similarity of the query words and the resource titles. Specifically, the matching and retrieval of related products can be achieved by mapping the text information of the query words and the products to the same semantic space, and then calculating the inner product or cosine similarity.

[0039] In addition, in the disclosed embodiment, in order to improve the generalization of the model, forged query words can also be used to replace the user's real query words. Specifically, a section can be randomly intercepted from the resource title as a forged query word, and the intercepted part of the original title can be concealed. Then the above training process can be implemented as follows: obtain the resource title, and intercept the target field from the resource title; input the target field as a query word into the user tower, and input the resource title after intercepting the target field into the resource tower, and pre-train the dual-tower model. Among them, the above target field is a field randomly intercepted from the resource title, and the intercepted target field is input into the user tower as the above forged query word.

[0040] In order to solve the problem of target data consistency, after the embodiment of the present disclosure obtains the dual-tower model through the above-mentioned pre-training process, it is necessary to further fine-tune the dual-tower model. The fine-tuning stage is performed based on the above-mentioned sample data, and the sample data includes multiple categories of samples obtained according to the user's operation on the resource. In the e-commerce scenario, exemplarily, the sample data may include order samples, click samples, exposed but not clicked samples, and random negative samples. The target loss function is constructed by multiple categories of different samples, and the above-mentioned dual-tower model is fine-tuned. In the recall stage, the data and goals of the back-end link can be taken into account at the same time, and the semantic relationship between commodities such as exposure, click, and conversion can be fully considered to solve the problem of semantic and target consistency in the metric space.

[0041] In step S120, a target loss function is constructed based on the sample data, and the pre-trained dual-tower model is fine-tuned using the target loss function.

[0042] After obtaining the pre-trained dual-tower model and sample data through step S110, in this step, the embodiment of the present disclosure fine-tunes the pre-trained dual-tower model. Specifically, the target loss function can be constructed through the sample data, and the model can be fine-tuned based on the target loss function.

[0043] Exemplarily, in an e-commerce scenario, the process of determining the above-mentioned target loss function can be implemented as follows: determine the first loss function based on order samples and exposed but not clicked samples; determine the second loss function based on click samples and exposed but not clicked samples; determine the third loss function based on click samples and random negative samples; determine the fourth loss function based on exposed but not clicked samples and random negative samples; construct the target loss function based on the first loss function, the second loss function, the third loss function and the fourth loss function.

[0044] Specifically, Figure 2 This is a model structure diagram for fine-tuning the above twin-tower model. Figure 2 As shown, in the fine-tuning stage, the above query term information and the user's demographic characteristics are input into the input layer on the user tower side, and the product title information and the above sample data are input into the product tower side. Optionally, the product's store, price, brand and other attribute information can also be input at the same time and represented as a vector of fixed dimension.

[0045] At the encoding layer, both the user tower and the commodity tower use a 4-layer Bert model structure, denoted as F q and F t Among them, the feature length of the middle layer of the encoder is 768, the length of the final output vector is 128, and the outputs of the user tower and the product tower are recorded as Q (user & query embedding) and I (item embedding), respectively.

[0046] Q=F q (f query )

[0047] I=F t (f item )

[0048] Among them, f query Indicates the user tower side input layer information, f item Represents the product word input layer information. All product sample data share the product tower, and its vector is represented by I order (i.e. the above order sample, I click (i.e. the above click sample), I unclick (i.e. the above exposure but no click samples) and I random (i.e., a random sample).

[0049] The above objective loss function is determined by the relationship between different types of samples. Figure 2 In the scenario shown, the process of determining the target loss function can be specifically implemented as follows:

[0050] In the process of determining the target loss function, the embodiment of the present disclosure considers the relationship between orders and non-clicks, clicks and non-clicks, clicks and negative samples, and non-clicks and random negative samples respectively.

[0051] Specifically:

[0052] 1) Relationship between orders and unclicked items: In the same batch of data, order samples are definitely positive samples compared to unclicked samples. Therefore, BPR loss is used as the loss function to model this type of partial order relationship. The formula is as follows:

[0053]

[0054] Where {order}, {unclick} represent the order set and unclicked set respectively; σ(x) = 1 / {1+e -x}, s(Q, I) =<Q,I> represents the inner product function.

[0055] 2) Relationship between clicks and non-clicks: In the same batch of data, clicked samples are relatively positive samples compared to non-clicked samples, which means that users are more inclined to click on samples. Therefore, in the vector space, the distance between the query vector and the clicked samples is smaller than that between the query vector and the non-clicked samples. Here, margin loss is used as the loss function for modeling, and its formula is as follows:

[0056]

[0057] Where {click} represents the click set; δ represents the measurement interval Margin.

[0058] 3) Relationship between clicks and random negative examples: In the same batch of data, clicks are what users are interested in, while random negative examples may be products that users are not interested in or have not been exposed. Therefore, softmax-loss is used here to measure the overall relative relationship, and its formula is as follows:

[0059]

[0060] Where {random} represents a set of random negative examples; τ1 represents the temperature coefficient, which scales the value.

[0061] 4) Relationship between unclicked and random negative examples: In the same batch of data, the exposed unclicked data is more likely to be a positive example than the random negative example, so further distinction is needed. Similarly, softmax-loss is used for measurement, and the formula is as follows:

[0062]

[0063] Where τ2 represents the temperature coefficient, which has the same meaning as τ1.

[0064] The overall loss function can be expressed as:

[0065] L=aL ou +bL cu +cL cn +dL un .

[0066] Among them, the above a, b, c, d are weight values, which can be determined according to the importance of the corresponding sample data in actual scenarios.

[0067] After obtaining the above target loss function, the specific implementation of fine-tuning the model based on the target loss function can be as follows: The fine-tuning training of the above dual-tower model can use the gradient back-propagation algorithm, the optimizer is the Adam optimizer, the learning rate is 5e-5, the data volume of each optimization batch is 256, and the iterative optimization is 1 million times. The Bert encoder has 4 layers, the maximum input sequence length is 100, and the output dimension is 128 dimensions.

[0068] It should be noted that the above scenario is only an exemplary description, and the protection scope of the embodiments of the present disclosure is not limited thereto. For example, the above loss function can also select other loss functions that meet the requirements based on the relationship between sample data, and the dimension of the above vector can also be adjusted according to the actual scenario.

[0069] In step S130, resources are retrieved based on the fine-tuned dual-tower model according to the query term input by the user.

[0070] After obtaining the fine-tuned dual-tower model through the above process, the embodiment of the present disclosure can perform resource recall based on the fine-tuned dual-tower model. Exemplarily, the process can be implemented as follows: receiving a query word input by a user; determining the similarity between the query word and the resource title of each resource in the resource library through the dual-tower model, and recalling resources based on the similarity.

[0071] In addition, in order to improve query efficiency, avoid repeated calculations, and improve efficiency, the disclosed embodiment can also improve the calculation of resources in the resource library, obtain the corresponding feature vector and store it, then the above-mentioned process of determining similarity can be implemented as follows: obtain the feature vector of the user tower side input information through the double tower model, the user tower side input information includes the query word and the user information of the user; predetermine the feature vector of the resource tower side input information through the double tower model, the resource tower side input information includes the attribute information of the resource and the resource title; calculate the vector inner product of the feature vector of the user tower side input information and the feature vector of the resource tower side input information, and determine the similarity based on the vector inner product. Specifically, in the e-commerce scenario, when deployed online on the e-commerce platform, the user query tower model service and the vector index service can be deployed at the same time, and the vector representation of the user query word can be calculated in real time according to the user query information received by the system, and then the product can be recalled through the vector index service (index library service such as faiss).

[0072] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0073] Furthermore, the embodiment of the present disclosure also provides a resource recall device, referring to Figure 3 As shown, the resource recall device 300 may include a data acquisition module 310, a model fine-tuning module 320 and a resource recall module 330. Among them:

[0074] The data acquisition module 310 is used to acquire sample data, where the sample data includes multiple types of samples obtained according to the user's operation on the resource;

[0075] A model fine-tuning module 320 is used to construct a target loss function based on sample data, and fine-tune the pre-trained dual-tower model through the target loss function;

[0076] The resource recall module 330 is used to recall resources according to the query words input by the user based on the fine-tuned dual-tower model.

[0077] In an exemplary embodiment of the present disclosure, the resource recall device further includes a model pre-training module, which is used to pre-train a dual-tower model, wherein the dual-tower model includes a user tower and a resource tower, and the training process can be implemented as follows: obtaining user data and resource data, wherein the user data includes query terms and user information input by the user, and the resource data includes resource titles; inputting the user data into the user tower, and inputting the resource data into the resource tower to pre-train the dual-tower model, wherein the dual-tower model performs resource recall by comparing the similarity between the query terms and the resource titles.

[0078] In addition, the query words used for model training can be extracted from the resource title, and the training process can be implemented as follows: obtain the resource title and extract the target field from the resource title; input the target field into the user tower as a query word, and input the resource title after extracting the target field into the resource tower to pre-train the dual-tower model.

[0079] In an exemplary embodiment of the present disclosure, the above-mentioned sample data includes order samples, click samples, exposed but not clicked samples, and random negative samples, and the above-mentioned model fine-tuning module is specifically used to: determine the first loss function based on the order samples and the exposed but not clicked samples; determine the second loss function based on the click samples and the exposed but not clicked samples; determine the third loss function based on the click samples and the random negative samples; determine the fourth loss function based on the exposed but not clicked samples and the random negative samples; and construct a target loss function based on the first loss function, the second loss function, the third loss function and the fourth loss function.

[0080] In an exemplary embodiment of the present disclosure, the resource recall module is specifically used to: receive a query word input by a user; determine the similarity between the query word and the resource title of each resource in the resource library through a dual-tower model, and recall the resources based on the similarity. The process of determining the similarity can be implemented as follows: obtain a feature vector of user tower side input information through a dual-tower model, the user tower side input information includes the query word and the user information of the user; predetermine a feature vector of resource tower side input information through a dual-tower model, the resource tower side input information includes the attribute information of the resource and the resource title; calculate the vector inner product of the feature vector of the user tower side input information and the feature vector of the resource tower side input information, and determine the similarity based on the vector inner product.

[0081] The specific details of each module or unit in the above resource recall device have been described in detail in the corresponding resource recall method, so they will not be repeated here.

[0082] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0083] Figure 4 Schematic diagram of the structure of an electronic device in the embodiment of the present disclosure. Figure 4 , which shows a structural schematic diagram of an electronic device 400 suitable for implementing the embodiments of the present disclosure. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0084] like Figure 4 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 308 to a random access memory (RAM) 403 to implement the voice control method of the embodiment described in the present disclosure. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0085] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0086] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby implementing the voice control method as described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0087] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0088] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0089] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0090] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:

[0091] Acquire sample data, where the sample data includes multiple types of samples obtained according to user operations on resources;

[0092] Construct a target loss function based on sample data, and use the target loss function to fine-tune the pre-trained dual-tower model;

[0093] Recall resources based on the query terms entered by the user based on the fine-tuned dual-tower model.

[0094] Optionally, when the above one or more programs are executed by the electronic device, the electronic device may also execute other steps described in the above embodiments.

[0095] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0096] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0097] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0098] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0099] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0100] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0101] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0102] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A resource recall method, characterized in that: include: Acquire sample data, where the sample data includes multiple types of samples obtained according to user operations on resources; Constructing a target loss function according to the sample data, and fine-tuning the pre-trained dual-tower model by using the target loss function; Recall resources based on the fine-tuned dual-tower model according to the query term input by the user.

2. The resource recall method according to claim 1, characterized in that: The dual-tower model includes a user tower and a resource tower. The pre-training phase of the dual-tower model includes: Acquire user data and resource data, wherein the user data includes the query word and user information input by the user, and the resource data includes a resource title; The user data is input into the user tower, and the resource data is input into the resource tower to pre-train the dual-tower model. The dual-tower model recalls resources by comparing the similarity between the query word and the resource title.

3. The resource recall method according to claim 2, characterized in that: The method further comprises: Obtain the resource title, and extract the target field from the resource title; The target field is input into the user tower as the query word, and the resource title after the target field is intercepted is input into the resource tower to pre-train the dual-tower model.

4. The resource recall method according to claim 1, characterized in that: The sample data includes order samples, click samples, exposed but not clicked samples, and random negative samples; and constructing a target loss function based on the sample data includes: Determining a first loss function according to the order sample and the exposed but not clicked sample; Determining a second loss function according to the click sample and the exposed but not clicked sample; Determining a third loss function according to the click sample and the random negative sample; Determining a fourth loss function according to the exposed but not clicked samples and the random negative samples; The target loss function is constructed according to the first loss function, the second loss function, the third loss function and the fourth loss function.

5. The resource recall method according to claim 1, characterized in that: The method of recalling resources based on the fine-tuned dual-tower model according to the query word input by the user includes: receiving the query word input by the user; The similarity between the query term and the resource title of each resource in the resource library is determined through the dual-tower model, and resources are recalled based on the similarity.

6. The resource recall method according to claim 5, characterized in that: Determining the similarity between the query term and the resource title of each resource in the resource library by using the double-tower model includes: Obtaining a feature vector of the user tower side input information through the dual-tower model, wherein the user tower side input information includes the query word and the user information of the user; Predetermining the feature vector of the input information on the resource tower side through the dual-tower model, the input information on the resource tower side includes the attribute information of the resource and the resource title; The vector inner product of the feature vector of the user tower side input information and the feature vector of the resource tower side input information is calculated, and the similarity is determined based on the vector inner product.

7. A resource recall device, characterized in that: include: A data acquisition module, used to acquire sample data, wherein the sample data includes multiple types of samples obtained according to user operations on resources; A model fine-tuning module, used to construct a target loss function based on the sample data, and fine-tune the pre-trained dual-tower model through the target loss function; The resource recall module is used to recall resources according to the query words input by the user based on the fine-tuned dual-tower model.

8. The resource recall module according to claim 7, characterized in that: The sample data includes order samples, click samples, exposed but not clicked samples, and random negative samples; the model fine-tuning module is used to: Determining a first loss function according to the order sample and the exposed but not clicked sample; Determining a second loss function according to the click sample and the exposed but not clicked sample; Determining a third loss function according to the click sample and the random negative sample; Determining a fourth loss function according to the exposed but not clicked samples and the random negative samples; The target loss function is constructed according to the first loss function, the second loss function, the third loss function and the fourth loss function.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

10. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 6 by executing the executable instructions.