A method, device and electronic device for recommending text-related content
Through the combination of the pre-trained generative large model and the summary generation model, text keywords are obtained and weighted sorted summary information is generated, which solves the problem of lack of depth and breadth of text recommendation content in the existing technology and achieves high efficiency of information that users care about. Refining and displaying.
Patent Information
- Application Number
- CN202410524940.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-04-29
AI Technical Summary
Existing text recommendation methods cannot effectively capture the abstract concepts and general information of the text, resulting in a lack of depth and breadth in the recommended content, and the output is the entire text similar to the input text, making it impossible to refine and summarize specific issues in the recommended text. , requiring users to read all recommended texts.
By obtaining the text to be recommended, input it into the pre-trained generative large model to obtain keywords, perform weighted sorting, search the database to obtain relevant text, and input the relevant text into the summary generation model to generate multi-segment summary information, based on the weighted ranking of keywords Output summary information.
It realizes the display of summary information that users care about most and filters out redundant or irrelevant information. Users can obtain the content closest to the topic of the text to be recommended without reading the entire content, which improves the depth and breadth of recommendations.
Smart Images

Figure CN118094019B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of large model technology, and in particular to a method, device and electronic device for recommending text-related content. Background Art
[0002] A large language model is a deep learning model that contains hundreds of billions or more parameters, which are obtained through training with a large amount of text data. Based on the Transformer architecture, the large language model can process a large amount of natural language text, learn knowledge and language rules from it, and improve the ability to understand and generate natural language. Therefore, the large language model can achieve some tasks that are difficult to achieve with traditional methods, such as text generation, reading comprehension, common sense reasoning, etc.
[0003] Existing text recommendation methods are content-based text recommendation methods, which analyze the content features of the input text, calculate the similarity between the input text and other texts in the database, and use the text with the highest similarity as the recommended text. However, recommendation based on text similarity cannot capture the abstract concepts and general information of the text well, resulting in the lack of depth and breadth of the recommended text. In addition, recommendation based on text similarity outputs the entire text similar to the input text, and cannot refine and summarize the specific problems in the recommended text, requiring users to read the entire recommended text. Summary of the invention
[0004] The embodiments of the present application provide a method, device and electronic device for recommending text-related content, which can solve the problem of missing text recommendation content and low prominence.
[0005] In a first aspect, an embodiment of the present application provides a method for recommending text-related content, the method comprising:
[0006] Get the text of the official document to be recommended;
[0007] Inputting the official document text to be recommended into the pre-trained generative large model to obtain keywords related to the official document text to be recommended;
[0008] Performing weighted sorting on the keywords;
[0009] Search the database according to the keywords to obtain relevant official documents;
[0010] Inputting the relevant official document text into a summary generation model to obtain multiple summary information;
[0011] The plurality of pieces of summary information are sorted and output according to the weighted sorting of the keywords.
[0012] In one possible design, it also includes:
[0013] Obtain electronic official document data;
[0014] Preprocessing the electronic document data includes: word segmentation, stop word removal, and part-of-speech tagging;
[0015] The large model is trained using the low-rank adapter method to obtain a pre-trained generative large model.
[0016] In a possible design, the weighted sorting of the keywords includes:
[0017] The weight of each keyword is set according to the frequency of occurrence of the keyword in the official document to be recommended.
[0018] In one possible design, it also includes:
[0019] Searching for sentences in the relevant official document text that contain the keyword;
[0020] A plurality of summary information is generated by combining the sentences containing the keywords.
[0021] In one possible design, it also includes:
[0022] Count the types of keywords and the number of each keyword contained in each summary information;
[0023] Calculate the second weight according to the weight of each keyword and the quantity of each keyword;
[0024] The multiple pieces of summary information are sorted according to the second weight.
[0025] In a second aspect, an embodiment of the present application provides a text-related content recommendation device, the device comprising:
[0026] A receiving module, used for obtaining the text of the official document to be recommended;
[0027] The processing module is used to input the official document text to be recommended into a pre-trained generative large model to obtain keywords related to the official document text to be recommended; perform weighted sorting on the keywords; retrieve a database based on the keywords to obtain relevant official document texts; input the relevant official document texts into a summary generation model to obtain multiple sections of summary information; sort the multiple sections of summary information according to the weighted sorting of the keywords and output them.
[0028] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and one or more processors; wherein the memory is used to store computer program code, and the computer program code comprises computer instructions; when the computer instructions are executed by the processor, the electronic device executes part or all of the steps of the method in the first aspect or various possible implementations of the first aspect.
[0029] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores instructions. When the instructions are executed on a computer, the computer executes part or all of the steps of the method in the first aspect or various possible implementations of the first aspect.
[0030] The present application provides a method for recommending text-related content, including: obtaining a document to be recommended; inputting the document to be recommended into a pre-trained generative model to obtain keywords related to the document to be recommended; weighting and sorting the keywords; searching a database according to the keywords to obtain relevant document texts; inputting the relevant document texts into a summary generation model to obtain multiple sections of summary information; and sorting and outputting the multiple sections of summary information according to the weighted sorting of the keywords. By adding keyword weight information, the generated summary information is comprehensively sorted by text importance and relevance, so that the summary information that the user may be most concerned about is displayed in the most important position, and only certain key information is displayed, while other redundant or irrelevant information is filtered out. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0032] Figure 1 A flow chart of a method for recommending text-related content provided in an embodiment of the present application;
[0033] Figure 2 A schematic diagram of an exemplary composition of a text-related content recommendation device 200 provided in an embodiment of the present application;
[0034] Figure 3 This is a schematic diagram of an exemplary structure of an electronic device 300 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The technical solution of the embodiment of the present application will be described below in conjunction with the drawings in the embodiment of the present application.
[0036] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind of", "described", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear contrary indication in its context. It should also be understood that although the terms first, second, etc. may be used to describe a certain class of objects in the following embodiments, the objects should not be limited to these terms. These terms are only used to distinguish the specific objects of this class of objects. For example, the terms first, second, etc. may be used to describe weights in the following embodiments, but weights should not be limited to these terms. These terms are only used to distinguish different weights. The same is true for other classes of objects that may be described in the following embodiments using the terms first, second, etc., and will not be repeated here.
[0037] The following introduces the implementation scenarios involved in the embodiments of the present application and explanations of technical terms.
[0038] The embodiments of the present application relate to the technical field of pre-trained large models, using an official document library as a knowledge base and publicly available official document texts as a model parameter adjustment data set to achieve keyword-centered generation and recommendation of multi-segment text summaries.
[0039] The following describes the text-related content recommendation method involved in the embodiments of the present application through several implementation methods.
[0040] like Figure 1 As shown, Figure 1 A method 100 for recommending text-related content (hereinafter referred to as method 100 ) is shown. The method 100 includes the following steps:
[0041] Step S101, obtaining the text of the official document to be recommended.
[0042] In this embodiment, the document text to be recommended can be a phrase or sentence directly input by the user or a whole document. In addition, the embodiment of the present application can also be applied to scenarios such as comprehensive collaborative office in enterprises. For example, in the approval of various types of documents in the electronic document circulation link, the key content of the document can be analyzed at the corresponding position in the approval link.
[0043] Step S102: input the official document text to be recommended into a pre-trained generative large model to obtain keywords related to the official document text to be recommended.
[0044] In this embodiment, the keyword may be one or more keywords, which are used to represent the key information and main content of the official document to be recommended.
[0045] Step S103: performing weighted sorting on the keywords.
[0046] Step S104, searching the database according to the keyword to obtain relevant official document texts.
[0047] In this embodiment, the official document data in the database is obtained from the electronic official document system, and also includes the content in the publicly available national policy document library. All official document data are aggregated and pre-processed to obtain the retrieval database of this application.
[0048] Step S105: input the relevant official document text into a summary generation model to obtain multiple summary information.
[0049] In this embodiment, one summary information may be generated for each relevant official document text, multiple paragraphs of summary information may be generated for multiple relevant official document texts, or multiple paragraphs of summary information may be generated for each relevant official document text, and this application does not impose any limitation on this.
[0050] Step S106: sort the multiple pieces of summary information according to the weighted sorting of the keywords and output them.
[0051] In an optional implementation, the method further includes:
[0052] Obtain electronic official document data;
[0053] Preprocessing the electronic document data includes: word segmentation, stop word removal, and part-of-speech tagging;
[0054] The large model is trained using the low-rank adapter method to obtain a pre-trained generative large model. In this embodiment, electronic document data is first collected from the electronic document system and the public national policy document library, and the electronic document data is sorted and cleaned to ensure the accuracy and completeness of the electronic document data. Data preprocessing is then performed, including: word segmentation, removal of stop words, part-of-speech tagging, etc., to facilitate subsequent model training. Since the amount of document data is small, the low-rank adapter method is used to fine-tune the pre-trained generative model. The low-rank adapter method can reduce the number of parameters to be updated during training, thereby reducing memory requirements, and accelerates the training and fine-tuning of the pre-trained generative large model by simplifying computing requirements.
[0055] In an optional implementation manner, the weighted sorting of the keywords includes:
[0056] The weight of each keyword is set according to the frequency of occurrence of the keyword in the official document to be recommended. In this embodiment, the keywords are weighted by the term frequency-inverse document frequency index method (TF-IDF). For each keyword, its weight increases in direct proportion to the number of times it appears in the document, and its weight decreases in inverse proportion to the frequency of its appearance in the corpus. By weighted sorting of keywords using the TF-IDF method, the keywords that can best characterize the text to be recommended can be ranked higher.
[0057] In an optional implementation, the method further includes:
[0058] Searching for sentences in the relevant official document text that contain the keyword;
[0059] Combine the sentences containing the keywords and generate multiple paragraphs of summary information. In this embodiment, in the relevant official document text obtained by searching the database based on keywords, not all the texts are keyword-related content. Each official document has a topic that is described in detail and also has related topics. If the summary is directly generated without considering the keywords, key information may be ignored or lost in the summary, thereby reducing the quality and effectiveness of the summary. Therefore, it is necessary to first find the content related to the keywords in the relevant official document text, and then combine the content related to the keywords to generate summary information through the summary generation model. The summary information obtained in this way is the content related to the keywords, and is also the summary information related to the official document text to be recommended.
[0060] In an optional implementation, the method further includes:
[0061] Count the types of keywords and the number of each keyword contained in each summary information;
[0062] Calculate the second weight according to the weight of each keyword and the quantity of each keyword;
[0063] The multiple pieces of summary information are sorted according to the second weight.
[0064] In this embodiment, multiple related official documents correspond to multiple summary information. When output to the user, there needs to be a sequence, and the subject of each official document may be different. Therefore, multiple summary information needs to be sorted. A summary information may contain multiple keywords, and the same keyword may appear multiple times. Therefore, the second weight of each summary information is calculated according to the type and number of keywords, and sorted according to the second weight. Sorting the summary information by keyword weight can make the content of the key topic ranked first, so that users have a better reference experience.
[0065] In summary, the text-related content recommendation method of the embodiment of the present application generates keywords through a generative large model, and sorts and displays the summary information according to the keyword weight, which can better recommend the content related to the official document text to be recommended. And the generated result is summary, which can extract the most representative and relevant sentences in the text, and the user can get the content closest to the theme of the official document without reading the entire content. Retrieving related texts through keywords is not limited by user input and can be applied to texts of various types and lengths. And keywords usually have strong semantic interpretability, which can intuitively reflect the theme and content of the official document text to be recommended. In addition, the summary information is sorted and displayed, and the user can grasp the closest recommendation focus at the first time, directly reflecting the strong correlation between the recommended text and the text to be recommended.
[0066] correspond Figure 1 The method described above, and an embodiment of the present application also provides a device for executing the above method.
[0067] like Figure 2 As shown, Figure 2 A text-related content recommendation device 200 is shown, the device comprising:
[0068] Receiving module 201, used for obtaining the text of the official document to be recommended;
[0069] The processing module 202 is used to input the official document text to be recommended into the pre-trained generative large model to obtain keywords related to the official document text to be recommended; perform weighted sorting on the keywords; retrieve the database according to the keywords to obtain relevant official document texts; input the relevant official document texts into the summary generation model to obtain multiple paragraphs of summary information; sort the multiple paragraphs of summary information according to the weighted sorting of the keywords and output them.
[0070] It can be understood that the division of the above modules / units is only a division of logical functions. In actual implementation, the functions of the above modules can be integrated into hardware entities. For example, the functions of the processing module can be integrated into the processor, and the functions of the receiving module can be integrated into the transceiver. The programs and instructions for implementing the functions of the above modules can be maintained in the memory. Figure 3 An electronic device 300 is provided, which may include a processor 301, a transceiver 302 and a memory 303. The transceiver 302 is used to perform the transmission and reception of various data and signals in the method 100. The memory 303 may be used to store programs / codes etc. required for the processor 301 to perform the method 100.
[0071] In a specific implementation, corresponding to the aforementioned electronic device 300, the embodiment of the present application further provides a computer storage medium, wherein the computer storage medium provided in the electronic device 300 may store a program, and when the program is executed, some or all of the steps in each embodiment including method 100 to method 300 may be implemented. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0072] Those skilled in the art will appreciate that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0073] In the several embodiments provided in the present application, it should be understood that the disclosed methods, devices and systems can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0074] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0075] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0076] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a cloud game control device, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., and other media that can store program codes.
[0077] Although the optional embodiments of the present application have been described, those skilled in the art, once informed of the basic creative concept, may make additional changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiment and all changes and modifications falling within the scope of the present application.
[0078] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present invention.
Claims
1. A method for recommending text-related content. It is characterized in that The method is implemented by only the following steps: Get the text of the official document to be recommended; Inputting the official document text to be recommended into the pre-trained generative large model to obtain keywords related to the official document text to be recommended; Performing weighted sorting on the keywords; Search the database according to the keywords to obtain relevant official documents; Inputting the relevant official document text into a summary generation model to obtain multiple paragraphs of summary information; wherein multiple paragraphs of summary information are generated for each relevant official document text; Sorting and outputting the plurality of summary information segments according to the weighted ranking of the keywords includes: Count the types of keywords and the number of each keyword contained in each summary information; Calculate the second weight according to the weight of each keyword and the quantity of each keyword; The multiple pieces of summary information are sorted according to the second weight.
2. The method according to claim 1, It is characterized in that Also includes: Obtain electronic official document data; Preprocessing the electronic document data includes: word segmentation, stop word removal, and part-of-speech tagging; The large model is trained using the low-rank adapter method to obtain a pre-trained generative large model.
3. The method according to claim 1, It is characterized in that The weighted sorting of the keywords includes: The weight of each keyword is set according to the frequency of occurrence of the keyword in the official document to be recommended.
4. The method according to claim 1, It is characterized in that Also includes: Searching for sentences in the relevant official document text that contain the keyword; A plurality of summary information is generated by combining the sentences containing the keywords.
5. A text-related content recommendation device, It is characterized in that The device is used to implement the text-related content recommendation method according to any one of claims 1 to 4, specifically comprising: A receiving module, used for obtaining the text of the official document to be recommended; The processing module is used to input the official document text to be recommended into a pre-trained generative large model to obtain keywords related to the official document text to be recommended; perform weighted sorting on the keywords; retrieve a database based on the keywords to obtain relevant official document texts; input the relevant official document texts into a summary generation model to obtain multiple sections of summary information; sort the multiple sections of summary information according to the weighted sorting of the keywords and output them.
6. An electronic device, It is characterized in that The electronic device comprises a memory and one or more processors; wherein, The memory is used to store computer program codes, wherein the computer program codes include computer instructions; when the computer instructions are executed by the processor, the electronic device executes the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, It is characterized in that The method comprises a computer program, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 4.
