CN108022016A - A kind of Prediction of Stock Price method and system based on artificial intelligence - Google Patents

A kind of Prediction of Stock Price method and system based on artificial intelligence Download PDF

Info

Publication number
CN108022016A
CN108022016A CN201711294176.2A CN201711294176A CN108022016A CN 108022016 A CN108022016 A CN 108022016A CN 201711294176 A CN201711294176 A CN 201711294176A CN 108022016 A CN108022016 A CN 108022016A
Authority
CN
China
Prior art keywords
msub
news
stock
feature
stock price
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711294176.2A
Other languages
Chinese (zh)
Inventor
张潇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University
Original Assignee
Hong Gu Information Technology (zhuhai) Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hong Gu Information Technology (zhuhai) Co Ltd filed Critical Hong Gu Information Technology (zhuhai) Co Ltd
Priority to CN201711294176.2A priority Critical patent/CN108022016A/en
Publication of CN108022016A publication Critical patent/CN108022016A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0206Price or cost determination based on market factors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Physics & Mathematics (AREA)
  • Marketing (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Game Theory and Decision Science (AREA)
  • Human Resources & Organizations (AREA)
  • Data Mining & Analysis (AREA)
  • Technology Law (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention discloses a kind of Prediction of Stock Price method and system based on artificial intelligence, to solve the problems, such as that the Consideration of existing Prediction of Stock Index has one-sidedness.This method includes:Obtain the stock price feature and stock news feature of the day of trade in preset time;The stock price feature and stock news feature input bidirectional circulating neural network model are trained;The composite character vector input multi-layer perception (MLP) of bidirectional circulating neural network model output is subjected to classification based training;The stock price of next day of trade is predicted according to the output of the multi-layer perception (MLP).Frame of the invention based on bidirectional circulating network, by the way that price feature is combined with news features, makes full use of the data message of acquisition, more accurately stock price is predicted.

Description

A kind of Prediction of Stock Price method and system based on artificial intelligence
Technical field
The present invention relates to field of artificial intelligence, more particularly to a kind of Prediction of Stock Price method based on artificial intelligence And system.
Background technology
Prediction of Stock Price refers to the historical information and the relevant market information of stock using price, and prediction stock is not Carry out the ups and downs situation or price situation of a period of time.In recent years, deep learning method was obtained in natural language processing field Many progress.Deep learning method also gradually applies to Prediction of Stock Index field.
Fama proposes effective market hypothesis in nineteen sixty-five, it is believed that stock market is " effective information " market, stock Price fully reflects the event having occurred and that, and the event that those not yet occur but market expectations can occur to stock price Influence.This after being assumed to be Prediction of Stock Index work provide foundation.
However, prediction stock price is still very difficult, because stock price is affected by numerous factors, for single For stock, except Macroscopic Factors, the dependent event of public company etc. such as the monetary policy of country, the prosperous situations of industry Microcosmic influence factors can also have an impact stock price.Therefore, except the pricing information of stock itself, many related works are all by stock Important evidence of the related news information of ticket as prediction stock price.
GPC Fung etc. are in document [Stock prediction:Integrating text mining approach Using real-time news] in made a prediction to stock price using real-time news information.They are first with linear Return and clustering method is segmented the price curve of stock, rising stage and decline phase of the every section of time interval to dutiable value.Then News in rising stage and decline phase is respectively labeled as good news and bad news.Selected by statistical method in news Advantage and empty profit feature.Finally make prediction according to ups and downs of the feature in these news to stock price.But this method Ignore continuation of the news for price impact.
TH Nguyen etc. predict stock price using agent model.In document [Topic modeling based Sentiment analysis on social media for stock market prediction] in, they propose one The topic model of a fusion emotion and topic, and by the main body analysis of the model use to stock related news.Obtaining After the theme distribution vector of each news, this theme vector is added in the feature of Prediction of Stock Index by they, is finally obtained Good prediction effect.But it have ignored the exclusive feature in financial field itself.
Xiao Ding etc. are by deep learning approach application to Prediction of Stock Index field.In the literature, they propose a kind of new Things abstracting method, the event of structuring is extracted from news.The event of these structurings becomes the input of neutral net, For predicting stock price.Then, on the basis of decimation in time work, when they further learn structuring in the literature Between event embedding, and using convolutional neural networks go prediction stock price.But multiple times are have ignored for stock The comprehensive function of valency.
Except being also used for Prediction of Stock Index with the content in social media with the relevant news information of stock, mass media. Johan Bollen etc. are in document [Twitter mood predicts the stock market] with Twitter Ups and downs of the content to stock market are made a prediction.They use popular feelings daily on the tool analysis Twitter such as OpinionFinde These affective characteristicses, are then added in prediction model, the ups and downs to stock market are made a prediction by sense.But can only be overall to stock market Situation make a prediction, be not suitable for the prediction of single stock.
Development situation of the relevant news information of stock usually to stock in itself is more related, also easily favourable comprising some Term of polarity etc., therefore Zeya Zhang et al. are in related work [Stock prediction:a method based on Extraction of news features and recurrent neural networks] in used the advantage of news The distribution of polarity section is used as its feature, and is put into Recognition with Recurrent Neural Network and is calculated in the lump with historical price information.It is but new Hear in text and contain abundant information, only go to consider from polarity favourable and insufficient.
The content of the invention
The technical problem to be solved in the present invention purpose is to provide a kind of Prediction of Stock Price method based on artificial intelligence And system, to solve the problems, such as that the Consideration of existing Prediction of Stock Index has one-sidedness.
To achieve these goals, the technical solution adopted by the present invention is:
A kind of Prediction of Stock Price method based on artificial intelligence, including step:
Obtain the stock price feature and stock news feature of the day of trade in preset time;
The stock price feature and stock news feature input bidirectional circulating neural network model are trained;
The composite character vector input multi-layer perception (MLP) of bidirectional circulating neural network model output is subjected to classification instruction Practice;
The stock price of next day of trade is predicted according to the output of the multi-layer perception (MLP).
Further, described the step of obtaining the stock price feature of the day of trade in preset time, specifically includes:
Obtain the price series of stock price day of trade in preset time:
p1, p2..., pt
Calculate amount of increase and amount of decrease r of the stock price i-th of day of tradeiFor:
The amount of increase and amount of decrease sequence of the day of trade in preset time is obtained according to result of calculation:
Rx, r2..., rt
Further, described the step of obtaining the stock news feature of the day of trade in preset time, specifically includes:
Obtain the news sequence of the day of trade in preset time:
It is l that every news is divided into lengthtWord sequence:
Judge the news whether be the day of trade on the day of news, if so, then being obtained using Word2Vec and GloVe described The term vector feature of each lexical item of news;Otherwise, the document vector characteristics of the news are obtained using fastText.
Further, it is described that the stock price feature and the stock news feature are inputted into bidirectional circulating neutral net The step of model is trained specifically includes:
Positive RNN and reverse RNN are combined to form into bidirectional circulating neural network model;
The stock price feature and the stock news feature are inputted into the bidirectional circulating neural network model;
Using the positive output of the bidirectional circulating neural network model with reversely output splicing as the neutral net mould The output of type.
Further, the step of stock price of next day of trade is predicted in the output according to the multi-layer perception (MLP) Specifically include:
The probability for going up and dropping in next day of trade using Softmax calculating stocks;
Using the result of maximum probability as prediction result.
A kind of Prediction of Stock Price system based on artificial intelligence, including:
Characteristic module, for obtaining the stock price feature and stock news feature of the day of trade in preset time;
First training module, for the stock price feature and stock news feature input bidirectional circulating is neural Network model is trained;
Second training module, for the composite character vector input multilayer for exporting the bidirectional circulating neural network model Perceptron carries out classification based training;
Prediction module, for predicting the stock price of next day of trade according to the output of the multi-layer perception (MLP).
Further, the characteristic module specifically includes:
First acquisition unit, the price series for day of trade that obtains stock price in preset time:
p1, p2..., pt
First computing unit, for calculating amount of increase and amount of decrease r of the stock price i-th of day of tradeiFor:
Price feature unit, for obtaining the amount of increase and amount of decrease sequence of the day of trade in preset time according to result of calculation:
r1, r2..., rt
Further, the characteristic module specifically further includes:
Second acquisition unit, for obtaining the news sequence of the day of trade in preset time:
Division unit, is l for every news to be divided into lengthtWord sequence:
Judging unit, for judge the news whether be the day of trade on the day of news, if so, then using Word2Vec with GloVe obtains the term vector feature of each lexical item of the news;Otherwise, obtained using fastText the document of the news to Measure feature.
Further, first training module specifically includes:
Combining unit, for positive RNN and reverse RNN to be combined to form bidirectional circulating neural network model;
Input unit, for the stock price feature and the stock news feature to be inputted the bidirectional circulating nerve Network model;
Output unit, for the positive output of the bidirectional circulating neural network model to be exported splicing as institute with reverse State the output of neural network model.
Further, the prediction module specifically includes:
Second computing unit, for the probability for going up and dropping in next day of trade using Softmax calculating stocks;
Prediction of result unit, for using the result of maximum probability as prediction result.
It is of the invention compared with traditional technology, have the following advantages:
Frame of the invention based on bidirectional circulating network, by the way that price feature is combined with news features, makes full use of and obtains The data message taken, is more accurately predicted stock price.
Brief description of the drawings
Fig. 1 is a kind of Prediction of Stock Price method flow diagram based on artificial intelligence that embodiment one provides;
Fig. 2 is a kind of Prediction of Stock Price system construction drawing based on artificial intelligence that embodiment two provides.
Embodiment
It is the specific embodiment of the present invention and with reference to attached drawing below, technical scheme is further described, But the present invention is not limited to these embodiments.
Embodiment one
A kind of Prediction of Stock Price method based on artificial intelligence is present embodiments provided, as shown in Figure 1, including step:
S11:Obtain the stock price feature and stock news feature of the day of trade in preset time;
S12:Stock price feature and stock news feature input bidirectional circulating neural network model are trained;
S13:The composite character vector input multi-layer perception (MLP) that bidirectional circulating neural network model exports is subjected to classification instruction Practice;
S14:The stock price of next day of trade is predicted according to the output of multi-layer perception (MLP).
Present embodiments provide a kind of Two-way Cycle neutral net for being combined stock price feature with stock news feature Model.Study on Stock Prediction Model is had using Two-way Cycle neutral net intuitively to be considered, stock price has one in a short time first Fixed timing dependence, secondly influence of the media event for stock price have continuation, i.e. media event can be at one section It is interior that lasting influence is produced to stock price.It can be found that whether stock price information is also from the ups and downs problem of stock price It is news information, is all the sequence with time correlation, for other graders (support vector machines, decision tree etc.), circulation god Being capable of effectively influence of the Expressive Features in sequential through network.In Prediction of Stock Index problem, shadow of a piece of news for share price Sound is often not limited to a day of trade, but at one end in the day of trade of time.
In the present embodiment, step S11 is the stock price feature and stock news feature for obtaining the day of trade in preset time.
The Consideration of the present embodiment includes two aspects, and one is stock price feature, and one is stock news feature.
Wherein, the step of obtaining the stock price feature of the day of trade in preset time specifically includes:
Obtain the price series of stock price day of trade in preset time:
p1, p2..., pt
Calculate amount of increase and amount of decrease r of the stock price i-th of day of tradeiFor:
The amount of increase and amount of decrease sequence of the day of trade in preset time is obtained according to result of calculation:
r1, r2..., rt
Specifically, stock can have some transaction data in each day of trade, including opening price, closing price, highest are minimum Valency, trading volume, amount of increase and amount of decrease etc..Wherein, closing price is commonly used in representing price of the stock on the day of, and amount of increase and amount of decrease is to receive on the same day Disk valency compares the lifting percentage of upper day of trade closing price.
The transaction value sequence for remembering continuous N days is p1, p2..., pt, ptFor the transaction data of t-th of day of trade.If will Predict the price of the t days, price feature is the transaction value sequence of t-N days to t-1 days.
Finally in use, every class transaction data of price will be normalized, the difference between different stocks is avoided It is different and cause model to be difficult to restrain.
In the present embodiment, specifically included in acquisition preset time the step of the stock news feature of the day of trade:
Obtain the news sequence of the day of trade in preset time:
It is l that every news is divided into lengthtWord sequence:
Judge the news whether be the day of trade on the day of news, if so, then being obtained using Word2Vec and GloVe described The term vector feature of each lexical item of news;Otherwise, the document vector characteristics of the news are obtained using fastText.
Specifically, stock is also possible to have some relevant news or agencies report in each day of trade, these are usual More related to the development situation of stock in itself, recording some continuous N days day of trade news sequence is:
The word sequence length of wherein every news is expressed as lt, therefore news is represented by one sequence:
The present embodiment for extracting news features using three kinds of different vectorial learning methods, including:
Word2Vec, GloVe and fastText.
Judge news whether be the day of trade on the day of news, if so, obtaining each of news using Word2Vec and GloVe The term vector feature of lexical item;Otherwise, the document vector characteristics of news are obtained using fastText.
Specifically, for the news on the day of the day of trade, quantified using Word2Vec and GloVe in headline and news Hold.
Since two ways respectively has quality, two kinds of term vector features are spliced when finally using, are obtained each The final feature vector of lexical item represents.
For the news of historical trading day, the document vector characteristics of news are obtained using fastText.
Since term vector feature is more concerned with the local message of each word, fastText is also used in text Document vector characteristics, easy to preferably obtain the global information amount of document.
In the present embodiment, step S12 is that stock price feature and stock news feature are inputted bidirectional circulating neutral net It is trained.
Wherein, step S12 is specifically included:
Positive RNN and reverse RNN are combined to form into bidirectional circulating neural network model;
The stock price feature and the stock news feature are inputted into the bidirectional circulating neural network model;
Using the positive output of the bidirectional circulating neural network model with reversely output splicing as the neutral net mould The output of type.
Specifically, due to the information of Prediction of Stock Index be all by certain timing, can be with using Recognition with Recurrent Neural Network Price and the information in news are preferably obtained, and bidirectional circulating network is then forward circulation neutral net and recycled back nerve Network forms, and compared to the advantage that one-way circulation neutral net has bigger, reverse sequence information can be captured, to text feature Processing is particularly effective.Therefore, the present embodiment using bidirectional circulating neutral net come processing feature.
Stock price feature and stock news feature are inputted bidirectional circulating neural network model, input bag by the present embodiment Include:The same day relevant headline, the same day relevant news content, continuous N days of past related news (including title with it is interior Hold), and price feature N days continuous.
Traditional neutral net is difficult information of the processing with timing without selection Memorability and persistence. And RNN (Recognition with Recurrent Neural Network) solves the problems, such as this.
RNN is the network for including circulation, it is allowed to the persistence of information.Work as shown in Fig. 2, the model A of neutral net is read The input Two-way Cycle neural network model x of preceding time tt, and obtain output ht, while by some current existing information states again It is secondary to be returned to itself as input.
The RNN that the present embodiment uses is the LSTM networks of multilayer, and LSTM is shot and long term memory network, is a kind of time recurrence Neutral net, is suitable for being spaced in processing and predicted time sequence and postponing relatively long critical event.It is a kind of special RNN structures, and can handle well and select memory timing information in useful relation and information, solve this sequence Long-term Dependence Problem in row problem.Therefore can also preferably extract in historical information between different event and different prices The relation that influences each other etc..
Positive RNN and reverse RNN are combined to form bidirectional circulating neutral net by the present embodiment, finally by forward direction output and instead Splice to output, the output as the bidirectional circulating neutral net.
In the present embodiment, step S13 is the composite character vector input multilayer for exporting bidirectional circulating neural network model Perceptron carries out classification based training.
Specifically, the output of multiple bidirectional circulating neutral nets is spliced, become the feature vector of a mixing, as more The input of layer perceptron (LMP).Multi-layer perception (MLP) is a kind of feedforward neural network connected entirely, can reflect one group of input vector It is mapped to another group of output vector, you can to represent that two differences see the mapping relations in space.By the stacking of multilayer neural network, The mapping relations of arbitrarily complicated degree can be realized in theory, therefore the present embodiment learns mixing spy using multi-layer perception (MLP) network Sign vector arrives the relationship map of final output.
In the present embodiment, step S14 is the stock price that next day of trade is predicted according to the output of multi-layer perception (MLP).
Wherein, step S14 is specifically included:
The probability for going up and dropping in next day of trade using Softmax calculating stocks;
Using the result of maximum probability as prediction result.
Specifically, output layer calculates the probability distribution on different labels using Softmax, as next day of trade goes up The probability distribution of label or the label of drop, and the label of maximum probability is used as final prediction result.Such as the ratio that goes up The probability that drops is big, then predicts next day of trade balloon.
The present embodiment uses cross entropy as cost function in training, and it is optimized with Adam algorithms.
The present embodiment proposes the frame based on bidirectional circulating network, and by by pricing information and newsletter archive feature With reference to the more accurately ups and downs to stock price are predicted.
Embodiment two
A kind of Prediction of Stock Price system based on artificial intelligence is present embodiments provided, as shown in Fig. 2, including:
Characteristic module 21, for obtaining the stock price feature and stock news feature of the day of trade in preset time;
First training module 22, for stock price feature and stock news feature to be inputted bidirectional circulating neutral net mould Type is trained;
Second training module 23, for the composite character vector input multilayer sense for exporting bidirectional circulating neural network model Know that machine carries out classification based training;
Prediction module 24, for predicting the stock price of next day of trade according to the output of multi-layer perception (MLP).
Present embodiments provide a kind of Two-way Cycle neutral net for being combined stock price feature with stock news feature Model.Study on Stock Prediction Model is had using Two-way Cycle neutral net intuitively to be considered, stock price has one in a short time first Fixed timing dependence, secondly influence of the media event for stock price have continuation, i.e. media event can be at one section It is interior that lasting influence is produced to stock price.It can be found that whether stock price information is also from the ups and downs problem of stock price It is news information, is all the sequence with time correlation, for other graders (support vector machines, decision tree etc.), circulation god Being capable of effectively influence of the Expressive Features in sequential through network.In Prediction of Stock Index problem, shadow of a piece of news for share price Sound is often not limited to a day of trade, but at one end in the day of trade of time.
In the present embodiment, characteristic module 21 is used for the stock price feature and stock news for obtaining the day of trade in preset time Feature.
The Consideration of the present embodiment includes two aspects, and one is stock price feature, and one is stock news feature.
Wherein, acquisition module 21 specifically includes:
First acquisition unit, the price series for day of trade that obtains stock price in preset time:
p1, p2..., pt
First computing unit, for calculating amount of increase and amount of decrease r of the stock price i-th of day of tradeiFor:
Price feature unit, for obtaining the amount of increase and amount of decrease sequence of the day of trade in preset time according to result of calculation:
r1, r2..., rt
Specifically, stock can have some transaction data in each day of trade, including opening price, closing price, highest are minimum Valency, trading volume, amount of increase and amount of decrease etc..Wherein, closing price is commonly used in representing price of the stock on the day of, and amount of increase and amount of decrease is to receive on the same day Disk valency compares the lifting percentage of upper day of trade closing price.
The transaction value sequence for remembering continuous N days is p1, p2..., pt, ptFor the transaction data of t-th of day of trade.If will Predict the price of the t days, price feature is the transaction value sequence of t-N days to t-1 days.
Finally in use, every class transaction data of price will be normalized, the difference between different stocks is avoided It is different and cause model to be difficult to restrain.
In the present embodiment, characteristic module 21 also specifically includes:
Second acquisition unit, for obtaining the news sequence of the day of trade in preset time:
Division unit, for every news to be divided into the word sequence that length is lt:
Judging unit, for judge the news whether be the day of trade on the day of news, if so, then using Word2Vec with GloVe obtains the term vector feature of each lexical item of the news;Otherwise, obtained using fastText the document of the news to Measure feature.
Specifically, stock is also possible to have some relevant news or agencies report in each day of trade, these are usual More related to the development situation of stock in itself, recording some continuous N days day of trade news sequence is:
The word sequence length of wherein every news is expressed as lt, therefore news is represented by one sequence:
The present embodiment for extracting news features using three kinds of different vectorial learning methods, including:
Word2Vec, GloVe and fastText.
Judge news whether be the day of trade on the day of news, if so, obtaining each of news using Word2Vec and GloVe The term vector feature of lexical item;Otherwise, the document vector characteristics of news are obtained using fastText.
Specifically, for the news on the day of the day of trade, quantified using Word2Vec and GloVe in headline and news Hold.
Since two ways respectively has quality, two kinds of term vector features are spliced when finally using, are obtained each The final feature vector of lexical item represents.
For the news of historical trading day, the document vector characteristics of news are obtained using fastText.
Since term vector feature is more concerned with the local message of each word, fastText is also used in text Document vector characteristics, easy to preferably obtain the global information amount of document.
In the present embodiment, the first training module 22 is used to stock price feature and stock news feature inputting bidirectional circulating Neutral net is trained.
Wherein, the first training module 22 specifically includes:
Combining unit, for positive RNN and reverse RNN to be combined to form bidirectional circulating neural network model;
Input unit, for the stock price feature and the stock news feature to be inputted the bidirectional circulating nerve Network model;
Output unit, for the positive output of the bidirectional circulating neural network model to be exported splicing as institute with reverse State the output of neural network model.
Specifically, due to the information of Prediction of Stock Index be all by certain timing, can be with using Recognition with Recurrent Neural Network Price and the information in news are preferably obtained, and bidirectional circulating network is then forward circulation neutral net and recycled back nerve Network forms, and compared to the advantage that one-way circulation neutral net has bigger, reverse sequence information can be captured, to text feature Processing is particularly effective.Therefore, the present embodiment using bidirectional circulating neutral net come processing feature.
Stock price feature and stock news feature are inputted bidirectional circulating neural network model, input bag by the present embodiment Include:The same day relevant headline, the same day relevant news content, continuous N days of past related news (including title with it is interior Hold), and price feature N days continuous.
Traditional neutral net is difficult information of the processing with timing without selection Memorability and persistence. And RNN (Recognition with Recurrent Neural Network) solves the problems, such as this.
RNN is the network for including circulation, it is allowed to the persistence of information.The model A of neutral net reads the defeated of current time t Enter Two-way Cycle neural network model xt, and obtain output ht, while some current existing information states are returned to itself again As input.
The RNN that the present embodiment uses is the LSTM networks of multilayer, and LSTM is shot and long term memory network, is a kind of time recurrence Neutral net, is suitable for being spaced in processing and predicted time sequence and postponing relatively long critical event.It is a kind of special RNN structures, and can handle well and select memory timing information in useful relation and information, solve this sequence Long-term Dependence Problem in row problem.Therefore can also preferably extract in historical information between different event and different prices The relation that influences each other etc..
Positive RNN and reverse RNN are combined to form bidirectional circulating neutral net by the present embodiment, finally by forward direction output and instead Splice to output, the output as the bidirectional circulating neutral net.
In the present embodiment, the second training module 23 is used for the composite character vector for exporting bidirectional circulating neural network model Input multi-layer perception (MLP) and carry out classification based training.
Specifically, the output of multiple bidirectional circulating neutral nets is spliced, become the feature vector of a mixing, as more The input of layer perceptron (LMP).Multi-layer perception (MLP) is a kind of feedforward neural network connected entirely, can reflect one group of input vector It is mapped to another group of output vector, you can to represent that two differences see the mapping relations in space.By the stacking of multilayer neural network, The mapping relations of arbitrarily complicated degree can be realized in theory, therefore the present embodiment learns mixing spy using multi-layer perception (MLP) network Sign vector arrives the relationship map of final output.
In the present embodiment, prediction module 24 is used for the stock valency that next day of trade is predicted according to the output of multi-layer perception (MLP) Lattice.
Wherein, prediction module 24 specifically includes:
Second computing unit, for the probability for going up and dropping in next day of trade using Softmax calculating stocks;
Prediction of result unit, for using the result of maximum probability as prediction result.
Specifically, output layer calculates the probability distribution on different labels using Softmax, as next day of trade goes up The probability distribution of label or the label of drop, and the label of maximum probability is used as final prediction result.Such as the ratio that goes up The probability that drops is big, then predicts next day of trade balloon.
The present embodiment uses cross entropy as cost function in training, and it is optimized with Adam algorithms.
The present embodiment proposes the frame based on bidirectional circulating network, and by by pricing information and newsletter archive feature With reference to the more accurately ups and downs to stock price are predicted.
Specific embodiment described herein is only to spirit explanation for example of the invention.Technology belonging to the present invention is led The technical staff in domain can do various modifications or additions to described specific embodiment or replace in a similar way Generation, but without departing from spirit of the invention or beyond the scope of the appended claims.

Claims (10)

  1. A kind of 1. Prediction of Stock Price method based on artificial intelligence, it is characterised in that including step:
    Obtain the stock price feature and stock news feature of the day of trade in preset time;
    The stock price feature and stock news feature input bidirectional circulating neural network model are trained;
    The composite character vector input multi-layer perception (MLP) of bidirectional circulating neural network model output is subjected to classification based training;
    The stock price of next day of trade is predicted according to the output of the multi-layer perception (MLP).
  2. 2. a kind of Prediction of Stock Price method based on artificial intelligence according to claim 1, it is characterised in that described to obtain The step of stock price feature for taking the day of trade in preset time, specifically includes:
    Obtain the price series of stock price day of trade in preset time:
    p1, p2..., pt
    Calculate amount of increase and amount of decrease r of the stock price i-th of day of tradeiFor:
    <mrow> <msub> <mi>r</mi> <mi>i</mi> </msub> <mo>=</mo> <mfrac> <mrow> <msub> <mi>p</mi> <mi>i</mi> </msub> <mo>-</mo> <msub> <mi>p</mi> <mrow> <mi>i</mi> <mo>-</mo> <mn>1</mn> </mrow> </msub> </mrow> <msub> <mi>p</mi> <mrow> <mi>i</mi> <mo>-</mo> <mn>1</mn> </mrow> </msub> </mfrac> <mo>;</mo> </mrow>
    The amount of increase and amount of decrease sequence of the day of trade in preset time is obtained according to result of calculation:
    r1, r2..., rt
  3. 3. a kind of Prediction of Stock Price method based on artificial intelligence according to claim 2, it is characterised in that described to obtain The step of stock news feature for taking the day of trade in preset time, specifically includes:
    Obtain the news sequence of the day of trade in preset time:
    <mrow> <mover> <msub> <mi>D</mi> <mn>1</mn> </msub> <mo>&amp;RightArrow;</mo> </mover> <mo>,</mo> <mover> <msub> <mi>D</mi> <mn>2</mn> </msub> <mo>&amp;RightArrow;</mo> </mover> <mo>,</mo> <mo>...</mo> <mo>,</mo> <mover> <msub> <mi>D</mi> <mi>t</mi> </msub> <mo>&amp;RightArrow;</mo> </mover> <mo>;</mo> </mrow>
    It is l that every news is divided into lengthtWord sequence:
    <mrow> <msub> <mi>w</mi> <mn>1</mn> </msub> <mo>,</mo> <msub> <mi>w</mi> <mn>2</mn> </msub> <mo>,</mo> <mo>...</mo> <mo>,</mo> <msub> <mi>w</mi> <msub> <mi>l</mi> <mi>t</mi> </msub> </msub> <mo>;</mo> </mrow>
    Judge the news whether be the day of trade on the day of news, if so, then obtaining the news using Word2Vec and GloVe Each lexical item term vector feature;Otherwise, the document vector characteristics of the news are obtained using fastText.
  4. 4. a kind of Prediction of Stock Price method based on artificial intelligence according to claim 1, it is characterised in that described to incite somebody to action The step of stock price feature and stock news feature input bidirectional circulating neural network model are trained is specific Including:
    Positive RNN and reverse RNN are combined to form into bidirectional circulating neural network model;
    The stock price feature and the stock news feature are inputted into the bidirectional circulating neural network model;
    Using the positive output of the bidirectional circulating neural network model with reversely output splicing as the neural network model Output.
  5. 5. a kind of Prediction of Stock Price method based on artificial intelligence according to claim 1, it is characterised in that described The step of predicting the stock price of next day of trade according to the output of the multi-layer perception (MLP) specifically includes:
    The probability for going up and dropping in next day of trade using Softmax calculating stocks;
    Using the result of maximum probability as prediction result.
  6. A kind of 6. Prediction of Stock Price system based on artificial intelligence, it is characterised in that including:
    Characteristic module, for obtaining the stock price feature and stock news feature of the day of trade in preset time;
    First training module, for the stock price feature and the stock news feature to be inputted bidirectional circulating neutral net Model is trained;
    Second training module, for the composite character vector input Multilayer Perception for exporting the bidirectional circulating neural network model Machine carries out classification based training;
    Prediction module, for predicting the stock price of next day of trade according to the output of the multi-layer perception (MLP).
  7. A kind of 7. Prediction of Stock Price system based on artificial intelligence according to claim 6, it is characterised in that the spy Sign module specifically includes:
    First acquisition unit, the price series for day of trade that obtains stock price in preset time:
    p1, p2..., pt
    First computing unit, for calculating amount of increase and amount of decrease r of the stock price i-th of day of tradeiFor:
    <mrow> <msub> <mi>r</mi> <mi>i</mi> </msub> <mo>=</mo> <mfrac> <mrow> <msub> <mi>p</mi> <mi>i</mi> </msub> <mo>-</mo> <msub> <mi>p</mi> <mrow> <mi>i</mi> <mo>-</mo> <mn>1</mn> </mrow> </msub> </mrow> <msub> <mi>p</mi> <mrow> <mi>i</mi> <mo>-</mo> <mn>1</mn> </mrow> </msub> </mfrac> <mo>;</mo> </mrow>
    Price feature unit, for obtaining the amount of increase and amount of decrease sequence of the day of trade in preset time according to result of calculation:
    r1, r2..., rt
  8. A kind of 8. Prediction of Stock Price system based on artificial intelligence according to claim 7, it is characterised in that the spy Sign module specifically further includes:
    Second acquisition unit, for obtaining the news sequence of the day of trade in preset time:
    <mrow> <mover> <msub> <mi>D</mi> <mn>1</mn> </msub> <mo>&amp;RightArrow;</mo> </mover> <mo>,</mo> <mover> <msub> <mi>D</mi> <mn>2</mn> </msub> <mo>&amp;RightArrow;</mo> </mover> <mo>,</mo> <mo>...</mo> <mo>,</mo> <mover> <msub> <mi>D</mi> <mi>t</mi> </msub> <mo>&amp;RightArrow;</mo> </mover> <mo>;</mo> </mrow>
    Division unit, is l for every news to be divided into lengthtWord sequence:
    <mrow> <msub> <mi>w</mi> <mn>1</mn> </msub> <mo>,</mo> <msub> <mi>w</mi> <mn>2</mn> </msub> <mo>,</mo> <mo>...</mo> <mo>,</mo> <msub> <mi>w</mi> <msub> <mi>l</mi> <mi>t</mi> </msub> </msub> <mo>;</mo> </mrow>
    Judging unit, for judge the news whether be the day of trade on the day of news, if so, then using Word2Vec with GloVe obtains the term vector feature of each lexical item of the news;Otherwise, obtained using fastText the document of the news to Measure feature.
  9. 9. a kind of Prediction of Stock Price system based on artificial intelligence according to claim 6, it is characterised in that described One training module specifically includes:
    Combining unit, for positive RNN and reverse RNN to be combined to form bidirectional circulating neural network model;
    Input unit, for the stock price feature and the stock news feature to be inputted the bidirectional circulating neutral net Model;
    Output unit, for the positive output of the bidirectional circulating neural network model to be exported splicing as the god with reverse Output through network model.
  10. 10. a kind of Prediction of Stock Price system based on artificial intelligence according to claim 6, it is characterised in that described Prediction module specifically includes:
    Second computing unit, for the probability for going up and dropping in next day of trade using Softmax calculating stocks;
    Prediction of result unit, for using the result of maximum probability as prediction result.
CN201711294176.2A 2017-12-08 2017-12-08 A kind of Prediction of Stock Price method and system based on artificial intelligence Pending CN108022016A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711294176.2A CN108022016A (en) 2017-12-08 2017-12-08 A kind of Prediction of Stock Price method and system based on artificial intelligence

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711294176.2A CN108022016A (en) 2017-12-08 2017-12-08 A kind of Prediction of Stock Price method and system based on artificial intelligence

Publications (1)

Publication Number Publication Date
CN108022016A true CN108022016A (en) 2018-05-11

Family

ID=62079038

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711294176.2A Pending CN108022016A (en) 2017-12-08 2017-12-08 A kind of Prediction of Stock Price method and system based on artificial intelligence

Country Status (1)

Country Link
CN (1) CN108022016A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108647828A (en) * 2018-05-15 2018-10-12 中山大学 A kind of Prediction of Stock Index method of combination news corpus and stock market's transaction data
CN108694476A (en) * 2018-06-29 2018-10-23 山东财经大学 A kind of convolutional neural networks Stock Price Fluctuation prediction technique of combination financial and economic news
CN108876604A (en) * 2018-05-25 2018-11-23 平安科技(深圳)有限公司 Stock market's Risk Forecast Method, device, computer equipment and storage medium
CN109816442A (en) * 2019-01-16 2019-05-28 四川驹马科技有限公司 A kind of various dimensions freight charges prediction technique and its system based on feature tag
CN110363568A (en) * 2019-06-06 2019-10-22 上海交通大学 Prediction of Stock Price method, system and the medium of the multi-threaded information of fusing text
CN111222051A (en) * 2020-01-16 2020-06-02 深圳市华海同创科技有限公司 Training method and device of trend prediction model
CN111685748A (en) * 2020-06-15 2020-09-22 广州视源电子科技股份有限公司 Quantile-based blood pressure early warning method, quantile-based blood pressure early warning device, quantile-based blood pressure early warning equipment and storage medium
CN113781219A (en) * 2021-09-06 2021-12-10 上海卡方信息科技有限公司 Real-time algorithm trading system and method in stock trading process

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108647828A (en) * 2018-05-15 2018-10-12 中山大学 A kind of Prediction of Stock Index method of combination news corpus and stock market's transaction data
CN108876604A (en) * 2018-05-25 2018-11-23 平安科技(深圳)有限公司 Stock market's Risk Forecast Method, device, computer equipment and storage medium
WO2019223133A1 (en) * 2018-05-25 2019-11-28 平安科技(深圳)有限公司 Method for forecasting stock market risk, device, computer apparatus, and storage medium
CN108694476A (en) * 2018-06-29 2018-10-23 山东财经大学 A kind of convolutional neural networks Stock Price Fluctuation prediction technique of combination financial and economic news
CN109816442A (en) * 2019-01-16 2019-05-28 四川驹马科技有限公司 A kind of various dimensions freight charges prediction technique and its system based on feature tag
CN110363568A (en) * 2019-06-06 2019-10-22 上海交通大学 Prediction of Stock Price method, system and the medium of the multi-threaded information of fusing text
CN111222051A (en) * 2020-01-16 2020-06-02 深圳市华海同创科技有限公司 Training method and device of trend prediction model
CN111222051B (en) * 2020-01-16 2023-09-12 深圳市华海同创科技有限公司 Training method and device for trend prediction model
CN111685748A (en) * 2020-06-15 2020-09-22 广州视源电子科技股份有限公司 Quantile-based blood pressure early warning method, quantile-based blood pressure early warning device, quantile-based blood pressure early warning equipment and storage medium
CN113781219A (en) * 2021-09-06 2021-12-10 上海卡方信息科技有限公司 Real-time algorithm trading system and method in stock trading process

Similar Documents

Publication Publication Date Title
CN108022016A (en) A kind of Prediction of Stock Price method and system based on artificial intelligence
Souma et al. Enhanced news sentiment analysis using deep learning methods
Zhang et al. Transformer-based attention network for stock movement prediction
WO2020020088A1 (en) Neural network model training method and system, and prediction method and system
US11348012B2 (en) System and method for forming predictions using event-based sentiment analysis
CN106384166A (en) Deep learning stock market prediction method combined with financial news
CN109509086A (en) The method, apparatus and storage medium of processing collection business based on artificial intelligence
Sun et al. SFFS-PC-NN optimized by genetic algorithm for dynamic prediction of financial distress with longitudinal data streams
Fu et al. Listening to the investors: A novel framework for online lending default prediction using deep learning neural networks
CN110909529B (en) User emotion analysis and prejudgment system of company image promotion system
CN112231485A (en) Text recommendation method and device, computer equipment and storage medium
CN111914553B (en) Financial information negative main body judging method based on machine learning
CN114493535B (en) Asset model-based data center system for data driving
Jahanbin et al. Aspect-Based Sentiment Analysis of Twitter Influencers to Predict the Trend of Cryptocurrencies Based on Hybrid Deep Transfer Learning Models
CN107895051A (en) A kind of stock news quantization method and system based on artificial intelligence
Ronaghi et al. ND-SMPF: A noisy deep neural network fusion framework for stock price movement prediction
CN110213239B (en) Suspicious transaction message generation method and device and server
Wenjie et al. A NOVEL MODEL FOR STOCK CLOSING PRICE PREDICTION USING CNN-ATTENTION-GRU-ATTENTION.
Zhao et al. Innovative mechanism of rural finance: Risk assessment methods and impact factors of agricultural loans based on personal emotion and artificial intelligence
SirElkhatim et al. Prediction of banks financial distress
Sun et al. Money: Ensemble learning for stock price movement prediction via a convolutional network with adversarial hypergraph model
Orłowski et al. Conceptual fuzzy model of the Polish Internet mortgage market
Ding et al. Integrating stock features and global information via large language models for enhanced stock return prediction
Li et al. Stock price trend prediction using LSTM and sentiment analysis on news headlines
Girsang Cryptocurrency Price Prediction Based Social Network Sentiment Analysis Using LSTM-GRU and FinBERT

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Zhang Xiao

Inventor after: Yan Hongfei

Inventor before: Zhang Xiao

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20190703

Address after: 519031 Creative Valley, 1889 Huandao East Road, Hengqin New District, Zhuhai City, Guangdong Province, 18, 110-159 (Centralized Office District)

Applicant after: Hong Gu information technology (Zhuhai) Co., Ltd.

Applicant after: Peking University

Address before: 519031 Creative Valley, 1889 Huandao East Road, Hengqin New District, Zhuhai City, Guangdong Province, 18, 110-159 (Centralized Office District)

Applicant before: Hong Gu information technology (Zhuhai) Co., Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180511