Network object processing method, device, electronic device and readable storage medium

By using the trained word weight model to calculate the word fragment correlation between network objects and search text, the problem of misrecall recall of network objects in the prior art is solved, and the search effect is improved.

CN113961665BActive Publication Date: 2024-12-03BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111083673.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-15
Publication Date
2024-12-03
Estimated Expiration
2041-09-15

AI Technical Summary

Technical Problem

In the prior art, when sorting network objects based on the sorting model, it is easy to lead to misrecalls and poor search results.

Method used

The trained first word weight model and second word weight model are used to obtain the word weights of the target search text and network objects respectively, calculate the word fragment correlation, and sort based on the correlation.

Benefits of technology

By subdividing text into word segments and setting word weights, the accuracy of search correlation calculation is improved, the accuracy of sorting is improved, and the search effect is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113961665B_ABST
    Figure CN113961665B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a network object processing method, device, electronic device and readable storage medium. In the method, according to the trained first word weight model and second word weight model, the first word weight of each first word fragment in the target search text and the second word weight of each second word fragment in the first description text of the target network object are respectively obtained; the target network object is searched according to the target search text. For any target network object, according to each first word weight and each second word weight of the target network object, the fragment correlation of each first word fragment and each second word fragment is calculated, and the fragment correlation is positively correlated with the first word weight and the second word weight. Based on the fragment correlation, the search correlation between the target search text and the target network object is calculated, and sorted according to the search correlation. In this way, the calculated search correlation can be made more accurate to a certain extent, thereby improving the search effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of network technology, and in particular relates to a network object processing method, device, electronic equipment and readable storage medium. Background Art

[0002] At present, with the continuous development of network technology, more and more network objects are provided in the network platform. When using the network platform, users often type in search text to search for the required network objects from the network platform. However, there are often multiple network objects searched based on the search text, so it is necessary to sort the searched network objects to display them to the user.

[0003] In the related art, the searched network objects are often directly sorted based on the sorting model. In this way, sometimes the wrongly recalled network objects are displayed to the user at the front, so the search effect is poor. Summary of the invention

[0004] The present invention provides a network object processing method, device, electronic device and readable storage medium to solve the problem of poor search effect.

[0005] In a first aspect, the present invention provides a network object processing method, the method comprising:

[0006] According to the trained first word weight model and the second word weight model, respectively obtaining the first word weight of each first word segment in the target search text and the second word weight of each second word segment in the first description text of the target network object; the target network object is searched according to the target search text;

[0007] For any of the target network objects, calculating the segment correlation between each of the first word segments and each of the second word segments according to each of the first word weights and each of the second word weights of the target network object; the segment correlation is positively correlated with the first word weight and the second word weight;

[0008] Based on the segment relevance, the search relevance between the target search text and the target network object is calculated, and sorted according to the search relevance.

[0009] In a second aspect, the present invention provides a network object processing device, the device comprising:

[0010] An acquisition module, used to acquire the first word weight of each first word segment in the target search text and the second word weight of each second word segment in the first description text of the target network object according to the trained first word weight model and the second word weight model; the target network object is searched according to the target search text;

[0011] A first calculation module is used to calculate, for any of the target network objects, the segment correlation between each of the first word segments and each of the second word segments according to each of the first word weights and each of the second word weights of the target network object; the segment correlation is positively correlated with the first word weight and the second word weight;

[0012] The second calculation module is used to calculate the search relevance between the target search text and the target network object based on the segment relevance, and sort them according to the search relevance.

[0013] In a third aspect, the present invention provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the program.

[0014] In a fourth aspect, the present invention provides a readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the above method.

[0015] In an embodiment of the present invention, the first word weight of each first word fragment in the target search text and the second word weight of each second word fragment in the first description text of the target network object are respectively obtained according to the trained first word weight model and the second word weight model; the target network object is searched according to the target search text. For any target network object, the fragment relevance of each first word fragment and each second word fragment is calculated according to each first word weight and each second word weight of the target network object, and the fragment relevance is positively correlated with the first word weight and the second word weight. Based on the fragment relevance, the search relevance of the target search text and the target network object is calculated, and sorted according to the search relevance. In this way, by subdividing the target search text and the first description text into word fragments, setting word weights for each word fragment in the target search text and the first description text in a targeted manner, and subsequently calculating the search relevance based on the word weights, the semantics of the two can be more carefully and accurately portrayed during calculation to a certain extent, and then the calculated search relevance can be made more accurate to a certain extent, the accuracy of sorting can be improved, and thus the search effect can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1is a flowchart of a method for processing a network object provided by an embodiment of the present invention;

[0018] Figure 2 is a schematic diagram of a model structure provided by an embodiment of the present invention;

[0019] Figure 3 is a schematic diagram of a training sample structure provided by an embodiment of the present invention;

[0020] Figure 4 is another schematic diagram of a model structure provided by an embodiment of the present invention;

[0021] Figure 5 It is a schematic diagram of an overall process provided by an embodiment of the present invention;

[0022] Figure 6 is a structural diagram of a network object processing device provided by an embodiment of the present invention;

[0023] Figure 7 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0025] Figure 1 is a flowchart of a method for processing a network object provided by an embodiment of the present invention. Figure 1 As shown, the method may include:

[0026] Step 101: According to the trained first word weight model and the second word weight model, the first word weight of each first word fragment in the target search text and the second word weight of each second word fragment in the first description text of the target network object are respectively obtained; the target network object is searched according to the target search text.

[0027] In an embodiment of the present invention, the trained first word weight model and the second word weight model may be obtained by pre-training. The first word weight model may be used to determine the word weights of each word fragment in the search text, and the second word weight model may be used to determine the word weights of each word fragment in the first description text of the target network object. Among them, the word weight may be used to characterize the semantic importance of the word fragment in the text, that is, the degree of influence of the semantics conveyed by the word fragment on the overall semantics of the text in which the word fragment is located. The greater the semantic importance, the greater the word weight. The word weight model can dynamically model the weight of the word fragment, that is, the semantic influence of the same word fragment in different texts may be different, and accordingly, the word weights of the same word fragment in different texts determined based on the word weight model may be different. Further, in an embodiment of the present invention, when a search request is received, the search text carried in the search request can be extracted as the target search text, and then, based on the target search text, a search can be performed in the network platform to recall network objects related to the target search text, thereby obtaining the target network object. Among them, there may be multiple target network objects. Then, the description text of the target network object can be obtained, thereby obtaining the first description text. The first description text may include the name, label, introduction and other information of the target network object.

