Method for training correlation model and method and device for calculating correlation score
By training the correlation model and using text summarization and data enhancement models to improve calculation efficiency and accuracy, it solves the problem of inaccurate calculation of correlation scores in the existing technology and achieves accurate and efficient calculation of correlation scores between search terms and texts.
Patent Information
- Application Number
- CN202310141382.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2024-08-23
AI Technical Summary
Existing tree models and pre-trained models have flaws in calculating the correlation scores between search terms and text. They cannot directly calculate the correlation scores from the text itself and are inaccurate. They also lack a deep understanding of the connection between search terms and text.
By training the correlation model, the text summary model is used to extract important text representation content, and combined with the data enhancement model for annotation, the calculation efficiency and accuracy of the correlation model are improved, and the BERT model is used to calculate the correlation score.
It achieves a more accurate and efficient calculation of the correlation score between search terms and text, improving the accuracy and efficiency of search results.
Smart Images

Figure CN118535907A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method for training a correlation model, a device for calculating a correlation score, a storage medium, and an electronic device. Background Art
[0002] A very important step in the search scenario is to calculate the relevance score. At present, most methods for calculating the relevance score mainly include two methods: (1) The calculation method based on the tree model, which mainly uses the LightGBM model for calculation. The tree model-based method generally requires multiple dimensions of features of the search term and the text to calculate the relevance score between the search term and the text. (2) Using pre-trained models such as BERT to directly calculate the relevance score between the search term and the text. There are generally two methods for using pre-trained models: the first is to first obtain the vector representation of the search term and the document, and then use cosine similarity to calculate the relevance score between the search term and the text. The second is to calculate the relevance score by fine-tuning. The specific method is to use [QUERY][SEP][DOC] as the input of the BERT model, and then fine-tune the [CLS] bit output of the BERT model, connect it to a fully connected neural network model and a cross-entropy loss function, and then obtain the relevance score between the search term and the text.
[0003] Both existing relevance models have certain disadvantages. The disadvantages of the relevance model for the tree model are: (1) This type of model cannot calculate the relevance score between the search term and the text through the text, so it lacks the ability to directly calculate the relevance score from the text itself. (2) The second type of model directly calculates the relevance between the search term and the text, but because the text is too long, the vector representation of the text cannot be fully encoded, resulting in inaccurate relevance scores calculated using this pre-trained model. At the same time, because the first calculation method of this model does not generate interaction between the search term and the text, it is impossible to understand the connection between the search term and the text from a deep level. Summary of the invention
[0004] Embodiments of the present application provide a method for training a correlation model, a method, an apparatus, a storage medium, an electronic device, and a computer program product for calculating a correlation score.
[0005] In a first aspect, an embodiment of the present application provides a method for training a correlation model for an electronic device, the method comprising:
[0006] A first encoding step, inputting a plurality of training search words and a plurality of training titles into a first encoding model to obtain a plurality of first vector representations;
[0007] In the text summarization step, multiple training texts are input into the trained text summarization model to generate text summary data;
[0008] A second encoding step, inputting the text summary data into the first encoding model to obtain a plurality of second vector representations;
[0009] a labeling step, using the trained data enhancement model to label the multiple training search terms and the multiple training texts to obtain multiple labeled data;
[0010] The training step uses the multiple first vector representations, the multiple second vector representations, and the multiple labeled data to train the correlation model to obtain a trained correlation model.
[0011] In a possible implementation of the first aspect, the text summarization step includes:
[0012] Use public corpus data to pre-train the text summary model to obtain a pre-trained text summary model.
[0013] The pre-trained text summary model is trained using a plurality of training summaries to obtain the trained text summary model.
[0014] In a possible implementation of the first aspect above, the marking step includes:
[0015] Get the relevance score between each search term and each text;
[0016] Count the feature data of each search word-text pair;
[0017] The data enhancement model is trained using the plurality of correlation scores and the plurality of feature data to obtain the trained data enhancement model.
[0018] In a possible implementation of the first aspect above, the data enhancement model is a neural network model.
[0019] In a possible implementation of the first aspect above, the first encoding model is a BERT model, and the correlation model is a BERT model.
[0020] In a second aspect, an embodiment of the present application provides a method for calculating a relevance score, for use in an electronic device, the method comprising:
[0021] An acquisition step of acquiring a current search term and at least one text recalled by the current search term;
[0022] The calculation step is to input the current search term and at least one of the texts into the relevance model trained according to the first aspect, and calculate the relevance score of the current search term and each of the texts.
[0023] In a third aspect, an embodiment of the present application provides a search method for an electronic device, the method comprising:
[0024] Get the search term entered by the user;
[0025] Using the method for calculating the relevance score according to the second aspect, obtaining the relevance score of each text in the search term and at least one recalled text;
[0026] The at least one text is sorted according to the relevance score and returned to the user.
[0027] In a fourth aspect, an embodiment of the present application provides a device for training a correlation model, the device comprising:
[0028] A first encoding unit, inputting a plurality of training search words and a plurality of training titles into a first encoding model to obtain a plurality of first vector representations;
[0029] A text summary unit, which inputs a plurality of training texts into a trained text summary model to generate text summary data;
[0030] A second encoding unit, inputting the text summary data into the first encoding model to obtain a plurality of second vector representations;
[0031] A labeling unit, using the trained data enhancement model to label the multiple training search terms and the multiple training texts to obtain multiple labeling data;
[0032] A training unit trains the correlation model using the multiple first vector representations, the multiple second vector representations, and the multiple labeled data to obtain a trained correlation model.
[0033] In a fifth aspect, an embodiment of the present application provides a device for calculating a correlation score, the device comprising:
[0034] An acquisition unit, which acquires a current search term and at least one text recalled by the current search term;
[0035] A calculation unit inputs the current search term and at least one of the texts into the trained relevance model according to the third aspect, and calculates the relevance score of the current search term and each of the texts.
[0036] In a sixth aspect, an embodiment of the present application provides a computer program product, comprising computer executable instructions, which are executed by a processor to implement the method for training a correlation model described in the first aspect, the method for calculating a correlation score described in the second aspect, or the search method described in the third aspect.
[0037] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed on a computer, the computer executes the method for training a correlation model described in the first aspect, the method for calculating a correlation score described in the second aspect, or the search method described in the third aspect.
[0038] In an eighth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; one or more memories; wherein the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device executes the method for training a correlation model described in the first aspect or the method for calculating a correlation score described in the second aspect or the search method described in the third aspect.
[0039] In the present invention, a trained text summarization model is used to perform text summarization on a large amount of training texts, extract important text representation content (i.e., text summary data), and use the training search terms, training titles, and text summary data as inputs of the correlation model (i.e., training data), which can greatly improve the computational efficiency of the correlation model. In addition, the present invention uses a data enhancement model based on a neural network to annotate large-scale unlabeled data and perform data enhancement, thereby improving the accuracy of correlation model training.
[0040] By using the trained correlation model in the present invention, the correlation score between the search term and the text can be calculated more accurately and efficiently, thereby providing better protection for the downstream links of the search. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 According to some embodiments of the present application, a block diagram of an electronic device is shown;
[0042] Figure 2 According to some embodiments of the present application, a flowchart of a method for training a correlation model is shown;
[0043] Figure 3 According to some embodiments of the present application, a flowchart of a method for calculating a relevance score is shown;
[0044] Figure 4 According to some embodiments of the present application, a structural diagram of an apparatus for training a correlation model is shown;
[0045] Figure 5 According to some embodiments of the present application, a structural diagram of a device for calculating a correlation score is shown;
[0046] Figure 6 According to some embodiments of the present application, a flowchart of a search method is shown. DETAILED DESCRIPTION
[0047] Illustrative embodiments of the present application include, but are not limited to, methods for training a relevance model, methods for calculating a relevance score, apparatuses, media, electronic devices, and computer program products.
[0048] The embodiments of the present application will be described in further detail below in conjunction with the accompanying drawings.
[0049] Figure 1 According to some embodiments of the present application, a block diagram of an electronic device is shown.
[0050] like Figure 1 As shown, the electronic device 100 may include one or more processors 102, a system motherboard 108 connected to at least one of the processors 102, a system memory 104 connected to the system motherboard 108, a non-volatile memory (NVM) 106 connected to the system motherboard 108, and a network interface 110 connected to the system motherboard 108.
[0051] The processor 102 may include one or more single-core or multi-core processors. The processor 102 may include any combination of a general-purpose processor (CPU) and a special-purpose processor (e.g., a graphics processor, an application processor, a baseband processor, etc.). A graphics processing unit (GPU) is a special-purpose processor that has a higher number of cores and powerful parallel computing capabilities than a general-purpose processor and is widely used in computer graphics processing. In an embodiment of the present invention, the processor 102 may be configured to execute the following: Figure 2 Or one or more of the various embodiments shown in 3.
[0052] In some embodiments, the system board 108 may include any suitable interface controller (not shown). Figure 1 ), to provide any suitable interface to at least one of the processors 102 and / or any suitable device or component in communication with the system motherboard 108.
[0053] In some embodiments, the system board 108 may include one or more memory controllers to provide an interface to the system memory 104. The system memory 104 may be used to load and store data and / or instructions 120. In some embodiments, the system memory 104 of the electronic device 100 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).
[0054] The non-volatile memory 106 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions 120. In some embodiments, the non-volatile memory 106 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), a CD (Compact Disc) drive, and a DVD (Digital Versatile Disc) drive.
[0055] The non-volatile memory 106 may include a portion of storage resources installed on the device of the electronic device 100, or it may be accessible to an external device but is not necessarily a portion of the external device. For example, the non-volatile memory 106 may be accessed over a network via the network interface 110.
[0056] In particular, the system memory 104 and the non-volatile memory 106 may respectively include: a temporary copy and a permanent copy of the instructions 120. The instructions 120 may include: when executed by at least one of the processors 102, causing the electronic device 100 to implement the following Figure 3 In some embodiments, the instructions 120 , hardware, firmware, and / or software components thereof may additionally / alternatively be located in the system board 108 , the network interface 110 , and / or the processor 102 .
[0057] The network interface 110 may include a transceiver for providing a radio interface for the electronic device 100, 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 110 may be integrated with other components of the electronic device 100. For example, the network interface 110 may be integrated with at least one of the processor 102, the system memory 104, the non-volatile memory 106, and a firmware device (not shown) having instructions. When at least one of the processors 102 executes the instructions, the electronic device 100 implements Figure 2 Or one or more of the various embodiments shown in 3.
[0058] The network interface 110 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 110 may be a network adapter, a wireless network adapter, a telephone modem, and / or a wireless modem.
[0059] In one embodiment, at least one of the processors 102 may be packaged together with one or more controllers for the system motherboard 108 to form a system in package (SiP). In one embodiment, at least one of the processors 102 may be integrated on the same die with one or more controllers for the system motherboard 108 to form a system on a chip (SoC).
[0060] The electronic device 100 may further include an input / output (I / O) device 112 connected to the system motherboard 108. The I / O device 112 may include a user interface to enable a user to interact with the electronic device 100; the design of the peripheral component interface enables the peripheral components to interact with the electronic device 100. In some embodiments, the electronic device 100 further includes a sensor for determining at least one of an environmental condition and location information related to the electronic device 100.
[0061] In some embodiments, the I / O device 112 may include, but is 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., a light emitting diode flash), a keyboard, and a graphics card. The graphics card is composed of a graphics processor integrated with an I / O interface (e.g., a PCIE interface) that complies with the data transmission protocol specification.
[0062] 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.
[0063] In some embodiments, the sensors may include, but are not limited to, gyroscope sensors, accelerometers, proximity sensors, ambient light sensors, and positioning units. The positioning unit may also be part of or interact with the network interface 110 to communicate with components of a positioning network (e.g., global positioning system (GPS) satellites).
[0064] 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 100. In other embodiments of the present application, the electronic device 100 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.
[0065] 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 102 includes any system having a processor such as a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.
[0066] 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.
[0067] One or more aspects of at least one embodiment may be implemented by instructions stored on a computer-readable storage medium, which, when read and executed by a processor, enables an electronic device to implement the method of the embodiment described in the present invention.
[0068] The method for training a correlation model and the method for calculating a correlation score provided in this application can be applied to Figure 1 In the electronic device 100 shown, the electronic device 100 is, for example, a computer, a mobile device, a platform device, etc.
[0069] Figure 2 is a flowchart of a method for training a correlation model according to an embodiment of the present invention.
[0070] In the first encoding step S21, a plurality of training search words and a plurality of training titles are input into a first encoding model to obtain a plurality of first vector representations.
[0071] The first encoding model is the BERT (Bidirectional Encoder Representation from Transformers) model.
[0072] It can be understood that the training title is the text title used for training the model, and the training search term is the search term used for training the model.
[0073] In the text summarization step S22, a plurality of training texts are input into the trained text summarization model to generate text summary data.
[0074] Text summarization refers to the process of extracting, summarizing or refining key information from a text or a text collection through various techniques to summarize and display the main content or gist of the original text (collection).
[0075] Manual text summarization is a very costly process, so it is necessary to use a trained text summarization model to perform text summarization. The specific training process is as follows.
[0076] The existing text summarization model is pre-trained using public corpus data to obtain a pre-trained text summarization model.
[0077] Then, the pre-trained text summarization model is trained using the multiple training summaries to obtain a trained text summarization model. The multiple training summaries are, for example, obtained by manually summarizing text in advance. Specifically, the training summaries can be obtained by manually summarizing, for example, 5,000 texts.
[0078] These training summaries are used to fine-tune the pre-trained text summarization model, thereby achieving domain self-adaptation of the text summarization model. In other words, the trained text summarization model can achieve domain self-adaptation.
[0079] The training texts are a large amount of texts used for training. By inputting these training texts into the trained text summary model, text summary data of these training texts can be obtained.
[0080] Optionally, the training title in step S21 is the title of the training text in step S22.
[0081] In the second encoding step S23, the text summary data is input into the first encoding model (eg, BERT model) to obtain a plurality of second vector representations.
[0082] In the labeling step S24, the trained data enhancement model is used to label multiple training search terms and multiple training texts to obtain multiple labeled data.
[0083] The training of the correlation model is highly dependent on the labeled data, so it is necessary to quickly generate large-scale labeled data to train the correlation model. To this end, the present invention uses the trained data enhancement model to obtain these labeled data. The training process of the data enhancement model is as follows.
[0084] First, obtain the correlation score between each search term and each text. Specifically, for example, a large amount of existing unlabeled data (e.g., 50,000 pieces of data) can be selected, and these unlabeled data, for example, contain a large number of search terms and a large number of texts. These unlabeled data are manually labeled, for example, to obtain the correlation score between each search term and each text. In other words, multiple correlation scores can be obtained.
[0085] Secondly, the characteristic data of each pair of search words and texts are counted. The characteristic data includes, for example: the number of searches for the search word, the probability of clicking the text under the search word, the number of exposures of the text under the search word, the average exposure time of the text under the search word, the number of search word rewrites under the search word, etc.
[0086] The data enhancement model is trained using the above correlation scores and feature data to obtain a trained data enhancement model. The data enhancement model is, for example, a neural network model.
[0087] As described above, after obtaining the trained data enhancement model, multiple training search terms and multiple training texts are input into the trained data enhancement model for data annotation, thereby obtaining multiple (large amounts of) annotated data. These annotated data are training search terms and training texts annotated with relevance.
[0088] In the training step S25, the correlation model is trained using the multiple first vector representations, the multiple second vector representations, and the multiple labeled data to obtain a trained correlation model.
[0089] The correlation model is, for example, the BERT model.
[0090] In the present invention, a trained text summarization model is used to perform text summarization on a large amount of training texts, extract important text representation content (i.e., text summary data), and use the training search terms, training titles, and text summary data as inputs of the correlation model (i.e., training data), which can greatly improve the computational efficiency of the correlation model. In addition, the present invention uses a data enhancement model based on a neural network to annotate large-scale unlabeled data and perform data enhancement, thereby improving the accuracy of correlation model training.
[0091] Figure 3 is a flowchart of a method for calculating a relevance score according to an embodiment of the present invention.
[0092] In the acquisition step S31, the current search term and at least one text recalled by the current search term are acquired. Specifically, the current search term q is acquired, and then at least one text can be recalled by the current search term q.
[0093] In the calculation step S32, the current search term q and at least one text input are calculated according to the above Figure 2 The trained relevance model obtained by the method shown is used to calculate the relevance score between the current search term q and each text.
[0094] By using the trained correlation model in the present invention, the correlation score between the search term and the text can be calculated more accurately and efficiently, thereby providing better protection for the downstream links of the search.
[0095] Figure 6 A search method according to an embodiment of the present invention is used in an electronic device. Figure 6 As shown, the method includes:
[0096] S61, obtaining a search term input by a user.
[0097] S62, use according to Figure 3 The method for calculating the relevance score shown obtains the relevance score of each text in the search term and at least one recalled text.
[0098] S63, sorting the at least one text according to the relevance score and returning it to the user. For example, sorting the at least one text in descending order of relevance score and returning the texts to the user in the sorted order.
[0099] The present invention also provides a device 40 for training a correlation model, such as Figure 4 As shown, the device 40 includes: a first encoding unit 41, inputting multiple training search terms and multiple training titles into a first encoding model to obtain multiple first vector representations; a text summary unit 42, inputting multiple training texts into a trained text summary model to generate text summary data; a second encoding unit 43, inputting the text summary data into the first encoding model to obtain multiple second vector representations; a labeling unit 44, using a trained data enhancement model to perform data labeling on multiple training search terms and multiple training texts to obtain multiple labeled data; a training unit 45, using the multiple first vector representations, the multiple second vector representations, and the multiple labeled data to train the correlation model to obtain a trained correlation model.
[0100] It is understandable that the first encoding unit 41, the text summary unit 42, the second encoding unit 43, the labeling unit 44, and the training unit 45 can be implemented by the processor 102 having the functions of these modules or units in the electronic device 100. The implementation methods disclosed in the foregoing are method implementation methods corresponding to the present implementation method, and the present implementation method can be implemented in conjunction with the above-mentioned implementation methods. The relevant technical details mentioned in the above-mentioned implementation methods are still valid in the present implementation methods, and they will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in the present implementation methods can also be applied in the above-mentioned implementation methods.
[0101] The present invention also provides a device 50 for calculating a correlation score, such as Figure 5 As shown, the device 50 includes: an acquisition unit 51, which acquires the current search term and at least one text recalled by the current search term; a calculation unit 52, which inputs the current search term and at least one text into the Figure 4The device 40 uses the trained relevance model to calculate the relevance score between the current search term and each text.
[0102] It is understandable that the acquisition unit 51 and the calculation unit 52 can be implemented by the processor 102 having the functions of these modules or units in the electronic device 100. The embodiments disclosed in the foregoing are method embodiments corresponding to this embodiment, and this embodiment can be implemented in conjunction with the above-mentioned embodiments. The relevant technical details mentioned in the above-mentioned embodiments are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above-mentioned embodiments.
[0103] The present invention also provides a computer program product, comprising computer executable instructions, which are executed by the processor 102 to implement the method for training a correlation model or the method for calculating a correlation score of the present invention.
[0104] The present invention also provides a computer-readable storage medium having instructions stored thereon. When the instructions are executed on a computer, the computer executes the method for training a correlation model or the method for calculating a correlation score of the present invention.
[0105] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0106] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.
[0107] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0108] 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.
[0109] 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.
[0110] 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 correlation model, for use in electronic equipment, characterized in that: The method comprises: A first encoding step, inputting a plurality of training search words and a plurality of training titles into a first encoding model to obtain a plurality of first vector representations; In the text summarization step, multiple training texts are input into the trained text summarization model to generate text summary data; A second encoding step, inputting the text summary data into the first encoding model to obtain a plurality of second vector representations; a labeling step, using the trained data enhancement model to label the multiple training search terms and the multiple training texts to obtain multiple labeled data; The training step uses the multiple first vector representations, the multiple second vector representations, and the multiple labeled data to train the correlation model to obtain a trained correlation model.
2. The method according to claim 1, characterized in that The text summarization step comprises: Use public corpus data to pre-train the text summary model to obtain a pre-trained text summary model. The pre-trained text summary model is trained using a plurality of training summaries to obtain the trained text summary model.
3. The method according to claim 1, characterized in that The marking step comprises: Get the relevance score between each search term and each text; Count the feature data of each search word-text pair; The data enhancement model is trained using the plurality of correlation scores and the plurality of feature data to obtain the trained data enhancement model.
4. The method according to claim 3, characterized in that The data enhancement model is a neural network model.
5. The method according to any one of claims 1 to 4, characterized in that The first encoding model is a BERT model, and the correlation model is a BERT model.
6. A method for calculating a relevance score, for use in an electronic device, characterized in that: The method comprises: An acquisition step of acquiring a current search term and at least one text recalled by the current search term; The calculation step is to input the current search term and at least one of the texts into the trained relevance model according to any one of claims 1-5, and calculate the relevance score of the current search term and each of the texts.
7. A search method for an electronic device, characterized in that: The method comprises: Get the search term entered by the user; Using the method for calculating the relevance score according to claim 6, obtaining the relevance score of each text in the search term and at least one recalled text; The at least one text is sorted according to the relevance score and returned to the user.
8. A device for training a correlation model, characterized in that: The device comprises: A first encoding unit, inputting a plurality of training search words and a plurality of training titles into a first encoding model to obtain a plurality of first vector representations; A text summary unit, which inputs a plurality of training texts into a trained text summary model to generate text summary data; A second encoding unit, inputting the text summary data into the first encoding model to obtain a plurality of second vector representations; A labeling unit, using the trained data enhancement model to label the multiple training search terms and the multiple training texts to obtain multiple labeling data; A training unit trains the correlation model using the multiple first vector representations, the multiple second vector representations, and the multiple labeled data to obtain a trained correlation model.
9. A device for calculating a relevance score, characterized in that: The device comprises: An acquisition unit, which acquires a current search term and at least one text recalled by the current search term; A calculation unit inputs the current search term and at least one of the texts into the trained relevance model according to claim 7, and calculates the relevance score of the current search term and each of the texts.
10. A computer program product comprising computer executable instructions, characterized in that: The instructions are executed by a processor to implement the method for training a relevance model according to any one of claims 1 to 5, the method for calculating a relevance score according to claim 6, or the search method according to claim 7.
11. A computer-readable storage medium, characterized in that: The storage medium stores instructions, which, when executed on a computer, cause the computer to execute the method for training a correlation model described in any one of claims 1 to 5, the method for calculating a correlation score described in claim 6, or the search method described in claim 7.
12. An electronic device, characterized in that: include: one or more processors; one or more memories; Wherein, the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device executes the method for training a correlation model described in any one of claims 1 to 5, the method for calculating a correlation score described in claim 6, or the search method described in claim 7.
Citation Information
Patent Citations
Graph model text abstract generation method based on word frequency and semantics
CN111125349A
Search content sorting method and device, storage medium and electronic equipment
CN112100529A
Sorting model training method and device and electronic equipment
CN113590796A
Model training and sorting method and device, electronic equipment and storage medium
CN114595370A
Text abstract model training method and device
CN114861640A
