Stock screening and predicting method and system based on theme comprehensive score

By adopting the thematic comprehensive scoring method in stock investment analysis, combining LDA, cosine similarity and LSTM models, the problem of traditional methods being difficult to effectively utilize text data and lacking multi-factor comprehensive considerations is solved, and the accuracy of stock screening and prediction and the stability of investment portfolios are improved.

CN120088067APending Publication Date: 2025-06-03SHANGHAI UNIVERSITY OF ELECTRIC POWER
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510054654.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

Traditional stock investment analysis methods have limitations, it is difficult to effectively utilize massive text data, and the lack of comprehensive consideration of multiple factors, resulting in insufficient accuracy of quantitative target selection and timing prediction.

Method used

The stock screening and prediction method based on the theme comprehensive score is adopted, and the text theme is extracted through the LDA model, and the vocabulary similarity is calculated based on the cosine similarity algorithm to obtain the popularity of the topic; the LSTM model is used to predict the emotional polarity of the text, calculate the comprehensive score of the topic, select relevant stocks of high-scoring topics for screening, and predict the rise and fall through the random forest model.

Benefits of technology

The accuracy of quantitative target selection and stock price fluctuations prediction has been improved, and stock price fluctuations can be effectively screened out, and the investment targets with investment value can be adjusted in a timely manner, reducing investment risks, and improving the stability and risk resistance of the investment portfolio.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120088067A_ABST
    Figure CN120088067A_ABST
Patent Text Reader

Abstract

The invention relates to a stock screening and predicting method and system based on theme comprehensive scores. The method comprises the following steps: acquiring a text, and performing data cleaning and word segmentation processing to obtain vocabularies in the text; performing theme extraction on the text to obtain vocabularies under each theme and the occurrence frequency of the vocabularies; calculating the similarity between the vocabularies, performing topic classification on the vocabularies according to the similarity to obtain the total number of times of occurrence of the related vocabularies in the text under each topic, and taking the total number of times as the topic popularity of the topic; predicting the sentiment polarity of the text, and calculating the sentiment polarity score of each theme; obtaining a theme comprehensive score according to the theme popularity and the emotion polarity score; selecting a theme with a top comprehensive score ranking, adding related stocks under the theme into a stock pool, and screening in the stock pool to obtain a stock target; and predicting rising and falling of the stock target through the stock prediction model to obtain a prediction result. Compared with the prior art, the accuracy of quantitative bid selection and stock rising and falling prediction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial investment, and particularly to a method and system for stock screening and prediction based on a comprehensive theme score. Background Art

[0002] In the field of stock investment, accurately selecting investment targets and grasping investment opportunities have always been the core issues that investors focus on. Traditional stock investment analysis methods mainly rely on fundamental analysis and technical analysis. Fundamental analysis focuses on the research of macro factors such as the company's financial status and industry prospects, while technical analysis focuses on predicting future trends by analyzing historical data such as stock prices and trading volumes. However, these traditional methods have certain limitations.

[0003] On the one hand, fundamental analysis requires investors to have a large amount of professional knowledge and rich experience, and the reaction to changes in the macroeconomic environment and industry dynamics is relatively lagging. On the other hand, technical analysis is mainly based on historical data, and market uncertainties and unexpected factors often lead to the failure of technical analysis.

[0004] With the development of Internet and big data technologies, text data in the financial market is becoming increasingly rich, such as news reports, social media comments, research reports, etc. These text data contain a large amount of information about stocks, but how to effectively extract valuable information from these massive text data and apply it to stock investment decisions has become a hot issue in current research. At present, although there are already some methods for stock investment analysis using text analysis technologies, most of them only focus on the analysis of single factors, lack comprehensive consideration of multiple factors, and it is difficult to achieve accurate quantitative target selection and timing prediction. Summary of the Invention

[0005] The purpose of the present invention is to overcome the defects of the above-mentioned existing technologies and provide a method and system for stock screening and prediction based on a comprehensive theme score, which improves the accuracy of quantitative target selection and stock price increase and decrease prediction.

[0006] The purpose of the present invention can be achieved by the following technical solutions:

[0007] A method for stock screening and prediction based on a comprehensive theme score, comprising the following steps:

[0008] Obtain text, perform data cleaning on the text, and perform word segmentation on the text after data cleaning to obtain the words in the text;

[0009] Extract themes from the text through the LDA model, obtain the words under each theme and their corresponding probabilities, and convert the probabilities into the number of occurrences;

[0010] Calculate the similarity between the words through the cosine similarity algorithm, classify the words according to the similarity to obtain the total number of occurrences of relevant words under each topic in the text, and use the total number as the topic popularity of the topic;

[0011] Predict the sentiment polarity of the text through the LSTM model, calculate the sentiment polarity score for the text represented by each topic to obtain the sentiment polarity score;

[0012] Obtain the comprehensive topic score based on the topic popularity and sentiment polarity score;

[0013] Select the topics with the top scores according to the comprehensive topic score, add the relevant stocks under the topics to the stock pool, and screen the stock targets from the stock pool through the trading strategy;

[0014] Predict the rise and fall of the stock targets through the stock prediction model to obtain the prediction result.

[0015] Further, the data cleaning is to remove noise data, and the noise data includes irrelevant advertisements and duplicate content.

[0016] Further, the text includes Chinese text and English text. The specific steps for word segmentation of the text include: using Jieba for word segmentation of the Chinese text and using the NLTK tool for word segmentation of the English text.

[0017] Further, the steps for topic extraction of the text through the LDA model include: after completing the word segmentation, removing the stop words in the text, converting the text into a bag-of-words model, setting the LDA model parameters, and outputting the words and their corresponding probabilities under each topic according to the probability ranking.

[0018] Further, the specific steps for calculating the similarity between the words through the cosine similarity algorithm include:

[0019] Convert the words under each topic into vectors through the Word2Vec model, convert the vectors into NumPy arrays, calculate the dot product and modulus of the vectors according to the NumPy arrays, and then obtain the similarity between the words. The calculation formula for the similarity is as follows:

[0020]

[0021] In the formula, is the word vector, is another word vector, is the modulus of the word vector, is the modulus of another word vector.

[0022] Further, when classifying the words according to the similarity, when the similarity of the words is greater than a preset similarity threshold, they are classified under the same theme.

[0023] Further, the calculation formula for the comprehensive theme score is:

[0024] text_score = topic_num * emotion_score

[0025] In the formula, text_score is the comprehensive theme score, topic_num is the theme popularity, and emotion_score is the sentiment polarity score.

[0026] Further, the trading strategy includes multiple ones among the moving average crossover strategy, the relative strength index strategy, and the Bollinger Band breakout strategy.

[0027] Further, the stock prediction model is a random forest model, and the training steps of the stock prediction model include: calculating the daily return rate of each stock according to the stock data in the target pool; creating a target variable according to the positive or negative of the return rate, if the return rate is greater than 0, the stock rises, otherwise the stock falls; using the return rate as a feature variable, storing the feature data in the feature dataset, storing the target data in the target dataset, and dividing the feature data and the target data into a training set and a test set; training the random forest model using the training set, predicting the feature data of the test set through the trained model to obtain a prediction result; evaluating the accuracy rate of the stock prediction model by comparing the consistency between the prediction result and the target data of the test set.

[0028] According to another aspect of the present invention, there is provided a stock screening and prediction system based on the comprehensive theme score, including:

[0029] A word segmentation processing module, configured to obtain a text, perform data cleaning on the text, and perform word segmentation processing on the text after data cleaning to obtain the words in the text;

[0030] A theme extraction module, configured to extract themes from the text through an LDA model, obtain the words under each theme and their corresponding probabilities, and convert the probabilities into the number of occurrences;

[0031] A theme popularity acquisition module, configured to calculate the similarity between the words through a cosine similarity algorithm, classify the words according to the similarity to obtain the total number of occurrences of the relevant words under each theme in the text, and use the total number as the theme popularity of the theme;

[0032] An emotional polarity score acquisition module, which is used to predict the emotional polarity of text through an LSTM model, calculate the emotional polarity scores of the text represented by each of the said topics, and obtain the emotional polarity scores;

