CN109299252A - The viewpoint polarity classification method and device of stock comment based on machine learning - Google Patents

The viewpoint polarity classification method and device of stock comment based on machine learning Download PDF

Info

Publication number
CN109299252A
CN109299252A CN201810943297.3A CN201810943297A CN109299252A CN 109299252 A CN109299252 A CN 109299252A CN 201810943297 A CN201810943297 A CN 201810943297A CN 109299252 A CN109299252 A CN 109299252A
Authority
CN
China
Prior art keywords
stock
viewpoint
machine learning
comment
learning model
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
CN201810943297.3A
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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology 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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201810943297.3A priority Critical patent/CN109299252A/en
Publication of CN109299252A publication Critical patent/CN109299252A/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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/242Dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking

Abstract

The viewpoint polarity classification method and device for the stock comment based on machine learning that the invention discloses a kind of, this method comprises: the every stock comment text mark viewpoint polarity for obtaining the training set and verifying collection being made of stock comment text, and being concentrated for training set and verifying;Based on the training set after mark, machine learning model is trained, and is evaluated and tested based on effect of the test set after mark to the learning model, the machine learning model after being trained;The relevant information of stock comment text to be predicted is input to the machine learning model after the training, obtains the viewpoint polarity classification information of the stock comment text of machine learning model output.The present invention carries out specially treated and training to existing machine learning model, the classification prediction of viewpoint polarity is carried out to stock comment data, convenient and efficient, accuracy is high, investor can be helped more accurately to understand the general trend of market development and stock dynamic, used for investor or quant.

Description