[0028] Furthermore, the first word segment can be any word segment included in the target search text, and a first word segment can be a word in the target search text. The second word segment can be any word segment included in the first description text of the target network object, and a second word segment can be a word in the first description text. The specific length of the first / second word segment can be determined by the word segmentation granularity. For example, the larger the word segmentation granularity, the more characters included in the first / second word segment, and the longer the segment. The smaller the word segmentation granularity, the fewer characters included in the first / second word segment, and the shorter the segment.

[0029] Step 102: For any of the target network objects, based on the first word weights and the second word weights of the target network object, calculate the segment correlation between each of the first word segments and each of the second word segments; the segment correlation is positively correlated with the first word weight and the second word weight.

[0030] In an embodiment of the present invention, for any first word fragment, the correlation between the first word fragment and each second word fragment of the target network object can be calculated, and then p*q fragment correlations can be obtained. Among them, p can represent the total number of first word fragments, and q can represent the total number of second word fragments of the target network object. Among them, the fragment correlation between the first word fragment and the second word fragment can characterize the degree of correlation between the first word fragment and the second word fragment. The higher the fragment correlation, the stronger the semantic association between the first word fragment and the second word fragment. The first description texts of different target network objects can be different, and therefore, the number of second word fragments of different target network objects can be different.

[0031] Step 103: Based on the segment relevance, calculate the search relevance between the target search text and the target network object, and sort them according to the search relevance.

[0032] In an embodiment of the present invention, the fragment relevance can characterize the relevance between the target search text and each part in the first description text of the target network object. Therefore, the search relevance between the target search text and the target network object can be further determined based on all the fragment relevances. The search relevance can characterize the overall relevance between the target search text and the target network object. If the semantic relevance is stronger, that is, the search relevance is higher, it can be determined that the target network object is more in line with user needs. Accordingly, the target network objects can be sorted in such a way that the higher the search relevance, the higher the position.

[0033] In actual application scenarios, the M target network objects at the top can also be returned to the user. Furthermore, since the word fragments with higher word weights contribute more to the semantics of the text, in the embodiment of the present invention, a larger fragment relevance is set for the fragments with larger word weights, which can increase the proportion of the fragment relevance calculated based on the fragments with higher importance relative to the fragment relevance of other fragments in the search relevance, thereby ensuring the accuracy of sorting using the search relevance calculated based on the fragment relevance to a certain extent, so that the target network objects that better meet the user's needs can be ranked in a higher position, thereby ensuring the search effect.

[0034] The network object processing method provided by the embodiment of the present invention obtains the first word weight of each first word fragment in the target search text and the second word weight of each second word fragment in the first description text of the target network object according to the trained first word weight model and the second word weight model; the target network object is searched according to the target search text. For any target network object, the fragment relevance of each first word fragment and each second word fragment is calculated according to each first word weight and each second word weight of the target network object, and the fragment relevance is positively correlated with the first word weight and the second word weight. Based on the fragment relevance, the search relevance of the target search text and the target network object is calculated, and sorted according to the search relevance. In this way, by subdividing the target search text and the first description text into word fragments, setting word weights for each word fragment in the target search text and the first description text in a targeted manner, and calculating the search relevance based on the word weights in the subsequent calculation, the semantics of the two can be more carefully and accurately described during the calculation to a certain extent, and then the calculated search relevance can be made more accurate to a certain extent, and the accuracy of the sorting can be improved, thereby improving the search effect.

[0035] Optionally, the operation of calculating the segment relevance between each of the first word segments and each of the second word segments according to each of the first word weights and each of the second word weights of the target network object may specifically include:

[0036] Step S21, detecting whether a first target word segment hits a second target word segment; the first target word segment is any of the first word segments, and the second target word segment is any of the second word segments of the target network object.

[0037] In an embodiment of the present invention, it is possible to detect whether the contents of the first target word segment and the second target word segment are consistent. If the contents of the two are consistent, it is possible to determine that the first target word segment hits the second target word segment. Otherwise, it is possible to determine that the first target word segment does not hit the second target word segment. Alternatively, it is also possible to detect the text similarity between the first target word segment and the second target word segment based on a preset text similarity detection algorithm. If the text similarity is greater than a preset similarity threshold, it is possible to determine that the first target word segment hits the second target word segment. Otherwise, it is possible to determine that the first target word segment does not hit the second target word segment. Alternatively, a hit detection model may be pre-constructed, and based on the hit detection model, it is possible to detect whether the first target word segment hits the second target word segment.

[0038] Step S22: If the first target word segment hits the second target word segment, the segment correlation between the first target word segment and the second target word segment is calculated according to the first word weight of the first target word segment and the second word weight of the second target word segment.

[0039] In an embodiment of the present invention, if the first target word segment hits the second target word segment, it can be determined that there is a high probability that the first target word segment and the second target word segment are correlated. Therefore, the fragment correlation between the two can be calculated only when the first target word segment hits the second target word segment.

[0040] In the embodiment of the present invention, it is first detected whether the first target word segment hits the second target word segment. If so, the segment correlation between the first target word segment and the second target word segment is calculated, thereby avoiding unnecessary computing operations to a certain extent, thereby saving computing resources.

[0041] Optionally, the operation of calculating the segment relevance between the first target word segment and the second target word segment according to the first word weight of the first target word segment and the second word weight of the second target word segment may specifically include:

[0042] Step S31, determining a matching level value between the first target word segment and the second target word segment according to the first word weight and the second word weight; the matching level value is negatively correlated with the weight difference, and the weight difference is the difference between the first word weight and the second word weight.

[0043] In an embodiment of the present invention, the matching level value can be used to characterize the matching degree between the first target word fragment and the second target word fragment. Furthermore, since the word weight can more accurately characterize the semantic contribution of the word fragment in the text in which it is located, the matching level value between the word fragments is determined based on the word weight in this step, so that the semantic contribution of the word fragments can be taken into account as a whole in the process of determining the matching level value, and then the determined matching level value is more suitable for the search text and the first description text currently involved in the calculation to a certain extent, thereby ensuring that the determined matching level value is in line with the current situation. At the same time, if the word weights are closer, it can be determined that the word fragments are more matched. Therefore, setting the matching level value to be negatively correlated with the weight difference can ensure the accuracy of the determined matching level value to a certain extent.

[0044] Step S32: Calculate the segment correlation based on the matching level value, the first word weight, and the second word weight; the segment correlation is positively correlated with the matching level value.

