Word loss scoring model training method and device, medium and program product
The BERT model is trained through the correlation model, and the word segmentation score is determined using reverse order, which solves the problem of insufficient recall when the query word is long, and realizes training of high-quality word weight model without manual labeling, which improves the recall and training efficiency.
Patent Information
- Application Number
- CN202310531574.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-11
- Publication Date
- 2024-11-12
AI Technical Summary
In the prior art, when the query terms are long, the amount of recalls that are difficult to meet user needs is insufficient, and the amount of sample data that requires manual labeling is large, which is costly and inefficient.
The BERT model is trained through the correlation model to generate massive data samples, and the word loss score of word segmentation is determined using reverse order. A word loss sequence is generated to train a predetermined word loss scoring model without manually labeling word weights.
It realizes the high-quality word weight model training without manual labeling, which increases the recall amount, reduces training cost and time, and improves the training efficiency of the model.
Smart Images

Figure CN118939856A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer data processing, and in particular to a training method, device, medium and program product of a missing word scoring model. Background Art
[0002] In the prior art, given a query word is used for recall in a search engine, and the search engine returns a corresponding batch of documents. If the query word is long and obscure, the number of documents that fully match the query word is small, which is difficult to meet user needs. How to discard some words in the query word and increase the recall is an urgent problem to be solved.
[0003] At present, the common practice is to use the word weight model to drop words according to the weight from low to high. The word weight model is usually a deep model such as BERT, which requires a large amount of sample data for training. The training of the word weight model usually uses manually annotated samples. The number of manually annotated samples is usually tens of thousands, which is not enough to train a very high-quality model.
[0004] The method of the present invention does not require manual labeling of word weights and can train a high-quality word weight model. Summary of the invention
[0005] The purpose of the present invention is to provide a training method, device, medium and program product for a missing word scoring model. The present invention trains a BERT model through a large amount of data samples generated by a correlation model, and the training results can be used for recalling missing words.
[0006] An embodiment of the present invention discloses a method for training a word loss scoring model, the method comprising:
[0007] Performing a first ranking on the plurality of documents based on a given query term and first relevance scores of the plurality of documents;
[0008] Segmenting the query word to generate multiple segmented words, constructing a first segmented word set including the multiple segmented words, and removing at least one segmented word in the first segmented word set to obtain multiple second segmented word sets;
[0009] respectively calculating second relevance scores of the plurality of second word segmentation sets and the plurality of documents, performing a second sorting on the plurality of documents based on the second relevance scores, determining the number of inverse order pairs of the plurality of documents based on the result of the first sorting and the result of the second sorting, and determining a word loss score and a word loss sequence of the word segmentation based on the number of inverse order pairs, wherein the word loss score indicates the possibility of the word segmentation being discarded;
[0010] A predetermined word loss scoring model is trained using the plurality of word loss sequences as training data, wherein the plurality of word loss sequences are generated by a plurality of query words.
[0011] Optionally, the predetermined word loss scoring model is a BERT model.
[0012] Optionally, the BERT model outputs word loss scores of the multiple word segments.
[0013] Optionally, the loss function of the BERT model is Among them, N represents the number of segmentations, f i and f j represents the word loss scores of the i-th and j-th word segments, where i and j are positive integers less than or equal to N.
[0014] Optionally, the first relevance score and the second relevance score are obtained by a relevance model.
[0015] Optionally, the query word is segmented by a word segmentation algorithm to generate the multiple word segments.
[0016] Optionally, the number of the reverse order pairs is inversely proportional to the possibility of the word being discarded.
[0017] An embodiment of the present invention discloses an electronic device, characterized in that the device includes a processor and a memory storing computer-executable instructions, and the processor is configured to execute the instructions to implement the above-mentioned training method of the word loss scoring model.
[0018] An embodiment of the present invention discloses a computer-readable storage medium, characterized in that at least one computer instruction is stored in the computer-readable storage medium, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned training method of the word loss scoring model.
[0019] An embodiment of the present invention discloses a computer program product, characterized in that the computer program product includes computer instructions, and when the computer instructions are executed, the above-mentioned training method of the word loss scoring model is implemented.
[0020] The present invention provides a training method, device, medium and program product of a missing word scoring model, which can quickly recommend high-value items with a wide coverage of interest points by fusing the diversity scores of items calculated by clustering algorithm and singular value decomposition with the value scores of items.
[0021] Compared with the prior art, the main difference and effect of the embodiments of the present invention are: the training method of the missing word scoring model of the present invention does not require manual labeling of word weights, but uses a mature relevance model in search to score query words and document tuples. The scores largely determine the order of the documents. The BERT model is trained with massive data samples generated by the relevance model, and finally the sequence in the training data is fitted by the BERT model to realize the training of the word importance model, and the training results are used for recall. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a schematic diagram of a scenario in which a training method for a word loss scoring model according to an embodiment of the present invention is applied;
[0023] Figure 2 is a flow chart of a method for training a word loss scoring model according to an embodiment of the present invention;
[0024] Figure 3 is a scoring schematic diagram of a word loss scoring model according to an embodiment of the present invention;
[0025] Figure 4 4 is a hardware structure block diagram of an electronic device for word loss model training according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The present invention will be further described below in conjunction with specific embodiments and accompanying drawings. It will be appreciated that the specific embodiments described herein are intended only to explain the present invention, rather than to limit the present invention. In addition, for ease of description, only some, but not all, structures or processes related to the present invention are shown in the accompanying drawings. It should be noted that in this specification, similar reference numerals and letters represent similar items in the following drawings.
[0027] It should be understood that although the terms "first", "second", etc. may be used herein to describe various features, these features should not be limited by these terms. These terms are used only to distinguish and should not be understood as indicating or implying relative importance. For example, a first feature may be referred to as a second feature, and similarly a second feature may be referred to as a first feature without departing from the scope of the exemplary embodiments.
[0028] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0029] Figure 1 The figure is a schematic diagram of a scenario in which a training method for a word loss scoring model is applied according to an embodiment of the present invention.
[0030] Figure 1A schematic diagram of an application scenario to which the embodiment of the present disclosure is applicable is shown. In the application scenario, the device involved includes a device for training a word loss scoring model, which may be a server or a terminal. Figure 1 Take the model training device as the first server 101 as an example. On the first server 101, the pre-built model can be trained based on the lost word sequence as training sample data to obtain a trained lost word scoring model.
[0031] like Figure 1 As shown, the training sample data can be collected in advance and stored in a database.
[0032] like Figure 1 As shown, the device involved in the application scenario may also include a processing device for processing the user's query request through the word loss scoring model, which may be a server or a terminal. Figure 1 Take the second server 102 as an example. After training a word loss scoring model based on training sample data on the first server 101, the word loss scoring model on the first server 101 is deployed on the second server 102. On the second server 102, the user's query request is detected and processed by the word loss scoring model.
[0033] like Figure 1 As shown, the device involved in the application scenario may also include a terminal 103. The terminal 103 may send the user's query request to the second server 102. The second server 102 detects and processes the user's query request through a word loss scoring model and returns the result to the terminal 103.
[0034] Among them, the client 103 can be one or more, and the number of the client 103 should not be used as a limiting condition of the present invention. For example, the data source comes from different clients 103, and at least one client 103 sends data to the recommendation system. The client 103 can be a computer device such as a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., which has computing power, input and output functions, and network connection functions. The server 101 and the server 102 can be a single server device, or a server cluster, a cloud server, etc., which can provide game application services to the outside.
[0035] In one example, a user gives a query word and the search engine returns documents or content related to it. If the query word is long and obscure, the number of documents that completely match the query word is small, which is difficult to meet the user's needs. In order to solve this problem, it is necessary to discard some words in the query word to increase the recall.
[0036] For example, in the application scenario of a shopping and sharing platform, the query term posted by the user in the search box is "suggestions on what to wear in winter windbreakers". Since the query term is long, the number of fully matched documents found by the search engine in the database is small, which cannot meet the sufficient recall. Those skilled in the art can understand that in the above query term example, "suggestions on what to wear" has little impact on the final search recall result. Therefore, in actual operation, the query term "suggestions on what to wear" will be dropped to increase the recall.
[0037] At present, the commonly used method is to assign term weights to query words based on deep learning models, and perform word loss processing according to the weights from low to high. The recognition accuracy of deep learning models is closely related to the quality and quantity of training sample data, so manual annotation is usually used to score sample words. However, manual annotation is costly, slow, and requires less sample data. Therefore, how to generate massive training data is still a difficult problem.
[0038] In view of the above problems, the present invention provides a method, device, medium and program product for training a missing word scoring model, which can train a high-quality missing word scoring model without manually labeling word weights.
[0039] Figure 2 4 is a flowchart of a method for training a word loss scoring model according to an embodiment of the present invention.
[0040] The training method of the word loss scoring model provided in one embodiment of the present invention requires the cooperation of the client 103 and the server 101 and the server 102, and the method specifically includes:
[0041] In the first ranking step S100: a first ranking is performed on the plurality of documents based on a given query term and first relevance scores of the plurality of documents.
[0042] The server 102 receives the query request from the client 103, and detects and processes the query request. When the document related to the query request of the client 103 is found, the document is displayed in the order of the relevance between the query word and the multiple documents. The displayed document may include displaying the title, summary, and highlighted keyword part of the document to achieve the functional effect of the search engine.
[0043] As an implementation, the relevance score is obtained by a relevance model.
[0044] Relevance refers to the strong and weak correlations between a given query keyword and the corresponding recalled documents. For example, if a user enters the keyword "winter windbreaker" and the returned document involves winter windbreakers, then the document has a strong correlation with the query keyword. If it only mentions autumn windbreakers, then the document has a weak correlation with the keyword.
[0045] Calculate the relevance between the query term and multiple documents, and sort the documents based on the relevance according to certain rules.
[0046] The correlation between the query term and multiple documents can be called the vertical field correlation, which refers to the strength of the correlation between the query term and the document.
[0047] Relevance is a relative concept. For example, for a query term, the first document is more relevant than the second document, and the second document is more relevant than the third document. Therefore, it is necessary to measure the relevance of multiple documents to the query term. In order to measure the relevance of multiple documents to the query term, it is necessary to obtain the relevance of multiple documents to the query term.
[0048] The relevance acquisition method of the relevance model can evaluate the relevance between multiple documents and a query term based on a single feature. For example, the single feature may be the number of times the query term appears in the document.
[0049] The correlation acquisition method of the correlation model may be a correlation acquisition method that integrates features of multiple dimensions, for example, a learning to rank method, which can integrate features of multiple different dimensions to measure correlation.
[0050] The relevance acquisition method of the relevance model can also be based on the use of a vector space model. The vector space model, as a tool for document representation and similarity calculation, is an effective tool commonly used in the search field.
[0051] It is worth noting that those skilled in the art can understand that the purpose of the correlation model is to calculate the correlation, which can be used for sorting. As a common technical means in this field, the correlation model is based on what can be actually used by those skilled in the art and should not be used as a limitation of the present invention.
[0052] In the word segmentation step S200: the query word is segmented to generate multiple word segments, a first word segmentation set including the multiple word segments is constructed, and at least one word segmentation in the first word segmentation set is removed to obtain multiple second word segmentation sets.
[0053] Word segmentation is to divide the query words entered by the user into multiple independent, complete and correct words, and then match the search results that are more in line with the user's search keywords or sentences based on the understanding of the meaning of each word according to Chinese grammar rules, context and synonyms.
[0054] The word segmentation algorithm of the present application is an existing technology that can be understood by technicians in this field and will not be described in detail here.
[0055] It is worth noting that those skilled in the art can understand that the purpose of word segmentation algorithms and related models is to segment query terms. As common technical means in this field, word segmentation algorithms and related models are based on what technical personnel in this field can actually use and should not be used as limiting conditions of the present invention.
[0056] As an implementation method, the query word is segmented by a word segmentation algorithm to generate multiple word segments.
[0057] In one example, the server 102 receives a query request from the client 103, and the content of the query request is "suggestions on how to wear a windbreaker in winter". The server 102 divides the query word into five segmentation results, namely "winter", "windbreaker", "wearing", "of", and "suggestions", by using a word segmentation algorithm.
[0058] In another example, a first segmentation set including multiple segmentations is constructed. For example, the content of the query request is "suggestions on how to wear a windbreaker in winter". The server 102 segments the query words into "winter", "windbreaker", "wearing", "of", and "suggestions" through a segmentation algorithm. The first segmentation set is [winter, windbreaker, wearing, of, suggestions]. At least one segmentation set in the first segmentation set is removed to obtain multiple second segmentation sets. The second segmentation set can be any permutation and combination of segmentations, such as [winter], [winter, windbreaker], [windbreaker, suggestions, winter], [wearing, of, suggestions], [windbreaker, wearing, of, suggestions].
[0059] Next is the second sorting step S300: respectively calculating second relevance scores of the plurality of second word segmentation sets and the plurality of documents, performing a second sorting on the plurality of documents based on the second relevance scores, determining the number of inverse pairs of the plurality of documents based on the results of the first sorting and the results of the second sorting, determining a word loss score and a word loss sequence of the word segmentation based on the number of inverse pairs, wherein the word loss score indicates the possibility of a word segmentation being discarded.
[0060] Specifically, to determine the number of reverse order pairs of a plurality of documents based on the result of the first sorting and the result of the second sorting, it is necessary to measure the similarity of the two sorted lists.
[0061] In one example, in a data retrieval application scenario, you need to calculate how close the sorted list of documents given by the system under a certain query condition is to a predefined sorted list, or compare the results of different search engines. In a recommendation system, you need to monitor the difference between the recommendation list given by the new algorithm for a certain user and the recommendation list given by the old algorithm in a certain algorithm iteration.
[0062] In the prior art, MAP (Average Precision and Mean Average Precision), MRR (Mean Reciprocal Rank), and NDCG (Normalized Discounted Cumulative Gain) are commonly used to evaluate the quality of ranking algorithms. However, these metrics rely on the relevance grades of the query terms and documents manually annotated. When there is no such annotation data, or the ranking list to be evaluated has nothing to do with relevance, and there happens to be a benchmark list for comparison, the number of inversion pairs can be used to quantify the degree of inconsistency between two ranking lists.
[0063] The number of inversion pairs can also be referred to as the Kendall rank correlation coefficient. For example, let A be an ordered set with n numbers (n > 1), where all the numbers are different. If there exist positive integers i and j such that 1 ≤ i < j ≤ n and A[i] > A[j], then the ordered pair <A[i], A[j]> is called an inversion pair of A, also known as the number of inversions. For an array A[1…n] containing N non-negative integers, if i < j and A[i] > A[j], then (A[i], A[j]) is called an inversion pair in the array A. For example, the inversion pairs of the array (3, 1, 4, 5, 2) are (3, 1), (3, 2), (4, 2), (5, 2), a total of 4. The calculation methods of inversion pairs can include the naive algorithm, using bubble sort, using insertion sort, using merge sort, using a binary indexed tree, etc.
[0064] It should be noted that those skilled in the art can understand that the purpose of calculating the inversion pairs is to compare the degree of difference between different documents. As a common technical means in this field, the algorithms and related models for calculating the inversion pairs shall be subject to what can be actually used by those skilled in the art and should not be regarded as a limiting condition of the present invention.
[0065] As an implementation manner, the number of inversion pairs is inversely proportional to the possibility of the word segment being discarded.
[0066] In an example, in the first word segment set [c1, …, c n , if the number of inversion pairs of the word segment c i is the least, then the importance of this word segment is the lowest and it should be discarded most. On the contrary, if the number of inversion pairs of the word segment c i is more, it indicates that discarding the word segment c i has a greater impact on the relevance between the query term and multiple documents. The word segment c i is more important and should not be discarded. The number of inversion pairs is in an inverse proportional relationship with the possibility of the word segment being discarded.
[0067] As an implementation manner, the first relevance score and the second relevance score are obtained from the relevance model.
[0068] In one example, the client 103 sends a query request to the server 102. The query request includes a given query term q, and the query term q includes multiple segmented words, q = ["winter", "windbreaker", "outfit", "of", "suggestion"]. The server 102 reads k documents from the database, and the documents are denoted as d1, …, d k , and the relevance model scores the k documents based on the query term, which is denoted as the first relevance score. The k documents are sorted in descending order according to the first relevance score.
[0069] The word segmentation algorithm segments the query term q to construct a first segmented word set including multiple segmented words. The first segmented word set is ["winter", "windbreaker", "outfit", "of", "suggestion"], and "winter" is one of the segmented words in the segmented word set.
[0070] Remove any one word from the first segmented word set. For example, remove the segmented word "outfit" to generate a second segmented word set q ′ , and the second segmented word set q ′ = ["winter", "windbreaker", "of", "suggestion"].
[0071] Remove any one segmented word from the query term in turn, and calculate the relevance between the second segmented word set q ′ and multiple documents d1, …, d k , which is denoted as the second relevance score. The documents are sorted according to the second relevance score.
[0072] When sorting based on the first relevance score, document d i is ranked in front of document d j . When sorting based on the second relevance score, document d i is ranked behind document d j . By using the inversion pair algorithm, it is determined that (d i , d j ) is an inversion pair.
[0073] Calculate the number of inversion pairs generated by each segmented word in the first segmented word set ["winter", "windbreaker", "outfit", "of", "suggestion"] respectively.
[0074] For example, through the inversion pair algorithm, it is found that the segmented word "of" has the least impact on the document sorting, and the number of inversion pairs generated by the document is the least. It can be judged that the importance of the segmented word "of" is the lowest. Discard the segmented word "of", then the discard word score of "of" is the highest. First, discard "of". The current second segmented word set is q ′ = ["winter", "windbreaker", "outfit", "suggestion"]. Continue to perform discard word scoring on the remaining segmented words. Through the inversion pair algorithm, it is found that the segmented word "outfit" has the least impact on the document sorting, and the number of inversion pairs generated by the document is the least. It can be judged that the importance of the segmented word "outfit" is the lowest. Discard the segmented word "outfit", and the current second segmented word set is q ′= [winter, windbreaker, suggestion], select the most discarded participles from the first participle set [winter, windbreaker, outfit, of, suggestion] in turn to obtain a discarded word sequence. For example, the discarded word sequence is “of < outfit < suggestion < winter < windbreaker”.
[0075] It is worth noting that the score used as the word loss threshold is set by those skilled in the art according to actual needs, and the word segmentation can be discarded when the score is high or when the score is low.
[0076] Finally, in the model training step S400 , a predetermined word loss scoring model is trained using a plurality of word loss sequences as training data, wherein the plurality of word loss sequences are generated by a plurality of query words.
[0077] In one example, given a query term q and a document d, a relevance score is given to (q, d), where a higher score indicates a closer match between q and d.
[0078] The word segmentation algorithm cuts the query word q into [c1,…,c n ], it is worth noting that for different q, the number of n varies.
[0079] The training data collected is a sequence of n words. For example, n = 4, and the missing word sequence obtained is c2 <c4<c1<c3。
[0080] Multiple query words q generate multiple lost word sequences, and the multiple lost word sequences are used as training data for training the ground-truth scoring model.
[0081] As an implementation method, the predetermined word loss scoring model is a BERT (Bidirectional Encoder Representations from Transformer) model.
[0082] The goal of the BERT model is to use large-scale unlabeled corpus training to obtain a model that contains rich semantic information in the text. As an implementation method, the BERT model outputs the word loss score of multiple word segmentations.
[0083] In the neurolinguistics NLP (Neuro Linguistic Program) method based on deep neural networks, characters / words in a text are usually represented by one-dimensional vectors; on this basis, the neural network will take the one-dimensional word vectors of each character or word in the text as input, and after a series of complex transformations, output a one-dimensional word vector as the semantic representation of the text. Usually, characters / words with similar semantics are closer in the feature vector space, and the text vector converted from the character / word vector can also contain more accurate semantic information. Therefore, the main input of the BERT model is the original word vector of each character / word in the text, and the output is the vector representation of each character / word in the text after integrating the semantic information of the entire text.
[0084] The BERT model of the present invention inputs multiple word loss sequences and outputs word loss scoring scores of multiple word segments.
[0085] As an implementation, the loss function of the BERT model is Among them, N represents the number of segmentations, f i and f j Represents the word loss scores of the i-th and j-th word segments, where i and j are positive integers less than N.
[0086] The loss function is used to evaluate the fit of the trained model. The larger the loss function, the worse the model fit.
[0087] The specific meaning of the loss function formula includes: among N participles, if the i-th participle is ranked higher than the j-th participle, that is, the i-th participle is less important than the j-th participle, then let f i As small as possible, f j As big as possible to widen the score gap.
[0088] Use the gradient descent algorithm to reduce the loss and update the BERT model. Finally, train a word loss scoring model. Use the word loss scoring model directly for inference online. Throw the word segmentation into the word loss scoring model, and the model will quickly respond with the word loss answer.
[0089] Figure 3 4 is a scoring schematic diagram of a word loss scoring model according to an embodiment of the present invention.
[0090] like Figure 3 As shown in the figure, the word loss scoring model is the BERT model. A large number of word segmentation results, that is, the word loss sequence of the word segmentation, are input into the BERT model as sample data for training the model to train the BERT model. The scoring of the BERT model is consistent with the word loss sequence.
[0091] The present invention does not require manual annotation of samples and can automatically generate massive training sample data. The score fitting of the model trains the sequence in the sample data rather than the numerical value.
[0092] The trained Bert model is deployed on the server 102. The server 102 receives the query request of the user of the terminal 103 and can discard the unimportant words in the query words according to the result of the word loss model to increase the recall.
[0093] Figure 4 is a hardware structure block diagram of an electronic device for word loss model training according to an embodiment of the present invention.
[0094] like Figure 4 As shown, the electronic device 400 may include one or more processors 402, a system motherboard 408 connected to at least one of the processors 402, a system memory 404 connected to the system motherboard 408, a non-volatile memory (NVM) 406 connected to the system motherboard 408, and a network interface 410 connected to the system motherboard 408.
[0095] The processor 402 may include one or more single-core or multi-core processors. The processor 402 may include any combination of general-purpose processors and special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In an embodiment of the present invention, the processor 402 may be configured to execute the following operations: Figure 2 The training method of the loss word scoring model shown.
[0096] In some embodiments, system board 408 may include any suitable interface controller to provide any suitable interface to at least one of processors 402 and / or any suitable device or component in communication with system board 408 .
[0097] In some embodiments, the system board 408 may include one or more memory controllers to provide an interface to the system memory 404. The system memory 404 may be used to load and store data and / or instructions. In some embodiments, the system memory 404 of the electronic device 400 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).
[0098] The non-volatile memory 406 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, the non-volatile memory 406 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of a HDD (Hard Disk Drive, hard disk drive), a CD (Compact Disc, optical disk) drive, and a DVD (Digital Versatile Disc, digital versatile disc) drive.
[0099] The non-volatile memory 406 may include a portion of storage resources installed on a device of the electronic device 400, or it may be accessible by the device but not necessarily a portion of the device. For example, the non-volatile memory 406 may be accessed over a network via the network interface 410.
[0100] In particular, system memory 404 and non-volatile memory 406 may include a temporary copy and a permanent copy of instructions 420, respectively. Instructions 420 may include instructions that, when executed by at least one of processors 402, cause electronic device 400 to implement the following: Figure 3 Instructions of the training method of the missing word scoring model shown. In some embodiments, the instructions 420, hardware, firmware and / or software components thereof may be additionally / alternatively placed in the system mainboard 408, the network interface 410 and / or the processor 402.
[0101] The network interface 410 may include a transceiver for providing a radio interface for the electronic device 400, thereby communicating with any other suitable device (e.g., a front-end module, an antenna, etc.) through one or more networks. In some embodiments, the network interface 410 may be integrated with other components of the electronic device 400. For example, the network interface 410 may be integrated with at least one of the processor 402, the system memory 404, the NVM 406, and a firmware device (not shown) having instructions. When at least one of the processors 402 executes the instructions, the electronic device 400 implements Figure 2 One or more of the various embodiments shown.
[0102] The network interface 410 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 410 may be a network adapter, a wireless network adapter, a telephone modem, and / or a wireless modem.
[0103] In one embodiment, at least one of the processors 402 may be packaged together with one or more controllers for the system board 408 to form a system in package (SiP). In one embodiment, at least one of the processors 402 may be integrated on the same die with one or more controllers for the system board 408 to form a system on a chip (SoC).
[0104] The electronic device 400 may further include an input / output (I / O) device 412 connected to the system motherboard 408. The I / O device 412 may include a user interface to enable a user to interact with the electronic device 400; the design of the peripheral component interface enables the peripheral components to interact with the electronic device 400. In some embodiments, the electronic device 400 further includes a sensor for determining at least one of an environmental condition and location information related to the electronic device 400.
[0105] In some embodiments, input / output (I / O) devices 412 may include, but are not limited to, a display (e.g., a liquid crystal display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., a still image camera and / or a video camera), a flashlight (e.g., an LED flash), and a keyboard.
[0106] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.
[0107] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 400. In other embodiments of the present application, the electronic device 400 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0108] Program code can be applied to input instructions to perform the functions described in the present invention and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a system for processing instructions including processor 402 includes any system having a processor such as a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0109] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in the present invention is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.
[0110] According to one embodiment of the present invention, a computer-readable storage medium is further proposed, wherein at least one computer instruction is stored in the computer-readable storage medium, and the at least one instruction is loaded and executed by a processor to implement the aforementioned training method of the word loss scoring model.
[0111] According to one embodiment of the present invention, a computer program product is further proposed, wherein the computer program product comprises computer instructions, and when the computer instructions are executed, the aforementioned training method of the word loss scoring model is implemented.
[0112] Illustrative embodiments of the present invention include, but are not limited to, a method, apparatus, medium, and program product for training a word loss scoring model.
[0113] The various aspects of the illustrative embodiments will be described using terms commonly used by those skilled in the art to convey the essence of their work to other persons skilled in the art. However, it is apparent to those skilled in the art that some alternative embodiments may be implemented using some of the features described. For purposes of explanation, specific numbers and configurations are set forth so that the illustrative embodiments are more thoroughly understood. However, it is apparent to those skilled in the art that alternative embodiments may be implemented without the specific details. In some other cases, some well-known features are omitted or simplified herein to avoid obscuring the illustrative embodiments of the present invention.
[0114] In addition, various operations will be described as multiple separate operations in a manner that is most helpful for understanding the illustrative embodiments; however, the order of description should not be interpreted as implying that these operations must rely on the order of description, and many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can also be rearranged. When the described operations are completed, the process can be terminated, but can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0115] References in the specification to "an example", "an example", "an embodiment", "an implementation", etc. indicate that the described embodiment may include a particular feature, structure, or property, but each embodiment may or may not necessarily include the particular feature, structure, or property. Moreover, these phrases are not necessarily directed to the same embodiment. In addition, when particular features are described in conjunction with a specific embodiment, the knowledge of those skilled in the art can affect the combination of these features with other embodiments, whether or not these embodiments are explicitly described.
[0116] Unless the context dictates otherwise, the terms "comprising," "having," and "including" are synonymous. The phrase "A and / or B" means "(A), (B), or (A and B)."
[0117] As used herein, the term "module" may refer to, be part of, or include: memory (shared, dedicated, or group) for running one or more software or firmware programs, application-specific integrated circuits (ASICs), electronic circuits and / or processors (shared, dedicated, or group), combinational logic circuits, and / or other suitable components that provide the described functionality.
[0118] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order is not necessary. Instead, in some embodiments, these features may be described in a manner and / or order different from that shown in the illustrative drawings. In addition, the structural or method features included in a specific figure do not mean that all embodiments need to include such features. In some embodiments, these features may not be included or may be combined with other features.
[0119] 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.
[0120] 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, 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 intention that the claimed invention requires more features than those expressly recited in each claim. Rather, as reflected in the claims, inventive aspects lie in less than all of the features of the individual embodiments previously disclosed. Therefore, the claims that follow the detailed description are hereby expressly incorporated into the detailed description, with each claim itself serving as a separate embodiment of the present invention.
[0121] 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.
[0122] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims, any one of the claimed embodiments may be used in any combination.
Claims
1. A method for training a missing word scoring model for electronic equipment, characterized in that: include: Performing a first ranking on the plurality of documents based on a given query term and first relevance scores of the plurality of documents; Segmenting the query word to generate multiple segmented words, constructing a first segmented word set including the multiple segmented words, and removing at least one segmented word in the first segmented word set to obtain multiple second segmented word sets; respectively calculating second relevance scores of the plurality of second word segmentation sets and the plurality of documents, performing a second sorting on the plurality of documents based on the second relevance scores, determining the number of inverse order pairs of the plurality of documents based on the result of the first sorting and the result of the second sorting, and determining a word loss score and a word loss sequence of the word segmentation based on the number of inverse order pairs, wherein the word loss score indicates the possibility of the word segmentation being discarded; A predetermined word loss scoring model is trained using the plurality of word loss sequences as training data, wherein the plurality of word loss sequences are generated by a plurality of query words.
2. The training method of the missing word scoring model according to claim 1, characterized in that: The predetermined word loss scoring model is a BERT model.
3. The training method of the missing word scoring model according to claim 2, characterized in that: The BERT model outputs the word loss scores of the multiple word segments.
4. The training method of the missing word scoring model according to claim 3, characterized in that: The loss function of the BERT model is Among them, N represents the number of segmentations, f i and f j Represents the word loss scores of the i-th and j-th word segmentations, where i and j are positive integers less than or equal to N.
5. The method for training a missing word scoring model according to claim 1, characterized in that: The first relevance score and the second relevance score are obtained by a relevance model.
6. The method for training a missing word scoring model according to claim 1, characterized in that: The query word is segmented by a word segmentation algorithm to generate the multiple word segments.
7. The method for training a missing word scoring model according to claim 4, characterized in that: The number of the reverse order pairs is inversely proportional to the probability of the word being discarded.
8. An electronic device, characterized in that: The device comprises a processor and a memory storing computer executable instructions, wherein the processor is configured to execute the instructions to implement the training method of the word loss scoring model according to any one of claims 1-7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer instruction, and the at least one instruction is loaded and executed by the processor to implement the training method of the word loss scoring model according to any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are executed, the training method of the word loss scoring model according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and device for training search model and method and device for searching target object
CN112328891A
Noise attentuation using a dipole sparse TAU-p inversion
WO2015145261A2
