Public opinion analysis copywriting determination method and device, computer equipment and storage medium
By extracting and matching keywords in public opinion analysis using pre-trained BART generative model and BERT model, the problem of inaccurate keyword search in the prior art is solved, and the accuracy and reliability of public opinion analysis copywriting is improved.
Patent Information
- Application Number
- CN202411156464.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-02-28
AI Technical Summary
The existing technology relies on keyword search in public opinion analysis, resulting in insufficient correlation recognition capabilities implicitly in article content, inaccurate new word recognition and keyword matching, affecting the accuracy and comprehensiveness of search results.
The target keywords of the target article are extracted using a pre-trained two-way autoregressive BART generative model, and the relevant keywords associated with the target keywords are determined through the BERT model. Then, match the target keywords and related keywords from the ES library, and use similarity scores to improve the relevance of search results.
Keywords are extracted through deep learning models, combined with complex semantic relationships and context information, and generated keywords that are highly relevant to the content of the article, reducing the risk of inaccurate keyword matching and improving the accuracy and reliability of public opinion analysis copywriting.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, is applicable to the financial field, and in particular, relates to a method, device, computer equipment and storage medium for determining public opinion analysis copy. Background Art
[0002] With the continuous development of artificial intelligence technology, in the current field of public opinion analysis, most products and solutions mainly rely on keyword search technology to obtain relevant news and articles. These technologies usually configure specific keywords, use search engines (such as Elasticsearch) to collect data from all channels, and obtain relevant articles through word segmentation and matching technology. However, this method has some significant problems and shortcomings.
[0003] With the development of language and the continuous emergence of new words, existing keyword search technology can often only match articles that are directly related to the keywords, while ignoring the possible implicit correlation in the article content. Existing technology has limitations in identifying and processing new words, which affects the accuracy and comprehensiveness of search results. Therefore, how to improve the accuracy of determining public opinion analysis copy based on public opinion analysis keywords has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides a method, apparatus, computer equipment and storage medium for determining public opinion analysis copy, so as to improve the accuracy of determining public opinion analysis copy according to public opinion analysis keywords.
[0005] In a first aspect, the present application provides a method for determining a public opinion analysis copy, the method comprising:
[0006] Extract the target keywords of the target article through the pre-trained bidirectional autoregressive BART generative model;
[0007] Determine relevant keywords associated with the target keyword based on a preset sentence BERT model;
[0008] Determine a target analysis copy that matches the target keyword and the related keywords from a preset search engine solution ES library.
[0009] In a second aspect, the present application further provides a device for determining a public opinion analysis copy, the device comprising:
[0010] The target keyword extraction module is used to extract the target keywords of the target article through the pre-trained bidirectional autoregressive BART generative model;
[0011] A related keyword determination module, used to determine related keywords associated with the target keyword based on a preset sentence pattern BERT model;
[0012] The target analysis copy determination module is used to determine the target analysis copy that matches the target keyword and the related keywords from the preset search engine solution ES library.
[0013] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the above-mentioned method for determining public opinion analysis text when executing the computer program.
[0014] In a fourth aspect, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the method for determining public opinion analysis text as described above.
[0015] The present application discloses a method, device, computer equipment and storage medium for determining a public opinion analysis copy. The method for determining a public opinion analysis copy includes extracting target keywords of a target article through a pre-trained bidirectional autoregressive BART generative model; determining related keywords associated with the target keyword based on a preset sentence BERT model; and determining a target analysis copy that matches the target keyword and the related keywords from a preset search engine solution ES library. In the above manner, the present application uses a pre-trained bidirectional autoregressive BART generative model to more accurately extract keywords from a target article, and generates keywords that are highly relevant to the content of the article through complex semantic relationships and contextual information. The ES library is used to calculate the similarity score between the target keyword and these preset keywords, so that the search results are highly relevant to the target keyword. Through deep learning and similarity scoring mechanisms, the risk of misjudgment caused by inaccurate keyword matching is reduced, and the reliability of determining the public opinion analysis copy is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 It is a schematic flow chart of a method for determining a public opinion analysis copy provided by the first embodiment of the present application;
[0018] Figure 2 is a schematic flow chart of a method for determining a public opinion analysis copy provided in the second embodiment of the present application;
[0019] Figure 3A schematic diagram of a BART generative model of a method for determining a public opinion analysis copy provided in the second embodiment of the present application;
[0020] Figure 4 A schematic diagram of the Sentence-BERT similarity model training for a method for determining a public opinion analysis text provided in an embodiment of the present application;
[0021] Figure 5 A schematic block diagram of a device for determining a public opinion analysis text provided in an embodiment of the present application;
[0022] Figure 6 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0025] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0026] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0027] The embodiments of the present application provide a method, device, computer equipment and storage medium for determining a public opinion analysis text. Among them, the method for determining a public opinion analysis text can be applied to a server. By using a pre-trained bidirectional autoregressive BART generative model, keywords can be more accurately extracted from the target article, and keywords that are highly relevant to the content of the article are generated through complex semantic relationships and contextual information. The ES library is used to calculate the similarity score between the target keyword and these preset keywords, so that the search results are highly relevant to the target keyword. Through deep learning and similarity scoring mechanisms, the risk of misjudgment caused by inaccurate keyword matching is reduced, and the reliability of determining the public opinion analysis text is improved. Among them, the server can be an independent server or a server cluster.
[0028] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0029] See also Figure 1 , Figure 1 It is a schematic flow chart of a method for determining a public opinion analysis text provided by the first embodiment of the present application. The method for determining a public opinion analysis text can be applied to a server to more accurately extract keywords from a target article by using a pre-trained bidirectional autoregressive BART generative model, and to generate keywords that are highly relevant to the content of the article through complex semantic relationships and contextual information. The ES library is used to calculate the similarity score between the target keyword and these preset keywords, so that the search results are highly relevant to the target keyword. Through deep learning and similarity scoring mechanisms, the risk of misjudgment due to inaccurate keyword matching is reduced, and the reliability of determining the public opinion analysis text is improved.
[0030] like Figure 1 As shown, the method for determining the public opinion analysis text specifically includes steps S10 to S30.
[0031] Step S10, extracting target keywords of the target article through a pre-trained bidirectional autoregressive BART generative model;
[0032] In one embodiment, the BART generative model is mainly used to extract keyword entities of the article. The deep learning keyword solution can solve the three problems mentioned above: 1. New word recognition; 2. Inaccurate generated keywords; 3. The generated words may not be keywords.
[0033] The target article is processed using the BART generative model to extract key information and keywords from the article. The model can fully capture the contextual information of the article content through a bidirectional autoregressive mechanism and generate keywords closely related to the article topic. The BART generative model is pre-trained to learn the universal representation of language using a large amount of text data. The training data includes articles of different categories. Keywords are manually annotated to train the model to extract keywords.
[0034] Step S20: determining related keywords associated with the target keyword based on a preset sentence BERT model;
[0035] In one embodiment, first, the Sentence-BERT similarity model is pre-trained to learn the universal representation of language using a large amount of text data. The training data includes articles of different categories, and the model is trained to extract keywords by manually annotating keywords. The preset keywords are stored in the Elasticsearch (ES) library and indexed for efficient search and matching. The target article is processed, and keywords are extracted using the Sentence-BERT similarity model, and similarity scores are calculated between the extracted keywords and the preset keywords in the ES library.
[0036] ES has the following characteristics:
[0037] Full-text search: Elasticsearch supports full-text search, can efficiently retrieve text content, and supports word segmentation and indexing in multiple languages;
[0038] Distributed design: Elasticsearch automatically shards data and distributes it to multiple nodes in the cluster, supports horizontal expansion, and can handle large-scale data sets;
[0039] High availability: Elasticsearch is designed to ensure high availability. The data synchronization and failover mechanisms between nodes enable the system to continue to operate normally when a node fails.
[0040] Step S30: Determine a target analysis copy that matches the target keyword and the related keywords from a preset search engine solution ES library.
[0041] In a specific embodiment, the current product solutions for public opinion analysis are basically to search for relevant news by configuring relevant keywords such as China Ping An, and then match relevant articles from es (crawler collects omni-channel data and stores it in es) according to word segmentation. After obtaining relevant articles, public opinion index analysis is performed. There are problems with a batch of articles searched in this way. The articles obtained may not have a particularly strong relationship with the keywords, resulting in less accurate public opinion index analysis.
[0042] In one embodiment, a method for determining a public opinion analysis scheme provided in this embodiment can be applied in the financial field, such as the following application scenarios: market sentiment analysis, risk management, risk management, compliance monitoring, customer service, investment strategy, product development, etc.
[0043] Use deep learning models to analyze public sentiment in social media, news reports, and forum discussions to predict market trends and investor sentiment, monitor company reputation and brand health through public opinion analysis, and promptly identify negative information that may affect a company's stock price. Automatically identify and report discussions or behaviors that may violate financial regulations to help financial institutions comply with regulatory requirements.
[0044] Analyze customer feedback and complaints to improve services and products, and use public opinion analysis to assist investment decisions, such as predicting stock trends by analyzing industry news and company announcements and guiding new product development and service improvements based on market feedback and consumer discussions.
[0045] The present embodiment discloses a method, apparatus, computer equipment and storage medium for determining a public opinion analysis copy. The method for determining a public opinion analysis copy includes extracting target keywords of a target article through a pre-trained bidirectional autoregressive BART generative model; determining related keywords associated with the target keyword based on a preset sentence BERT model; and determining a target analysis copy that matches the target keyword and the related keywords from a preset search engine solution ES library. In the above manner, the present application uses a pre-trained bidirectional autoregressive BART generative model to more accurately extract keywords from a target article, and generates keywords that are highly relevant to the content of the article through complex semantic relationships and contextual information. The ES library is used to calculate the similarity score between the target keyword and these preset keywords, so that the search results are highly relevant to the target keyword. Through deep learning and similarity scoring mechanisms, the risk of misjudgment due to inaccurate keyword matching is reduced, and the reliability of determining the public opinion analysis copy is improved.
[0046] See also Figure 2 , Figure 2It is a schematic flow chart of a method for determining a public opinion analysis copy provided by the second embodiment of the present application. The method for determining a public opinion analysis copy can be applied to a server to more accurately extract keywords from a target article by using a pre-trained bidirectional autoregressive BART generative model, and to generate keywords that are highly relevant to the content of the article through complex semantic relationships and contextual information. The ES library is used to calculate the similarity score between the target keyword and these preset keywords, so that the search results are highly relevant to the target keyword. Through deep learning and similarity scoring mechanisms, the risk of misjudgment due to inaccurate keyword matching is reduced, and the reliability of determining the public opinion analysis copy is improved.
[0047] based on Figure 1 The embodiment shown, this embodiment Figure 2 As shown, before step S10, steps S01 to S02 are included:
[0048] Step S01, respectively obtaining a preset number of at least one type of copywriting as initial training set data;
[0049] Step S02: preprocess the initial training set data, and train the initial BART generative model using the preprocessed initial training set data to generate the pretrained bidirectional autoregressive BART generative model.
[0050] In one embodiment, Figure 3 As shown, Figure 3 A schematic diagram of a BART generative model for a method for determining a public opinion analysis copy provided in the second embodiment of the present application. The specific training process of the BART generative model is as follows:
[0051] 1. Take 30,000 data items from each category of articles, and the number of data items can be set by the user;
[0052] 2. Count the length thresholds of different news articles and delete articles with the shortest length accounting for 5% and the longest length accounting for 5%;
[0053] 3. Data cleaning, removing special characters, deleting tabs, removing links, removing Unicode codes, converting traditional Chinese to simplified Chinese, etc.
[0054] 4. Manually label keyword data;
[0055] 5. Start training the Bart keyword extraction model based on the annotated corpus:
[0056] 5.1 Divide the training data into training data, verification data, and test data according to the ratio of 8:1:1;
[0057] 5.2 Training model;
[0058] 5.3 Calculate the loss through cross entropy based on the label;
[0059] 5.4 Validate the data through the validation set every 100 rounds. Obtain the accuracy, precision, and recall of the validation set. As well as the loss of the validation set, record the loss value, and find the model parameters that have the lowest loss of each validation set every 100 rounds;
[0060] 5.5 After training, evaluate the model performance by testing and calculating the Rouge indicator;
[0061] 5.6 If the model does not meet the requirements, analyze and determine the incorrect corpus, adjust the corpus, and then train the model using the corpus.
[0062] The present embodiment discloses a method, device, computer equipment and storage medium for determining a public opinion analysis text, the method for determining a public opinion analysis text comprises obtaining a preset number of at least one type of text as initial training set data respectively; preprocessing the initial training set data, and training the initial BART generative model through the preprocessed initial training set data to generate the pre-trained bidirectional autoregressive BART generative model; extracting the target keyword of the target article through the pre-trained bidirectional autoregressive BART generative model; determining the relevant keywords associated with the target keyword based on the preset sentence BERT model; and determining the target analysis text matching the target keyword and the relevant keywords from the preset search engine solution ES library. In the above manner, the present application uses the pre-trained bidirectional autoregressive BART generative model to more accurately extract keywords from the target article, and generates keywords that are highly relevant to the content of the article through complex semantic relationships and contextual information. The ES library is used to calculate the similarity score between the target keyword and these preset keywords, so that the search results are highly relevant to the target keyword. Through deep learning and similarity scoring mechanisms, the risk of misjudgment caused by inaccurate keyword matching is reduced, and the reliability of determining the public opinion analysis text is improved.
[0063] In a more preferred embodiment, the initial training set data is preprocessed, including:
[0064] According to the length threshold and special characters of each of the initial training set data, invalid training set data in the initial training set data is deleted, and valid training set data is retained as the initial training set data.
[0065] In a specific embodiment, different news article length thresholds are counted, and articles with a minimum length accounting for 5% and a maximum length accounting for 5% are deleted. The specific values can be set by the user.
[0066] Determine the threshold for data length, for example, the data length must be between 10 and 100 characters, and determine the rules for special characters: for example, the data cannot contain non-alphanumeric characters, such as punctuation or special symbols. Import all initial training set data into an editable document or database, check the length of each data to ensure that it is within the defined threshold range; check whether each data contains special characters and filter them according to the defined rules. For data that does not meet the length threshold or contains special characters, delete these data from the training set, ensure that the remaining data meets all defined standards, verify the validity of the data through random sampling checks, and save the cleaned valid training set data to a new file or database for subsequent use.
[0067] Further, the initial BART generative model is trained by using the preprocessed initial training set data to generate the pretrained bidirectional autoregressive BART generative model, including:
[0068] Dividing the initial training set data into training data, verification data and test data based on a preset ratio;
[0069] Iteratively train the initial BART generative model according to the training data, the verification data and a preset loss function to determine initial model parameters;
[0070] The initial model parameters are adjusted using the test data to generate the pre-trained BART generative model.
[0071] In a specific embodiment, the training data is divided into training data and verification data at a ratio of 8:1:1. The loss is calculated by cross entropy according to the label, and the data is verified once through the verification set every 100 cycles. The accuracy, precision, and recall of the verification set are obtained. And the loss of the verification set. The loss value is recorded. The model parameters with the lowest loss of each verification set for every 100 rounds are retained. After the training is completed, the model performance is evaluated by testing and calculating the Rouge indicator. If the model does not meet the standard, analyze and determine the wrong corpus, and adjust the corpus. Train the model through the corpus.
[0072] The present embodiment discloses a method, apparatus, computer equipment and storage medium for determining a public opinion analysis text. The method for determining a public opinion analysis text comprises respectively obtaining a preset number of at least one type of text as initial training set data; deleting invalid training set data in the initial training set data according to a length threshold and special characters of each of the initial training set data, retaining valid training set data as the initial training set data, and dividing the initial training set data into training data, verification data and test data based on a preset ratio; iteratively training the initial BART generative model according to the training data, the verification data and a preset loss function to determine initial model parameters; adjusting the initial model parameters through the test data to generate the pre-trained BART generative model; extracting target keywords of the target article through a pre-trained bidirectional autoregressive BART generative model; determining related keywords associated with the target keywords based on a preset sentence BERT model; and determining a target analysis text matching the target keywords and the related keywords from a preset search engine solution ES library. Through the above method, this application uses a pre-trained bidirectional autoregressive BART generative model to more accurately extract keywords from the target article, and generates keywords that are highly relevant to the article content through complex semantic relationships and contextual information. The ES library is used to calculate the similarity score between the target keyword and these preset keywords, so that the search results are highly relevant to the target keyword. Through deep learning and similarity scoring mechanisms, the risk of misjudgment caused by inaccurate keyword matching is reduced, and the reliability of determining public opinion analysis copy is improved.
[0073] based on Figure 1 In the embodiment shown, in this embodiment, step S20 includes:
[0074] Generate a target word vector according to the target keyword and the preset sentence BERT model;
[0075] Calculate the similarity between the target word vector and the preset keyword vector of each preset keyword in the ES library based on the cosine similarity formula;
[0076] The related keywords are determined according to the similarity results.
[0077] In a specific embodiment, Figure 4 As shown, Figure 4 A schematic diagram of the Sentence-BERT similarity model training for a method for determining a public opinion analysis text provided in an embodiment of the present application.
[0078] The pre-training process mainly includes the following steps:
[0079] (1) Twin network obtains sentence vector representation:
[0080] The sentence pairs are input into two BERT models with shared parameters, and then all the word vectors of the Bert output sentence are passed into the Pooling layer for average pooling (that is, all word vectors are averaged in the dimension of sentence length) to obtain the sentence vector representation of each sentence.
[0081] (2) Calculation of similarity between two vectors:
[0082] Then the two vectors u and v are calculated using the cosine similarity formula, the formula is as follows:
[0083]
[0084] (3) The loss function is calculated using mean-square error (MSE):
[0085] Reduce the huge time overhead of Bert semantic retrieval, making it suitable for unsupervised tasks such as sentence similarity calculation and text clustering.
[0086] This embodiment discloses a method, device, computer equipment and storage medium for determining a public opinion analysis copy. The method for determining a public opinion analysis copy includes extracting a target keyword of a target article through a pre-trained bidirectional autoregressive BART generative model; generating a target word vector based on the target keyword and the preset sentence BERT model; calculating the similarity result between the target word vector and the preset keyword vector of each preset keyword in the ES library based on the cosine similarity formula; determining the relevant keywords based on the similarity result; and determining the target analysis copy matching the target keyword and the relevant keywords from the preset search engine solution ES library. In the above manner, the present application uses a pre-trained bidirectional autoregressive BART generative model to more accurately extract keywords from the target article, and generates keywords that are highly relevant to the content of the article through complex semantic relationships and contextual information. The ES library is used to calculate the similarity score between the target keyword and these preset keywords, so that the search results are highly relevant to the target keyword. Through deep learning and similarity scoring mechanisms, the risk of misjudgment caused by inaccurate keyword matching is reduced, and the reliability of determining the public opinion analysis copy is improved.
[0087] Furthermore, before step S20, the following steps are included:
[0088] Extracting each of the preset keywords and inputting them into an initial semantic BERT model to extract the preset keyword vector of each of the preset keywords;
[0089] Calculating the cosine similarity between the preset keyword vectors based on the cosine similarity calculation formula;
[0090] Randomly pairing the preset keyword vectors to generate a pairing result;
[0091] Based on the pairing result and the cosine similarity, the initial semantic BERT model is trained to determine the preset sentence BERT model.
[0092] In a specific embodiment, the extracted keywords are used as annotation corpus, randomly paired in pairs, and whether the two keywords are similar is marked. The training data is divided into training data, verification data, and test data training model according to 8:1:1. Keywords are extracted from the article and the keywords are vectorized. Finally, the article, keywords, and keyword vectors are stored in es. When searching, the score is calculated by the cosine angle function of es to determine the target analysis copy.
[0093] The present embodiment discloses a method, device, computer equipment and storage medium for determining a public opinion analysis copy. The method for determining a public opinion analysis copy includes extracting target keywords of a target article through a pre-trained bidirectional autoregressive BART generative model; extracting each of the preset keywords and inputting them into an initial semantic BERT model to extract the preset keyword vector of each of the preset keywords; calculating the cosine similarity between each of the preset keyword vectors based on the cosine similarity calculation formula; randomly pairing each of the preset keyword vectors to generate a pairing result; based on the pairing result and the cosine similarity, adjusting parameters of the initial semantic BERT model to determine the preset sentence BERT model; generating a target word vector based on the target keyword and the preset sentence BERT model; calculating the similarity result between the target word vector and the preset keyword vector of each preset keyword in the ES library based on the cosine similarity formula; determining the relevant keywords based on the similarity result; and determining a target analysis copy matching the target keyword and the relevant keywords from the preset search engine solution ES library. Through the above method, this application uses a pre-trained bidirectional autoregressive BART generative model to more accurately extract keywords from the target article, and generates keywords that are highly relevant to the article content through complex semantic relationships and contextual information. The ES library is used to calculate the similarity score between the target keyword and these preset keywords, so that the search results are highly relevant to the target keyword. Through deep learning and similarity scoring mechanisms, the risk of misjudgment caused by inaccurate keyword matching is reduced, and the reliability of determining public opinion analysis copy is improved.
[0094] Based on any of the above embodiments, in this embodiment, step S30 includes:
[0095] Sorting the preset analysis texts matching the target keyword and / or the related keyword according to the similarity score;
[0096] Based on the preset text screening rules, at least one target analysis text is determined from the sorted preset analysis texts.
[0097] See also Figure 5 , Figure 5 The embodiment of the present application provides a schematic block diagram of a public opinion analysis text determination device, which is used to execute the above-mentioned public opinion analysis text determination method. The public opinion analysis text determination device can be configured on a server.
[0098] like Figure 5 As shown, the public opinion analysis copy determination device 400 includes:
[0099] A target keyword extraction module 410 is used to extract target keywords of a target article through a pre-trained bidirectional autoregressive BART generative model;
[0100] A related keyword determination module 420, configured to determine related keywords associated with the target keyword based on a preset sentence BERT model;
[0101] The target analysis text determination module 430 is used to determine the target analysis text that matches the target keyword and the related keywords from the preset search engine solution ES library.
[0102] Furthermore, the public opinion analysis copy determination device 400 further includes:
[0103] An initial training set data acquisition module, used to respectively acquire a preset number of at least one type of copywriting as initial training set data;
[0104] The BART model training module is used to preprocess the initial training set data, and train the initial BART generative model through the preprocessed initial training set data to generate the pretrained bidirectional autoregressive BART generative model.
[0105] Furthermore, the BART model training module includes:
[0106] The preprocessing unit is used to delete invalid training set data in the initial training set data according to the length threshold and special characters of each of the initial training set data, and retain valid training set data as the initial training set data.
[0107] Furthermore, the BART model training module includes:
[0108] An initial training set data processing unit, used for dividing the initial training set data into training data, verification data and test data based on a preset ratio;
[0109] An initial model parameter determination unit, configured to iteratively train the initial BART generative model according to the training data, the verification data and a preset loss function to determine initial model parameters;
[0110] A model training unit is used to adjust the initial model parameters through the test data to generate the pre-trained BART generative model.
[0111] Furthermore, the related keyword determination module 420 includes:
[0112] A target word vector generating unit, used to generate a target word vector according to the target keyword and the preset sentence BERT model;
[0113] A similarity score determination unit, used to calculate the similarity result between the target word vector and the preset keyword vector of each preset keyword in the ES library based on the cosine similarity formula;
[0114] The related keyword determining unit is used to determine the related keywords according to the similarity result.
[0115] Furthermore, the public opinion analysis copy determination device 400 further includes:
[0116] A preset keyword vector extraction module, used for extracting each of the preset keywords and inputting them into an initial semantic BERT model to extract the preset keyword vector of each of the preset keywords;
[0117] A cosine similarity calculation module, used for calculating the cosine similarity between the preset keyword vectors based on the cosine similarity calculation formula;
[0118] A random pairing module, used for randomly pairing the preset keyword vectors to generate a pairing result;
[0119] A parameter training module is used to perform parameter training on the initial semantic BERT model based on the pairing result and the cosine similarity to determine the preset sentence BERT model.
[0120] Furthermore, the target analysis copy determination module 430 includes:
[0121] A similarity score sorting unit, used to sort the preset analysis texts matching the target keyword and / or the related keyword according to the similarity score;
[0122] The target analysis document determining unit is used to determine at least one target analysis document from the sorted preset analysis documents based on a preset document screening rule.
[0123] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0124] The above-mentioned device can be implemented in the form of a computer program. Figure 6 Runs on the computer device shown.
[0125] See also Figure 6 , Figure 6 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0126] See also Figure 6 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0127] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any one of the methods for determining the public opinion analysis copy.
[0128] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0129] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any method for determining the public opinion analysis copy.
[0130] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0131] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0132] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0133] Extract the target keywords of the target article through the pre-trained bidirectional autoregressive BART generative model;
[0134] Determine relevant keywords associated with the target keyword based on a preset sentence BERT model;
[0135] Determine a target analysis copy that matches the target keyword and the related keywords from a preset search engine solution ES library.
[0136] In one embodiment, before extracting the target keywords of the target article through the pre-trained bidirectional autoregressive BART generative model, it is used to achieve:
[0137] Obtaining a preset number of at least one type of copywriting as initial training set data;
[0138] The initial training set data is preprocessed, and the initial BART generative model is trained using the preprocessed initial training set data to generate the pretrained bidirectional autoregressive BART generative model.
[0139] In one embodiment, the initial training set data is preprocessed to achieve:
[0140] According to the length threshold and special characters of each of the initial training set data, invalid training set data in the initial training set data is deleted, and valid training set data is retained as the initial training set data.
[0141] In one embodiment, the initial BART generative model is trained by preprocessing the initial training set data to generate the pretrained bidirectional autoregressive BART generative model, which is used to achieve:
[0142] Dividing the initial training set data into training data, verification data and test data based on a preset ratio;
[0143] Iteratively train the initial BART generative model according to the training data, the verification data and a preset loss function to determine initial model parameters;
[0144] The initial model parameters are adjusted using the test data to generate the pre-trained BART generative model.
[0145] In one embodiment, based on a preset sentence BERT model, relevant keywords associated with the target keyword are determined to achieve:
[0146] Generate a target word vector according to the target keyword and the preset sentence BERT model;
[0147] Calculate the similarity between the target word vector and the preset keyword vector of each preset keyword in the ES library based on the cosine similarity formula;
[0148] The related keywords are determined according to the similarity results.
[0149] In one embodiment, before determining the related keywords associated with the target keyword based on the preset sentence BERT model, it is used to implement:
[0150] Extracting each of the preset keywords and inputting them into an initial semantic BERT model to extract the preset keyword vector of each of the preset keywords;
[0151] Calculating the cosine similarity between the preset keyword vectors based on the cosine similarity calculation formula;
[0152] Randomly pairing the preset keyword vectors to generate a pairing result;
[0153] Based on the pairing result and the cosine similarity, the initial semantic BERT model is trained to determine the preset sentence BERT model.
[0154] In one embodiment, a target analysis copy matching the target keyword and the related keywords is determined from a preset search engine solution ES library to achieve:
[0155] Sorting the preset analysis texts matching the target keyword and / or the related keyword according to the similarity score;
[0156] Based on the preset text screening rules, at least one target analysis text is determined from the sorted preset analysis texts.
[0157] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the methods for determining public opinion analysis texts provided in the embodiments of the present application.
[0158] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Medi a Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card (Flash Card), etc., equipped on the computer device.
[0159] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for determining a public opinion analysis copy, characterized in that: include: Extract the target keywords of the target article through the pre-trained bidirectional autoregressive BART generative model; Determine relevant keywords associated with the target keyword based on a preset sentence BERT model; Determine a target analysis copy that matches the target keyword and the related keywords from a preset search engine solution ES library.
2. The method for determining public opinion analysis copy according to claim 1, characterized in that: Before extracting the target keywords of the target article through the pre-trained bidirectional autoregressive BART generative model, the following steps are included: Obtaining a preset number of at least one type of copywriting as initial training set data; The initial training set data is preprocessed, and the initial BART generative model is trained using the preprocessed initial training set data to generate the pretrained bidirectional autoregressive BART generative model.
3. The method for determining public opinion analysis copy according to claim 2, characterized in that: The preprocessing of the initial training set data includes: According to the length threshold and special characters of each of the initial training set data, invalid training set data in the initial training set data is deleted, and valid training set data is retained as the initial training set data.
4. The method for determining public opinion analysis copy according to claim 2, characterized in that: The initial BART generative model is trained by preprocessing the initial training set data to generate the pretrained bidirectional autoregressive BART generative model, including: Dividing the initial training set data into training data, verification data and test data based on a preset ratio; Iteratively train the initial BART generative model according to the training data, the verification data and a preset loss function to determine initial model parameters; The initial model parameters are adjusted using the test data to generate the pre-trained BART generative model.
5. The method for determining public opinion analysis copy according to claim 1, characterized in that: The determining, based on the preset sentence BERT model, related keywords associated with the target keyword includes: Generate a target word vector according to the target keyword and the preset sentence BERT model; Calculate the similarity between the target word vector and the preset keyword vector of each preset keyword in the ES library based on the cosine similarity formula; The related keywords are determined according to the similarity results.
6. The method for determining public opinion analysis copy according to claim 5, characterized in that: Before determining the related keywords associated with the target keyword based on the preset sentence BERT model, the method includes: Extracting each of the preset keywords and inputting them into an initial semantic BERT model to extract the preset keyword vector of each of the preset keywords; Calculating the cosine similarity between the preset keyword vectors based on the cosine similarity calculation formula; Randomly pairing the preset keyword vectors to generate a pairing result; Based on the pairing result and the cosine similarity, the initial semantic BERT model is trained to determine the preset sentence BERT model.
7. The method for determining a public opinion analysis copy according to any one of claims 1 to 6, characterized in that: The step of determining a target analysis copy matching the target keyword and the related keywords from a preset search engine solution ES library includes: Sorting the preset analysis texts matching the target keyword and / or the related keyword according to the similarity score; Based on the preset text screening rules, at least one target analysis text is determined from the sorted preset analysis texts.
8. A device for determining a public opinion analysis copy, characterized in that: include: The target keyword extraction module is used to extract the target keywords of the target article through the pre-trained bidirectional autoregressive BART generative model; A related keyword determination module, used to determine related keywords associated with the target keyword based on a preset sentence pattern BERT model; The target analysis copy determination module is used to determine the target analysis copy that matches the target keyword and the related keywords from the preset search engine solution ES library.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the method for determining the public opinion analysis text as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the method for determining public opinion analysis text according to any one of claims 1 to 7.