[0033] A theme comprehensive score module, which is used to obtain the theme comprehensive score according to the said theme popularity and emotional polarity score;

[0034] A stock target acquisition module, which is used to select the said topics with higher scores according to the theme comprehensive score, add the relevant stocks under the said topics to the stock pool, and screen to obtain stock targets in the said stock pool through a trading strategy;

[0035] A stock price increase and decrease prediction module, which is used to predict the increase and decrease of the said stock targets through a random forest model and obtain the prediction results.

[0036] Compared with the prior art, the present invention has the following beneficial effects:

[0037] 1. The present invention performs word segmentation on the text after data cleaning to obtain the words in the text, extracts the themes of the text, and obtains the words and their occurrence times under each theme; by calculating the similarity between words, classifies the words according to the similarity to obtain the total number of occurrences of the relevant words under each theme in the text, and takes it as the theme popularity of the theme; predicts the emotional polarity of the text and calculates the emotional polarity scores of each theme; obtains the theme comprehensive score according to the theme popularity and emotional polarity score; selects the themes with higher theme comprehensive scores, adds the relevant stocks under the themes to the stock pool, and screens to obtain stock targets through a trading strategy. Through the comprehensive consideration of the theme popularity and emotional polarity score, it can effectively screen out stock targets with investment value.

[0038] 2. The present invention selects the themes with higher theme comprehensive scores, adds the relevant stocks under the themes to the stock pool, screens to obtain stock targets in the stock pool, predicts the increase and decrease of the stock targets through a stock prediction model, improves the profitability of stock investment to a certain extent, and in the period of large market fluctuations, the method of the present invention can adjust the investment portfolio more timely, effectively reduces the investment risk, and improves the stability and risk resistance ability of the investment portfolio. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a schematic flow chart of a stock screening and prediction method based on theme comprehensive score proposed by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0040] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment is implemented on the premise of the technical solution of the present invention, and gives the detailed implementation manner and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0041] English abbreviations involved:

[0042] Latent Dirichlet Allocation: LDA

[0043] Long Short-Term Memory: LSTM

[0044] Natural Language Toolkit: NLTK

[0045] Embodiment 1

[0046] This embodiment provides a stock screening and prediction method based on the comprehensive theme score, as Figure 1 shown, including the following steps:

[0047] S1. Obtain the text, perform data cleaning on the text, and perform word segmentation on the text after data cleaning to obtain the vocabulary in the text.

[0048] Collect a wide range of stock-related text data, crawl financial news, research reports, social media posts, etc. from Eastmoney.com. Perform data cleaning on the collected text to remove noise data, such as irrelevant advertisements, duplicate content, etc. The text includes Chinese text and English text. The specific steps for performing word segmentation on the text include: using Jieba for word segmentation of Chinese text and using NLTK for word segmentation of English text.

[0049] S2. Extract the theme of the text through the LDA model, obtain the vocabulary and its corresponding probability under each theme, and convert the probability into the number of occurrences.

[0050] Apply the topic modeling algorithm Latent Dirichlet Allocation (LDA) model. The LDA model is an unsupervised learning algorithm that regards the document collection as a probability model. In this embodiment, all the crawled financial texts after data cleaning are regarded as large documents, assuming that each document is composed of multiple mixed themes, and each theme is represented by the probability distribution of multiple vocabulary.

[0051] The steps for theme extraction of financial texts are as follows:

[0052] ① On the basis of word segmentation, we continue to remove stop words from the segmented documents.

[0053] ② Create a dictionary and convert the text into a bag-of-words model representation.

[0054] ③ Set the LDA model parameters. After a series of parameter tuning, the final parameters and their set values are: the number of topics num_topics = 10, the number of training passes passes = 20, the prior distribution parameter α of document-topic = 0.2, the prior distribution parameter η of topic-word = 0.3, and the model update frequency update_every = 1.

[0055] ④ Sort according to the probability and output the top 10 words and their corresponding probabilities under each topic.

[0056] The output results are as follows:

[0057] [('Policy', 0.05), ('Central Bank', 0.04), ('Interest Rate', 0.03), ('Monetary Policy', 0.03), ('Reserve Requirement Cut', 0.02), ('Macro-control', 0.02), ('Economy', 0.02), ('Inflation', 0.01), ('Money Supply', 0.01), ('Fiscal Policy', 0.01)].

[0058] Verify the accuracy of the LDA model by using the financial text with pre-labeled topic classifications. Adopt a dataset of 835 known financial news articles, among which 267 belong to the category of the stock market, indicating that the proportion of stocks in all financial news texts is 267 / 835 = 0.32, and the topics are manually labeled. After using the trained LDA model for topic classification, the result is [('Stock', 0.29)], so the probability of stocks is 29%, and the recall rate is 90.6%, indicating that the trained LDA model has a very high accuracy.

[0059] Convert the probability into a frequency count, such as [('Stock', 5), ('Rise', 4), ('Market Index', 3)], and each word corresponds to the number of times the word appears.

[0060] Finally, put all the topics that appear into the document and perform the first-round summary, that is, aggregate the same words and accumulate the frequencies to obtain the result set.

[0061] S3. Calculate the similarity between words through the cosine similarity algorithm, classify the words into topics according to the similarity, obtain the total number of times the relevant words under each topic appear in the text, and use the total number as the topic popularity of the topic.

[0062] Because some words are different but have similar meanings and the similarity between words may be relatively high, in the second round of this embodiment, the cosine similarity algorithm is used to calculate the similarity between words.

[0063] For two word vectors, cosine similarity measures the similarity by calculating the cosine value of the angle between them. The closer the cosine value is to 1, the more similar the two words are.

[0064] The specific steps to calculate the similarity between words through the cosine similarity algorithm are as follows:

[0065] Convert the words under each topic in the result set obtained in the previous round into word vectors through the Word2Vec model, convert the word vectors into NumPy arrays, calculate the dot product and norm of the word vectors based on the NumPy arrays, and then obtain the similarity between words. The formula for calculating the similarity is as follows:

[0066]

[0067] In the formula, is the word vector, is another word vector, is the norm of the word vector, is the norm of another word vector.

[0068] When classifying words into topics according to the similarity, when the similarity of words is greater than the preset similarity threshold, they are classified under the same topic. The words with similarity greater than the threshold are summarized for the second time to obtain a new round of result set.

[0069] Count the total number of times the relevant words under each topic appear in the text, and use this as a measure of the popularity of the topic. For example, within a certain period of time, the relevant words under the topic of "new energy vehicles" appeared 500 times in the collected stock text, then the popularity of this topic is 500.

[0070] In this embodiment, the topics are sorted from high to low according to the topic popularity, a topic popularity ranking list is constructed, and the top 100 topics in the topic popularity ranking are selected.

[0071] S4. Predict the sentiment polarity of the text through the LSTM model, calculate the sentiment polarity score for the text represented by each topic, and obtain the sentiment polarity score.

[0072] After the topic extraction and similarity analysis in the first two rounds, a list of the top 100 in topic popularity is obtained, but it is impossible to determine whether the topic is positive or negative. In this embodiment, the sentiment score of the topic is analyzed through sentiment polarity judgment.

[0073] Judge the sentiment polarity of the sentiment text through the long short-term memory network (LSTM). The LSTM model can process the long sequence information in the text, better capture the semantic and sentiment features of the text, encode the text data and input it into the LSTM model, and predict the sentiment polarity of the text by training the model.

[0074] The training steps of the LSTM model include:

[0075] ① Data preprocessing: Use Tokenizer to convert the text into a sequence of numbers, use pad_sequences to pad the sequences to the same length, and normalize the sentiment scores to the range [-1, 1] to adapt to the output range of the tanh activation function.

[0076] ② Build the initial model: Use the Embedding layer to convert the word indices in the text into word vectors. The corresponding parameters are input_dim = 10000, output_dim = 128, and input_length = 200.