The viewpoint polarity classification method and device of stock comment based on machine learning
Technical field
The present invention relates to artificial intelligence and big data field, and in particular to a kind of sight of the stock comment based on machine learning Point-polarity classification method, device, electronic equipment and computer readable storage medium.
Background technique
Investor would generally find associated value information using search engine and help its final decision, and these decision processes Major part is the analytical judgment and experience by people.In fact, the stock comment data in internet contains abundant and has The semantic information of value can help investor to understand the general trend of market development and stock dynamic.Existing stock comment and analysis method The feeling polarities of capture stock comment are mostly just focused on, to understand that stock comment acts on the macroscopic view of the general trend of market development. However, the stock comment in internet has usually contained a large amount of noise, such as waterborne troops and personal subjective tendency group psychology, To severely impact the judgement of investor.Therefore it is authoritative fine granularity to be carried out to stock comment information using artificial intelligence technology Analysis, and then being automatically an apprentice of selected good quality stock in massive information for stock invester and stock analysis is significantly.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind It states the viewpoint polarity classification method of the stock comment based on machine learning of problem, device, electronic equipment and computer-readable deposits Storage media.
According to one aspect of the present invention, a kind of viewpoint polarity classification side of stock comment based on machine learning is provided Method, this method comprises:
It obtains the training set being made of stock comment text and verifying collects, and the every stock concentrated for training set and verifying Comment text marks viewpoint polarity;
Based on the training set after mark, machine learning model is trained, and based on the test set after mark to described The effect of learning model is evaluated and tested, the machine learning model after being trained;
The relevant information of stock comment text to be predicted is input to the machine learning model after the training, is somebody's turn to do The viewpoint polarity classification information of the stock comment text of machine learning model output.
It is according to the present invention on the other hand, provide a kind of viewpoint polarity point of stock comment based on machine learning Class device, the device include:
Acquiring unit collects suitable for obtaining the training set being made of stock comment text and verifying, and is training set and verifying The every stock comment text concentrated marks viewpoint polarity;
Training unit, suitable for being trained to machine learning model based on the training set after mark, and based on mark after Test set evaluates and tests the effect of the learning model, the machine learning model after being trained;
Predicting unit, suitable for the relevant information of stock comment text to be predicted to be input to the engineering after the training Model is practised, the viewpoint polarity classification information of the stock comment text of machine learning model output is obtained.
According to a further aspect of the invention, a kind of electronic equipment is provided, the electronic equipment includes: processor, with And it is stored with the memory for the computer program that can be run on a processor;
Wherein, the processor, for executing any of the above-described institute when executing the computer program in the memory The method stated.
According to a further aspect of the invention, a kind of computer readable storage medium is provided, computer is stored thereon with Program, the computer program realize method described in any of the above embodiments when being executed by processor.
According to the technique and scheme of the present invention, collected by obtaining the training set being made of stock comment text and verifying, and be Every stock comment text that training set and verifying are concentrated marks viewpoint polarity;Based on the training set after mark, to machine learning Model is trained, and is evaluated and tested based on effect of the test set after mark to the learning model, the machine after being trained Device learning model;The relevant information of stock comment text to be predicted is input to the machine learning model after the training, is obtained The viewpoint polarity classification information of the stock comment text exported to the machine learning model.The present invention is to existing machine learning Model carries out specially treated and training, the classification prediction of viewpoint polarity is carried out to stock comment data, so that stock to be predicted is commented The stock that the machine learning model exports can be obtained after being input to the machine learning model after training in the relevant information of paper sheet The viewpoint polarity classification information of ticket comment text, convenient and efficient, accuracy is high, investor can be helped more accurately to understand city Field tendency and stock dynamic, use for investor or quant.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows a kind of viewpoint polarity point of stock comment based on machine learning according to an embodiment of the invention Class method flow diagram;
Fig. 2 is a stock comment data information schematic diagram;
Fig. 3 is another representation schematic diagram of a stock comment data information;
Fig. 4 is the stock comment data amount schematic diagram after original issue stock comment data amount and cleaning;
Fig. 5 is using the profit situation schematic diagram after intelligence share-selecting method c selection stock;
Fig. 6 shows a kind of viewpoint polarity point of stock comment based on machine learning according to an embodiment of the invention Class schematic device;
Fig. 7 shows the viewpoint polarity classification of another stock comment based on machine learning of one embodiment of the invention Schematic device;
Fig. 8 is the structural schematic diagram of the electronic equipment in the embodiment of the present invention;
Fig. 9 is the structural schematic diagram of one of embodiment of the present invention computer readable storage medium.
Specific embodiment
The explanation of nouns that the present invention occurs:
FM:Factorization Machine, Factorization machine are a kind of known algorithms, are mentioned by Steffen Rendle A kind of machine learning algorithm based on matrix decomposition out, is widely used in classification and prediction model.
SVM:Support Vector Machine, support vector machines are a kind of known algorithms, for a kind of common differentiation Method.It is the learning model for having supervision in machine learning field, commonly used to carry out pattern-recognition, classification and recurrence Analysis.
ARMA:Auto Regressive Moving Average, autoregressive moving-average model, model parameter method high score One of resolution spectral analysis method.This method is to study the typical method of stationary random process rational spectrum, is suitable for very big one kind Practical problem.It has more accurate Power estimation and more excellent spectral resolution performance than AR modelling and MA modelling.
OSRatio:Opinion Shift Ratio, viewpoint changes ratio, for characterizing stock commentator to same stock A possibility that changing viewpoint.
TSRatio:the Ratio of True-then-Shift, changes correct aspect ratio, comments for characterizing stock By member to stock comment viewpoint it is correct under the premise of change viewpoint a possibility that.
FSRatio:the Ratio of False-then-Shift changes wrong views ratio, comments for indicator stock A possibility that by member to viewpoint is changed under the premise of stock comment viewpoint mistake.
TCTRatio:the Reliability Ratio of True-then-Constant, consistent correct viewpoint are reliable Ratio, for characterize stock commentator it is correct to stock comment viewpoint under the premise of still keep the reliability of the viewpoint.
TSTRatio:the Reliability Ratio of True-then-Shift, changes correct viewpoint and reliably compares Rate, for characterize stock commentator to stock comment viewpoint it is correct under the premise of change viewpoint reliability.
FCTRatio:the Reliability Ratio of False-then-Constant, consistent wrong views can By ratio, for characterizing stock commentator to the reliability for still keeping the viewpoint under the premise of stock comment viewpoint mistake.
FSTRatio:the Reliability Ratio of False-then-Shift changes wrong views and reliably compares Rate comments on stock the reliability of change viewpoint under the premise of viewpoint mistake for characterizing stock commentator.
BIC criterion: Bayesian Information Criterion, bayesian information criterion.Bayesian decision theory It is the important component that subjective Bayes send inducing theory.It is under incomplete information, to the state subjectivity that part is unknown Then probability Estimation is modified probability of happening with Bayesian formula, desired value and amendment probability is finally recycled to make most Excellent decision.
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
Fig. 1 shows a kind of viewpoint polarity point of stock comment based on machine learning according to an embodiment of the invention Class method flow diagram, as shown in Figure 1, this method comprises:
Step S11: obtaining the training set being made of stock comment text and verifying collects, and concentrated for training set and verifying Every stock comment text marks viewpoint polarity;
Step S12: based on the training set after mark, being trained machine learning model, and based on the test after mark Collection evaluates and tests the effect of learning model, the machine learning model after being trained;
The step includes:
Feature is extracted from the stock comment text of training set, using the feature of extraction as the input of machine learning model, Using the viewpoint polarity classification information of stock comment text as the output of the machine learning model;
The viewpoint of viewpoint polarity classification information and respective stock the comment text mark of output based on machine learning model Polarity, the loss of computing machine learning model, and the parameter based on calculated loss Learning machine learning model;
Feature is extracted from the stock comment text of verifying collection, the feature of extraction is input in machine learning model, is obtained The viewpoint polarity classification information of the stock comment text exported to machine learning model;The sight of output based on machine learning model The viewpoint polarity of point-polarity classification information and respective stock comment text mark, evaluates and tests the effect of machine learning model;
Step S13: the relevant information of stock comment text to be predicted is input to the machine learning model after training, is obtained The viewpoint polarity classification information of the stock comment text exported to the machine learning model.
Wherein, feature is extracted from the stock comment text of training set comprise determining that dictionary;Based on dictionary, training is determined The word frequency for the every stock comment text concentrated is against text frequency TF-IDF feature;Wherein, TF-IDF feature is that dictionary size is big Small vector, each of which dimension are TF-IDF value of the corresponding words based on the stock comment text;Text is commented on from the stock of verifying collection It includes: to determine the word frequency of every stock comment text that verifying is concentrated against text frequency TF- based on dictionary that feature is extracted in this IDF feature;The relevant information of stock comment text to be predicted are as follows: the TF-IDF feature of the stock comment text.
Every for collecting by obtaining the training set being made of stock comment text and verifying, and being concentrated for training set and verifying Stock comment text marks viewpoint polarity;Based on the training set after mark, machine learning model is trained, and based on mark Test set afterwards evaluates and tests the effect of the learning model, the machine learning model after being trained;By stock to be predicted The relevant information of ticket comment text is input to the machine learning model after the training, obtains being somebody's turn to do for machine learning model output The viewpoint polarity classification information of stock comment text.The present invention carries out specially treated and training to existing machine learning model, The classification prediction of viewpoint polarity is carried out to stock comment data, so that the relevant information of stock comment text to be predicted is input to instruction The viewpoint polarity classification of the stock comment text of machine learning model output can be obtained after machine learning model after white silk Information, convenient and efficient, accuracy is high, investor can be helped more accurately to understand the general trend of market development and stock dynamic, for throwing Money person or quant use.
In one embodiment of the invention, method shown in Fig. 1 further comprises:
By the viewpoint polarity classification information of the stock comment text of machine learning model output to respective stock when corresponding Between practical ups and downs situation be compared, determine the reliability index of the stock comment text.
In one embodiment of the invention, method shown in Fig. 1 further comprises: generating for stock comment text corresponding Structural data, the structural data include: stock commentator mark, comment time, target stock, viewpoint polarity and reliability Index.
In one embodiment of the invention, method shown in Fig. 1 further comprises: obtaining the stock comment number of structuring According to;Wherein, a stock comment data refers to single stock commentator to the single comment data of single stock;
Based on acquired stock comment data, the viewpoint polarity distribution information of stock commentator is excavated;Specifically include as It is one of lower or a variety of:
All historical stocks of same stock are directed to based on the same stock commentator in acquired stock comment data Comment data, determines the probability for the stock comment data that stock commentator is expected to rise for stock publication, and determines the stock Ticket commentator issues the probability of stock comment data expected to fall for the stock;
All historical stocks of different stocks are directed to based on the same stock commentator in acquired stock comment data Comment data, determines the probability for the stock comment data that stock commentator publication is expected to rise, and determines stock commentator hair The probability of cloth stock comment data expected to fall;
All historical stocks of same stock are directed to based on the different stock commentators in acquired stock comment data Comment data, determines the probability for the stock comment data that stock commentator is expected to rise for stock publication, and determines that stock is commented The probability of stock comment data expected to fall is issued for the stock by member;
All historical stocks of different stocks are directed to based on the different stock commentators in acquired stock comment data Comment data determines the probability for the stock comment data that publication is expected to rise, and determines and issue the general of stock comment data expected to fall Rate.
And based on acquired stock comment data, excavate the viewpoint reliability distributed intelligence of stock commentator;Specifically Include:
According to the price timing information of different stocks, the same stock comment in acquired stock comment data is determined Correctness of the member for each stock comment data in all historical stock comment datas of different stocks;
According to the stock comment data quantity of the correct stock comment data quantity of a stock commentator and mistake, really The correct probability of the viewpoint of fixed stock commentator.
In one embodiment of the invention, method shown in Fig. 1 further comprises: based on same stock commentator to same Each adjacent stock comment data in the stock comment sequence of stock, extracts stock comment data pair;
Stock comment data pair based on extraction counts stock commentator and keeps the probability of viewpoint and change the general of viewpoint Rate.
In one embodiment of the invention, method shown in Fig. 1 further comprises: based on same stock commentator to same Each adjacent stock comment data in the stock comment sequence of stock, extracts stock comment data pair;
Stock comment data pair based on extraction determines that stock commentator changes viewpoint under the premise of viewpoint is correct Probability TSRatio, and determine that stock commentator changes the probability FSRatio of viewpoint under the premise of viewpoint mistake;
Stock comment data pair based on extraction determines that stock commentator keeps viewpoint under the premise of viewpoint is correct, And the correct probability TCTRatio of viewpoint kept, and determine that stock commentator changes sight under the premise of viewpoint is correct Point, and the correct probability TSTRatio of viewpoint changed;
Stock comment data pair based on extraction determines that stock commentator keeps viewpoint under the premise of viewpoint mistake, And the correct probability FCTRatio of viewpoint kept, and determine that stock commentator changes sight under the premise of viewpoint mistake Point, and the correct probability FSTRatio of viewpoint changed.
The solution proposed by the present invention that Reliability modeling is carried out to stock comment data, the program are one unified Frame, has merged a variety of Heterogeneous Information Sources, such as stock price timing, stock comment text content and delivers stock comment The historical behavior of stock commentator can effectively cross noise filtering, filter out valuable, reliable stock comment information, for investment Person or quant use;Can be applied not only to stock comment information fail-safe analysis, apply also for financial field other Aspect, such as Economic situations analysis, stock are precisely recommended, investment combination management and automated transaction.Specific implementation is as follows:
One, stock comment data cleaning treatment can tentatively wash the stock that internet obtains by data cleansing and comment By the noise of data, comprising:
(1) deleting viewpoint polarity is neutral stock comment data.
(2) sequence data and stock comment data corresponding to stock comment sequence of the length less than 5 are deleted.
Fig. 2 is a stock comment data information schematic diagram, as shown in Fig. 2, a stock comment text includes stock comment person 201 (allan), time 202 (8days ago), viewpoint polarity 203 (BUY, Bullish), target stock 204 (IBM), comment The information such as content 205 (I think there is a support at 173.11).
Wherein, because viewpoint polarity be in immediately, be difficult to be automatically recognized, i.e., deletion viewpoint polarity is neutral stock comment Data needs manually go to screen." length comments on sequence less than 5 stock " refers to that same stock comment people comments same stock By number less than 5.
Fig. 3 is another representation schematic diagram of a stock comment data information, it can be seen from the figure that target stock Be classified as A-share, for quizmaster to whether sh60000 is bought, stock commentator Liu Anlin answers this, comment the time be 2016-12-29, viewpoint polarity are to be expected to rise, and include the polar content of viewpoint are as follows: share price encounters a year line support, it may be considered that it buys in, Viewpoint is for reference.
Fig. 4 is the stock comment data amount schematic diagram after original issue stock comment data amount and cleaning, which is new Unrestrained financial planner website.It can be seen from the figure that the quantity after cleaning greatly reduces, a large amount of stock comment datas is disposed and have made an uproar Sound, and then reduce the calculation amount of follow-up data processing.
Two, stock commentator viewpoint polarity and reliability distribution pattern are excavated, and can pass through stock commentator's historical stock Comment information excavates its stock comment polarity tendency and reliability distribution, comprising:
(1) polarity distribution is commented on by the stock that stock commentator's historical stock comment information counts stock commentator, I.e. publication is expected to rise and probability distribution expected to fall.Excavate stock commentator viewpoint polarity distribution information include it is a kind of in four kinds of modes or It is a variety of, simplified summary are as follows: one-to-one, one-to-many, many-one and multi-to-multi, specifically:
All historical stocks of same stock are directed to based on the same stock commentator in acquired stock comment data Comment data, determines the probability for the stock comment data that stock commentator is expected to rise for stock publication, and determines the stock Ticket commentator issues the probability of stock comment data expected to fall for the stock;
All historical stocks of different stocks are directed to based on the same stock commentator in acquired stock comment data Comment data, determines the probability for the stock comment data that stock commentator publication is expected to rise, and determines stock commentator hair The probability of cloth stock comment data expected to fall;
All historical stocks of same stock are directed to based on the different stock commentators in acquired stock comment data Comment data, determines the probability for the stock comment data that stock commentator is expected to rise for stock publication, and determines that stock is commented The probability of stock comment data expected to fall is issued for the stock by member;
All historical stocks of different stocks are directed to based on the different stock commentators in acquired stock comment data Comment data determines the probability for the stock comment data that publication is expected to rise, and determines and issue the general of stock comment data expected to fall Rate.
(2) reliability point is commented on by the stock that stock commentator's historical stock comment information counts stock commentator Cloth, i.e. stock comment on reliable and unreliable probability distribution.
Three, the identical of views sexual norm of stock commentator excavates, and comments on sequence data by stock commentator's historical stock and digs Dig its identical of views property probability distribution, comprising:
(1) each adjacent stock comment data in sequence is commented on based on stock of the same stock commentator to same stock, Extract stock comment data pair, i.e. 2-gram data pair, the data are to include the polar stock comment data pair of viewpoint;
(2) the stock comment data pair based on extraction counts stock commentator and keeps the probability of viewpoint and change viewpoint Probability.
For example, same stock commentator is to each adjacent stock comment data in the stock comment sequence of same stock are as follows: Be expected to rise, be expected to fall, is expected to fall, be expected to rise, being expected to rise, be based on above-mentioned data, obtain the polar 2-gram data pair of viewpoint, be respectively as follows: be expected to rise, It is expected to fall;It is expected to fall, expected to fall;It is expected to fall, be expected to rise;It is expected to rise, is expected to rise.Based on above-mentioned 2-gram data pair, stock commentator guarantor is counted The probability of viewpoint is held, i.e., identical of views probability is 0.5, and the probability for changing viewpoint is 0.5.
Four, stock commentator viewpoint change pattern is excavated, and comments on Series Data Mining by stock commentator's historical stock Its viewpoint change pattern, comprising:
(1) each adjacent stock comment data in sequence is commented on based on stock of the same stock commentator to same stock, Stock comment data pair is extracted, i.e., viewpoint polarity and sight are extracted to the comment sequence data of same stock using stock commentator Point two kinds of 2-gram data pair of correctness;
(2) the stock comment data pair based on extraction determines that stock commentator changes sight under the premise of viewpoint is correct The probability TSRatio of point, and determine that stock commentator changes the probability FSRatio of viewpoint under the premise of viewpoint mistake, Under the premise of changing the probability TSRatio of viewpoint, viewpoint mistake under the premise of viewpoint is correct to statistics according to viewpoint polarity data Change the probability FSRatio of viewpoint;
(3) the stock comment data pair based on extraction determines that stock commentator keeps seeing under the premise of viewpoint is correct Point, and the correct probability TCTRatio of viewpoint kept, and determine that stock commentator changes under the premise of viewpoint is correct Viewpoint, and the correct probability TSTRatio of viewpoint changed, i.e., keep viewpoint to Statistics according to data under the premise of correct Reliability TCTRatio (i.e. stock commentator previous moment viewpoint is correct, subsequent time still maintains the viewpoint and correct), it sees Change the reliability TSTRatio of viewpoint under the premise of point is correct;
(4) the stock comment data pair based on extraction determines that stock commentator keeps seeing under the premise of viewpoint mistake Point, and the correct probability FCTRatio of viewpoint kept, and determine that stock commentator changes under the premise of viewpoint mistake Viewpoint, and the correct probability FSTRatio of viewpoint changed, i.e., according to data to holding viewpoint under the premise of Statistics mistake Reliability FCTRatio (i.e. stock commentator previous moment viewpoint mistake, subsequent time still maintain the viewpoint and correct), it sees Change the reliability FSTRatio of viewpoint under the premise of point mistake.
For example, same stock commentator is to each adjacent stock comment data in the stock comment sequence of same stock are as follows: Be expected to rise, be expected to fall, is expected to fall, be expected to rise, being expected to rise, be based on above-mentioned data, obtain the polar 2-gram data pair of viewpoint, be respectively as follows: be expected to rise, It is expected to fall;It is expected to fall, expected to fall;It is expected to fall, be expected to rise;It is expected to rise, is expected to rise, while obtaining the 2-gram data pair of viewpoint correctness, corresponding point Not are as follows: correct, correct;It is mistake, correct;Correctly, mistake;Correctly, correctly.
Changing the probability TSRatio of viewpoint under the premise of viewpoint is correct to statistics according to viewpoint polarity data is 0.5, viewpoint The probability FSRatio for changing viewpoint under the premise of mistake is 0;According to data the reliable of viewpoint is kept to Statistics under the premise of correct Property TCTRatio be 0.25, under the premise of viewpoint is correct change viewpoint reliability TSTRatio be 0.25;According to data to statistics It is 0.25 that the reliability FCTRatio of viewpoint is kept under the premise of viewpoint mistake, changes the reliability of viewpoint under the premise of viewpoint mistake FSTRatio is 0.
Five, stock comment viewpoint Check up polarity (o (ci)) utilizes the historical stock comment text data training FM mould of collection Type carries out the classification prediction of viewpoint polarity to stock comment data based on trained FM model, wherein FM model, that is, machine learning Model is a kind of existing algorithm model, but the present invention has carried out specially treated to it, is applied to stock viewpoint Check up polarity, It specifically includes:
(1) it obtains the training set being made of stock comment text and verifying collects, and every concentrated for training set and verifying Stock comment text marks viewpoint polarity, that is, determines training set, development set and test set stock comment text, wherein development set and Test set is similar, is referred to as verifying collection.Wherein, development set obtains most for optimizing in the training process to model parameter Excellent model, test set is for testing the effect of model after training;Viewpoint is polar to be labeled as manually marking, i.e., artificial mark Infuse the feeling polarities (being expected to rise or expected to fall) of every stock comment text in training set and test set.
(2) word segmentation processing being carried out to training set text, statistics obtains dictionary, for example, " I thinks that tomorrow, stock can rise ", it can Participle are as follows: " I ", " thinking ", " tomorrow ", " stock ", " meeting ", " rising ", the similar segmenting method, statistics obtain dictionary.
(3) it is based on the dictionary, determines the TF-IDF feature of every stock comment text in training set, this feature is dictionary The vector of size, each dimension are TF-IDF value of the corresponding words based on the text.
TF-IDF (term frequency-inverse document frequency) be it is a kind of for information retrieval with The common weighting technique of data mining.TF means word frequency (Term Frequency), and IDF means inverse document frequency (Inverse Document Frequency).The main thought of TFIDF is: if some word or phrase go out in an article Existing frequency is high, and seldom occurs in other articles, then it is assumed that and this word or phrase have good class discrimination ability, It is adapted to classify.TFIDF is actually: TF*IDF, TF word frequency (Term Frequency), the reverse document-frequency of IDF (Inverse Document Frequency).TF indicates the frequency that entry occurs in document d.The main thought of IDF is: such as Document of the fruit comprising entry t is fewer, that is, n smaller, and IDF is bigger, then illustrates that entry t has good class discrimination ability. If the number of files comprising entry t is m in certain a kind of document C, and the total number of documents that other classes include t is k, it is clear that all to include The number of files n=m+k of t, when m is big, n is also big, and the value of the IDF obtained according to IDF formula can be small, just illustrates entry t Class discrimination is indifferent.
In simple terms, the everyday words often occurred in some other documents occurred in training set, such as " ", " " Deng the important ratio of these words is lower, and the viewpoint polarity of " being expected to rise ", " expected to fall " etc occurred in stock comment text Word, importance are higher.TF-IDF is exactly the feature for evaluating the importance of each word in dictionary.
It is the vector of dictionary size about the TF-IDF feature, each dimension is TF- of the corresponding words based on the text The understanding of IDF value, for example, contain 1000 words in 100 sentences altogether, then the vector of each sentence is 1000 dimensions, For example the initial vector is [1,0,0 ... ... 1], wherein 1 represents target word and occurs in sentence, 0 represents target word in sentence Do not occur, 1 and 0 in initial vector will be obtained multiplied by the TF-IDF value of the stock comment text that is, multiplied by the weight of the word To the TF-IDF feature of stock comment text.
(4) feature is extracted from the stock comment text of training set, using the feature of extraction as the defeated of machine learning model Enter, using the viewpoint polarity classification information of stock comment text as the output of machine learning model;Training set stock is commented on For the TF-IDF feature of text as mode input feature, it is output that stock, which comments on feeling polarities, i.e. output is expected to rise or expected to fall, That is output 1 or 0.
(5) sight of the viewpoint polarity classification information of the output based on machine learning model and respective stock comment text mark Point-polarity, the loss of computing machine learning model, and the parameter based on calculated loss Learning machine learning model;It is based on Training set utilizes the method optimizing of cross validation using the stochastic gradient descent calligraphy learning FM model parameter of adaptive regularization The value of hyper parameter k in FM model is adjusted, wherein the value of hyper parameter k is artificial specified value.
(6) based on verifying collection, FM modelling effect is evaluated and tested, specifically: feature is extracted from the stock comment text of verifying collection, The feature of extraction is input in machine learning model, the viewpoint polarity of the stock comment text of machine learning model output is obtained Classification information;The viewpoint of viewpoint polarity classification information and respective stock the comment text mark of output based on machine learning model Polarity evaluates and tests the effect of machine learning model.
(7) (5), (6) and (7) are repeated, until FM effect meets the requirements (such as accuracy rate is greater than 95%), then completes FM model Training.
(8) it is based on trained FM model, the classification of viewpoint polarity is carried out to stock comment text, obtains o (ci) attribute.
(9) the reliability r (ci) of each stock comment is calculated according to (formula 1):
Wherein,The date is represented,ForStock price,ForSecond day stock valence Lattice,It is 0 or 1.
(10) corresponding structural data is generated for stock comment text, which includes: stock commentator mark Know, comment on time, target stock, viewpoint polarity and reliability index, is i.e. building stock comments on cell data ci={ d (ci), a (ci), s (ci), t (ci), o (ci), r (ci) }, wherein d (ci) is comment content, and a (ci) is stock commentator mark, s It (ci) is target stock, t (ci) is the comment time, and o (ci) is viewpoint polarity, and r (ci) is reliability index.
Six, stock comment information reliability scoring method, i.e., to the reliable of a certain stock comment information of some stock commentator Property marking.Extract key feature from stock comment sequence, share price sequence and stock comment person's historical behavior data, based on disaggregated model and when Between the integrated study frame of series analysis model give a mark to the reliability of stock comment information, specifically include:
(1) feature vector is extracted based on stock comment data collection and share price sequence sets, firstly, being based on stock comment data collection In at least partly stock comment data in each stock comment data, extract one of following feature or a variety of compositions One feature vector:
This trand ticket comment data be expected to rise or viewpoint polarity information expected to fall;On how to determine that this trand ticket comments on number According to be expected to rise or viewpoint polarity information expected to fall, be elaborated in step 5, details are not described herein.
In all stock comment datas for stock s that the t same day is issued, the stock comment data quantity be expected to rise is seen The stock comment data quantity fallen;
It is issued in the past first preset length time from t days, in all stock comment datas for stock s, Stock comment data quantity, stock comment data quantity expected to fall, the correct stock comment data quantity of viewpoint and the sight being expected to rise The stock comment data quantity of point mistake;
The price series of stock s from t days in the past second preset length time;
The stock s that machine learning model for predicting Stock Price is predicted is defeated in the price of next day of trade and the model Standard deviation out;
From t days in the past third preset length time, in all stock comment datas of stock commentator a publication, Stock comment data quantity, stock comment data quantity expected to fall, the correct stock comment data quantity of viewpoint and the sight being expected to rise The stock comment data quantity of point mistake;
From t days in the past 4th preset length time, the stock for stock s of stock commentator a publication is commented on In data, stock comment data quantity, the stock comment data quantity expected to fall, the correct stock comment data number of viewpoint be expected to rise The stock comment data quantity of amount and viewpoint mistake;
The stock comment sequence issued in the past 5th preset length time from t days based on stock commentator a is true Fixed, change the probability of viewpoint under the premise of the viewpoint change probability OSRatio based on stock commentator a, viewpoint are correct Viewpoint and holding are kept under the premise of the probability FSRatio of change viewpoint, viewpoint are correct under the premise of TSRatio, viewpoint mistake The correct probability TCTRatio of viewpoint, viewpoint it is correct under the premise of change viewpoint and change the correct probability of viewpoint The correct probability FCTRatio of viewpoint and viewpoint mistake of holding viewpoint and holding under the premise of TSTRatio, viewpoint mistake Under the premise of one of the correct probability FSTRatio of viewpoint or a variety of that changes viewpoint and change;
Wherein, the stock commentator of this trand ticket comment data is a, and comment is stock s, issue date t.
On how to the viewpoint polarity distribution information of determining stock commentator a, it has been elaborated in step 3, Details are not described herein.
For example, key feature is extracted from stock comment sequence, share price sequence and stock comment person's historical behavior data, the key Feature includes: viewpoint polarity, historical stock state, price timing and stock commentator's historical behavior.Wherein, viewpoint polarity is to work as Preceding comment be expected to rise or it is expected to fall;Historical stock state includes two kinds of situations: first is not consider the time, all needles of same day publication To stock comment data quantity, the stock comment data quantity expected to fall in the stock comment data of stock s, being expected to rise;Second is In stock comment in past 7 days in all stock comment datas for stock s, the stock comment data quantity be expected to rise is seen The stock comment data quantity of the correct stock comment data quantity of stock comment data quantity, viewpoint and viewpoint mistake fallen; Price timing includes: the price series of stock s and the second day price predicted with arma modeling and defeated in 25 days in the past Standard deviation out;Stock comment person's historical behavior include: some stock comment person a made within past 7/30/90 day be expected to rise/it is expected to fall/just Really/mistake stock number of reviews;Some stock comment person to current stock made within past 7/30/90 day be expected to rise/it is expected to fall/just Really/mistake stock number of reviews;It is determined based on some stock comment person a in the stock comment sequence of publication in the past 7/30/90 day One of OSRatio, TSRatio, FSRatio, TCTRatio, TSTRatio or a variety of.
(2) the support vector machines model of Radial basis kernel function (formula 2) is based on using the training of extracted feature vector:
Enable Radial basis kernel function are as follows:
Wherein, x1And x2It is two feature vectors, variable can also be become;γ is the parameter of Radial basis kernel function, is generally set Be set to 1 divided by feature sum, such as 10000 features, then r is set to 0.0001;φ () maps primitive character To higher-dimension kernel spacing, in order to carry out the calculating of optimizing decision hyperplane (formula 3);
SVM model are as follows:
The principle of SVM is to solve for correctly dividing the maximum separating hyperplance of training dataset and geometry interval.It is defeated Entering is some feature samples points, and model can determine two things: 1, all data in one hyperplane of study, this hyperplane Point is ideally divided into two classes, and the output of the first kind is 1 (corresponding reliable stock comment), and the output of the second class is 0 (corresponding not reliable stock Comment) 2, all data points it is more remoter better with a distance from hyperplane.
If it (is all linearly can not in most cases that feature samples point, which is linearly inseparable in original space, Point), then it is desirable that he is mapped in higher dimensional space the mapping for making problem become linear separability, using by a kind of mapping It is exactly kernel function.
(3) pass through optimization (formula 4) calculating parameter ω and b:
s.t.yiTφ(ci)+b)≥1-ξi,
ξi>=0, i=1 ..., N, (formula 4)
Wherein C is the tradeoff parameter of noise and simplified Hyperplane classification in training sample, yiIt is whether stock comments on viewpoint Correct label.These three parameters of ω, b, ξ are all the parameters for needing model training to learn, and wherein ω and b is SVM model Two parameters being used in prediction;S.t. represent it is subsequent be front constraint condition, i.e., after two rows be the first row target The constraint condition of function.yiIt is the boundary of objective function, this boundary will be the bigger the better.
(4) training of share price sequence sets is utilized to be used for the machine learning model of predicting Stock Price, such as arma modeling, comprising:
A. training set and test set stock price sequence data are determined, input data is continuous several stock price data, Output is stock price data one day after;It is determined as the stock price sequence data of model training collection and test set, wherein instructing The each data practiced in collection or test set include: for the continuous several days stock price datas of input model and conduct The stock price data one day after of label;
B. based on training set training arma modeling, and collect the prediction effect for verifying model based on verifying;I.e. based on training set, Using maximal possibility estimation training arma modeling parameter, tuning is carried out to parameter p and q based on BIC criterion, based on trained Arma modeling lasts the share price of share price data prediction one day after using certain stock, verifies the prediction effect based on verifying collection.
Generally speaking, based on the Forecasting of Stock Prices of Time Series Analysis Model, stock historical price sequence, training ARMA are utilized Model, the price based on trained arma modeling prediction stock one day after.
(5) SVM model and the machine learning model for predicting Stock Price are integrated, is obtained for evaluating stock comment reliability Disaggregated model;I.e. based on Forecasting of Stock Prices result building classification equation, such as following formula 5:
Wherein,It isThe share price of time,It isThe predicted value of second day share price,It is stock Comment viewpoint feeling polarities, err (ci) be share price sequence data standard deviation, i.e. the error of Forecasting of Stock Prices value that currently exports of model Confidence value in other words.
(6) SVM model and arma modeling are integrated, final classification function is obtained, such as following formula 6:
h(ci) be 1 when, indicate stock comment it is reliable;h(ci) be -1 when, indicate stock comment it is unreliable.WhereinCalculation formula is such as Following formula 7:
[0,1] u ∈ in formula 7 is the weighting coefficient of SVM and arma modeling prediction result, is determined by experiment u=0.59 effect Fruit is best.
Stock comment reliability classification exact value 8 can be calculated according to the following formula:
As r υ (ci) it is higher when, it is more reliable to stock comment classification results.(formula 8) is the absolute value of the output result of (formula 7).
Seven, the probability calculation that stock rises or falls passes through the correlated characteristic and measurement extracted during stock comment degree of reiability As a result, calculating the probability that stock rises or falls, comprising:
(1) according to the following formula 9 calculate the branch stock ups and downs probability cf (sj)::
Wherein,Indicate stock comment data collectionIn stock comment data quantity, i.e., all stock number of reviews Summation, ciIndicate a stock comment data,For the viewpoint polarity of this trand ticket comment data,For this trand ticket The reliability index of comment data, r υ (ci) it is the exact value that reliability classification is carried out to this trand ticket comment data.
(2) 10 advance versus decline is predicted according to the following formula:
(3) probability that 11 calculating stocks rise or fall according to the following formula:
w(sj)=| cf (sj) | (formula 11)
As cf (sjWhen) >=0, w (sj) value it is bigger, the probability for illustrating that stock rises is larger, as cf (sj) < 0 when, w (sj) Value is bigger, and the probability for illustrating that stock falls is larger.
Eight, stock comment reliability model is completed, when specified viewpoint information inquiry request of the reception about stock commentator Export result data corresponding with the inquiry request.
Nine, the equity investment based on stock comment reliability model measurement, is based on the reliable stock of stock comment data reliability model discrimination It comments, and is invested according to this, comprising:
(1) the probability w (s that stock rises or falls is calculated to stocks all in stock pondj), wherein sjFor single stock;
(2) a variety of intelligent share-selecting methods:
A. the stock for choosing the highest predetermined number of probability for rising and rising carries out suggestion for investment, and capital authority reselection procedure is average The mode of weighting;That is the highest K stock of screening amount of increase index is as suggestion for investment, and capital authority reselection procedure average weighted Mode, i.e. every stock average investment G/K member, wherein G is the gross investment amount of money;
B. choose and rise and the stock of the highest predetermined number of probability that rises carries out suggestion for investment, and capital authority reselection procedure according to The mode of the probability weight to rise;That is K highest stock of screening amount of increase index is as suggestion for investment, and capital authority reselection procedure is pressed According to the mode of amount of increase exponential weighting, i.e. stock sjInvestment
C. the highest stock of probability for rising and rising is chosen from each Stock block, and capital authority reselection procedure averagely adds The mode of power;The highest stock of amount of increase index is selected in i.e. each column as suggestion for investment, altogether M (M=10) a plate Block (see the table below 1), and the mode of capital authority reselection procedure average weighted, i.e. every equity investment G/M member.
Table 1:Sectors of stock symbols
Table 1 is stock column information, and Category represents column name, and #Covered Symbols represents the number of share of stock in column Mesh.
D. the highest stock of probability for rising and rising is chosen from each Stock block, and capital authority reselection procedure is according to rising Probability weight mode;The highest stock of amount of increase index is selected in i.e. each column as suggestion for investment, altogether M (M= 10) a plate, and the mode of capital authority reselection procedure average weighted, i.e. every stock si investment
E. the one or more highest stock of the probability for rising and rising is chosen from each Stock block, is selected between each plate Average weighted mode is selected, is selected in the way of the probability weight to rise between the stock of each plate of selection;It is i.e. above-mentioned to select stocks Then the combination of method, such as respectively select the highest stock of Km amount of increase from each column first with average weighted or is pressed According to the mode of amount of increase exponential weighting, each stock is invested.It wherein can also be according to average to the gross investment of each column It weights or in the way of amount of increase exponential weighting.
Fig. 5 is using the profit situation schematic diagram after intelligence share-selecting method c selection stock, in January, 2016 to 2016 It selects December intelligence share-selecting method c to carry out simulation investment, each day of trade chooses K equity investment, invest 10000 yuan altogether, K =M, every stock 10000/M.
Fig. 6 shows a kind of viewpoint polarity point of stock comment based on machine learning according to an embodiment of the invention Class schematic device, the device 60 include:
Acquiring unit 601 collects suitable for obtaining the training set being made of stock comment text and verifying, and for training set and tests Every stock comment text that card is concentrated marks viewpoint polarity;
Training unit 602, suitable for being trained to machine learning model based on the training set after mark, and based on mark Test set afterwards evaluates and tests the effect of the learning model, the machine learning model after being trained;
Predicting unit 603, suitable for the relevant information of stock comment text to be predicted to be input to the machine after the training Device learning model obtains the viewpoint polarity classification information of the stock comment text of machine learning model output.
In one embodiment of the invention, training unit 602, it is special suitable for being extracted from the stock comment text of training set Sign, using the feature of extraction as the input of machine learning model, using the viewpoint polarity classification information of stock comment text as machine The output of device learning model;The viewpoint polarity classification information and respective stock comment text mark of output based on machine learning model The viewpoint polarity of note, the loss of computing machine learning model, and the parameter based on calculated loss Learning machine learning model; Feature is extracted from the stock comment text of verifying collection, the feature of extraction is input in the machine learning model, machine is obtained The viewpoint polarity classification information of the stock comment text of device learning model output;The viewpoint pole of output based on machine learning model Property classification information and respective stock comment text mark viewpoint polarity, evaluate and test the effect of machine learning model;Repeat above-mentioned step Suddenly, until the effect of machine learning model reaches preset condition.
In one embodiment of the invention, training unit 602 are adapted to determine that dictionary;Based on dictionary, determine in training set Every stock comment text word frequency against text frequency TF-IDF feature;Wherein, TF-IDF feature is dictionary size Vector, each of which dimension are TF-IDF value of the corresponding words based on the stock comment text;Based on dictionary, determine that verifying is concentrated every The word frequency of stock comment text is against text frequency TF-IDF feature;
The relevant information of stock comment text to be predicted are as follows: the TF-IDF feature of the stock comment text.
Fig. 7 shows the viewpoint polarity classification of another stock comment based on machine learning of one embodiment of the invention Schematic device, the device 70 include: acquiring unit 601;Training unit 602;;Predicting unit 603;Reliability determination unit 701;Data structured processing unit 702;Viewpoint polarity distribution determination unit 703.Wherein acquiring unit 601, training unit 602 It has been elaborated in the embodiment shown in fig. 6 with predicting unit 603, details are not described herein.
Reliability determination unit 701, the viewpoint polarity classification suitable for the stock comment text for exporting machine learning model Practical ups and downs situation of the information to respective stock in the corresponding time is compared, and determines that the reliability of the stock comment text refers to Number.
Data structured processing unit 702 is suitable for stock comment text and generates corresponding structural data, the structuring Data include: stock commentator mark, comment time, target stock, viewpoint polarity and reliability index.
Viewpoint polarity distribution determination unit 703, suitable for obtaining the stock comment data of structuring;Wherein, a stock is commented Refer to single stock commentator to the single comment data of single stock by data;Based on acquired stock comment data, dig Dig the viewpoint polarity distribution information of stock commentator;And based on acquired stock comment data, excavate stock commentator's Viewpoint reliability distributed intelligence.
In one embodiment of the invention, viewpoint polarity distribution determination unit 703, one be adapted for carrying out in following steps Kind is a variety of:
All historical stocks of same stock are directed to based on the same stock commentator in acquired stock comment data Comment data, determines the probability for the stock comment data that stock commentator is expected to rise for stock publication, and determines the stock Ticket commentator issues the probability of stock comment data expected to fall for the stock;
All historical stocks of different stocks are directed to based on the same stock commentator in acquired stock comment data Comment data, determines the probability for the stock comment data that stock commentator publication is expected to rise, and determines stock commentator hair The probability of cloth stock comment data expected to fall;
All historical stocks of same stock are directed to based on the different stock commentators in acquired stock comment data Comment data, determines the probability for the stock comment data that stock commentator is expected to rise for stock publication, and determines that stock is commented The probability of stock comment data expected to fall is issued for the stock by member;
All historical stocks of different stocks are directed to based on the different stock commentators in acquired stock comment data Comment data determines the probability for the stock comment data that publication is expected to rise, and determines and issue the general of stock comment data expected to fall Rate.
In one embodiment of the invention, viewpoint polarity distribution determination unit 703, suitable for the price according to different stocks Timing information determines that the same stock commentator in acquired stock comment data is directed to all history stocks of different stocks The correctness of each stock comment data in ticket comment data;According to the comment of the correct stock of a stock commentator The stock comment data quantity of data bulk and mistake, determines the correct probability of the viewpoint of stock commentator.
In one embodiment of the invention, viewpoint polarity distribution determination unit 703 is further adapted for based on same stock Commentator extracts stock comment data pair to each adjacent stock comment data in the stock comment sequence of same stock;It is based on The stock comment data pair of extraction counts stock commentator and keeps the probability of viewpoint and change the probability of viewpoint.
In one embodiment of the invention, viewpoint polarity distribution determination unit 703, is further adapted for,
Based on same stock commentator to each adjacent stock comment data in the stock comment sequence of same stock, extract Stock comment data pair;
Stock comment data pair based on extraction determines that stock commentator changes viewpoint under the premise of viewpoint is correct Probability TSRatio, and determine that stock commentator changes the probability FSRatio of viewpoint under the premise of viewpoint mistake;
Stock comment data pair based on extraction determines that stock commentator keeps viewpoint under the premise of viewpoint is correct, And the correct probability TCTRatio of viewpoint kept, and determine that stock commentator changes sight under the premise of viewpoint is correct Point, and the correct probability TSTRatio of viewpoint changed;
Stock comment data pair based on extraction determines that stock commentator keeps viewpoint under the premise of viewpoint mistake, And the correct probability FCTRatio of viewpoint kept, and determine that stock commentator changes sight under the premise of viewpoint mistake Point, and the correct probability FSTRatio of viewpoint changed.
It in conclusion being collected by obtaining the training set being made of stock comment text and verifying, and is training set and verifying The every stock comment text concentrated marks viewpoint polarity;Based on the training set after mark, machine learning model is trained, And it is evaluated and tested based on effect of the test set after mark to the learning model, the machine learning model after being trained;It will The relevant information of stock comment text to be predicted is input to the machine learning model after the training, obtains the machine learning mould The viewpoint polarity classification information of the stock comment text of type output.The present invention carries out special place to existing machine learning model Reason and training carry out the classification prediction of viewpoint polarity to stock comment data, so that the related letter of stock comment text to be predicted Breath be input to training after machine learning model after can be obtained the machine learning model output the stock comment text sight Point-polarity classification information, convenient and efficient, accuracy is high, and has merged a variety of Heterogeneous Information Sources, such as stock price timing, stock Ticket comment text content and the historical behavior for delivering the stock commentator that stock is commented on are based on the multi-source heterogeneous big data, borrow It helps data mining technology to analyse in depth and extracts key feature, carry out stock using these features and comment on degree of reiability, it can be with Noise filtering is effectively crossed, valuable, reliable stock comment information is filtered out from massive information, chooses good quality stock, it can It helps investor more accurately to understand the general trend of market development and stock dynamic, is used for investor or quant.This method Can be applied not only to stock comment information fail-safe analysis, apply also for financial field other aspect, as Economic situations analysis, Stock precisely recommends, investment combination management and automated transaction etc..
It should be understood that
Algorithm and display be not inherently related to any certain computer, virtual bench or other equipment provided herein. Various fexible units can also be used together with teachings based herein.As described above, it constructs required by this kind of device Structure be obvious.In addition, the present invention is also not directed to any particular programming language.It should be understood that can use various Programming language realizes summary of the invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects, Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself All as a separate embodiment of the present invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power Benefit requires, abstract and attached drawing) disclosed in each feature can be by providing identical, equivalent, or similar purpose alternative features come generation It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed Meaning one of can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice Microprocessor or digital signal processor (DSP) realize the typing dress of taking pictures of word content according to an embodiment of the present invention It sets, some or all functions of some or all components in electronic equipment and computer readable storage medium.The present invention Be also implemented as executing method as described herein some or all device or device program (for example, Computer program and computer program product).It is such to realize that program of the invention can store on a computer-readable medium, Or it may be in the form of one or more signals.Such signal can be downloaded from an internet website to obtain, or It is provided on the carrier signal, or is provided in any other form.
For example, Fig. 8 is the structural schematic diagram of the electronic equipment in the embodiment of the present invention.The electronic equipment 800 includes: processing Device 810, and it is stored with the memory 820 for the computer program that can be run on the processor 810.Processor 810, is used for Each step of method in the present invention is executed when executing the computer program in the memory 820.Memory 820 can be all Such as the electronic memory of flash memory, EEPROM (electrically erasable programmable read-only memory), EPROM, hard disk or ROM etc.It deposits Reservoir 820 has the memory space 830 stored for executing the computer program 531 of any method and step in the above method. Computer program 831 can read or be written to this one or more meter from one or more computer program product In calculation machine program product.These computer program products include such as hard disk, compact-disc (CD), storage card or floppy disk etc Program code carrier.Such computer program product is usually computer readable storage medium described in such as Fig. 9.
Fig. 9 is the structural schematic diagram of one of embodiment of the present invention computer readable storage medium.This is computer-readable Storage medium 900 is stored with the computer program 831 for executing steps of a method in accordance with the invention, can be by electronic equipment 800 processor 810 is read, and when computer program 831 is run by electronic equipment 800, the electronic equipment 800 is caused to execute Each step in method described in face, specifically, the calculation procedure 831 of the computer-readable recording medium storage can be with Execute method shown in any of the above-described embodiment.Computer program 831 can be compressed in a suitable form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame Claim.