[0045] In the embodiment of the present invention, since the matching level value can characterize the matching degree between the first target word segment and the second target word segment participating in the current calculation to a certain extent, the matching level value can be further introduced in the process of calculating the segment correlation. At the same time, the higher the matching level value, the more similar the first target word segment and the second target word segment participating in the current calculation can be to a certain extent reflected. Therefore, by calculating in a manner in which the segment correlation is positively correlated with the matching level value, the accuracy of the calculation result can be ensured to a certain extent.

[0046] In an embodiment of the present invention, the matching level value of the first target word segment and the second target word segment is determined based on the first word weight and the second word weight; the matching level value is negatively correlated with the weight difference, and the weight difference is the difference between the first word weight and the second word weight. The segment correlation is calculated based on the matching level value, the first word weight and the second word weight; the segment correlation is positively correlated with the matching level value. In this way, the matching level values ​​of the two word segments involved in the current calculation are first determined based on the word weights of the two word segments, and the matching level value is further introduced in the subsequent calculation process, so that the matching situation between the word segments can be taken into account in the calculation process, and then to a certain extent, the calculated segment correlation can more accurately measure the correlation between the first target word segment and the second target word segment from multiple aspects, thereby improving the accuracy of the segment correlation.

[0047] Optionally, the operation of determining the matching level value of the first target word segment and the second target word segment according to the first word weight and the second word weight may specifically include:

[0048] Step S41, respectively determine the weight levels corresponding to the preset weight range to which the first word weight and the second word weight belong, and obtain the first level and the second level; the weight level is positively correlated with the end value of the preset weight range.

[0049] In an embodiment of the present invention, the preset weight range may be pre-divided, and the weight levels corresponding to different preset weight ranges may be different. Specifically, the larger the end value of the preset weight range, the higher the corresponding set weight level may be. For example, assuming that the preset weight range includes: range A: (0~0.3], range B: (0.3~0.5], range C: (0.5~0.8] and range D: (0.8~1], then the weight levels corresponding to ranges A~D may increase successively. Among them, the weight level corresponding to range A may be a "redundant level", the weight level corresponding to range B may be a "general level", the weight level corresponding to range C may be a "key level", and the weight level corresponding to range D may be a "core level".

[0050] In this step, the first word weight / second word weight can be compared with the minimum end value and the maximum end value of each preset weight range. If the first word weight / second word weight is greater than the minimum end value of the preset weight range and not greater than the maximum end value, it can be determined that the first word weight / second word weight belongs to the preset weight range. Accordingly, the weight level corresponding to the preset weight range to which the first word weight belongs can be determined as the first level, and the weight level corresponding to the preset weight range to which the second word weight belongs can be determined as the second level.

[0051] Step S42: determine the matching level value according to the first level and the second level; the matching level value is positively correlated with the first level and the second level, and negatively correlated with the level difference between the first level and the second level.

[0052] In an embodiment of the present invention, corresponding level values ​​may be pre-set for different weight level combinations. The weight level combination may include two weight levels. For example, when four weight levels are included, 16 weight level combinations may be generated accordingly. The higher the weight level included in the weight level combination and the smaller the level difference of the included weight levels, the larger the corresponding level value may be. In a specific implementation, the level value corresponding to the weight level combination consisting of the first level and the second level may be detected to obtain the matching level value.

[0053] In an embodiment of the present invention, the weight levels corresponding to the preset weight ranges to which the first word weight and the second word weight belong are determined respectively to obtain the first level and the second level; the weight level is positively correlated with the end value of the preset weight range. According to the first level and the second level, the matching level value is determined; the matching level value is positively correlated with the first level and the second level, and negatively correlated with the level difference between the first level and the second level. In this way, a higher matching level value can be set for word fragments that are closer in word weight, that is, more matched, so that the accuracy of the matching level value can be ensured to a certain extent. At the same time, the operation of determining the matching level value can be realized by only determining the preset weight range to which the two belong, so that the efficiency of determining the matching level value can be ensured to a certain extent.

[0054] Furthermore, when the first target word fragment does not hit the second target word fragment, the fragment correlation between the first target word fragment and the second target word fragment can be directly set to 0. The search correlation can be positively correlated with the fragment correlation. For example, the above operation of calculating the search correlation between the target search text and the target network object based on the fragment correlation can specifically include: calculating the sum of all fragment correlations as the search correlation. Among them, the higher the search correlation, the higher the correlation level between the target search text and the target network object. In the embodiment of the present invention, the search correlation is calculated by combining the fragment correlation calculated by the word weight and the matching level value, which can improve the accuracy of the calculated search correlation to a certain extent, thereby solving the problem of inaccurate identification of the correlation level.

[0055] In specific implementation, when the first target word fragment hits the second target word fragment, its corresponding hit identifier can be set to the first identifier; when the first target word fragment does not hit the second target word fragment, its corresponding hit identifier can be set to the second identifier. Among them, the first identifier can take the value of "1", and the second identifier can take the value of "0". Correspondingly, for the first target word fragment and the second target word fragment participating in the calculation this time, the fragment correlation can be calculated according to the hit identifier, the first word weight, the second word weight and the matching level value set for them. Among them, when the hit identifier is the second identifier, the value of the fragment correlation can be 0. Finally, the sum of all fragment correlations is calculated as the search correlation. For example, the hit identifier, the first word weight, the second word weight and the matching level value can be used as the input of a preset formula, and then the output of the preset formula is used as the search correlation. The preset formula can be:

[0056]

[0057] Among them, Relevance represents the search relevance, Qi represents the first word weight of the first target word segment, Ti represents the second word weight of the second target word segment, Xi represents the hit identifier of the first target word segment and the second target word segment participating in the current calculation, and the value of Xi can be {0,1}, and Li represents the matching level value of the first target word segment and the second target word segment participating in the current calculation. In this preset formula, the search relevance is calculated by combining the word weights and matching level values ​​of the search text and the description text of the network object, which can ensure the accuracy of the calculated search relevance to a certain extent.

[0058] Optionally, the first word weight model can be trained and obtained in the following way:

[0059] Step S51, segmenting the first historical text and the second description text of the first related network object respectively to obtain first sample word fragments and second sample word fragments; the first related network object is a network object having user historical operation behavior among network objects searched according to the first historical text.