[0077] Introduce the Bidirectional LSTM layer to process the sequence information, and use the GlobalAveragePooling1D layer for dimensionality reduction. The corresponding parameters are units = 64 and return_sequences = True.

[0078] Use the Dense layer for feature extraction and classification. To prevent overfitting, add the Dropout layer. The corresponding parameters are units = 64, activation = relu, and rate = 0.2.

[0079] Use the tanh activation function to limit the output to [-1, 1].

[0080] ③ Compile and train the model: For the model, use the mse loss function and the adam optimizer for training, and use mae as the evaluation metric.

[0081] ④ Evaluate the model:

[0082] Loss (MSE) on the test set: 0.05

[0083] Mean Absolute Error (MAE): 0.15

[0084] Mean Absolute Error (origin-MAE) in the original range [-10, 10]: 1.5

[0085] Mean Squared Error (origin-MSE) in the original range: 5.0

[0086] Through the above model training and the display of its results, it shows that the model has a good fitting degree for the test data, and the average deviation of the model prediction is relatively small.

[0087] By calculating the sentiment polarity scores of the documents represented by each topic, for the text judged as positive by the sentiment analysis model, assign it a sentiment polarity score between [0, 10]. The higher the score, the more positive the sentiment. For negative text, assign it a sentiment polarity score between [-10, 0]. The lower the score, the more negative the sentiment. For neutral text, assign a score of 0.

[0088] S5. Obtain the comprehensive topic score based on the topic popularity and the sentiment polarity score.

[0089] Since the number of occurrences of some topics is too large, resulting in an abnormally high overall score value, normalize the dimension of the number of occurrences of the topic and compress it to the range of occurrences [0, 100].

[0090] The calculation formula for the comprehensive topic score is:

[0091] text_score = topic_num * emotion_score

[0092] In the formula, text_score is the comprehensive topic score, topic_num is the topic popularity, and emotion_score is the sentiment polarity score.

[0093] For example: The popularity score of the topic in the banking field is 60, and the sentiment polarity score is 5. Then the comprehensive topic score of this topic is 300, belonging to the positive field. The popularity score of the topic in the health field is 75, and the sentiment polarity score is -4. Then the comprehensive topic score of this topic is -200, belonging to the negative field.

[0094] S6. Select the topics with the top-ranked scores according to the comprehensive topic score, add the relevant stocks under the topics to the stock pool, and screen the stock targets from the stock pool through trading strategies.

[0095] According to the comprehensive topic score, select the top 5 topic fields in terms of scores. For example, after calculation, the comprehensive scores of the 5 topics of "gas", "brewing industry", "jewelry", "shipping port" and "coal industry" rank among the top. Select relevant stocks from these 5 topic fields and add them to the stock pool. On average, 6 stocks are selected for each topic field, so the stock pool probably contains 30 stocks.

[0096] For the stocks in the first-round pool, in this embodiment, based on the historical data of the stock in the past year, screen the patterns through trading strategies based on the historical price and trend of the stock. The trading strategies include multiple of the moving average crossover strategy, relative strength index strategy and Bollinger Band breakout strategy.

[0097] Taking the Relative Strength Index (RSI) strategy as an example, in this embodiment, the change in the stock price is first calculated, and then the increase and decrease amplitudes are obtained. The Relative Strength Index (RSI) is calculated based on the average increase and decrease amplitudes over a certain period (such as 14 days). When the RSI is below 30, the stock is in an oversold state, which may be a buying opportunity; when the RSI falls back from above 70, it may also imply that the stock price is about to correct, and it is suitable for attention. If a stock meets one of these conditions, it passes the screening.

[0098] It is also possible to simply analyze the price trend and trading volume of the stock. If the stock shows an upward trend and the trading volume gradually increases, it indicates that the stock is in a strong stage and can be used as a screening target; if the stock is in a consolidation pattern and the trading volume is small, it may be necessary to wait for a breakout signal before screening.

[0099] Based on the first-round stock pool, 3 - 5 stock targets are further screened to form a target pool.

[0100] S7. Predict the rise and fall of the stock targets through the stock prediction model to obtain the prediction results.

[0101] The stock prediction model is a random forest model. The training steps of the stock prediction model include:

[0102] Stock data of the stock targets in the target pool is downloaded from tushare, and the daily return rate of each stock, as well as the percentage change in the closing prices of two adjacent days, is calculated.

[0103] The target variable is created based on the positive or negative of the return rate. If the return rate is greater than 0, it is 1 (indicating the stock price rises), otherwise it is 0 (indicating the stock price falls); the return rate is used as the feature variable, the feature data is stored in the feature dataset, the target data is stored in the target dataset, and the feature data and target data are divided into a training set and a test set; the random forest model is trained using the training set, and the feature data of the test set is predicted through the trained model to obtain the prediction results; by comparing the consistency between the prediction results and the target data of the test set, the accuracy rate of the stock prediction model is evaluated. Finally, the average accuracy result of the obtained stock prediction model is 0.65.

[0104] The trained random forest algorithm is used to predict the stocks in these stock pools. Among the 30 stocks, 21 stocks are profitable and only 9 stocks are loss-making. The number of profitable stocks is much larger than the number of loss-making stocks. Among the profitable stocks, the highest return rate reaches 21%, and the highest annualized rate reaches 28%. It can be seen that the stock screening and prediction method based on the theme comprehensive score proposed by the present invention improves the accuracy rate of quantitative target selection and stock price rise and fall prediction.

[0105] Embodiment 2

[0106] This embodiment provides a stock screening and prediction system based on the comprehensive theme score, including:

[0107] A word segmentation processing module, which is used to obtain text, perform data cleaning on the text, and perform word segmentation processing on the text after data cleaning to obtain the vocabulary in the text;

[0108] A theme extraction module, which is used to extract themes from the text through the LDA model, obtain the vocabulary and its corresponding probability under each theme, and convert the probability into the number of occurrences;

[0109] A theme popularity acquisition module, which is used to calculate the similarity between words through the cosine similarity algorithm, classify the words according to the similarity to obtain the total number of occurrences of relevant words under each theme in the text, and use the total number as the theme popularity of the theme;

[0110] An emotional polarity score acquisition module, which is used to predict the emotional polarity of the text through the LSTM model, calculate the emotional polarity score for the text represented by each theme, and obtain the emotional polarity score;

[0111] A theme comprehensive score module, which is used to obtain the theme comprehensive score according to the theme popularity and the emotional polarity score;

[0112] A stock target acquisition module, which is used to select the themes with the top scores according to the theme comprehensive score, add the relevant stocks under the themes to the stock pool, and screen the stock targets from the stock pool through trading strategies;

[0113] A stock price increase and decrease prediction module, which is used to predict the increase and decrease of the stock target through the random forest model and obtain the prediction result.

[0114] The rest is the same as in Embodiment 1.

[0115] The preferred specific embodiments of the present invention have been described in detail above. It should be understood that those of ordinary skill in the art can make many modifications and variations based on the concept of the present invention without creative work. Therefore, all technical solutions that can be obtained by those skilled in the art in the technical field of the present invention based on the concept of the present invention through logical analysis, reasoning or limited experiments on the basis of the prior art should be within the protection scope determined by the claims.

Claims

1. A stock screening and prediction method based on comprehensive theme scores, characterized in that: The following steps are involved: Acquire a text, perform data cleaning on the text, and perform word segmentation on the text after data cleaning to obtain words in the text; Perform topic extraction on the text using an LDA model to obtain the words under each topic and their corresponding probabilities, and convert the probabilities into occurrence counts; Calculate the similarity between the words by using a cosine similarity algorithm, classify the words by topic according to the similarity, obtain the total number of times the relevant words under each topic appear in the text, and use the total number as the topic popularity of the topic; Predict the sentiment polarity of the text through the LSTM model, calculate the sentiment polarity score of the text represented by each topic, and obtain the sentiment polarity score; Obtaining a comprehensive score of the topic according to the topic popularity and sentiment polarity score; Select the topic with the highest score according to the comprehensive score of the topic, add the relevant stocks under the topic to the stock pool, and screen the stock targets in the stock pool through the trading strategy; The rise and fall of the target stock is predicted by the stock prediction model to obtain a prediction result.

