CN109598387A - Forecasting of Stock Prices method and system based on two-way cross-module state attention network model - Google Patents
Forecasting of Stock Prices method and system based on two-way cross-module state attention network model Download PDFInfo
- Publication number
- CN109598387A CN109598387A CN201811535943.9A CN201811535943A CN109598387A CN 109598387 A CN109598387 A CN 109598387A CN 201811535943 A CN201811535943 A CN 201811535943A CN 109598387 A CN109598387 A CN 109598387A
- Authority
- CN
- China
- Prior art keywords
- text
- sequence
- stock
- social
- data
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q50/00—Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
- G06Q50/01—Social networking
Abstract
The present invention provides a kind of Forecasting of Stock Prices method based on two-way cross-module state attention network model, data set is chosen, share price is crawled and closes and sequence data and push away special social text data set accordingly, and text data is pre-processed;For special social text is pushed away, text sequence, which is converted to vector characteristics, using term vector is indicated, for share price sequence data, continuous sequence is carried out three classification processings, is converted to discrete data expression;It to share price sequence data and pushes away special text data set and is utilized respectively Recognition with Recurrent Neural Network and model, merge two parts module using the attention mechanism of a two-way cross-module state, share price sequence relevant with prediction target and social activity text sequence are extracted in study respectively;Cutting data set using the parameter of training sample learning network model and collects progress arameter optimization using verifying;Utilize the stock price trend in the network model prediction target data based on two-way cross-module state attention.
Description
Technical field
The present invention relates to financial technology fields, and in particular to is a kind of based on depth series model modeling multi-modal data
Forecasting of Stock Prices method and forecasting system.
Background technique
With the raising of economic level, stock market's development is in the status of ever more important with stablizing in macroeconomy.And it is right
In individual, the investment way of people is just undergoing huge variation, and more people begin to focus on and participate in stock market investment
In.Equity investment also has high risk while having high yield, and market is influenced by many factors, such as various macroscopic views
Factor, Investment Psychology, company's situation etc., thus compared with it is difficult to predict.
Nevertheless, the research of Prediction of Stock Price has huge value.For individual, efficient Stock Market Forecasting energy
Enough bring considerable economic well-being of workers and staff.From the angle of macroscopic view, the development of finance data Predicting Technique helps to parse macroeconomy.
In stock gesture Predicting Technique, important temporal aspect is analyzed or extracted frequently with time series and is predicted.
Relatively good prediction technique is generated using verified energy is modeled across modal data such as share price data and text data, so
And it is not furtherd investigate also using two-way attention mechanism, while to share price data and text data serializing modeling.
In the present invention, share price data and social text are modeled using the two-way attention mechanism of cross-module state, energy
Enough efficiently extract out important sequence information.
Through retrieving, currently without publication related to the present invention.
Summary of the invention
The present invention, which innovates to provide for the first time, a kind of applies social text and stock price sequence data to carry out Forecasting of Stock Prices
Method and Forecasting of Stock Prices system, core are to stock price and text joint modeling, and the attention of two-way calculating cross-module state
Power weight.Through retrieving, there is not yet any prior art related to the present invention or report.The present invention is using the double of cross-module state
Share price data and social text are modeled to attention mechanism, important sequence information can be efficiently extracted out.This hair
It is bright that a kind of network frame being able to use is provided, i.e., the text information in stock price discrete data and social networks is modeled
Predict the method and forecasting system of stock trend.
Forecasting of Stock Prices method proposed by the present invention based on two-way cross-module state attention network model, comprising the following steps:
The first step chooses data set, crawls share price and closes and sequence data and pushes away top grade social activity text data set accordingly, and
Text data is pre-processed.
Second step, for social text, text sequence, which is converted to vector characteristics, using term vector is indicated, for share price sequence
Continuous share price sequence is carried out three classification processings by column data, is converted to discrete data expression.
Third step to share price sequence data and pushes away top grade social activity text data set and is utilized respectively Recognition with Recurrent Neural Network and build
Mould merges two parts module using the attention mechanism of a two-way cross-module state, and study is extracted related to prediction target respectively
Share price sequence and social text sequence.
4th step, cutting data set using the parameter of training sample learning network model and collect progress parameter using verifying
Tuning.
5th step utilizes the stock price trend in the network model prediction target data based on two-way cross-module state attention.
In the present invention, the stock price information refers to collected stock market's closing price data information, and share price is closed sequence number
According to referring to by the share price data after original share price information pre-processing, closed sequence using pretreated share price in the present invention
Input of the data as model.Preferably, refer to the stock market's closing quotation share price crawled in Yahoo's finance on Standard and Poor's 500 Index
Information.
In the present invention, social text information refers to include but is not limited to push away spy, microblogging, wechat and other various network social intercourses
The information of related stock on platform, it is preferable that the social text information in relation to stock in Standard & Poor 500.Preferably, sharp
Special interface is pushed away in python, is that keyword is seized with stock label " $ ".It such as, is key using stock label " $ "
What word was crawled pushes away the User Status text data in special social platform.
In the present invention, social text information is urtext information, and social text data refers to pretreated text envelope
Breath.
In the first step, text data pretreatment refers to: due to there are the vocabulary or character of some not information content,
Need to carry out the social text data (e.g., pushing away special text data) crawled stop-word, additional character, link removal behaviour
Make etc..
Wherein, described to remove stop-word many with frequency in English, but do not influence the word integrally understood or word after going out, often
For article, preposition, adverbial word or conjunction etc..
Wherein, the additional character be push away some mathematic signs after going out alphanumeric and basic comma fullstop in spy and
Emoticon.
Wherein, described to be linked as pushing away special end in many, user is added to the web site url of description object, in the present invention
Such link is eliminated in process of data preprocessing.
In the second step, text sequence, which is converted to vector characteristics, using term vector is indicated, is generated according to the following steps:
(1) the social text data good to Text Pretreatment, is trained using term vector model word2vec, learns
The term vector of each word indicates in entire text library;The dimension for remembering term vector is De;
(2) vector for generating social text level indicates;
Such as, by taking the social text (pushing away spy) of a certain stock as an example, according to the term vector obtained, to the social text of this bar
The term vector of all words carries out average pondization operation per one-dimensional.It will N in the social text of this barwordThe dimension of a word is
Nword*DeTerm vector matrix obtains a D using the average pond in dimensioneThe social text representation of dimension.
(3) vector table for generating day rank shows;
Such as, by taking the related social text representation of the stock of some day as an example.It is obtained according to the method for abovementioned steps (2)
NtweetThe vector of the social text level of a social activity text (e.g., pushing away spy) indicates after (e.g., pushing away superfine expression), for Ntweet*De
Stock text matrix for the day rank of dimension indicates, in term vector per one-dimensional upper using maximum, minimum and average Chi Huacao
Make, obtains a 3*DeThis day stock text representation.The text input that the vector table is shown as model in the present invention indicates
Form.It realizes and text sequence is converted to vector characteristics expression using term vector.
In the second step, the operation for carrying out three classification processings to the continuous value sequence of share price refers to: original for what is crawled
Closing quotation share price sequence signature uses the share price of "+1 " as the same day if the closing price on the same day is higher than the closing price of the previous day
Character representation, conversely, the share price character representation of " -1 " on the day of is then used, if the closing price of the closing price on the same day and the previous day
Maintain an equal level, then uses the share price character representation of " 0 " on the day of.The continuous share price sequence signature converts in order to which one is derived from as a result,
The three sorting sequence features of {+1,0, -1 }.
In the third step, it is utilized respectively Recognition with Recurrent Neural Network and share price sequence data and social text data set is built
Mould.Wherein, to the modeling of share price sequence data are as follows: using external share price and target histories price series share price sequence data into
The modeling of row Recognition with Recurrent Neural Network, core are using a coding-decoding composition attention mechanism: being used in coding side
The relevant external stock of attention mechanism selection, in decoding end sequence signature relevant for entire sequence selection.According to following
Step carries out:
(1) relevant external stock is selected using attention mechanism in coding side:
(a) list entries length is stock [X outside the M branch of T1... XM], wherein it is T that every stock, which is a length,
Vector indicates;
(b) attention weight is calculated using input:
WhereinIndicate the hidden state of long memory network in short-term, Xm, indicate the sequence inputting of m branch stock, UenIt respectively indicates coding side attention and calculates global weight parameter, the weight parameter of hidden state and m branch stock
The weight parameter of the sequence inputting of ticket,Expression pairAttention weight afterwards;
(c) attention weight is for selecting external share price feature relevant to stock is predicted;
The state value of memory unit is updated using this feature;
(2) in decoding end sequence signature relevant for entire sequence selection:
(a) the state feature of the incoming each moment memory unit in input coding end and text module list entries are special
Sign uses attention mechanism to select sequence signature relevant to predicted value in entire sequence to it;Wherein, attention weight meter
Calculation mode are as follows:
Wherein, TtIndicate the input feature vector of social text module;Attention weight is for selecting relevant encoder-side
Memory unit state,Wde、UdeIt respectively indicates decoding end attention and calculates global weight parameter, the weight of hidden state ginseng
Several weight parameters corresponding with the incoming hidden state of coding side, QTIndicate the t days corresponding weight parameters of text vector,Expression pairAttention weight afterwards;
(b) pass through the expression of attention weight calculation status switch weighted sum:
The expression of the status switch weighted sum and the historical time sequence of target stock update the memory unit of decoding end jointly
State.
In the third step, it carries out modeling to social text (pushing away Te Wenben) data set using Recognition with Recurrent Neural Network to refer to: right
The social text sequence for the vectorization that pretreatment in the first step obtains indicates, using long memory network in short-term to text
Sequence is modeled, and is included the following steps:
(1) input is [E1..., ET], indicate that a length of T's of the sequence of target stock pushes away special text vector, i.e., by described the
Two one step process indicate the pretreated vector of social text (e.g., pushing away Te Wenben);
(2) weighting sequence and expression C in share price block are utilizedd, participate in the calculating of text attention weight
WtextAnd UtextRespectively indicate attention calculation formula overall situation weight, the power of hidden state in social text
The weight parameter of weight parameter and social text input.QCIndicate the weighting sequence and corresponding weight ginseng in share price block
Number.Expression pairCarry out the attention weight that softmax is obtained.
(3) this text attention weight can calculate text sequence weighted sum feature
Indicate the corresponding attention weight of each temporal social text input, C in time seriestextExpression is based on
The weighted sum integrating representation of the attention mechanism of social text input.
(4) feature CtextFor updating the state of memory unit
Wherein,Indicate that each LSTM updates the hidden state expression of front and back, CtextIt is i.e. defeated based on social text
The weighted sum integrating representation of the attention mechanism entered.
In the third step, the attention mechanism using a two-way cross-module state refers to, in the solution of share price network module
Code end, utilizes the input feature vector [E of text1..., ET] help training sequence attention weight;In text network module, utilize
The hidden state weighted sum being calculated in share price module indicates Cd, text attention weight is updated.Therefore in sequence
Each moment in column, two parts module calculate respective attention with having used cross-module state data double-way from each other
Weight.
In 4th step, cutting data set refers to, (such as entire share price sequential data set social activity text data set
Push away special text data set), the cutting of data set is carried out according to the time, using the training set training pattern parameter segmented, is utilized
Verifying collection carries out arameter optimization.
In 5th step, using the network model based on two-way cross-module state attention, target stock price trend is predicted, according to
Following steps carry out:
(1) share price sequence relevant to prediction target and social text sequence are obtained according to the method for third step, that is, can obtain
To the hidden unit state at each moment of share price block decoding end and text module
(2) it takes the state of two parts feature last day in abovementioned steps (1) to indicate and is spliced to obtain
(3) it is predicted using the feature of splicing, as follows:
Wherein, using sigmoid as activation primitive σ;vo, Wo, bo, bvTo need trained parameter in network.
It preferably, further include step (4): during model training, using two norm canonicals of dropout network and parameter
The case where parameter is limited, prevents over-fitting.
In the present invention, in the second step, price data is carried out three classification processings by the present invention, using term vector by text
Information carries out pondization operation, and models respectively to two parts data, and emphasis is remembered using long memory network in short-term
The hidden state of unit extracts the relationship between stock between sequence.
In the third step, two-way cross-module state attention mechanism fusion share price and text data, core are share price moulds
The information exchange of block decoding end and text module is the hidden state sequence and text for being utilized respectively decoding end by the way of
List entries.
The invention also provides a kind of Forecasting of Stock Prices system using stock price information and social text information, the system packets
It includes following:
(1) characterization unit is inputted, the original share price of respective pretreatment, which is closed, data and pushes away special text data, discretization original stock
Valence is closed data, pushes away special text data using term vector serializing.
(2) text and price series modeling unit carry out Series Modeling to the share price data and text data of input characterization,
The attention weight of two parts data is calculated using mutual information, chooses correlated inputs characterization.
(3) it predicts generation unit, obtains (2) part text and the hidden state of the last day in price series modeling simultaneously
Splicing accesses the last sigmoid activation output of double-deck full articulamentum.
The present invention merges share price module and social text module calculating respectively attention on each time step of sequence
The weight of power, it is desirable that the sequence that attention calculates is homogeneity.
Compared with prior art, it includes: that the present invention can utilize social text sequence data that the present invention, which has beneficial effect,
The stock price information of combining target stock and external stock, associated prediction target stock gesture can according to two-way attention interaction
Important share price sequence and text sequence feature are chosen respectively.
Detailed description of the invention
Fig. 1 is the flow diagram of Forecasting of Stock Prices method of the present invention.
Fig. 2 is flow chart of data processing figure in one embodiment of the invention.
Fig. 3 is the frame diagram of whole network model in one embodiment of the invention.
Fig. 4 is the composed structure schematic diagram of Forecasting of Stock Prices system of the present invention.
Specific embodiment
In conjunction with following specific embodiments and attached drawing, the present invention is described in further detail.Implement process of the invention,
Condition, experimental method etc. are among the general principles and common general knowledge in the art, this hair in addition to what is specifically mentioned below
It is bright that there are no special restrictions to content.It should be pointed out that those skilled in the art, not departing from structure of the present invention
Under the premise of think of, various modifications and improvements can be made.These are all within the scope of protection of the present invention.
The present invention provides a kind of method for applying social text and stock price sequence data to be predicted, as shown in Figure 1,
Method includes the following steps:
The first step, the share price sequence data collection of closing for choosing required by task push away special social text data set, text accordingly
Data carry out the pretreatment such as removing dryness.
Second step, pretreated text sequence, which is converted to vector characteristics, using term vector indicates, and to share price sequence number
It is indicated according to three classification processings at discrete data.
Third step to share price sequence data and pushes away special text data set and models respectively using Recognition with Recurrent Neural Network, benefit
Two parts module is merged with the attention mechanism of a two-way cross-module state, it is special to extract sequence relevant to prediction target respectively
Sign.
4th step, cutting data set, training dataset and arameter optimization.
5th step predicts the stock price trend of target data based on the network model of two-way cross-module state attention.
The present invention proposes Forecasting of Stock Prices system, as shown in Figure 4, comprising:
(1) characterization unit is inputted.The original share price of respective pretreatment, which is closed, data and pushes away special text data, and discrete three classification is former
Beginning share price is closed data, is generated using term vector and is pushed away the vectorization of special text data and indicate.
(2) text and price series modeling unit.Using long memory network in short-term to the share price data and text of input characterization
Notebook data carries out Series Modeling, using two-way attention mechanism, the respective note calculated by using two parts data mutual information
Meaning power weight chooses correlated inputs characterization.
(3) generation unit is predicted.Obtain the long short-term memory of (2) part text and the last day in price series modeling
Network concealed state is simultaneously spliced, and the last sigmoid activation primitive output of double-deck full articulamentum is accessed.
The detailed process of the present embodiment, as shown in Figure 1.
Firstly, choosing data set
(1) stock in the Standard and Poor's 500 Index of Yahoo's finance is crawled, the daily price of closing of stock is taken out.
(2) with stock label " $ " be crawl keyword, crawled by python framing tools tweepy push away in spy with standard
Poole stock is relevant to push away Te Wenben.
(3) Te Wenben is pushed away to what is crawled, filters spcial character therein, the not no stop-word of information content and a large amount of of removal
The url website information occurred in text.
For the initial data of acquisition, the conversion regime to data is described below:
(1) discretization of share price sequence indicates.For the share price sequence data crawled, if the closing price on the same day is higher than previous
It closing price, use "+1 " as the same day share price character representation, conversely, then with " -1 " indicate, if the closing price on the same day with
The closing price of the previous day maintains an equal level, then uses the 0 share price character representation on the day of.Continuous share price sequence signature conversion takes for one
The three sorting sequence features from {+1,0, -1 }.
(2) vectorization of text indicates.
(a) Te Wenben is pushed away to denoising first, utilizes the word of each word in term vector model word2vec learning text library
Vector indicates.The dimension for remembering term vector is De。
(b) pushed away with a certain stock specially for example, according to the term vector obtained, to the term vectors of all words it is every it is one-dimensional into
The average pondization operation of row.The N in spy will be pushed awaywordThe dimension of a word is Nword*DeTerm vector matrix uses being averaged in dimension
Chi Hua obtains a DeDimension pushes away special text representation.
(c) vector table for generating day rank shows.By taking the stock text representation of some day as an example.It is obtained according to the method for (b)
NtweetIt is N to dimension after item pushes away special vector expressiontweet*DeDay rank stock text matrix indicate, in term vector
Per it is one-dimensional it is upper operated using maximum, minimum and average pondization, obtain a 3*DeThis day stock text representation.The vector table
The text input for being shown as model in the present invention indicates form.
Next based on utilizing the LSTM module in tensorflow, Series Modeling is carried out to two parts sequence data.
(1) share price sequence data models.Circulation nerve is carried out using external share price sequence and target stock historical price sequence
The modeling of network.
(a) in coding side:
List entries length is stock [X outside the M branch of T1... XM], wherein every stock be a length be T to
Amount indicates.
Attention weight is calculated using input:
Wherein,Indicate the hidden state of long memory network in short-term, Xm, indicate the sequence inputting of m branch stock.
Attention weight is for selecting external share price feature relevant to stock is predicted:
The state value of memory unit is updated using this feature.
(b) in decoding end:
The state feature and text module list entries feature of the incoming each moment memory unit in input coding end are right
It uses attention mechanism to select sequence signature relevant to predicted value in entire sequence.
Attention weight calculation mode:
Wherein, TtIndicate the input feature vector of social text module.Attention weight is for selecting relevant encoder-side
Memory unit state.Pass through the expression of attention weight calculation status switch weighted sumThe expression with
The historical time sequence of target stock updates the memory unit state of decoding end jointly.
(2) text sequence data modeling.
After the text sequence expression for having obtained vectorization to pretreatment, text sequence is carried out using long memory network in short-term
Modeling.
Input is [E first1..., ET], indicate that a length of T's of the sequence of target stock pushes away special text vector, to pushing away Te Wenben
Pretreated vector indicates.Using the weighting sequence in text input feature and share price block and indicate Cd, participate in text
The calculating of this attention weight:
This text attention weight can calculate text sequence weighted sum featureThis feature
CtextFor updating the state of memory unit
Next entire data set is cut according to time shaft according to training set, verifying collection and test set ratio 8:1:1
Point, training set learns the parameter of entire model for training, and the tuning for carrying out model parameter is collected using verifying.
During prediction, by the hidden unit state at each moment of share price block decoding end and text moduleIt goes the state feature for taking out last moment and is spliced intoUtilize this
Feature is predicted:
Wherein, using sigmoid as activation primitive σ.vo, Wo, bo, bvTo need trained parameter in network.
Preferably, in the training of model, to prevent over-fitting, using two norms of dropout network and parameter
Canonical limits parameter training size.
The method of the present invention can be applicable to other social networks, such as microblogging, implement and push away the basic phase of special embodiment
Together, detailed process is no longer described in detail.
Parameter in the above embodiment of the present invention is determined according to experimental result, that is, tests different parameter combinations, choosing
Take accuracy rate preferably one group of parameter.In test more than reality, appropriate adjustment can be carried out to above-mentioned parameter according to demand
The purpose of the present invention can be achieved.
Protection content of the invention is not limited to above embodiments.Under the spirit and scope without departing substantially from present inventive concept,
Various changes and advantages that will be apparent to those skilled in the art are all included in the present invention, and with appended claims
For protection scope.
Claims (13)
1. a kind of Forecasting of Stock Prices method based on two-way cross-module state attention network model, which is characterized in that the method includes
Following steps:
The first step chooses data set, crawls share price and closes sequence data and corresponding social text data set, and to social text
Data are pre-processed;
Second step, for social text data, text sequence, which is converted to vector characteristics, using term vector is indicated;It is closed for share price
City's sequence data, by continuous share price close sequence carry out three classification processings, be converted to discrete data expression;
Third step closes sequence data to share price and social text data set is utilized respectively Recognition with Recurrent Neural Network and models, benefit
Two parts module is merged with the attention mechanism of two-way cross-module state, study extracts share price relevant to prediction target and closes respectively
Sequence and social text sequence;
4th step, cutting data set using the parameter of training sample learning network model and collect progress arameter optimization using verifying;
5th step utilizes the stock price trend in the network model prediction target data based on two-way cross-module state attention.
2. Forecasting of Stock Prices method according to claim 1, which is characterized in that the stock price information refers to: crawling Network and Finance Network
The stock market's closing quotation stock price information stood on upper Standard and Poor's 500 Index.
3. Forecasting of Stock Prices method according to claim 1, which is characterized in that the social activity text information refers to social platform
The upper User Status text information in relation to stock in Standard & Poor 500.
4. Forecasting of Stock Prices method according to claim 1, which is characterized in that described to social text in the first step
Data carry out pretreatment refer to: to the social text data information crawled carry out stop-word, additional character, link replacement grasp
Make.
5. Forecasting of Stock Prices method according to claim 1, which is characterized in that, will be literary using term vector in the second step
Originally Sequence Transformed to be indicated at vector characteristics, it generates according to the following steps:
(1) the social text data good to Text Pretreatment, is trained using term vector model word2vec, is learnt entire out
The term vector of each word indicates in text library;The dimension for remembering term vector is De;
(2) vector for generating social text level indicates;For a certain item social activity text information in relation to stock, according to having obtained
Term vector, average pondization operation is carried out per one-dimensional to the term vectors of the social all words of text of this, that is, this is social literary
N in thiswordThe dimension of a word is Nword*DeTerm vector matrix obtains a D using the average pond in dimensioneThe social activity of dimension
Text representation;
(3) vector table for generating day rank shows;For the related social text representation of stock of some day, according to the step (2)
Method obtain NtweetAfter the vector expression of the social text level of a social activity text, for Ntweet*DeFor the day grade of dimension
Other stock text matrix indicates, term vector per it is one-dimensional it is upper operated using maximum, minimum and average pondization, obtain a 3*
DeThis day stock text vector characteristics indicate.
6. Forecasting of Stock Prices method according to claim 1, which is characterized in that in the second step, by continuous share price sequence
It carries out three classification processings to refer to: for the original closing quotation share price sequence signature crawled, if the closing price on the same day is higher than the previous day
Closing price then uses+1 share price character representation as the same day, conversely, -1 share price character representation on the day of is then used, if working as
It closing price and the closing price of the previous day maintains an equal level, then uses the 0 share price character representation on the day of, and continuous share price sequence signature turns
The three sorting sequence features for being derived from {+1,0, -1 } are turned to.
7. Forecasting of Stock Prices method according to claim 1, which is characterized in that in the third step, utilize a coding-solution
The attention mechanism of code composition, models share price sequence data using Recognition with Recurrent Neural Network, the coding-decoding composition
Attention mechanism are as follows: select relevant external stock using attention mechanism in coding side, selected in decoding end for entire sequence
Select relevant sequence signature;Include the following steps:
(1) relevant external stock is selected using attention mechanism in coding side:
(a) list entries length is stock [X outside the M branch of T1... XM], wherein every stock is the vector that a length is T
It indicates;
(b) attention weight is calculated using input:
WhereinIndicate the hidden state of long memory network in short-term, Xm, indicate the sequence inputting of m branch stock,Wen、Uen
Respectively indicate the sequence inputting that coding side attention calculates global weight parameter, the weight parameter of hidden state and m branch stock
Weight parameter,Expression pairAttention weight afterwards;
(c) attention weight is for selecting external share price feature relevant to stock is predicted:
Wherein, each element representation carries out importance again based on input data X of the attention weight α to the d days M stock
Distribution;The state value of memory unit is updated using this feature;
(2) in decoding end for entire sequence selection correlated series feature:
(a) the state feature and text module list entries feature of the incoming each moment memory unit in input coding end is right
It uses attention mechanism to select sequence signature relevant to predicted value in entire sequence;Attention weight calculation mode are as follows:
Wherein, TtIndicate the input feature vector of social text module,Wde、UdeIt respectively indicates decoding end attention and calculates global power
The corresponding weight parameter of hidden state that weight parameter, the weight parameter of hidden state and coding side are passed to, QTIndicate the t days texts
The corresponding weight parameter of this vector,Expression pairAttention weight afterwards;Attention weight is relevant for selecting
The memory unit state of encoder-side;
(b) pass through the expression of attention weight calculation status switch weighted sum:
Wherein,Indicate the corresponding attention weight of each temporal encoder hidden state, C in time seriesdIndicate base
In the integrating representation of the attention mechanism of encoder hidden state;The historical time sequence more new explanation jointly of the expression and target stock
The memory unit state at code end.
8. Forecasting of Stock Prices method according to claim 1, which is characterized in that in the third step, utilize circulation nerve net
Network carries out modeling to social text data set and refers to: after the text sequence expression for having obtained vectorization to pretreatment, using length
When memory network text sequence is modeled, include the following steps:
(1) input is [E1..., ET], the social text vector of a length of T of the sequence of target stock is indicated, as in the second step
Vector after social Text Pretreatment is indicated;
(2) weighting sequence and expression C in share price block are utilizedd, participate in the calculating of text attention weight:
Wherein,WtextAnd UtextRespectively indicate attention calculation formula overall situation weight in social text, hidden state
The weight parameter of weight parameter and social text input;QCIndicate the weighting sequence and corresponding weight ginseng in share price block
Number;Expression pairCarry out the attention weight that softmax is obtained;
(3) this text attention weight can calculate text sequence weighted sum feature:
Wherein,Indicate the corresponding attention weight of each temporal social text input, C in time seriestextExpression is based on
The weighted sum integrating representation of the attention mechanism of social text input;
(4) feature CtextFor updating the state of memory unit:
Wherein,Indicate that each LSTM updates the hidden state expression of front and back, CtextI.e. based on social text input
The weighted sum integrating representation of attention mechanism.
9. Forecasting of Stock Prices method according to claim 1, which is characterized in that in the third step, utilize two-way cross-module
The attention mechanism of state refers to, in the decoding end of share price network module, utilizes the input feature vector [E of text1..., ET] help to instruct
Practice sequence attention weight;In text network module, the hidden state weighted sum being calculated in share price module, which is utilized, to be indicated
Cd, text attention weight is updated.
10. Forecasting of Stock Prices method according to claim 1, which is characterized in that in the 4th step, cutting data set is
Refer to, special text data set is pushed away for entire share price sequential data set, the cutting of data set is carried out according to the time, using segmenting
Training set training pattern parameter, utilize verifying collection carry out arameter optimization.
11. Forecasting of Stock Prices method according to claim 1, which is characterized in that in the 5th step, using based on it is two-way across
The network model of mode attention predicts target stock price trend, includes the following steps:
(1) the share price sequence relevant to prediction target and social text sequence obtained according to the third step, that is, share price sequence
The hidden unit state at each moment of module decoding end and social text module
(2) taking the state of two parts feature last day in abovementioned steps (1) indicates and is spliced to obtain
(3) it is predicted using aforementioned obtained splicing feature:
Wherein, using sigmoid as activation primitive σ;vo, Wo, bo, bvTo need trained parameter, W in networko, boTable respectively
Show the weight and offset parameter for splicing the latter linked full articulamentum of first layer, vo, bvRespectively indicate the weight of the full articulamentum of the second layer
And offset parameter.
12. Forecasting of Stock Prices method according to claim 11, which is characterized in that further comprise: step (4), in model
During training, parameter is limited using two norm canonicals of dropout network and parameter.
13. a kind of Forecasting of Stock Prices system based on two-way cross-module state attention network model, which is characterized in that wanted using such as right
Described in any item Forecasting of Stock Prices methods of 1-12 are sought, the system comprises following:
(1) characterization unit is inputted, the original share price of respective pretreatment, which is closed, data and pushes away special text data, and the original share price of discretization is closed
City's data push away special text data using term vector serializing;
(2) text and price series modeling unit carry out Series Modeling to the share price data and text data of input characterization, utilize
Mutual information calculates the attention weight of two parts data, chooses correlated inputs characterization;
(3) it predicts generation unit, obtains the hidden state of text and the last day in price series modeling and splicing, access is double
The last sigmoid activation output of the full articulamentum of layer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811535943.9A CN109598387A (en) | 2018-12-14 | 2018-12-14 | Forecasting of Stock Prices method and system based on two-way cross-module state attention network model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811535943.9A CN109598387A (en) | 2018-12-14 | 2018-12-14 | Forecasting of Stock Prices method and system based on two-way cross-module state attention network model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109598387A true CN109598387A (en) | 2019-04-09 |
Family
ID=65960833
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811535943.9A Pending CN109598387A (en) | 2018-12-14 | 2018-12-14 | Forecasting of Stock Prices method and system based on two-way cross-module state attention network model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109598387A (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
CN111241234A (en) * | 2019-12-27 | 2020-06-05 | 北京百度网讯科技有限公司 | Text classification method and device |
CN111414749A (en) * | 2020-03-18 | 2020-07-14 | 哈尔滨理工大学 | Social text dependency syntactic analysis system based on deep neural network |
CN111680107A (en) * | 2020-08-11 | 2020-09-18 | 南昌木本医疗科技有限公司 | Financial prediction system based on artificial intelligence and block chain |
CN111986730A (en) * | 2020-07-27 | 2020-11-24 | 中国科学院计算技术研究所苏州智能计算产业技术研究院 | Method for predicting siRNA silencing efficiency |
WO2021068528A1 (en) * | 2019-10-11 | 2021-04-15 | 平安科技(深圳)有限公司 | Attention weight calculation method and apparatus based on convolutional neural network, and device |
WO2021094920A1 (en) * | 2019-11-14 | 2021-05-20 | International Business Machines Corporation | Fusing multimodal data using recurrent neural networks |
CN113052661A (en) * | 2021-04-14 | 2021-06-29 | 京东数字科技控股股份有限公司 | Attribute information acquisition method and device, electronic equipment and storage medium |
CN113343922A (en) * | 2021-06-30 | 2021-09-03 | 北京达佳互联信息技术有限公司 | Video identification method and device, electronic equipment and storage medium |
CN113807964A (en) * | 2021-09-16 | 2021-12-17 | 陈炜 | Method, equipment and storage medium for predicting stock price and determining parameters |
WO2023129272A1 (en) * | 2021-12-29 | 2023-07-06 | Fidelity Information Services, Llc | Processing sequences of multi-modal entity features using convolutional neural networks |
-
2018
- 2018-12-14 CN CN201811535943.9A patent/CN109598387A/en active Pending
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
WO2021068528A1 (en) * | 2019-10-11 | 2021-04-15 | 平安科技(深圳)有限公司 | Attention weight calculation method and apparatus based on convolutional neural network, and device |
US11915123B2 (en) | 2019-11-14 | 2024-02-27 | International Business Machines Corporation | Fusing multimodal data using recurrent neural networks |
AU2020385264B2 (en) * | 2019-11-14 | 2023-12-14 | International Business Machines Corporation | Fusing multimodal data using recurrent neural networks |
WO2021094920A1 (en) * | 2019-11-14 | 2021-05-20 | International Business Machines Corporation | Fusing multimodal data using recurrent neural networks |
GB2604552A (en) * | 2019-11-14 | 2022-09-07 | Ibm | Fusing multimodal data using recurrent neural networks |
CN111241234A (en) * | 2019-12-27 | 2020-06-05 | 北京百度网讯科技有限公司 | Text classification method and device |
CN111241234B (en) * | 2019-12-27 | 2023-07-18 | 北京百度网讯科技有限公司 | Text classification method and device |
CN111414749B (en) * | 2020-03-18 | 2022-06-21 | 哈尔滨理工大学 | Social text dependency syntactic analysis system based on deep neural network |
CN111414749A (en) * | 2020-03-18 | 2020-07-14 | 哈尔滨理工大学 | Social text dependency syntactic analysis system based on deep neural network |
CN111986730A (en) * | 2020-07-27 | 2020-11-24 | 中国科学院计算技术研究所苏州智能计算产业技术研究院 | Method for predicting siRNA silencing efficiency |
CN111680107B (en) * | 2020-08-11 | 2020-12-08 | 上海竞动科技有限公司 | Financial prediction system based on artificial intelligence and block chain |
CN111680107A (en) * | 2020-08-11 | 2020-09-18 | 南昌木本医疗科技有限公司 | Financial prediction system based on artificial intelligence and block chain |
CN113052661A (en) * | 2021-04-14 | 2021-06-29 | 京东数字科技控股股份有限公司 | Attribute information acquisition method and device, electronic equipment and storage medium |
CN113052661B (en) * | 2021-04-14 | 2024-04-09 | 京东科技控股股份有限公司 | Method and device for acquiring attribute information, electronic equipment and storage medium |
CN113343922A (en) * | 2021-06-30 | 2021-09-03 | 北京达佳互联信息技术有限公司 | Video identification method and device, electronic equipment and storage medium |
CN113343922B (en) * | 2021-06-30 | 2024-04-19 | 北京达佳互联信息技术有限公司 | Video identification method, device, electronic equipment and storage medium |
CN113807964A (en) * | 2021-09-16 | 2021-12-17 | 陈炜 | Method, equipment and storage medium for predicting stock price and determining parameters |
WO2023129272A1 (en) * | 2021-12-29 | 2023-07-06 | Fidelity Information Services, Llc | Processing sequences of multi-modal entity features using convolutional neural networks |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109598387A (en) | Forecasting of Stock Prices method and system based on two-way cross-module state attention network model | |
Swathi et al. | An optimal deep learning-based LSTM for stock price prediction using twitter sentiment analysis | |
CN107832400B (en) | A kind of method that location-based LSTM and CNN conjunctive model carries out relationship classification | |
Zhu et al. | Hierarchical attention flow for multiple-choice reading comprehension | |
Aydoğan et al. | Improving the accuracy using pre-trained word embeddings on deep neural networks for Turkish text classification | |
CN110222188A (en) | A kind of the company's bulletin processing method and server-side of multi-task learning | |
CN109325112B (en) | A kind of across language sentiment analysis method and apparatus based on emoji | |
CN103778215A (en) | Stock market forecasting method based on sentiment analysis and hidden Markov fusion model | |
Kilimci | Sentiment analysis based direction prediction in bitcoin using deep learning algorithms and word embedding models | |
CN108563703A (en) | A kind of determination method of charge, device and computer equipment, storage medium | |
Zhang et al. | Deep stock ranker: A LSTM neural network model for stock selection | |
CN114238577B (en) | Multi-task learning emotion classification method integrating multi-head attention mechanism | |
DE112020003538T5 (en) | CROSS-MODAL RECOVERY WITH WORD OVERLAP BASED CLUSTERS | |
Li et al. | UD_BBC: Named entity recognition in social network combined BERT-BiLSTM-CRF with active learning | |
Larsen et al. | 9. A mathematical approach to categorization and labeling of qualitative data: The latent categorization method | |
CN107579821A (en) | Password dictionary generation method and computer-readable recording medium | |
CN111221881B (en) | User characteristic data synthesis method and device and electronic equipment | |
Chen et al. | Online sales prediction via trend alignment-based multitask recurrent neural networks | |
Aich et al. | Convolutional neural network-based model for web-based text classification. | |
Wang et al. | A deep-learning-inspired person-job matching model based on sentence vectors and subject-term graphs | |
Farimani et al. | Leveraging latent economic concepts and sentiments in the news for market prediction | |
CN107392229A (en) | A kind of network representation method based on the Relation extraction that most gears to the needs of the society | |
Hwang et al. | Recent deep learning methods for tabular data | |
Zhang et al. | Dual-attention graph convolutional network | |
Zheng et al. | Named entity recognition in electric power metering domain based on attention mechanism |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20190409 |