[0060] In an embodiment of the present invention, the first historical text may be a used search text. For example, the historical search record of the network platform may be obtained, and the search text used in the historical search operation may be determined according to the historical search record, thereby obtaining the first historical text. Further, the user's historical operation behavior may be a click operation on the network object searched according to the first historical text. For example, the user's click behavior data corresponding to the historical search record may be obtained, and the network object that the user finally clicked and selected among the multiple network objects searched may be determined according to the user's click behavior data, thereby obtaining the first related network object. In actual scenarios, since users often click and select network objects that meet their search requirements, it can be determined that the first related network object meets the search requirements reflected by the first historical text, and the second description text of the first related network object has a high correlation with the first historical text. Among them, the second description text of the first related network object is the description text of the first related network object, for example, the product name of the first related network object. Accordingly, the embodiment of the present invention uses the first historical text and the second description text for sample construction, which can ensure that the training sample can provide valuable information to a certain extent, thereby ensuring the training effect. In specific implementation, word segmentation can be performed according to the minimum granularity to obtain sample word fragments. By segmenting words according to the minimum granularity, the constructed samples can be more refined, thus ensuring the training effect to a certain extent.

[0061] Step S52: setting a first sample word weight for each of the first sample word fragments according to the number of occurrences of each of the first sample word fragments in a first set; the first set includes the first sample word fragments and the second sample word fragments.

[0062] In the embodiment of the present invention, if the first sample word fragment in the first historical text appears more times in the first set, it can be explained to a certain extent that the first sample word fragment is more important and has a greater semantic contribution. Conversely, if the first sample word fragment in the first historical text appears less times in the first set, it can be explained to a certain extent that the first sample word fragment is less important and has a smaller semantic contribution. Therefore, in this step, the first sample word weight can be set for each first sample word fragment in the first historical text based on the number of occurrences, thereby ensuring the accuracy of the first sample word weight to a certain extent.

[0063] Step S53: training and acquiring the first word weight model according to the first historical text and the weights of each of the first sample words.

[0064] For example, the first historical text can be used as the input of a pre-built basic model to obtain the prediction value of the basic model. Then, the model loss value is calculated based on the prediction value and the weight of the first sample word, and the basic model is adjusted according to the loss value. Then, when the adjusted basic model does not meet the convergence condition, the above process can be repeated until the convergence condition is met, thereby achieving deep training. Among them, the convergence condition can be pre-set. For example, the convergence condition can include a loss value less than a preset value, a training number greater than a preset number threshold, and so on. Specifically, the basic model can be a semantic modeling network based on Transformer. Figure 2 is a schematic diagram of a model structure provided by an embodiment of the present invention, such as Figure 2 As shown, the basic model can extract segment features, character features and position features of each segment / character based on the input, and vectorize each type of feature based on the embedding layer. Then, the pooling operation can be performed based on the pooling layer (sum pooling), and semantic encoding can be performed based on the encoding layer (Transformer-base encode layer). Then, the encoding result is converted into a numerical value within the numerical range required for the loss function calculation through the subnet layer (subnet layer), and the loss value is calculated through the loss function layer (regression loss). Further, when calculating the model loss value, the predicted value and the first sample word weight can be input into the first preset loss function, and the output value of the first preset loss function is obtained as the model loss value. Among them, the first preset loss function can be pre-selected according to actual needs. For example, the preset loss function can be a regression LOSS function to ensure the computational efficiency of the first word weight model of the final training when predicting (infer) online. Specifically, the use of the regression LOSS function in the training stage can enable the training stage to train the basic model to process all word segments contained in the text in parallel at one time, so that the model can learn the ability to output the word weight of each word segment in the search text at one time. In this way, when the trained first-word weight model is applied online, the online prediction efficiency can be improved.

[0065] In the embodiment of the present invention, training data is obtained based on the first historical text and the description text of the network object with the user's historical operation behavior among the network objects searched based on the first historical text, and the first word weight model is obtained through training based on the training data. In this way, it can be ensured to a certain extent that the trained first word weight model can accurately set word weights for word fragments in the search text when it is actually applied.

[0066] Optionally, the operation of setting a first sample word weight for each of the first sample word segments according to the number of occurrences of each of the first sample word segments in the first set may specifically include:

[0067] Step S61, determining a hit rate of the first sample word fragments according to a first ratio between the number of occurrences of each of the first sample word fragments in the first set and the number of the second description texts; the hit rate is positively correlated with the first ratio.

[0068] In actual applications, when searching with different first historical texts, the number of first related network objects that the user finally clicks on may be different, and accordingly, the number of second description texts may be different. The more the number of second description texts, the more times the first sample word fragments appear in the first set. Conversely, the fewer the number of second description texts, the fewer times the first sample word fragments appear in the first set. If the weight of the first sample word is directly determined based only on the number of times the first sample word fragments appear in the first set, the problem of inaccurate setting of the weight of the first sample word may occur.

[0069] In this step, the first ratio is further calculated based on the number of occurrences and the number of second description texts to determine the hit rate. Since the hit rate takes into account the number of occurrences and the number of second description texts, when the weight of the first sample word is subsequently set based on the hit rate, the problem of inaccurate setting due to quantity differences can be avoided to a certain extent. Specifically, the first ratio can be directly determined as the hit rate to improve the efficiency of determining the hit rate. In one implementation, the second description text and the first historical text can be aggregated to generate a bipartite graph, thereby determining the hit rate from the first ratio. The bipartite graph may include the hit rate of each first sample word fragment.

[0070] Step S62: setting a first sample word weight for each of the first sample word segments according to the hit rate; the first sample word weight is positively correlated with the hit rate.

[0071] In an embodiment of the present invention, the hit rate can represent the importance of the first sample word segment. If the hit rate is larger, it can be said that the importance is higher, and then a larger first sample word weight can be set. Conversely, if the hit rate is smaller, it can be said that the importance is lower, and then a smaller first sample word weight can be set. Specifically, the hit rate can be used as the input of a preset setting function, and the output of the preset setting function can be used as the first sample word weight. The output of the preset setting function is positively correlated with the input.

[0072] In an embodiment of the present invention, the hit rate of the first sample word fragment is determined according to the first ratio between the number of occurrences of each first sample word fragment in the first set and the number of second description texts. The hit rate is positively correlated with the first ratio. Finally, the first sample word weight is set for each first sample word fragment according to the hit rate, and the first sample word weight is positively correlated with the hit rate. In this way, the problem of the first sample word weight being set inaccurate due to the different numbers of first related network objects corresponding to different first historical texts can be avoided, thereby ensuring the quality of the constructed sample.

[0073] Optionally, the second word weight model can be trained and obtained in the following way:

[0074] Step S71, segment the second historical text and the third description text of the second related network object respectively to obtain third sample word fragments and fourth sample word fragments; the second related network object is a network object with user historical operation behavior among the network objects searched according to the second historical text.