Claims (10)

1. a kind of viewpoint polarity classification method of the stock comment based on machine learning, wherein this method comprises:
The every stock comment for obtaining the training set being made of stock comment text and verifying collecting, and concentrated for training set and verifying Text marking viewpoint polarity;
Based on the training set after mark, machine learning model is trained, and based on the test set after mark to the study The effect of model is evaluated and tested, the machine learning model after being trained;
The relevant information of stock comment text to be predicted is input to the machine learning model after the training, obtains the machine The viewpoint polarity classification information of the stock comment text of learning model output.
2. the method as described in right will require 1, wherein the training set based on after mark carries out machine learning model Training, and evaluation and test is carried out based on effect of the test set after mark to the learning model and includes:
Feature is extracted from the stock comment text of training set, using the feature of extraction as the input of machine learning model, with stock Output of the viewpoint polarity classification information of ticket comment text as the machine learning model;
The viewpoint of viewpoint polarity classification information and respective stock the comment text mark of output based on the machine learning model Polarity calculates the loss of the machine learning model, and the parameter based on calculated loss Learning machine learning model;
Feature is extracted from the stock comment text of verifying collection, the feature of extraction is input in the machine learning model, is obtained The viewpoint polarity classification information of the stock comment text exported to the machine learning model;Based on the machine learning model The viewpoint polarity of viewpoint polarity classification information and respective stock the comment text mark of output, evaluates and tests the machine learning model Effect;
It repeats the above steps, until the effect of the machine learning model reaches preset condition.
3. method according to claim 2, wherein
Feature is extracted in the stock comment text from training set comprises determining that dictionary;Based on the dictionary, training set is determined In every stock comment text word frequency against text frequency TF-IDF feature;Wherein, TF-IDF feature is dictionary size Vector, each of which dimension be TF-IDF value of the corresponding words based on the stock comment text;
The feature of extracting from the stock comment text of verifying collection includes: to determine every that verifying is concentrated based on the dictionary The word frequency of stock comment text is against text frequency TF-IDF feature;
The relevant information of the stock comment text to be predicted are as follows: the TF-IDF feature of the stock comment text.
4. the method for claim 1, wherein this method further comprises:
By the viewpoint polarity classification information of the stock comment text of machine learning model output to respective stock in the corresponding time Practical ups and downs situation is compared, and determines the reliability index of the stock comment text.
5. method as claimed in claim 4, wherein this method further comprises:
Corresponding structural data is generated for stock comment text, when which includes: stock commentator mark, comment Between, comment content, target stock, viewpoint polarity and reliability index.
6. the method as described in right wants 5, wherein this method further comprises:
Obtain the stock comment data of structuring;Wherein, a stock comment data refers to single stock commentator to single stock The single comment data of ticket;
Based on acquired stock comment data, the viewpoint polarity distribution information of stock commentator is excavated;
And based on acquired stock comment data, excavate the viewpoint reliability distributed intelligence of stock commentator.
7. method as claimed in claim 6, wherein it is described based on acquired stock comment data, excavate stock commentator Viewpoint polarity distribution information include one of following or a variety of:
It is commented on based on the same stock commentator in acquired stock comment data for all historical stocks of same stock Data, determine the probability for the stock comment data that stock commentator is expected to rise for stock publication, and determine that the stock is commented The probability of stock comment data expected to fall is issued for the stock by member;
It is commented on based on the same stock commentator in acquired stock comment data for all historical stocks of different stocks Data, determine the probability for the stock comment data that stock commentator publication is expected to rise, and determine that stock commentator publication is seen The probability for the stock comment data fallen;
It is commented on based on the different stock commentators in acquired stock comment data for all historical stocks of same stock Data, determine the probability for the stock comment data that stock commentator is expected to rise for stock publication, and determine stock commentator The probability of stock comment data expected to fall is issued for the stock;
It is commented on based on the different stock commentators in acquired stock comment data for all historical stocks of different stocks Data determine the probability for the stock comment data that publication is expected to rise, and determine the probability for issuing stock comment data expected to fall.
8. a kind of viewpoint polarity sorter of the stock comment based on machine learning, wherein the device includes:
Acquiring unit collects suitable for obtaining the training set being made of stock comment text and verifying, and concentrates for training set and verifying Every stock comment text mark viewpoint polarity;
Training unit, suitable for being trained to machine learning model based on the training set after mark, and based on the test after mark Collection evaluates and tests the effect of the learning model, the machine learning model after being trained;
Predicting unit, suitable for the relevant information of stock comment text to be predicted to be input to the machine learning mould after the training Type obtains the viewpoint polarity classification information of the stock comment text of machine learning model output.
9. a kind of electronic equipment, which is characterized in that the electronic equipment includes: processor, and being stored with can be on a processor The memory of the computer program of operation;
Wherein, the processor, for when executing the computer program in the memory perform claim require it is any in 1-7 Method described in.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program quilt Processor realizes method of any of claims 1-7 when executing.
CN201810943297.3A 2018-08-17 2018-08-17 The viewpoint polarity classification method and device of stock comment based on machine learning Pending CN109299252A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810943297.3A CN109299252A (en) 2018-08-17 2018-08-17 The viewpoint polarity classification method and device of stock comment based on machine learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810943297.3A CN109299252A (en) 2018-08-17 2018-08-17 The viewpoint polarity classification method and device of stock comment based on machine learning

