Project splitting method, device, equipment and storage medium based on topic prediction
By performing paragraph splitting and theme prediction of policy documents and combining with title generation model, automated project splitting is achieved, solving the problem of inefficiency of traditional methods and improving the efficiency and accuracy of project splitting.
Patent Information
- Application Number
- CN202111181607.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-11
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-10-11
AI Technical Summary
The traditional method of dismantling policy support projects is not efficient, and business personnel need to read a large number of policy documents to manually split and analyze support projects.
Using the project splitting method based on theme prediction, the paragraphs are split by paragraphs on the original policy documents and the pre-trained standard theme prediction model is used to predict the paragraphs, splice the same theme and generate project titles using the title generation model. , realize automatic splitting of projects.
It improves the efficiency of project splitting, reduces the time and cost of manual analysis, and enables more quickly to extract multiple support projects from policy documents and conducts comprehensive analysis.
Smart Images

Figure CN113887198B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a project splitting method, device, electronic device and computer-readable storage medium based on topic prediction. Background Art
[0002] With the development of science and technology and economic progress, more and more support policies for enterprise development have emerged. A comprehensive analysis of the support policies is conducive to the better development of enterprises. The premise of the analysis is to disassemble multiple support projects from the support policies and conduct a comprehensive analysis based on the disassembled support projects. Traditional policy support project disassembly is usually done by business personnel who read the support policy documents, obtain multiple support projects based on the relevant content of the support projects mentioned in the policy, and summarize the names of the support projects for business use. This method is not efficient, so it is urgent to propose a more efficient project splitting method. Summary of the invention
[0003] The present invention provides a project splitting method, device and computer-readable storage medium based on topic prediction, the main purpose of which is to improve the efficiency of project splitting.
[0004] To achieve the above object, the present invention provides a project splitting method based on topic prediction, comprising:
[0005] Obtaining an original policy document, and dividing the original policy document into paragraphs to obtain multiple paragraphs;
[0006] Using a pre-trained standard topic prediction model to perform topic prediction on the plurality of paragraphs, to obtain topics corresponding to the paragraphs;
[0007] The paragraphs with the same theme are spliced together to obtain spliced paragraphs, and a pre-trained title generation model is used to perform title generation processing on the spliced paragraphs to obtain split items.
[0008] Optionally, before using a pre-trained standard topic prediction model to perform topic prediction on the plurality of paragraphs, the method includes:
[0009] Using the pre-acquired training paragraph set to train the preset topic prediction model, to obtain a trained initial topic prediction model;
[0010] The initial topic prediction model is subjected to dimensionality reduction processing to obtain a trained standard topic prediction model.
[0011] Optionally, the using the pre-acquired training paragraph set to train a preset topic prediction model to obtain a trained initial topic prediction model includes:
[0012] Perform word frequency analysis on the training paragraphs in the pre-acquired training paragraph set to obtain a word frequency matrix;
[0013] Based on a plurality of preset topics, the word frequency matrix is randomly numbered to obtain a topic number corresponding to the word frequency matrix;
[0014] Using the topic number as an input value of the topic prediction model, and calculating the Gibbs sampling value and the Dirichlet parameter estimation value of the topic prediction model;
[0015] The Gibbs sampling value and the Dirichlet parameter estimation value are used as model parameters of the topic prediction model to obtain a trained initial topic prediction model.
[0016] Optionally, performing word frequency analysis on the training paragraphs in the training paragraph set to obtain a word frequency matrix includes:
[0017] Performing word segmentation processing on the training paragraphs in the training paragraph set to obtain a training word segmentation set;
[0018] Filtering the training segmented words in the training segmented word set that are consistent with the keywords in the preset keyword library as training keywords, and summarizing the training keywords to obtain a training keyword set;
[0019] The keyword identifier and the keyword frequency corresponding to each keyword in the training keyword set are obtained, and a corresponding frequency matrix is constructed according to the keyword identifier and the keyword frequency.
[0020] Optionally, the randomly numbering the word frequency matrix based on a plurality of preset topics to obtain the topic numbers corresponding to the word frequency matrix includes:
[0021] Numbering the multiple topics to obtain numbers corresponding to the topics;
[0022] A topic reference table corresponding to the preset multiple topics is obtained, and the word frequency matrix with the same topic as that in the topic reference table is marked with a corresponding number to obtain the topic number corresponding to the word frequency matrix.
[0023] Optionally, performing dimensionality reduction processing on the initial topic prediction model to obtain a trained standard topic prediction model includes:
[0024] Using the initial topic prediction model to perform topic prediction on multiple training paragraphs in the training paragraph set to obtain paragraph topics corresponding to the training paragraphs;
[0025] Calculating the similarity between any two paragraph topics among the multiple paragraph topics respectively, and selecting the paragraph topics whose similarity is greater than a preset similarity threshold;
[0026] A preset number of paragraph topics among the paragraph topics whose similarity is greater than a preset similarity threshold are selected as target topics, and the initial topic prediction model is trained using the target topics to obtain a trained standard topic prediction model.
[0027] Optionally, before performing title generation processing on the concatenated paragraphs using a pre-trained title generation model, the method includes:
[0028] Obtaining the original text of the annotated paragraph, and inputting the original text of the annotated paragraph into the encoder of the title generation model for encoding to obtain encoded data;
[0029] Taking a weighted average of the subject and the hidden layer output by the encoder to obtain an attention vector;
[0030] Extracting the annotated title in the original text of the annotated paragraph, inputting the annotated title, the attention vector and the preset hidden features into a decoder in the title generation model for decoding, and obtaining a predicted item title;
[0031] Determine whether the predicted project title is consistent with the preset real project title. If the predicted project title is consistent with the preset real project title, output the title generation model as a pre-trained title generation model.
[0032] In order to solve the above problems, the present invention also provides a project splitting device based on topic prediction, the device comprising:
[0033] A paragraph splitting module is used to obtain an original policy document and split the original policy document into paragraphs to obtain multiple paragraphs;
[0034] A topic prediction module, used to use a pre-trained standard topic prediction model to perform topic prediction on the plurality of paragraphs to obtain topics corresponding to the paragraphs;
[0035] The title generation module is used to splice the paragraphs with the same theme to obtain spliced paragraphs, and use the pre-trained title generation model to perform title generation processing on the spliced paragraphs to obtain split items.
[0036] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0037] at least one processor; and,
[0038] a memory communicatively connected to the at least one processor; wherein,
[0039] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the above-mentioned project splitting method based on topic prediction.
[0040] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned project splitting method based on topic prediction.
[0041] The embodiment of the present invention splits the original policy document into paragraphs to obtain multiple paragraphs, performs preliminary splitting of the original policy document from the perspective of paragraphs, provides a data basis for subsequent project splitting, and splices the paragraphs with the same theme in the themes corresponding to the paragraphs obtained after performing topic prediction on multiple paragraphs using a pre-trained standard topic prediction model to obtain spliced paragraphs. The spliced paragraphs obtained by splicing paragraphs with the same project theme are the split projects, and a trained project title generation model is used to generate project titles for the spliced paragraphs to obtain split projects. Therefore, the project splitting method, device, electronic device and computer-readable storage medium based on topic prediction proposed by the present invention can improve the efficiency of project splitting. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of a process flow of a project splitting method based on topic prediction provided by an embodiment of the present invention;
[0043] Figure 2 A functional module diagram of a project splitting device based on topic prediction provided by an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of the structure of an electronic device for implementing the project splitting method based on topic prediction provided by an embodiment of the present invention.
[0045] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0046] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0047] An embodiment of the present application provides a project splitting method based on theme prediction. The execution subject of the project splitting method based on theme prediction includes, but is not limited to, at least one of electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the project splitting method based on theme prediction can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to: a single server, a server cluster, a cloud server, or a cloud server cluster, etc. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0048] Referring to Figure 1 As shown, it is a schematic flowchart of a project splitting method based on theme prediction provided by an embodiment of the present invention. In this embodiment, the project splitting method based on theme prediction includes:
[0049] S1. Obtain the original policy document, perform paragraph splitting on the original policy document to obtain multiple paragraphs.
[0050] In an embodiment of the present invention, the original policy document may be a support policy project book or other types of project documents. The original policy document can be downloaded from the database of the government department.
[0051] Specifically, the performing paragraph splitting on the original policy document to obtain multiple paragraphs includes:
[0052] Identify the text labels in the original policy document;
[0053] Use the text labels as splitting points to split the original policy document to obtain multiple paragraphs.
[0054] In detail, the original policy document contains multiple paragraphs and text labels corresponding to the multiple paragraphs. Among them, the text labels include different forms and corresponding meanings. For example, the text label "one" is a first-level title, the text label "1" is a second-level title, and the text label "(1)" is a third-level title. The original policy document can be split into multiple paragraphs according to the text labels.
[0055] S2. Use a pre-trained standard theme prediction model to perform theme prediction on the multiple paragraphs to obtain the themes corresponding to the paragraphs.
[0056] In the embodiment of the present invention, the pre-trained standard topic prediction model is used to predict topics for paragraphs, and a plurality of the paragraphs are respectively input into the standard topic prediction model to obtain topics corresponding to the paragraphs.
[0057] Specifically, before using the pre-trained standard topic prediction model to perform topic prediction on the plurality of paragraphs, the method includes:
[0058] Using the pre-acquired training paragraph set to train the preset topic prediction model, to obtain a trained initial topic prediction model;
[0059] The initial topic prediction model is subjected to dimensionality reduction processing to obtain a trained standard topic prediction model.
[0060] In detail, the preset topic prediction model can be an LDA (Latent Dirichlet Allocation) model. The LDA (Latent Dirichlet Allocation) model is a document topic generation model, also known as a three-layer Bayesian probability model, which includes a three-layer structure of words, topics and documents, and is also a latent Dirichlet allocation model, which is a generative unsupervised machine learning algorithm.
[0061] Furthermore, the method of using the pre-acquired training paragraph set to train a preset topic prediction model to obtain a trained initial topic prediction model includes:
[0062] Perform word frequency analysis on the training paragraphs in the pre-acquired training paragraph set to obtain a word frequency matrix;
[0063] Based on a plurality of preset topics, the word frequency matrix is randomly numbered to obtain a topic number corresponding to the word frequency matrix;
[0064] Using the topic number as an input value of the topic prediction model, and calculating the Gibbs sampling value and the Dirichlet parameter estimation value of the topic prediction model;
[0065] The Gibbs sampling value and the Dirichlet parameter estimation value are used as model parameters of the topic prediction model to obtain a trained initial topic prediction model.
[0066] In detail, by training the topic prediction model using the training paragraph set, a trained initial topic prediction model can be obtained, and the initial topic prediction model can achieve accurate topic prediction.
[0067] Furthermore, the word frequency analysis is performed on the training paragraphs in the training paragraph set to obtain a word frequency matrix, including:
[0068] Performing word segmentation processing on the training paragraphs in the training paragraph set to obtain a training word segmentation set;
[0069] Filtering the training segmented words in the training segmented word set that are consistent with the keywords in the preset keyword library as training keywords, and summarizing the training keywords to obtain a training keyword set;
[0070] The keyword identifier and the keyword frequency corresponding to each keyword in the training keyword set are obtained, and a corresponding frequency matrix is constructed according to the keyword identifier and the keyword frequency.
[0071] In detail, the word segmentation processing can be performed by a probability statistics-based word segmentation model, or the word segmentation processing can be performed by a Jieba word segmentation model. The preset keyword library contains multiple topic-related keywords. For example, the corresponding keywords under the insurance theme are "claim", "damage assessment", "investigation" and "verification". The multiple keywords are randomly sorted, and the ID values corresponding to each keyword are assigned in the order of random sorting. For example, the word ID corresponding to "claim" is 0 and the word frequency is 8 (the word ID corresponding to "claim" is 0 and the word frequency is 8, forming the matrix element (0, 8) corresponding to "claim"), the word ID corresponding to "damage assessment" is 1 and the word frequency is 5, the word ID corresponding to "damage assessment" is 2 and the word frequency is 4, and the word ID corresponding to "verification" is 3 and the word frequency is 3, then the word frequency matrix corresponding to the keyword set is [(0, 8)(1, 5), (2, 4), (3, 3)...].
[0072] Specifically, the randomly numbering the word frequency matrix based on the preset multiple topics to obtain the topic number corresponding to the word frequency matrix includes:
[0073] Numbering the multiple topics to obtain numbers corresponding to the topics;
[0074] A topic reference table corresponding to the preset multiple topics is obtained, and the word frequency matrix with the same topic as that in the topic reference table is marked with a corresponding number to obtain the topic number corresponding to the word frequency matrix.
[0075] In detail, in the present scheme, the preset multiple topics can be limited to 6 topics, such as scientific and technological projects (topic number 1), financial projects (topic number 2), innovation projects (topic number 3), insurance projects (topic number 4), intellectual property projects (topic number 5), and food safety projects (topic number 6). For example, when the topic probability distribution results corresponding to the keyword set ["claims", "damage assessment", "investigation", "verification", ...] are annotated, they can be [(1,0.5), (1,0.1), (1,0.1), (1,0.1), (1,0.1), (1,0.1)].
[0076] Furthermore, the topic number is used as the input value of the topic prediction model, the Gibbs sampling value and the Dirichlet parameter estimate of the topic prediction model are calculated, and the distribution is sampled using the Gibbs Sampling algorithm. Since it is an observed known word vector, only the topic vector is an implicit variable, so what needs to be sampled is the distribution. The Gibbs sampling value and the Dirichlet parameter estimate are used as model parameters of the topic prediction model to obtain a trained initial topic prediction model.
[0077] In the embodiment of the present invention, by performing dimensionality reduction processing on the initial topic prediction model, the standard topic prediction model can perform topic prediction more accurately.
[0078] Specifically, the dimensionality reduction process is performed on the initial topic prediction model to obtain a trained standard topic prediction model, including:
[0079] Using the initial topic prediction model to perform topic prediction on multiple training paragraphs in the training paragraph set to obtain paragraph topics corresponding to the training paragraphs;
[0080] Calculating the similarity between any two paragraph topics among the multiple paragraph topics respectively, and selecting the paragraph topics whose similarity is greater than a preset similarity threshold;
[0081] A preset number of paragraph topics among the paragraph topics whose similarity is greater than a preset similarity threshold are selected as target topics, and the initial topic prediction model is trained using the target topics to obtain a trained standard topic prediction model.
[0082] In detail, the similarity between any two paragraph topics among the multiple paragraph topics may be calculated by calculating cosine similarity or other calculation methods.
[0083] In this solution, the predicted topic corresponding to the paragraph is related to the support policy. For example, the topic corresponding to the paragraph may be "Several measures on accelerating the development of science and technology finance and supporting and cultivating science and technology SMEs" or "Projects to support small and medium-sized enterprises".
[0084] S3. The paragraphs with the same subject are spliced together to obtain spliced paragraphs, and a pre-trained title generation model is used to perform title generation processing on the spliced paragraphs to obtain split items.
[0085] In an embodiment of the present invention, the paragraphs with the same theme refer to paragraphs with the same project theme. The paragraphs with the same project theme are spliced together to obtain various projects in the policy, and the spliced paragraphs are processed for title generation. The corresponding project title is added to each project, and finally the split projects are generated.
[0086] Specifically, before using the pre-trained title generation model to perform title generation processing on the spliced paragraphs, the method includes:
[0087] Obtaining the original text of the annotated paragraph, and inputting the original text of the annotated paragraph into the encoder of the title generation model for encoding to obtain encoded data;
[0088] Taking a weighted average of the subject and the hidden layer output by the encoder to obtain an attention vector;
[0089] Extracting the annotated title in the original text of the annotated paragraph, inputting the annotated title, the attention vector and the preset hidden features into a decoder in the title generation model for decoding, and obtaining a predicted item title;
[0090] Determine whether the predicted project title is consistent with the preset real project title. If the predicted project title is consistent with the preset real project title, output the title generation model as a pre-trained title generation model.
[0091] In detail, the title generation model consists of two parts: TopicFeature and Seq2seq. The original paragraph with the marked title is input into the encoder end of the seq2seq model for encoding. The decoder end receives the marked title and hidden features for decoding. ContextVec is a weighted average of the hidden layer output by the encoder. The model vector is obtained by weightedly averaging the topic features of the paragraph obtained in the LDA topic model with ContextVec and added as input to the process of generating titles at the decoding end for training, thereby obtaining a title generation model.
[0092] The embodiment of the present invention splits the original policy document into paragraphs to obtain multiple paragraphs, performs preliminary splitting on the original policy document from the perspective of paragraphs, provides a data basis for subsequent project splitting, splices the paragraphs with the same theme in the themes corresponding to the paragraphs obtained after the theme prediction is performed on the multiple paragraphs using a pre-trained standard theme prediction model, and obtains spliced paragraphs. The spliced paragraphs obtained by splicing paragraphs with the same project theme are the split projects, and generates project titles for the spliced paragraphs using a trained project title generation model to obtain split projects. Therefore, the project splitting method based on theme prediction proposed by the present invention can improve the efficiency of project splitting.
[0093] like Figure 2 , which is a functional module diagram of a project splitting device based on topic prediction provided by an embodiment of the present invention.
[0094] The project splitting device 100 based on theme prediction according to the present invention can be installed in an electronic device. According to the functions achieved, the project splitting device 100 based on theme prediction may include a paragraph splitting module 101, a theme prediction module 102, and a title generation module 103. The modules in the present invention may also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of the electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
[0095] In this embodiment, the functions of each module / unit are as follows:
[0096] The paragraph splitting module 101 is used to obtain the original policy document, split the original policy document into paragraphs, and obtain a plurality of paragraphs;
[0097] The theme prediction module 102 is used to perform theme prediction on a plurality of paragraphs by using the pre-trained standard theme prediction model to obtain the themes corresponding to the paragraphs;
[0098] The title generation module 103 is used to splice the paragraphs with the same theme to obtain a spliced paragraph, and perform title generation processing on the spliced paragraph by using the pre-trained title generation model to obtain the split projects.
[0099] Specifically, the specific implementation manners of each module of the project splitting device 100 based on theme prediction are as follows:
[0100] Step 1: Obtain the original policy document, split the original policy document into paragraphs, and obtain a plurality of paragraphs.
[0101] In the embodiment of the present invention, the original policy document may be a support policy project book or other types of project documents. The original policy document can be downloaded from the database of the government department.
[0102] Specifically, the splitting of the original policy document into paragraphs to obtain a plurality of paragraphs includes:
[0103] Identify the text labels in the original policy document;
[0104] Split the original policy document with the text labels as the splitting points to obtain a plurality of paragraphs.
[0105] Specifically, the original policy document contains a plurality of paragraphs and the text labels corresponding to the plurality of paragraphs. Among them, the text labels include different forms and corresponding meanings. For example, the text label "one" is a first-level title, the text label "1" is a second-level title, and the text label "(1)" is a third-level title. The original policy document can be split into paragraphs according to the text labels.
[0106] Step 2: Use a pre-trained standard topic prediction model to predict topics for the multiple paragraphs to obtain topics corresponding to the paragraphs.
[0107] In the embodiment of the present invention, the pre-trained standard topic prediction model is used to predict topics for paragraphs, and a plurality of the paragraphs are respectively input into the standard topic prediction model to obtain topics corresponding to the paragraphs.
[0108] Specifically, before using the pre-trained standard topic prediction model to perform topic prediction on the plurality of paragraphs, the method includes:
[0109] Using the pre-acquired training paragraph set to train the preset topic prediction model, to obtain a trained initial topic prediction model;
[0110] The initial topic prediction model is subjected to dimensionality reduction processing to obtain a trained standard topic prediction model.
[0111] In detail, the preset topic prediction model can be an LDA (Latent Dirichlet Allocation) model. The LDA (Latent Dirichlet Allocation) model is a document topic generation model, also known as a three-layer Bayesian probability model, which includes a three-layer structure of words, topics and documents, and is also a latent Dirichlet allocation model, which is a generative unsupervised machine learning algorithm.
[0112] Furthermore, the method of using the pre-acquired training paragraph set to train a preset topic prediction model to obtain a trained initial topic prediction model includes:
[0113] Perform word frequency analysis on the training paragraphs in the pre-acquired training paragraph set to obtain a word frequency matrix;
[0114] Based on a plurality of preset topics, the word frequency matrix is randomly numbered to obtain a topic number corresponding to the word frequency matrix;
[0115] Using the topic number as an input value of the topic prediction model, and calculating the Gibbs sampling value and the Dirichlet parameter estimation value of the topic prediction model;
[0116] The Gibbs sampling value and the Dirichlet parameter estimation value are used as model parameters of the topic prediction model to obtain a trained initial topic prediction model.
[0117] In detail, by training the topic prediction model using the training paragraph set, a trained initial topic prediction model can be obtained, and the initial topic prediction model can achieve accurate topic prediction.
[0118] Furthermore, the word frequency analysis is performed on the training paragraphs in the training paragraph set to obtain a word frequency matrix, including:
[0119] Performing word segmentation processing on the training paragraphs in the training paragraph set to obtain a training word segmentation set;
[0120] Filtering the training segmented words in the training segmented word set that are consistent with the keywords in the preset keyword library as training keywords, and summarizing the training keywords to obtain a training keyword set;
[0121] The keyword identifier and the keyword frequency corresponding to each keyword in the training keyword set are obtained, and a corresponding frequency matrix is constructed according to the keyword identifier and the keyword frequency.
[0122] In detail, the word segmentation processing can be performed by a probability statistics-based word segmentation model, or the word segmentation processing can be performed by a Jieba word segmentation model. The preset keyword library contains multiple topic-related keywords. For example, the corresponding keywords under the insurance theme are "claim", "damage assessment", "investigation" and "verification". The multiple keywords are randomly sorted, and the ID values corresponding to each keyword are assigned in the order of random sorting. For example, the word ID corresponding to "claim" is 0 and the word frequency is 8 (the word ID corresponding to "claim" is 0 and the word frequency is 8, forming the matrix element (0, 8) corresponding to "claim"), the word ID corresponding to "damage assessment" is 1 and the word frequency is 5, the word ID corresponding to "damage assessment" is 2 and the word frequency is 4, and the word ID corresponding to "verification" is 3 and the word frequency is 3, then the word frequency matrix corresponding to the keyword set is [(0, 8)(1, 5), (2, 4), (3, 3)...].
[0123] Specifically, the randomly numbering the word frequency matrix based on the preset multiple topics to obtain the topic number corresponding to the word frequency matrix includes:
[0124] Numbering the multiple topics to obtain numbers corresponding to the topics;
[0125] A topic reference table corresponding to the preset multiple topics is obtained, and the word frequency matrix with the same topic as that in the topic reference table is marked with a corresponding number to obtain the topic number corresponding to the word frequency matrix.
[0126] In detail, in the present scheme, the preset multiple topics can be limited to 6 topics, such as scientific and technological projects (topic number 1), financial projects (topic number 2), innovation projects (topic number 3), insurance projects (topic number 4), intellectual property projects (topic number 5), and food safety projects (topic number 6). For example, when the topic probability distribution results corresponding to the keyword set ["claims", "damage assessment", "investigation", "verification", ...] are annotated, they can be [(1,0.5), (1,0.1), (1,0.1), (1,0.1), (1,0.1), (1,0.1)].
[0127] Furthermore, the topic number is used as the input value of the topic prediction model, the Gibbs sampling value and the Dirichlet parameter estimate of the topic prediction model are calculated, and the distribution is sampled using the Gibbs Sampling algorithm. Since it is an observed known word vector, only the topic vector is an implicit variable, so what needs to be sampled is the distribution. The Gibbs sampling value and the Dirichlet parameter estimate are used as model parameters of the topic prediction model to obtain a trained initial topic prediction model.
[0128] In the embodiment of the present invention, by performing dimensionality reduction processing on the initial topic prediction model, the standard topic prediction model can perform topic prediction more accurately.
[0129] Specifically, the dimensionality reduction process is performed on the initial topic prediction model to obtain a trained standard topic prediction model, including:
[0130] Using the initial topic prediction model to perform topic prediction on multiple training paragraphs in the training paragraph set to obtain paragraph topics corresponding to the training paragraphs;
[0131] Calculating the similarity between any two paragraph topics among the multiple paragraph topics respectively, and selecting the paragraph topics whose similarity is greater than a preset similarity threshold;
[0132] A preset number of paragraph topics among the paragraph topics whose similarity is greater than a preset similarity threshold are selected as target topics, and the initial topic prediction model is trained using the target topics to obtain a trained standard topic prediction model.
[0133] In detail, the similarity between any two paragraph topics among the multiple paragraph topics may be calculated by calculating cosine similarity or other calculation methods.
[0134] In this solution, the predicted topic corresponding to the paragraph is related to the support policy. For example, the topic corresponding to the paragraph may be "Several measures on accelerating the development of science and technology finance and supporting and cultivating science and technology SMEs" or "Projects to support small and medium-sized enterprises".
[0135] Step three: splice the paragraphs with the same theme to obtain spliced paragraphs, and use the pre-trained title generation model to generate titles for the spliced paragraphs to obtain split items.
[0136] In an embodiment of the present invention, the paragraphs with the same theme refer to paragraphs with the same project theme. The paragraphs with the same project theme are spliced together to obtain various projects in the policy, and the spliced paragraphs are processed for title generation. The corresponding project title is added to each project, and finally the split projects are generated.
[0137] Specifically, before using the pre-trained title generation model to perform title generation processing on the spliced paragraphs, the method includes:
[0138] Obtaining the original text of the annotated paragraph, and inputting the original text of the annotated paragraph into the encoder of the title generation model for encoding to obtain encoded data;
[0139] Taking a weighted average of the subject and the hidden layer output by the encoder to obtain an attention vector;
[0140] Extracting the annotated title in the original text of the annotated paragraph, inputting the annotated title, the attention vector and the preset hidden features into a decoder in the title generation model for decoding, and obtaining a predicted item title;
[0141] Determine whether the predicted project title is consistent with the preset real project title. If the predicted project title is consistent with the preset real project title, output the title generation model as a pre-trained title generation model.
[0142] In detail, the title generation model consists of two parts: TopicFeature and Seq2seq. The original paragraph with the marked title is input into the encoder end of the seq2seq model for encoding. The decoder end receives the marked title and hidden features for decoding. ContextVec is a weighted average of the hidden layer output by the encoder. The model vector is obtained by weightedly averaging the topic features of the paragraph obtained in the LDA topic model with ContextVec and added as input to the process of generating titles at the decoding end for training, thereby obtaining a title generation model.
[0143] The embodiment of the present invention splits the original policy document into paragraphs to obtain multiple paragraphs, performs preliminary splitting of the original policy document from the perspective of paragraphs, provides a data basis for subsequent project splitting, and splices the paragraphs with the same theme in the themes corresponding to the paragraphs obtained after the theme prediction of multiple paragraphs using a pre-trained standard theme prediction model to obtain spliced paragraphs. The spliced paragraphs obtained by splicing paragraphs with the same project theme are the split projects, and the trained project title generation model is used to generate project titles for the spliced paragraphs to obtain split projects. Therefore, the project splitting device based on theme prediction proposed by the present invention can improve the efficiency of project splitting.
[0144] like Figure 3 , which is a schematic diagram of the structure of an electronic device for implementing a project splitting method based on topic prediction provided by an embodiment of the present invention.
[0145] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a project splitting program based on topic prediction.
[0146] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing a project splitting program based on topic prediction, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
[0147] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of the project splitting program based on theme prediction, but also can be used to temporarily store data that has been output or is to be output.
[0148] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0149] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0150] Figure 3 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 3The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0151] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0152] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0153] The item splitting program based on topic prediction stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:
[0154] Obtaining an original policy document, and dividing the original policy document into paragraphs to obtain multiple paragraphs;
[0155] Using a pre-trained standard topic prediction model to perform topic prediction on the plurality of paragraphs, to obtain topics corresponding to the paragraphs;
[0156] The paragraphs with the same theme are spliced together to obtain spliced paragraphs, and a pre-trained title generation model is used to perform title generation processing on the spliced paragraphs to obtain split items.
[0157] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0158] Furthermore, if the module / unit integrated in the electronic device 1 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. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0159] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0160] Obtaining an original policy document, and dividing the original policy document into paragraphs to obtain multiple paragraphs;
[0161] Using a pre-trained standard topic prediction model to perform topic prediction on the plurality of paragraphs, to obtain topics corresponding to the paragraphs;
[0162] The paragraphs with the same theme are spliced together to obtain spliced paragraphs, and a pre-trained title generation model is used to perform title generation processing on the spliced paragraphs to obtain split items.
[0163] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0164] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0165] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, 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 hardware plus software functional modules.
[0166] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0167] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0168] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0169] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0170] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0171] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A project splitting method based on topic prediction, characterized in that: The method comprises: Using the pre-acquired training paragraph set to train the preset topic prediction model, to obtain a trained initial topic prediction model; Performing dimensionality reduction processing on the initial topic prediction model to obtain a trained standard topic prediction model; Obtaining an original policy document, and dividing the original policy document into paragraphs to obtain multiple paragraphs; Using the standard topic prediction model to perform topic prediction on the plurality of paragraphs, to obtain topics corresponding to the paragraphs; The paragraphs with the same topic are spliced together to obtain spliced paragraphs, and a pre-trained title generation model is used to perform title generation processing on the spliced paragraphs to obtain split items; The method of training a preset topic prediction model using the pre-acquired training paragraph set to obtain a trained initial topic prediction model includes: Perform word frequency analysis on the training paragraphs in the pre-acquired training paragraph set to obtain a word frequency matrix; Based on a plurality of preset topics, the word frequency matrix is randomly numbered to obtain a topic number corresponding to the word frequency matrix; Using the topic number as an input value of the topic prediction model, and calculating the Gibbs sampling value and the Dirichlet parameter estimation value of the topic prediction model; The Gibbs sampling value and the Dirichlet parameter estimation value are used as model parameters of the topic prediction model to obtain a trained initial topic prediction model.
2. The project splitting method based on topic prediction according to claim 1, characterized in that: The performing word frequency analysis on the training paragraphs in the training paragraph set to obtain a word frequency matrix includes: Performing word segmentation processing on the training paragraphs in the training paragraph set to obtain a training word segmentation set; Filtering the training segmented words in the training segmented word set that are consistent with the keywords in the preset keyword library as training keywords, and summarizing the training keywords to obtain a training keyword set; The keyword identifier and the keyword frequency corresponding to each keyword in the training keyword set are obtained, and a corresponding frequency matrix is constructed according to the keyword identifier and the keyword frequency.
3. The project splitting method based on topic prediction according to claim 1, characterized in that: The randomly numbering the word frequency matrix based on the preset multiple topics to obtain the topic number corresponding to the word frequency matrix includes: Numbering the multiple topics to obtain numbers corresponding to the topics; A topic reference table corresponding to the preset multiple topics is obtained, and the word frequency matrix with the same topic as that in the topic reference table is marked with a corresponding number to obtain the topic number corresponding to the word frequency matrix.
4. The project splitting method based on topic prediction according to claim 1, characterized in that: The step of performing dimensionality reduction processing on the initial topic prediction model to obtain a trained standard topic prediction model includes: Using the initial topic prediction model to perform topic prediction on multiple training paragraphs in the training paragraph set to obtain paragraph topics corresponding to the training paragraphs; Calculating the similarity between any two paragraph topics among the multiple paragraph topics respectively, and selecting the paragraph topics whose similarity is greater than a preset similarity threshold; A preset number of paragraph topics among the paragraph topics whose similarity is greater than a preset similarity threshold are selected as target topics, and the initial topic prediction model is trained using the target topics to obtain a trained standard topic prediction model.
5. The project splitting method based on topic prediction according to claim 1, characterized in that: Before the pre-trained title generation model is used to generate titles for the concatenated paragraphs, the method includes: Obtaining the original text of the annotated paragraph, and inputting the original text of the annotated paragraph into the encoder of the title generation model for encoding to obtain encoded data; Taking a weighted average of the subject and the hidden layer output by the encoder to obtain an attention vector; Extracting the annotated title in the original text of the annotated paragraph, inputting the annotated title, the attention vector and the preset hidden features into a decoder in the title generation model for decoding, and obtaining a predicted item title; Determine whether the predicted project title is consistent with the preset real project title. If the predicted project title is consistent with the preset real project title, output the title generation model as a pre-trained title generation model.
6. A project splitting device based on topic prediction, used to implement the project splitting method based on topic prediction according to any one of claims 1 to 5, characterized in that: The device comprises: A paragraph splitting module is used to obtain an original policy document and split the original policy document into paragraphs to obtain multiple paragraphs; A topic prediction module, used to use a pre-trained standard topic prediction model to perform topic prediction on the plurality of paragraphs to obtain topics corresponding to the paragraphs; The title generation module is used to splice the paragraphs with the same theme to obtain spliced paragraphs, and use the pre-trained title generation model to perform title generation processing on the spliced paragraphs to obtain split items.
7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the project splitting method based on topic prediction as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the project splitting method based on topic prediction as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Text classification method based on viewpoint
CN104331394A
Policy information processing method and device, storage medium and electronic device
CN110275935A