[0075] Specifically, the implementation method of this step is similar to the implementation method of the aforementioned step S51, and reference may be made to the relevant description of the aforementioned step S51, which will not be repeated here. It should be noted that the second historical text may be the same as the aforementioned first historical text. Accordingly, in one implementation method of the present invention, the first sample word fragment and the second sample word fragment obtained by segmenting the first historical text and the second description text of the first related network object may be reused, and the first sample word fragment and the second sample word fragment may be used as the third sample word fragment and the fourth sample word fragment, respectively, thereby saving implementation costs. It should be noted that the embodiment of the present invention may also perform a preprocessing operation, such as a normalization operation, before processing the first historical text / the second historical text and the second description text / the third description text, so as to make the text more standardized, thereby facilitating subsequent processing.

[0076] Step S72: setting a second sample word weight for each of the fourth sample word fragments according to the number of occurrences of each of the fourth sample word fragments in the second set; the second set includes the third sample word fragment and the fourth sample word fragment.

[0077] In the embodiment of the present invention, if the fourth sample word fragment in the third description text appears more times in the second set, it can be explained to a certain extent that the fourth sample word fragment is more important and has a greater semantic contribution. Conversely, if the fourth sample word fragment in the third description text appears less times in the second set, it can be explained to a certain extent that the fourth sample word fragment is less important and has a smaller semantic contribution. Therefore, in this step, the second sample word weight can be set for each fourth sample word fragment in the third description text based on the number of occurrences, thereby ensuring the accuracy of the second sample word weight to a certain extent.

[0078] Specifically, the hit rate of the fourth sample word fragment can be determined according to the second ratio between the number of occurrences of each fourth sample word fragment in the second set and the number of third description texts; the hit rate of the fourth sample word fragment is positively correlated with the second ratio. According to the hit rate of the fourth sample word fragment, a second sample word weight is set for each fourth sample word fragment. The second sample word weight is positively correlated with the hit rate of the fourth sample word fragment. Among them, the implementation method of each step and the effect that can be achieved can refer to the above-mentioned related description, which will not be repeated here.

[0079] Step S73: training and acquiring the second word weight model according to the third description text and each of the second sample word weights.

[0080] Specifically, the third description text and each second sample word weight may be used as training data to train and obtain the second word weight model.

[0081] In the embodiment of the present invention, training data is obtained based on the second historical text and the third description text of the network object with the user's historical operation behavior in the network object searched based on the second historical text, and the second word weight model is obtained by training based on the training data. In this way, it can be ensured to a certain extent that the trained second word weight model can accurately set word weights for word fragments in the description text of the network object when it is actually applied.

[0082] Optionally, before the operation of training and acquiring the second word weight model according to the third description text and the weights of each of the second sample words, the embodiment of the present invention may further include the following steps:

[0083] Step S81: for any of the fourth sample word fragments, based on a preset knowledge graph, determine the category to which the network object represented by the fourth sample word fragment belongs, and obtain a target category; the preset knowledge graph is mined based on network objects under various categories in the network platform.

[0084] In an embodiment of the present invention, offline mining can be performed in advance to generate a preset knowledge graph. Wherein, the network objects under the same category represent the same entity. For example, all network objects representing ingredients can be regarded as a category, all network objects representing dish names can be regarded as a category, all network objects representing locations can be regarded as a category, all network objects representing tastes can be regarded as a category, and all network objects representing brands can be regarded as a category. Furthermore, based on the relevant information of these network objects, the atomic words of each category can be mined to generate a preset knowledge graph. Wherein, the number of network objects under different categories can be different. For example, the number of network objects representing brands can be greater than 1000, the number of network objects representing ingredients can be greater than 2000, the number of network objects representing dish names can be greater than 240000, the number of network objects representing locations can be greater than 50000, and the number of network objects representing tastes can be greater than 100.

[0085] Furthermore, the fourth sample word fragment determined based on the user behavior data can be corrected in combination with the preset knowledge graph. Specifically, the category of the network object represented by the fourth sample word fragment can be determined based on the preset knowledge graph. For example, the atomic word contained in the fourth sample word fragment can be obtained, and then the category to which the atomic word belongs in the preset knowledge graph can be determined to obtain the target classification. Since the preset knowledge graph is obtained based on the mining of network objects in the network platform, the accuracy of the target classification determined based on the preset knowledge graph can be ensured to a certain extent.

[0086] Step S82: when the weight of the second sample word of the fourth sample word segment is greater than a first preset threshold and the target category is not a designated key category, reduce the weight of the second sample word.

[0087] In an embodiment of the present invention, the designated key category and the first preset threshold value may be pre-set according to actual needs. For example, "dish name" and "taste" may be selected as key categories. Furthermore, if the target category is not the designated key category and the second sample word weight is greater than the first preset threshold value, it can be determined that the second sample word weight is too high, and the second sample word weight can be reduced accordingly to achieve data correction, thereby generating more reliable training data and avoiding bias problems. Specifically, the second sample word weight can be updated to the difference between the second sample word weight and the preset value, thereby achieving a reduction.

[0088] Step S83: when the weight of the second sample word of the fourth sample word segment is less than the second preset threshold and the target category is the key category, increase the weight of the second sample word.

[0089] In an embodiment of the present invention, the second preset threshold may be pre-set according to actual needs, and the present invention does not limit this. Furthermore, if the target category is not a designated key category and the second sample word weight is less than the second preset threshold, it can be determined that the second sample word weight is low, and the second sample word weight can be increased accordingly to achieve data correction, thereby generating more reliable training data. Specifically, the second sample word weight can be updated to the sum of the second sample word weight and the preset value, thereby achieving an increase. For example, Figure 3 is a schematic diagram of a training sample structure provided by an embodiment of the present invention, such as Figure 3 As shown, the text can be preprocessed first, that is, the second historical text and the third description text are preprocessed, and then user behavior alignment is performed, that is, the second sample word weight is set for each fourth sample word segment in the third description text. Then, knowledge correction is performed based on the offline mined commodity knowledge (that is, the preset knowledge graph) to obtain the final training sample.

[0090] Since the description text of a network object often contains multiple fragments representing entities, assuming that the network object is a product, and the description text of the product is "(curry flavor) delicious barbecue rice", the description text contains two word fragments representing entities, "curry" and "barbecue rice". Therefore, traditional matching methods are prone to mismatching of search terms and product names. For example, when the user enters the search text "curry", the search results may recall the less relevant product "(curry flavor) delicious barbecue rice".