Publications (1)

Publication Number Publication Date
CN109299252A true CN109299252A (en) 2019-02-01

Family

ID=65165174

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810943297.3A Pending CN109299252A (en) 2018-08-17 2018-08-17 The viewpoint polarity classification method and device of stock comment based on machine learning

Country Status (1)

Country Link
CN (1) CN109299252A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111754352A (en) * 2020-06-22 2020-10-09 平安资产管理有限责任公司 Method, device, equipment and storage medium for judging correctness of viewpoint statement
CN112632286A (en) * 2020-09-21 2021-04-09 北京合享智慧科技有限公司 Text attribute feature identification, classification and structure analysis method and device
CN112988845A (en) * 2021-04-01 2021-06-18 毕延杰 Data information processing method and information service platform in big data service scene
CN113326376A (en) * 2021-05-28 2021-08-31 南京大学 Code review opinion quality evaluation system and method based on machine learning
CN113792552A (en) * 2021-08-23 2021-12-14 中国电子科技集团公司第三十研究所 Viewpoint transformation index calculation method based on user generated content

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101556580A (en) * 2009-05-20 2009-10-14 北京工商大学 Stock comment classification system based on analysis of discourse structure and method
US20140006313A1 (en) * 2012-04-18 2014-01-02 The Florida State University Research Foundation, Inc. Stock ranking predictions based on neighborhood model
CN104240125A (en) * 2014-09-27 2014-12-24 王志恒 Organization and individual stock comment accuracy rating method
CN106227756A (en) * 2016-07-14 2016-12-14 苏州大学 A kind of stock index forecasting method based on emotional semantic classification and system
CN106776581A (en) * 2017-02-21 2017-05-31 浙江工商大学 Subjective texts sentiment analysis method based on deep learning

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101556580A (en) * 2009-05-20 2009-10-14 北京工商大学 Stock comment classification system based on analysis of discourse structure and method
US20140006313A1 (en) * 2012-04-18 2014-01-02 The Florida State University Research Foundation, Inc. Stock ranking predictions based on neighborhood model
CN104240125A (en) * 2014-09-27 2014-12-24 王志恒 Organization and individual stock comment accuracy rating method
CN106227756A (en) * 2016-07-14 2016-12-14 苏州大学 A kind of stock index forecasting method based on emotional semantic classification and system
CN106776581A (en) * 2017-02-21 2017-05-31 浙江工商大学 Subjective texts sentiment analysis method based on deep learning

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王洪伟等: "网络股评对股市走势的影响:基于文本情感分析的方法", 《情报学报》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111754352A (en) * 2020-06-22 2020-10-09 平安资产管理有限责任公司 Method, device, equipment and storage medium for judging correctness of viewpoint statement
CN112632286A (en) * 2020-09-21 2021-04-09 北京合享智慧科技有限公司 Text attribute feature identification, classification and structure analysis method and device
CN112988845A (en) * 2021-04-01 2021-06-18 毕延杰 Data information processing method and information service platform in big data service scene
CN112988845B (en) * 2021-04-01 2021-11-16 湖南机械之家信息科技有限公司 Data information processing method and information service platform in big data service scene
CN113326376A (en) * 2021-05-28 2021-08-31 南京大学 Code review opinion quality evaluation system and method based on machine learning
CN113792552A (en) * 2021-08-23 2021-12-14 中国电子科技集团公司第三十研究所 Viewpoint transformation index calculation method based on user generated content
CN113792552B (en) * 2021-08-23 2023-05-09 中国电子科技集团公司第三十研究所 Viewpoint transition index calculation method based on user generated content

