Article title generation method based on end-to-end deep learning model
By generating article titles using an end-to-end deep learning model, this technology solves the problems of low relevance and poor diversity between titles and articles in existing technologies, achieving high-quality and diverse title generation, which is applicable to vertical fields such as automotive.
Patent Information
- Application Number
- CN202011451526.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-09
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2040-12-09
AI Technical Summary
In existing technologies, the titles generated by automatic title generation methods for vertical domain articles have low relevance to the article body, poor diversity, and cannot be manually controlled in terms of content format.
An article title generation method based on an end-to-end deep learning model is adopted to generate high-quality and diverse article titles through article category classification, intent classification and word segmentation.
The generated titles are highly relevant to the article content, offer good diversity, allow for manual control of content format, and are suitable for different vertical fields.
Smart Images

Figure CN112560458B_ABST
Abstract
Description
Technical Field
[0001] The present invention specifically relates to a method for generating article titles based on an end-to-end deep learning model. Background Art
[0002] There are currently two main solutions to the problem of automatic generation of titles for vertical articles:
[0003] (1) Search for titles of articles in vertical fields on the Internet based on user input.
[0004] (2) After collecting the titles of articles in the vertical field, summarize the content patterns, manually write title templates, and fill in the specific information of the articles in the templates to generate titles.
[0005] The prior art has the following disadvantages:
[0006] (1) The automatic title generation method based on search and template has a low correlation between the generated title and the article body, which will give readers a bad feeling that the title does not match the article.
[0007] (2) The titles generated by the existing technology have poor diversity and cannot be manually controlled in terms of title content. Summary of the invention
[0008] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides an article title generation method based on an end-to-end deep learning model.
[0009] In order to achieve the above object, the present invention provides the following technical solutions:
[0010] The article title generation method based on the end-to-end deep learning model includes the following steps:
[0011] (1) Input the article body into the article category classification model to obtain the article category; divide the article into small segments and use the intent classification model to predict the article intent; based on the article category and article intent, from the popular title intent combinations under the article category, give priority to selecting the title intent combination consisting of the article intent;
[0012] (2) Segment the text of the article, select the abstract, and obtain the main text summary;
[0013] (3) The input data is obtained by combining and splicing the main text summary, article category, and title intention, and then input into the end-to-end title generation model to obtain the article title.
[0014] Furthermore, the construction of the end-to-end title generation model includes data set establishment and model training, and the data set establishment and model training include the following steps:
[0015] (1.1) Collect articles in vertical fields;
[0016] (1.2) Experts in vertical fields classify the articles in the article corpus obtained in step (1.1) to obtain article categories; select a certain amount of articles to obtain an article data set {A1, A2, A3...A i ...A n}, n is the number of articles, A i represents the i-th article, 1≤i≤n; the articles are classified and labeled to obtain the article category dataset {C1, C2, C3...C i ……C n}, where C i Yes A i Article categories, train the BERT model to obtain the article category classification model;
[0017] (1.3) The article titles are divided into small segments according to punctuation marks, and the small segment title dataset {T1, T2, T3...T t ……T m},T t represents the t-th sub-section title, m is the number of sub-section titles, 1≤t≤m, and the intent of each sub-section is classified and annotated to obtain the title intent dataset {M1, M2, M3…M t ……M m}, where M t ={I1, I2, I3...I t ……I kt} is the intention corresponding to the t-th sub-section title, where k t is the number of intentions of the t-th sub-section title, k t is a non-zero natural number, and the BERT model is trained to obtain the intent classification model;
[0018] (1.4) Process the entire article corpus: Use the model obtained in steps (1.2) and (1.3) to predict the article category and title intent combination; segment the article body and article title, select the article summary, concatenate the article category, title intent combination and article summary as input, use the segmented title as the prediction target, and train the transformer model to obtain an end-to-end title generation model.
[0019] Furthermore, according to the article category and title intent combination obtained in step (1.4), the title intent combination is classified according to the article category, and the articles are sorted according to the number of readings on the Internet to obtain the popular title intent combination under each article category.
[0020] Furthermore, step (1) is specifically as follows: inputting the article body into the article category classification model in step (1.2), predicting the article category for the article body, dividing the article body into small segments according to punctuation marks, and using the intent classification model in step (1.3) to predict the article intent, and according to the article category and article intent, from the popular title intent combinations under the corresponding article category, giving priority to the title intent combination consisting of the article intent; that is to say: calculating the intent ratio of the popular title intent combinations belonging to the article intent, and then selecting the intent combination with a high intent ratio as the title intent combination.
[0021] Furthermore, step (2) is specifically as follows: use the sentencepiece word segmentation tool to segment the main text of the article, calculate the total number of words in the article, and if it does not exceed 500, use the entire main text as the summary; if it exceeds 500, select the first 400 words and the last 100 words of the article to form the main text summary.
[0022] Furthermore, step (3) is specifically as follows: the article category, title intent combination and text summary are concatenated with spaces and then input into the end-to-end title generation model to generate the corresponding article title.
[0023] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned article title generation method can be implemented.
[0024] A computer-readable storage medium stores a computer program, which can implement the steps in the above-mentioned article title generation method when executed by a processor.
[0025] The beneficial effects of the present invention are:
[0026] (1) The present invention adopts deep learning technology to classify articles and identify the intent of article titles, and provides a combination of article categories and title intent at the input end. This additional information optimizes the quality of title generation, and can manually control the title content form, with greater diversity.
[0027] (2) The present invention can select popular title intent combinations, and the generated title content is more attractive. Because the title content generated by the model is related to the input intent combination, the content form of the title can be controlled by giving different intent combinations, which is very useful when the title of the article needs to highlight certain aspects of the content.
[0028] (3) The title diversity obtained by the method of the present invention is better, and the article title generation method of the present invention can be easily and quickly migrated to different vertical fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is the flowchart of title generation model training.
[0030] Figure 2 It is a flowchart of title generation.
[0031] Figure 3 It is a schematic diagram of a computer device. DETAILED DESCRIPTION
[0032] The technical solution of the present invention in the automotive field is further described in detail below in conjunction with the accompanying drawings. It should be pointed out that the specific implementation methods are only detailed descriptions of the present invention and should not be regarded as limitations of the present invention.
[0033] Example 1
[0034] like Figure 2 As shown in FIG. 1 , the article title generation method based on the end-to-end deep learning model includes the following steps:
[0035] (1) Inputting the article body into the article category classification model to obtain the article category; based on the article category and the intent contained in the article, preferentially selecting the title intent combination composed of the article intent from the popular title intent combinations under the category;
[0036] (2) Segment the text of the article, select the abstract, and obtain the main text summary;
[0037] (3) The input data is obtained by combining and splicing the main text summary, article category, and title intention, and then input into the end-to-end title generation model to obtain the article title.
[0038] In some preferred embodiments, the construction of the end-to-end title generation model includes data set establishment and model training, such as Figure 1 As shown, the data set establishment and model training include the following steps:
[0039] (1.1) Collecting articles in vertical fields; in this embodiment, the vertical field is the automotive field;
[0040] (1.2) Experts in the automotive field conduct inductive analysis on the automotive articles in the article corpus obtained in step (1.1) and obtain 21 article categories, such as single-car shopping guide, double-car comparison, etc. They summarize the characteristics of articles in each category, compile article classification and annotation guidelines, and guide data annotation personnel to learn. We select about several thousand articles and obtain the article dataset {A1, A2, A3...A i ...A n}, n is the number of articles, A i represents the i-th article, A nrepresents the nth article, 1≤i≤n. Data annotators analyze the features of the articles based on the content of the automobile articles, and then determine whether the articles belong to a certain category, and obtain the article category data set {C1, C2, C3...C i ……C n}, where C i Yes A i The article category. The BERT model is trained with the above data set to obtain an article category classification model; the BERT model here is a conventional BERT model in the prior art, and the present invention does not improve it.
[0041] (1.3) Experts in the automotive field summarized and analyzed the titles of automotive articles and obtained 26 title intent categories, such as power, price, appearance, etc. The characteristics of each title intent category were summarized, and an intent classification annotation guide was written to explain the content form or keywords corresponding to each intent category, and some examples were attached to guide data annotators to learn according to the annotation guide. The titles of about several thousand articles were selected and divided into small segments according to punctuation marks to obtain a small segment title dataset {T1, T2, T3...T t ……T m},T t Indicates the title of the tth paragraph, T m represents the mth sub-section title, where m is the number of sub-section titles, 1≤t≤m. Data annotators classify the intent according to the content of each sub-section title. Each sub-section may correspond to one or more intents, and the title intent dataset {M1, M2, M3…M t ……M m}, where M t ={I1, I2, I3...I t ……I kt} is the intention corresponding to the t-th sub-section title, where k t is the number of intentions of the t-th sub-section title, k t A non-zero natural number.
[0042] The BERT model is trained using the above data set to obtain an intent classification model; the BERT model here is a conventional BERT model in the prior art, and the present invention does not improve it.
[0043] (1.4) Processing the entire article corpus: Use the model obtained in steps (1.2) and (1.3) to predict the article category a and the title intent combination b; Use the sentencepiece segmentation tool to segment the article body and the article title. After segmenting the article body, calculate the total number of words in the article. If it does not exceed 500, use the entire article as the summary c. If it exceeds 500, select the first 400 words and the last 100 words of the article to form the article summary c. Use the article category a, the title intent combination b and the article summary c concatenated with spaces as input, use the segmented title d as the prediction target, and train the transformer model to obtain an end-to-end title generation model. The transformer model here is a model known in the prior art, and the present invention does not improve it.
[0044] In some preferred methods, according to the article category and title intent combination obtained in step (1.4), the title intent combination is classified according to the article category, and the article is sorted according to the number of articles read on the Internet to obtain the popular title intent combination under each article category. Because an article has a corresponding article category and title intent combination, the article category and title intent combination are interrelated, and the title intent combination can be classified according to the article category. After the category of the article is determined, the article category corresponding to the title intent combination of the article is also determined. The popular title intent combination is the intent combination corresponding to the title of the popular article.
[0045] In some preferred embodiments, step (1) specifically includes: inputting the article body into the article category classification model in step (1.2) described above, and predicting the article category of the article body, for example, classifying an article to obtain its article category as "bicycle shopping guide";
[0046] Divide the article body into small segments according to punctuation marks, and use the intent classification model in step (1.3) to predict the intent contained in the article. For example, the intent combination of the article is {power, price, appearance}; according to the article category and the intent contained in the article, select the popular title intent combination under the corresponding article category from the obtained popular title intent combinations, and give priority to the title intent combination composed of the article intent; that is to say: calculate the intent ratio of the popular title intent combination to the article intent, and then select the intent combination with a high intent ratio as the title intent combination.
[0047] For example, the popular title intent combinations under the category of "Bicycle Shopping Guide" are {"Power, Price", "Price, Appearance", "Power, Interior"}. Calculate the proportion of the intents in these title intent combinations that belong to the article intent, and select the intent combination with a high proportion as the title intent combination. The intention ratio of "Power, Price" and "Price, Appearance" is 100%, while the intention ratio of "Power, Interior" is 50%, so "Power, Price" and "Price, Appearance" are selected.
[0048] Although the intent classification model is trained using title intent data, the difference between the title content and the body content is not significant. Using this model to predict the body of the article to obtain the intent contained in the article also has good results.
[0049] In some preferred methods, step (2) is specifically as follows: use the sentencepiece word segmentation tool to segment the main text of the article, calculate the total number of words in the article, and if it does not exceed 500, use the entire main text as the summary; if it exceeds 500, select the first 400 words and the last 100 words of the article to form the main text summary.
[0050] In some preferred methods, step (3) is specifically as follows: the article category, title intent combination and text summary are concatenated with spaces and input into an end-to-end title generation model to generate a corresponding article title, in which the title content corresponds to the title intent combination.
[0051] Example 2, refer to the attached Figure 3 .
[0052] In this embodiment, a computer device 100 is provided, including a memory 102, a processor 101, and a computer program 103 stored in the memory 102 and executable on the processor 101. When the processor 101 executes the computer program 103, the steps in the article title generation method provided in the above-mentioned embodiment 1 can be implemented.
[0053] Example 3
[0054] In this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the article title generation method provided in the above-mentioned embodiments can be implemented.
[0055] In this embodiment, the computer program may be the computer program in Embodiment 2.
[0056] In this embodiment, the computer-readable storage medium can be executed by the computer device in Embodiment 2.
[0057] Those skilled in the art can understand that all or part of the processes in the above embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0058] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0059] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the attached claims.
Claims
1. Article title generation method based on end-to-end deep learning model, Its characteristics are: The following steps are involved: (1) Input the article text into the article category classification model to obtain the article category; Split the article into small segments and use the intent classification model to predict the intent of the article; According to the article category and article intent, calculate the intent ratio of the popular title intent combinations under the article category to the article intent, and then select the intent combination with the highest intent ratio as the title intent combination; (2) Segment the text of the article, select the abstract, and obtain the main text summary; (3) The input data is obtained by combining the article summary, article category, and title intent, and then input into the end-to-end title generation model to obtain the article title; The construction of the end-to-end title generation model includes data set establishment and model training, and the data set establishment and model training include the following steps: (1.1) Collect articles in vertical fields; (1.2) Experts in vertical fields classify the articles in the article corpus obtained in step (1.1) to obtain article categories; select a certain amount of articles to obtain an article dataset {A 1 , A 2 , A 3 ...A i ...A n }, n is the number of articles, A i represents the i-th article, 1≤i≤n; the articles are classified and annotated to obtain the article category dataset {C 1 , C 2 , C 3 ……C i ……C n }, where C i Yes A i Article categories, train the BERT model to obtain the article category classification model; (1.3) Segment the article titles into small segments according to punctuation marks, and obtain the small segment title dataset {T 1 , T 2 , T 3 ……T t ……T m }, T t represents the t-th sub-section title, m is the number of sub-section titles, 1≤t≤m, and the intent of each sub-section is classified and annotated to obtain the title intent dataset {M 1 , M 2 , M 3 ……M t ……M m },in, is the intention corresponding to the t-th subsection title, where is the number of intentions of the t-th subsection title, is a non-zero natural number, and the BERT model is trained to obtain the intent classification model; (1.4) Process the entire article corpus: Use the model obtained in steps (1.2) and (1.3) to predict the article category and title intent combination; segment the article body and article title, select the article summary, concatenate the article category, title intent combination and article summary as input, use the segmented title as the prediction target, and train the transformer model to obtain an end-to-end title generation model.
2. The article title generation method based on the end-to-end deep learning model according to claim 1, Its characteristics are: According to the article category and title intent combinations obtained in step (1.4), the title intent combinations are classified according to the article category, and sorted according to the number of articles read on the Internet to obtain the popular title intent combinations under each article category.
3. The article title generation method based on the end-to-end deep learning model according to claim 2, Its characteristics are: Step (1) is specifically as follows: input the article body into the article category classification model in step (1.2), predict the article category for the article body, divide the article body into small segments according to punctuation marks, use the intent classification model in step (1.3) to predict the article intent, and according to the article category and article intent, calculate the intent ratio of the popular title intent combinations under the corresponding article category, and then select the intent combination with a high intent ratio as the title intent combination.
4. The article title generation method based on the end-to-end deep learning model according to claim 1, Its characteristics are: Step (2) is as follows: Use the sentencepiece word segmentation tool to segment the main text of the article and calculate the total number of words in the article. If it does not exceed 500, the entire article is used as the summary. If it exceeds 500, the first 400 words and the last 100 words of the article are selected to form the main text summary.
5. The article title generation method based on the end-to-end deep learning model according to claim 1, Its characteristics are: Step (3) is as follows: the article category, title intent combination and text summary are concatenated with spaces and input into the end-to-end title generation model to generate the corresponding article title.
6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, Its characteristics are: When the processor executes the computer program, the steps in the article title generation method described in any one of claims 1 to 5 can be implemented.
7. A computer-readable storage medium having a computer program stored thereon, Its characteristics are: When the computer program is executed by a processor, the steps in the article title generation method described in any one of claims 1 to 5 can be implemented.
Citation Information
Patent Citations
Title generation method and device, storage medium and server
CN108509417A
A method and apparatus for generating a text title
CN109299477A
Text intention recognition method and device
CN111931513A