[0091] In an embodiment of the present invention, for any fourth sample word fragment, based on a preset knowledge graph, the category of the network object represented by the fourth sample word fragment is determined to obtain a target classification; the preset knowledge graph is mined based on network objects under various categories in the network platform. When the weight of the second sample word of the fourth sample word fragment is greater than the first preset threshold, and the target classification is not a designated key classification, the weight of the second sample word is reduced. When the weight of the second sample word of the fourth sample word fragment is less than the second preset threshold, and the target classification is a key classification, the weight of the second sample word is increased. In this way, the data is corrected based on the preset knowledge graph, and the preset knowledge graph is integrated into the training link of the second word weight model, so that the training data of the second word weight model is more accurate, so that the relationship between multiple entities can be effectively modeled to a certain extent, and the second word weight model obtained based on the training data is improved. The processing effect of the text containing multiple entities.

[0092] Optionally, the operation of training and acquiring the second word weight model according to the third description text and the weights of each of the second sample words may specifically include:

[0093] Step S91: Using the third description text as an input of an initial model, so as to predict the predicted word weight and the predicted classification value of each fourth sample word segment in the third description text through the initial model.

[0094] For example, the third description text may be used as an input of a pre-built initial model to obtain a prediction value of the initial model, wherein the prediction value may include a prediction word weight and a prediction classification value, and the classification represented by the prediction classification value is predicted by the initial model based on the third description text.

[0095] Step S92, calculating a first loss value according to the predicted word weight and the second sample word weight, and calculating a second loss value according to the predicted classification value and the true classification value; the true classification value is used to characterize the target classification.

[0096] In an embodiment of the present invention, when calculating the first loss value, the predicted word weight and the second sample word weight may be input into a second preset loss function, and the output value of the second preset loss function may be obtained as the first loss value. The second preset loss function may be pre-selected according to actual needs. For example, the second preset loss function may be a regression LOSS function to ensure the computational efficiency of the final trained second word weight model during online prediction (infer).

[0097] Furthermore, when calculating the second loss value, the predicted classification value and the true classification value may be input into a third preset loss function, and the output value of the third preset loss function may be obtained as the second loss value. The second loss value may be used to characterize the gap between the classification predicted by the model and the true classification, that is, the ability of the model to predict the classification may be characterized. The third preset loss function may be pre-selected according to actual needs, and is not limited here.

[0098] Step S93: Adjust the initial model according to the first loss value and the second loss value to obtain the second word weight model.

[0099] In the embodiment of the present invention, the initial model may be a Transformer-based semantic modeling network. Figure 4 is another schematic diagram of a model structure provided by an embodiment of the present invention, such as Figure 4As shown, the initial model can extract segment features, character features and position features of each segment / character based on the input, and vectorize each type of feature based on the embedding layer. Then, the pooling operation can be performed based on the pooling layer (sum pooling), and semantic encoding can be performed based on the encoding layer (Transformer-base encode layer). Then, the predicted word weights and predicted classification values ​​in the encoding results are converted into numerical values ​​within the numerical range required for calculating the second preset loss function, and the numerical values ​​within the numerical range required for calculating the third preset loss function through two subnet layers (subnet layer), and the first loss value is calculated by the loss function layer (regression loss), and the second loss value is calculated by the loss function layer (entity classify-loss). In actual application, the subnet layer can also be merged into one, and the present invention does not limit this. Finally, the total loss value (total-Loss) can be obtained based on the first loss value and the second loss value. In the embodiment of the present invention, in order to show the enhanced entity modeling, not only the entity information is introduced in the training data construction. Furthermore, in the model structure, by adding an additional loss function for entity classification, the total loss value of the model is calculated based on the first loss value and the second loss value to achieve training, which can ensure the training effect to a certain extent.

[0100] Furthermore, the weighted sum of the first loss value and the second loss value may be calculated to obtain a total loss value. Then, the initial model may be adjusted based on the total loss value. When the adjusted initial model does not meet the convergence condition, the above process may be repeated until the convergence condition is met. The convergence condition may be pre-set, and for example, the convergence condition may include a loss value less than a preset value, a number of training times greater than a preset number threshold, and the like.

[0101] In an embodiment of the present invention, the third description text is used as the input of the initial model to predict the predicted word weights and predicted classification values ​​of each fourth sample word segment in the third description text through the initial model. A first loss value is calculated based on the predicted word weight and the second sample word weight, and a second loss value is calculated based on the predicted classification value and the true classification value; the true classification value is used to characterize the target classification. According to the first loss value and the second loss value, the initial model is adjusted to obtain a second word weight model. In this way, by further introducing the second loss value calculated based on the predicted classification value and the true classification value, the initial model can be further adjusted in combination with the initial model's ability to classify entities in the text, thereby ensuring the model training effect to a certain extent.

[0102] The following is an explanation using an exemplary scenario. In a mobile product search scenario, for example, in an e-commerce mobile search (Located-Based Service, LBS) scenario, the user can enter a search term (Query) in the search box, and accordingly, the platform can return a list page result with merchants and products (SPU, Standard Product Unit). Since search terms are generally short, and product naming in product searches lacks unified standards and contains multiple entities. Ranking models often lack features that accurately characterize the level of matching relevance, which can cause the wrongly recalled products to be ranked higher, thus affecting the user's search experience.

[0103] In one related technology, a statistical matching method is often used to achieve sorting, such as BM25, TF-IDF and other matching methods. However, this method lacks dynamic modeling capabilities and generalization capabilities, cannot fit complex semantic spaces, and has poor sorting effects. In another related technology, a model is often directly trained to obtain the correlation between the target search text and the target network object, such as the DSSM model. Based on this model, the search correlation between the target search text and the target network object is directly fitted. In this method, the required training samples need to cover the existence of correlation, the absence of correlation, and complex samples (Hard Negative Sample). Therefore, it is difficult to obtain training samples, and complex samples will also limit the accuracy of the model obtained by the final training. In addition, since product names often contain multiple entities and search terms are often short, it will make the model semantic understanding more difficult and the training more difficult, which will lead to poor sorting effects.

[0104] Figure 5 is a schematic diagram of an overall process provided by an embodiment of the present invention, such as Figure 5 As shown, search term weight modeling can be performed based on the search text (e.g., search term), that is, the first term weight model can be obtained by training. Also, offline mining of product noun weights can be performed based on product names, that is, the second sample word weights of the third description text are obtained, and the second sample word weights are corrected based on the mined knowledge graph. Next, product noun weight modeling can be performed, that is, the second word weight model can be obtained by training. Finally, the search term-product name correlation calculation can be performed to obtain the correlation level result, that is, the search correlation is calculated.