Similar Documents

Publication Publication Date Title
CN109299252A (en) The viewpoint polarity classification method and device of stock comment based on machine learning
CN101408886B (en) Selecting tags for a document by analyzing paragraphs of the document
CN101408887B (en) Recommending terms to specify body space
CN107291688A (en) Judgement document&#39;s similarity analysis method based on topic model
CN109035025A (en) The method and apparatus for evaluating stock comment reliability
EP1860578A1 (en) System for analyzing patents
WO2007078814A2 (en) Apparatus and method for strategy map validation and visualization
CN106227756A (en) A kind of stock index forecasting method based on emotional semantic classification and system
Sumathi et al. Data mining: analysis of student database using classification techniques
CN111798297A (en) Financial risk early warning analysis method and device
CN112215696A (en) Personal credit evaluation and interpretation method, device, equipment and storage medium based on time sequence attribution analysis
CN109300030A (en) Realize the method and apparatus that equity investment is recommended
CN109300031A (en) Data digging method and device based on stock comment data
Klosterman Data Science Projects with Python: A case study approach to gaining valuable insights from real data with machine learning
Arifin et al. Comparative analysis on educational data mining algorithm to predict academic performance
Yan et al. An interactive visual analytics system for incremental classification based on semi-supervised topic modeling
KR101265975B1 (en) Future technology value appraisal system and method
CN112419029B (en) Similar financial institution risk monitoring method, risk simulation system and storage medium
CN112506930B (en) Data insight system based on machine learning technology
CN109242160A (en) The method and apparatus for calculating advance versus decline probability
CN113505117A (en) Data quality evaluation method, device, equipment and medium based on data indexes
Elsid et al. Data Mining: Classification Techniques of Students’ Database A Case Study of the Nile Valley University, North Sudan
CN116578613B (en) Data mining system for big data analysis
Nettleton et al. Analysis of web search engine query sessions
Sailesh et al. Context driven data mining to classify students of higher educational institutions

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