2. The method for stock screening and prediction based on comprehensive subject scores according to claim 1, characterized in that: The data cleaning is to remove noise data, where the noise data includes irrelevant advertisements and repeated contents.

3. The method for stock screening and prediction based on comprehensive subject scores according to claim 1, characterized in that: The text includes Chinese text and English text. The specific steps of performing word segmentation processing on the text include: using Jieba word segmentation to perform word segmentation processing on the Chinese text, and using NLTK tool to perform word segmentation processing on the English text.

4. The method for stock screening and prediction based on comprehensive subject scores according to claim 1, characterized in that: The step of extracting topics from the text through the LDA model includes: after completing the word segmentation process, removing stop words in the text, converting the text into a bag-of-words model, setting LDA model parameters, and outputting the words under each topic and their corresponding probabilities according to probability sorting.

5. The method for stock screening and prediction based on comprehensive subject scores according to claim 1, characterized in that: The specific steps of calculating the similarity between the words by using the cosine similarity algorithm include: The words under each topic are converted into vectors through the Word2Vec model, and the vectors are converted into NumPy arrays. The dot product and modulus of the vectors are calculated according to the NumPy arrays to obtain the similarity between the words. The calculation formula of the similarity is as follows: In the formula, is the vocabulary vector, is another vocabulary vector, is the modulus of the vocabulary vector, is the modulus of another vocabulary vector.

6. The method for stock screening and prediction based on comprehensive subject scores according to claim 1, characterized in that: When the words are categorized into topics according to the similarities, when the similarities of the words are greater than a preset similarity threshold, they are categorized into the same topic.

7. The method for stock screening and prediction based on comprehensive subject scores according to claim 1, characterized in that: The calculation formula for the comprehensive score of the topic is: text_score=topic_num*emotion_score In the formula, text_score is the comprehensive score of the topic, topic_num is the topic popularity, and emotion_score is the emotional polarity score.

8. The method for stock screening and prediction based on comprehensive subject scores according to claim 1, characterized in that: The trading strategies include a variety of moving average crossover strategies, relative strength index strategies and Bollinger Band breakout strategies.

9. The method for stock screening and prediction based on comprehensive subject scores according to claim 1, characterized in that: The stock prediction model is a random forest model, and the training steps of the stock prediction model include: calculating the daily yield of each stock based on the stock data in the target pool; creating a target variable based on the positive or negative value of the yield, if the yield is greater than 0, the stock has risen, otherwise the stock has fallen; using the yield as a feature variable, storing the feature data in a feature data set, storing the target data in a target data set, and dividing the feature data and the target data into a training set and a test set; using the training set to train the random forest model, predicting the feature data of the test set through the trained model to obtain a prediction result; and evaluating the accuracy of the stock prediction model by comparing the consistency between the prediction result and the target data of the test set.

10. A stock screening and prediction system based on comprehensive theme scores, characterized in that: include: A word segmentation processing module is used to obtain text, perform data cleaning on the text, and perform word segmentation processing on the text after data cleaning to obtain words in the text; A topic extraction module is used to extract topics from the text through an LDA model, obtain the words under each topic and their corresponding probabilities, and convert the probabilities into occurrence counts; A topic heat acquisition module is used to calculate the similarity between the words by using a cosine similarity algorithm, classify the words by topic according to the similarity, obtain the total number of times the relevant words under each topic appear in the text, and use the total number as the topic heat of the topic; The sentiment polarity score acquisition module is used to predict the sentiment polarity of the text through the LSTM model, calculate the sentiment polarity score of each text represented by the topic, and obtain the sentiment polarity score; A topic comprehensive score module is used to obtain a topic comprehensive score according to the topic popularity and sentiment polarity score; A stock target acquisition module is used to select the topic with the highest score according to the comprehensive score of the topic, add the relevant stocks under the topic to the stock pool, and screen the stock targets in the stock pool through the trading strategy; The stock rise and fall prediction module is used to predict the rise and fall of the stock target through a random forest model to obtain a prediction result.