[0105] The embodiment of the present invention dynamically models word weights based on the word weight model, and mines the knowledge graph according to the data distribution characteristics of the product name, and integrates the knowledge information into the model modeling process. The constructed word weight model is used to perform short text matching during sorting, that is, the search text is matched, thereby ensuring the accuracy of sorting to a certain extent. Further, the model involved in the embodiment of the present invention is only a word weight model for targeted fitting of word weights. Therefore, the difficulty of obtaining training samples is relatively small, avoiding the problem of requiring a large amount of manual annotation, and reducing the difficulty of model training while reducing the cost of model training. At the same time, by training to obtain the word weight model, the generalization ability during text processing can be improved. Further, the embodiment of the present invention can be applied to the homepage search of the network platform to meet the strong search needs of users, avoid the product names that users need to purchase are long and contain multiple entities, thereby causing the correlation of sorting to be difficult to control and the sorting effect to be poor, thereby improving the click-through rate and visit purchase rate.

[0106] Figure 6 2 is a structural diagram of a network object processing device provided by an embodiment of the present invention. The device 20 may include:

[0107] The acquisition module 201 is used to respectively acquire the first word weight of each first word segment in the target search text and the second word weight of each second word segment in the first description text of the target network object according to the trained first word weight model and the second word weight model; the target network object is searched according to the target search text;

[0108] A first calculation module 202 is used to calculate, for any of the target network objects, the segment correlation between each of the first word segments and each of the second word segments according to each of the first word weights and each of the second word weights of the target network object; the segment correlation is positively correlated with the first word weight and the second word weight;

[0109] The second calculation module 203 is used to calculate the search relevance between the target search text and the target network object based on the segment relevance, and sort them according to the search relevance.

[0110] Optionally, the first calculation module 202 is specifically configured to:

[0111] Detecting whether a first target word segment hits a second target word segment; the first target word segment is any of the first word segments, and the second target word segment is any of the second word segments of the target network object;

[0112] If the first target word segment hits the second target word segment, the segment correlation between the first target word segment and the second target word segment is calculated according to the first word weight of the first target word segment and the second word weight of the second target word segment.

[0113] Optionally, the first calculation module 202 is further specifically configured to:

[0114] Determine a matching level value between the first target word segment and the second target word segment according to the first word weight and the second word weight; the matching level value is negatively correlated with the weight difference, and the weight difference is the difference between the first word weight and the second word weight;

[0115] The segment correlation is calculated based on the matching level value, the first word weight, and the second word weight; the segment correlation is positively correlated with the matching level value.

[0116] Optionally, the first calculation module 202 is further specifically configured to:

[0117] Determine the weight levels corresponding to the preset weight ranges to which the first word weight and the second word weight belong respectively, and obtain a first level and a second level; the weight level is positively correlated with the end value of the preset weight range;

[0118] The matching level value is determined according to the first level and the second level; the matching level value is positively correlated with the first level and the second level, and negatively correlated with the level difference between the first level and the second level.

[0119] Optionally, the first word weight model is obtained by training the following modules:

[0120] A first word segmentation module is used to segment the first historical text and the second description text of the first related network object to obtain a first sample word segment and a second sample word segment; the first related network object is a network object containing a user's historical operation behavior among network objects searched according to the first historical text;

[0121] A first setting module, configured to set a first sample word weight for each of the first sample word fragments according to the number of occurrences of each of the first sample word fragments in a first set; the first set includes the first sample word fragments and the second sample word fragments;

[0122] The first training module is used to train and obtain the first word weight model according to the first historical text and the weights of each of the first sample words.

[0123] Optionally, the first setting module is specifically used to:

[0124] Determining a hit rate of the first sample word fragments according to a first ratio between the number of occurrences of each of the first sample word fragments in the first set and the number of the second description texts; the hit rate is positively correlated with the first ratio;

[0125] According to the hit rate, a first sample word weight is set for each of the first sample word segments; the first sample word weight is positively correlated with the hit rate.

[0126] Optionally, the second word weight model is obtained by training the following modules:

[0127] A second word segmentation module is used to segment the second historical text and the third description text of the second related network object respectively to obtain a third sample word segment and a fourth sample word segment; the second related network object is a network object containing a user's historical operation behavior among network objects searched according to the second historical text;

[0128] A second setting module, configured to set a second sample word weight for each of the fourth sample word fragments according to the number of occurrences of each of the fourth sample word fragments in the second set; the second set includes the third sample word fragment and the fourth sample word fragment;

[0129] The second training module is used to train and obtain the second word weight model according to the third description text and the weight of each of the second sample words.

[0130] Optionally, before training and acquiring the second word weight model according to the third description text and each of the second sample word weights, the second training module is further used to:

[0131] For any of the fourth sample word fragments, based on a preset knowledge graph, determine the category to which the network object represented by the fourth sample word fragment belongs, and obtain a target category; the preset knowledge graph is mined based on network objects under various categories in the network platform;

[0132] When the weight of the second sample word of the fourth sample word segment is greater than a first preset threshold and the target category is not a designated key category, reducing the weight of the second sample word;

[0133] When the second sample word weight of the fourth sample word segment is less than a second preset threshold and the target category is the key category, the second sample word weight is increased.

[0134] Optionally, the second training module is specifically used to:

[0135] Using the third description text as an input of an initial model, so as to predict the predicted word weight and the predicted classification value of each fourth sample word segment in the third description text through the initial model;

[0136] Calculating a first loss value according to the predicted word weight and the second sample word weight, and calculating a second loss value according to the predicted classification value and the true classification value; the true classification value is used to characterize the target classification;

[0137] The initial model is adjusted according to the first loss value and the second loss value to obtain the second word weight model.

[0138] The network object processing device provided by the embodiment of the present invention obtains the first word weight of each first word fragment in the target search text and the second word weight of each second word fragment in the first description text of the target network object according to the trained first word weight model and the second word weight model; the target network object is searched according to the target search text. For any target network object, the fragment relevance of each first word fragment and each second word fragment is calculated according to each first word weight and each second word weight of the target network object, and the fragment relevance is positively correlated with the first word weight and the second word weight. Based on the fragment relevance, the search relevance of the target search text and the target network object is calculated, and sorted according to the search relevance. In this way, by subdividing the target search text and the first description text into word fragments, setting word weights for each word fragment in the target search text and the first description text in a targeted manner, and subsequently calculating the search relevance based on the word weights, the semantics of the two can be more carefully and accurately described during calculation to a certain extent, and then the calculated search relevance can be made more accurate to a certain extent, the accuracy of sorting can be improved, and thus the search effect can be improved.

[0139] The present invention also provides an electronic device, see Figure 7 , including: a processor 301, a memory 302, and a computer program 3021 stored in the memory and executable on the processor, wherein the processor implements the method of the aforementioned embodiment when executing the program.

[0140] The present invention also provides a readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the method of the aforementioned embodiment.

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

[0142] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the best mode of the present invention.

[0143] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0144] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.

[0145] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0146] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0147] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

[0148] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0149] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

[0150] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A network object processing method, characterized in that: The method comprises: According to the trained first word weight model and the second word weight model, respectively obtaining the first word weight of each first word segment in the target search text and the second word weight of each second word segment in the first description text of the target network object; the target network object is searched according to the target search text; For any of the target network objects, detecting whether a first target word segment hits a second target word segment; the first target word segment is any of the first word segments, and the second target word segment is any of the second word segments of the target network object; If the first target word segment hits the second target word segment, respectively determine the weight levels corresponding to the preset weight ranges to which the first word weight and the second word weight belong, and obtain a first level and a second level; the weight level is positively correlated with the end value of the preset weight range; Determine a matching grade value according to the first grade and the second grade; the matching grade value is positively correlated with the first grade and the second grade, and negatively correlated with the grade difference between the first grade and the second grade; the matching grade value is negatively correlated with the weight difference, and the weight difference is the difference between the first word weight and the second word weight; Multiply the hit identifiers of the first target word segment and the second target word segment, the matching level value, the first word weight, and the second word weight to obtain a segment correlation between the first target word segment and the second target word segment; the segment correlation is positively correlated with the matching level value; the segment correlation is positively correlated with the first word weight and the second word weight; Based on the segment relevance, calculating the search relevance between the target search text and the target network object, and sorting them according to the search relevance; The first word weight model is trained and obtained by the following method: The first historical text and the second description text of the first related network object are respectively segmented to obtain a first sample word segment and a second sample word segment; the first related network object is a network object containing a user's historical operation behavior among network objects searched according to the first historical text; According to the number of occurrences of each of the first sample word fragments in the first set, setting a first sample word weight for each of the first sample word fragments; the first set includes the first sample word fragments and the second sample word fragments; According to the first historical text and the weights of each of the first sample words, training and acquiring the first word weight model; The second word weight model is obtained by training in the following way: The second historical text and the third description text of the second related network object are respectively segmented to obtain a third sample word segment and a fourth sample word segment; the second related network object is a network object that has a user's historical operation behavior among network objects searched according to the second historical text; According to the number of occurrences of each of the fourth sample word fragments in the second set, setting a second sample word weight for each of the fourth sample word fragments; the second set includes the third sample word fragment and the fourth sample word fragment; The second word weight model is trained and acquired according to the third description text and the weights of each of the second sample words.

2. The method according to claim 1, characterized in that: The step of setting a first sample word weight for each of the first sample word segments according to the number of occurrences of each of the first sample word segments in the first set includes: Determining a hit rate of the first sample word fragments according to a first ratio between the number of occurrences of each of the first sample word fragments in the first set and the number of the second description texts; the hit rate is positively correlated with the first ratio; According to the hit rate, a first sample word weight is set for each of the first sample word segments; the first sample word weight is positively correlated with the hit rate.

3. The method according to claim 1, characterized in that Before training and acquiring the second word weight model according to the third description text and each of the second sample word weights, the method further includes: For any of the fourth sample word fragments, based on a preset knowledge graph, determine the category to which the network object represented by the fourth sample word fragment belongs, and obtain a target category; the preset knowledge graph is mined based on network objects under various categories in the network platform; When the weight of the second sample word of the fourth sample word segment is greater than a first preset threshold and the target category is not a designated key category, reducing the weight of the second sample word; When the second sample word weight of the fourth sample word segment is less than a second preset threshold and the target category is the key category, the second sample word weight is increased.

4. The method according to claim 3, characterized in that The step of training and acquiring the second word weight model according to the third description text and each of the second sample word weights includes: Using the third description text as an input of an initial model, so as to predict the predicted word weight and the predicted classification value of each fourth sample word segment in the third description text through the initial model; Calculating a first loss value according to the predicted word weight and the second sample word weight, and calculating a second loss value according to the predicted classification value and the true classification value; the true classification value is used to characterize the target classification; The initial model is adjusted according to the first loss value and the second loss value to obtain the second word weight model.

5. A network object processing device, characterized in that: The device comprises: An acquisition module, used to acquire the first word weight of each first word segment in the target search text and the second word weight of each second word segment in the first description text of the target network object according to the trained first word weight model and the second word weight model; the target network object is searched according to the target search text; A first calculation module is used to detect whether a first target word segment hits a second target word segment for any of the target network objects; the first target word segment is any of the first word segments, and the second target word segment is any of the second word segments of the target network object; if the first target word segment hits the second target word segment, respectively determine the weight levels corresponding to the preset weight ranges to which the first word weight and the second word weight belong, and obtain a first level and a second level; the weight level is positively correlated with the end value of the preset weight range; determine a matching level value according to the first level and the second level; the matching level value is positively correlated with the first level and the second level, and negatively correlated with the level difference between the first level and the second level; the matching level value is negatively correlated with the weight difference, and the weight difference is the difference between the first word weight and the second word weight; multiply the hit identifier of the first target word segment and the second target word segment, the matching level value, the first word weight and the second word weight, to obtain a segment correlation between the first target word segment and the second target word segment; the segment correlation is positively correlated with the matching level value; the segment correlation is positively correlated with the first word weight and the second word weight; The second calculation module is used to calculate the search relevance between the target search text and the target network object based on the segment relevance, and sort them according to the search relevance; the first word weight model is trained and obtained in the following manner: The first historical text and the second description text of the first related network object are respectively segmented to obtain a first sample word segment and a second sample word segment; the first related network object is a network object containing a user's historical operation behavior among network objects searched according to the first historical text; According to the number of occurrences of each of the first sample word fragments in the first set, setting a first sample word weight for each of the first sample word fragments; the first set includes the first sample word fragments and the second sample word fragments; According to the first historical text and the weights of each of the first sample words, training and acquiring the first word weight model; The second word weight model is obtained by training in the following way: The second historical text and the third description text of the second related network object are respectively segmented to obtain a third sample word segment and a fourth sample word segment; the second related network object is a network object that has a user's historical operation behavior among network objects searched according to the second historical text; According to the number of occurrences of each of the fourth sample word fragments in the second set, setting a second sample word weight for each of the fourth sample word fragments; the second set includes the third sample word fragment and the fourth sample word fragment; The second word weight model is trained and acquired according to the third description text and the weights of each of the second sample words.

6. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to one or more of claims 1 to 4 is implemented.

7. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute one or more of the methods described in claims 1-4.

Citation Information

Patent Citations

  • Interest point sorting method and device

    CN111984749A

  • Search term recommendation method, target model training method, device and equipment

    CN112650907A