WO2019085335A1 - 利用新词发现投资标的的方法、装置及存储介质 - Google Patents
利用新词发现投资标的的方法、装置及存储介质 Download PDFInfo
- Publication number
- WO2019085335A1 WO2019085335A1 PCT/CN2018/076174 CN2018076174W WO2019085335A1 WO 2019085335 A1 WO2019085335 A1 WO 2019085335A1 CN 2018076174 W CN2018076174 W CN 2018076174W WO 2019085335 A1 WO2019085335 A1 WO 2019085335A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- word
- corpus
- new word
- new
- text
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
Definitions
- the present application relates to the field of computer technology, and in particular, to a method, an electronic device, and a computer readable storage medium for discovering an investment target by using a new word.
- investors lack observations about the relationship between investment objects and hot topics, and this observation can improve the business planning, research and development focus, business growth, raw material demand, and team building of investment targets to a certain extent. Expected recognition of other aspects.
- the present application provides a method, an electronic device and a computer readable storage medium for discovering investment targets by using new words, the main purpose of which is to filter and analyze new words from news corpus, and extract new words extracted from news corpus. Investment targets.
- the present application provides an electronic device, which includes a memory, a processor, and a program stored on the processor for discovering an investment target by using a new word, the program being The processor implements the following steps when it executes:
- A1 preprocessing the corpus in the corpus, obtaining corpus text data, forming a corpus text set;
- A2 reading a pre-processed corpus text, performing word segmentation and de-stop word processing on the corpus text, and obtaining a plurality of words of the corpus text;
- A5. Calculate the mutual information value of the new word and the company name in the corpus, and extract the company name and new word whose mutual information value meets the preset condition as the reference investment target.
- the present application further provides a method for discovering an investment target by using a new word, the method comprising:
- the present application further provides a computer readable storage medium having stored thereon a program for discovering an investment target by using a new word, the program being executed by the processor to implement the above Use any new word to find any step in the method of investing in the subject.
- the method, the electronic device and the computer readable storage medium for discovering an investment target by using a new word proposed by the present application by processing a corpus text, performing a word segmentation, a stop word, and the like, extracting a new word to be determined from the corpus, and then calculating a new word to be determined
- the word frequency, coagulation degree and degree of freedom of the word screen out the real new words in the corpus text, and finally calculate the mutual information value of the new word and the company name in the corpus text to determine the final investment target, which improves the efficiency of the investment target extraction and accuracy.
- FIG. 1 is a schematic diagram of an application environment of a preferred embodiment of a method for discovering an investment target by using a new word in the present application
- FIG. 2 is a block diagram showing a procedure for discovering an investment target using a new word in FIG. 1;
- FIG. 3 is a flow chart of a preferred embodiment of a method for discovering an investment target using a new word in the present application
- FIG. 4 is a detailed flowchart of step S4 in the method for discovering an investment target by using a new word in the present application.
- the present application provides a method for discovering an investment target using a new word, which is applied to an electronic device 1.
- FIG. 1 it is a schematic diagram of an application environment of a preferred embodiment of a method for discovering an investment target using a new word in the present application.
- the electronic device 1 may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet computer, an e-book reader, or a portable computer.
- the electronic device 1 includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
- the memory 11 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like.
- the memory 11 may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1, in some embodiments.
- the memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (SMC), and a secure digital (Secure Digital) , SD) card, flash card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
- the memory 11 can be used not only for storing application software and various types of data installed in the electronic device 1, such as the program 10 for using the new word to find the investment target, the corpus 00, etc., but also for temporarily storing the data that has been output or will be output.
- the corpus refers to a corpus crawled from each website, such as a news corpus, in which a large amount of corpus is stored, and the present application extracts new words from the corpus of corpus 00 and explores the investment target according to the new words.
- the processor 12 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing stored in the memory 11. Data, such as the procedure 10 for discovering investment targets using new words.
- CPU Central Processing Unit
- controller microcontroller
- microprocessor or other data processing chip for running program code or processing stored in the memory 11.
- Data such as the procedure 10 for discovering investment targets using new words.
- Communication bus 13 is used to implement connection communication between these components.
- the network interface 14 can optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is typically used to establish a communication connection between the device and other electronic devices.
- a standard wired interface such as a WI-FI interface
- Figure 1 shows only the electronic device 1 with components 11-14, but it should be understood that not all illustrated components may be implemented, and more or fewer components may be implemented instead.
- the electronic device 1 may further include a user interface
- the user interface may include a display, an input unit such as a keyboard, and the optional user interface may further include a standard wired interface and a wireless interface.
- the display may be an LED display, a liquid crystal display, a touch liquid crystal display, and an Organic Light-Emitting Diode (OLED) touch device.
- the display may also be referred to as a display screen or display unit for displaying information processed in the electronic device 1 and a user interface for displaying visualizations.
- a program for discovering an investment target using a new word is stored in the memory 11.
- the processor 12 executes the program stored in the memory 11 to discover the investment target using the new word, the following steps are implemented:
- A1 preprocessing the corpus in the corpus, obtaining corpus text data, forming a corpus text set;
- A2 reading a pre-processed corpus text, performing word segmentation and de-stop word processing on the corpus text, and obtaining a plurality of words of the corpus text;
- A5. Calculate the mutual information value of the new word and the company name in the corpus, and extract the company name and new word whose mutual information value meets the preset condition as the reference investment target.
- the corpus refers to a plurality of different fields.
- This embodiment uses a news corpus as an example to describe a specific solution of the present application, but is not limited to the field of news.
- the web crawler When the investor needs to know the current news hotspots to obtain information about the relevant planning, research and development direction, or potential demand of the investment target company, use the web crawler to crawl the network news from the Internet, for example, crawling through Sina, Baidu, and crawling. Online news such as Tencent is used as a news corpus. Understandably, as time goes by, news hotspots will continue to change. Therefore, in order to enable investors to more accurately understand current news hotspots, filter the crawled online news in the time dimension and set the preset time interval.
- the pre-processing may unify the format of the news corpus into a text format, remove advertising noise from the news corpus, and filter one or more of dirty words, sensitive words, and stop words.
- the format of the news corpus is unified into a text format, the content that cannot be converted into a text format by the current technology can be filtered out.
- the word segmentation tool After obtaining the news corpus text, use the word segmentation tool to process the word corpus texts of each line separately, for example, using the Stanford Chinese word segmentation tool, jieba word segmentation and other word segmentation tools for word segmentation. For example, for the wording "Going to the movie last night", you will get the following result "Yesterday
- the method for segmenting the news corpus text may further include: one or more of a word segmentation based word segmentation method, an understanding based word segmentation method, a statistics based word segmentation method, and a dictionary based word segmentation method. .
- the news corpus text may be initially segmented by the branch processing, and the branch processing may be the corpus according to the punctuation branch. For example, at the punctuation such as a period, a comma, an exclamation mark, and a question mark.
- the word segmentation of the news corpus text there may be a case where the word data which should be used as a word in a certain field is divided into a plurality of word data, and thus new word discovery is required. If the adjacent words in the word segmentation result are aggregated, a new word to be determined in the news corpus text is formed.
- step A4 specifically includes:
- A41 calculating a word frequency of each pending new word of the corpus text, and filtering out a new word to be determined whose word frequency is greater than a first preset threshold;
- step A42 Calculate the degree of coagulation of each new word to be determined selected by step A41, and select a new word to be determined whose degree of coagulation is greater than a second predetermined threshold;
- step A43 Calculate the degree of freedom of each pending new word selected by step A42, and select a new word to be determined whose degree of freedom is greater than a third preset threshold as a true new word of the corpus text.
- the word frequency is represented by an Inverse Document Frequency (IDF), which characterizes the frequency of a word in a document. If the frequency of occurrence is higher, the probability that the word appears in different environments is more High, which characterizes the recognition of the word in different articles. The higher the general IDF, the higher the recognition, the more likely it is a new word. But if the IDF is very high, it means that the word is very common, and it is not necessary to enter the new word set, especially to prevent the new word pollution. In the screening step, the pending new words whose word frequency exceeds the first preset threshold (for example, more than 5 times in a news corpus text) are filtered out.
- the first preset threshold for example, more than 5 times in a news corpus text
- the pending new word selected through the above screening process may not be a word, but a phrase composed of multiple words. Therefore, in addition to the requirement of satisfying the word frequency, it is also necessary to consider the degree of coagulation of the new word to be determined, that is, the probability that each word in a pending new word appears together with other words in the pending new word. For example, in a corpus text, “movie” appeared 389 times, “cinema” only appeared 175 times, but we are more inclined to regard “cinema” as a word, because intuitively, "movie” and " The hospital” solidified more tightly.
- the words with the highest degree of coagulation are words such as "bat”, “spider”, “ ⁇ ”, “ ⁇ ”, and each word in these words almost always appears at the same time as another word, even in other The same is true for occasions.
- a second predetermined threshold eg, 0.02
- the probability that word A and word B appear alone is P(A) and P(B), respectively. If the two words are independent words, the probability that two words appear at the same time is P. (A) * P (B). If the two words are not independent, the probability that the two words appear at the same time will be greater than P(A)*P(B), ie P(C)>>P(A)*P(B). That is to say, the condition that the degree of coagulation of the pending new word exceeds the second preset threshold is:
- a and B respectively represent words in a new word to be determined
- P(C) refers to the probability that words A and B appear simultaneously
- m represents a second preset threshold.
- Degree of freedom refers to the degree of freedom of use of a word. It is not enough to see the degree of condensation inside a word. We also need to look at it externally as a whole. Taking the words “quilt” and “life” as examples, we can say “buy quilt”, “cover quilt”, “into the quilt”, “good quilt”, “this quilt”, etc., in front of the “quilt” Various words; but the usage of "lifetime” is very fixed, except for “one lifetime”, “this life”, “previous life”, “next life”, basically no words can be added in front of "lifetime”.
- the words that can appear on the left side of the word "life” are too limited, so that we may think that "lifetime” is not a separate word.
- the real word is actually the whole "lifetime” and "this life”. It can be seen that the degree of free use of a word is also an important criterion for judging whether it is a new word. If a word can be counted as a new word, it should be able to flexibly appear in a variety of different environments, with a very rich set of left and right neighbors.
- the randomness of the set of left and right words of the word can be measured by calculating the information entropy of a word.
- the word “grape” appeared four times, in which the left neighbor words are ⁇ eat, spit, eat, spit ⁇ , right
- the adjacent words are ⁇ no, leather, inverted, skin ⁇ .
- the information entropy of the left neighbor word of the word "grape” can be calculated to be about 0.693, and the information entropy of the right neighbor word is about 1.04. It can be seen that in this sentence, the word "grape” is richer in the right neighbor.
- the degree of freedom of a word takes a smaller value of its left neighbor word information entropy and right neighbor word information entropy.
- the screening step all the pending new words whose degrees of freedom are greater than the third preset threshold (for example, 1.92) are screened out as the real new words of the news prediction text, because the degree of freedom of the word "grape" is less than the third pre- If the threshold is set, the word will not be screened out as a new word.
- the third preset threshold for example, 1.92
- the information entropy calculation formula is:
- the logarithm of the formula generally takes 2 as the base, and the unit is the bit; n refers to the number of the left adjacent word or the right adjacent word; P i refers to the probability of occurrence of each left or right neighbor word.
- the company name is extracted from the news corpus text by using the word segmentation and the predetermined company name library.
- the company has mature technology from the news corpus, so it will not be described again.
- the new words finally extracted from the news corpus text include “pollutant emissions”.
- the company names included in the news corpus are Yunnan Salinization, Sany Heavy Industry, and China Power Construction, respectively calculating “pollutant emissions” and “Yunnan Salt”.
- Mutual information values of “Zheyi”, “Sany Heavy Industry” and “China Power Construction” retain the company name whose mutual information value is greater than the fourth preset threshold (for example, 0.8) as the reference investment target.
- preset thresholds and the like involved in the foregoing embodiments need to be preset parameters, and can be set by the user according to actual conditions.
- the electronic device 1 proposed in the above embodiment extracts a new word to be determined from the corpus by performing word segmentation, de-stopping, and the like on the corpus text, and then filters out the word frequency, coagulation degree, and degree of freedom of the new word to be determined.
- the real new words in the corpus text and finally calculate the mutual information value of the new word and the company name in the corpus text to determine the final investment target, which improves the efficiency and accuracy of the investment target extraction.
- the program 10 for discovering the investment target using the new word may also be divided into one or more modules, one or more modules being stored in the memory 11 and processed by one or more
- the present invention is implemented by the processor (this embodiment is the processor 12) to accomplish the present application.
- module refers to a series of computer program instructions that are capable of performing a particular function. For example, referring to FIG. 2, it is a block diagram of a program 10 for discovering an investment target using a new word in FIG. 1.
- the program 10 for discovering an investment target by using a new word may be divided into a first processing module 110,
- the two processing modules 120, the aggregation module 130, the calculation module 140, and the extraction module 150 are all similar to the above, and are not described in detail herein, for example, where:
- the first processing module 110 is configured to preprocess the corpus in the corpus, obtain corpus text data, and form a corpus text set;
- the second processing module 120 is configured to read a pre-processed corpus text, perform word segmentation and de-stop word processing on the corpus text, and obtain a plurality of words of the corpus text;
- the aggregation module 130 is configured to aggregate the adjacent segments of the corpus text, and combine the adjacent segments into a pending new word to form a pending new word set of the corpus text;
- the calculating module 140 is configured to screen out a real new word of the corpus text according to a comparison result between a word frequency, a degree of coagulation, and a degree of freedom of each pending new word in the corpus text and a preset threshold;
- the extraction module 150 is configured to calculate the mutual information value of the filtered new word and the company name in the corpus, and extract the company name and the new word whose mutual information value satisfies the preset condition as the reference investment target.
- the present application also provides a method for discovering investment targets using new words.
- a flow chart of a preferred embodiment of a method for discovering an investment target using a new word is provided in the present application.
- the method can be performed by a device that can be implemented by software and/or hardware.
- the method for discovering an investment target by using a new word includes:
- the corpus refers to a plurality of different fields.
- This embodiment uses a news corpus as an example to describe a specific solution of the present application, but is not limited to the field of news.
- the web crawler to crawl the network news from the Internet as a news corpus, for example, crawling through the crawler. , Baidu, Tencent and other online news. Understandably, as time goes by, news hotspots will continue to change. Therefore, in order to enable investors to more accurately understand current news hotspots, filter the crawled online news in the time dimension and set the preset time interval.
- the pre-processing may unify the format of the news corpus into a text format, remove advertising noise from the news corpus, and filter one or more of dirty words, sensitive words, and stop words.
- the format of the news corpus is unified into a text format, the content that cannot be converted into a text format by the current technology can be filtered out.
- the word segmentation tool After obtaining the news corpus text, use the word segmentation tool to process the word corpus texts of each line separately, for example, using the Stanford Chinese word segmentation tool, jieba word segmentation and other word segmentation tools for word segmentation. For example, for the wording "Going to the movie last night", you will get the following result "Yesterday
- the method for segmenting the news corpus text may further include: one or more of a word segmentation based word segmentation method, an understanding based word segmentation method, a statistics based word segmentation method, and a dictionary based word segmentation method. .
- the news corpus text may be initially segmented by the branch processing, and the branch processing may be the corpus according to the punctuation branch. For example, at the punctuation such as a period, a comma, an exclamation mark, and a question mark.
- the word segmentation of the news corpus text there may be a case where the word data which should be used as a word in a certain field is divided into a plurality of word data, and thus new word discovery is required. If the adjacent words in the word segmentation result are aggregated, a new word to be determined in the news corpus text is formed.
- step S4 specifically includes:
- step S43 Calculate the degree of freedom of each pending new word selected by step S42, and select a new word to be determined whose degree of freedom is greater than a third preset threshold as a true new word of the corpus text.
- the word frequency is represented by an Inverse Document Frequency (IDF), which characterizes the frequency of a word in a document. If the frequency of occurrence is higher, the probability that the word appears in different environments is more High, which characterizes the recognition of the word in different articles. The higher the general IDF, the higher the recognition, the more likely it is a new word. But if the IDF is very high, it means that the word is very common, and it is not necessary to enter the new word set, especially to prevent the new word pollution. In the screening step, the pending new words whose word frequency exceeds the first preset threshold (for example, more than 5 times in a news corpus text) are filtered out.
- the first preset threshold for example, more than 5 times in a news corpus text
- the pending new word selected through the above screening process may not be a word, but a phrase composed of multiple words. Therefore, in addition to the requirement of satisfying the word frequency, it is also necessary to consider the degree of coagulation of the new word to be determined, that is, the probability that each word in a pending new word appears together with other words in the pending new word. For example, in a corpus text, “movie” appeared 389 times, “cinema” only appeared 175 times, but we are more inclined to regard “cinema” as a word, because intuitively, "movie” and " The hospital” solidified more tightly.
- the words with the highest degree of coagulation are words such as "bat”, “spider”, “ ⁇ ”, “ ⁇ ”, and each word in these words almost always appears at the same time as another word, even in other The same is true for occasions.
- a second predetermined threshold eg, 0.02
- the probability that word A and word B appear alone is P(A) and P(B), respectively. If the two words are independent words, the probability that two words appear at the same time is P. (A) * P (B). If the two words are not independent, the probability that the two words appear at the same time will be greater than P(A)*P(B), ie P(C)>>P(A)*P(B). That is to say, the condition that the degree of coagulation of the pending new word exceeds the second preset threshold is:
- a and B respectively represent words in a new word to be determined
- P(C) refers to the probability that words A and B appear simultaneously
- m represents a second preset threshold.
- Degree of freedom refers to the degree of freedom of use of a word. It is not enough to see the degree of condensation inside a word. We also need to look at it externally as a whole. Taking the words “quilt” and “life” as examples, we can say “buy quilt”, “cover quilt”, “into the quilt”, “good quilt”, “this quilt”, etc., in front of the “quilt” Various words; but the usage of "lifetime” is very fixed, except for “one lifetime”, “this life”, “previous life”, “next life”, basically no words can be added in front of "lifetime”.
- the words that can appear on the left side of the word "life” are too limited, so that we may think that "lifetime” is not a separate word.
- the real word is actually the whole "lifetime” and "this life”. It can be seen that the degree of free use of a word is also an important criterion for judging whether it is a new word. If a word can be counted as a new word, it should be able to flexibly appear in a variety of different environments, with a very rich set of left and right neighbors.
- the randomness of the set of left and right words of the word can be measured by calculating the information entropy of a word.
- the word “grape” appeared four times, in which the left neighbor words are ⁇ eat, spit, eat, spit ⁇ , right
- the adjacent words are ⁇ no, leather, inverted, skin ⁇ .
- the information entropy of the left neighbor word of the word "grape” can be calculated to be about 0.693, and the information entropy of the right neighbor word is about 1.04. It can be seen that in this sentence, the word "grape” is richer in the right neighbor.
- the degree of freedom of a word takes a smaller value of its left neighbor word information entropy and right neighbor word information entropy.
- the screening step all the pending new words whose degrees of freedom are greater than the third preset threshold (for example, 1.92) are screened out as the real new words of the news prediction text, because the degree of freedom of the word "grape" is less than the third pre- If the threshold is set, the word will not be screened out as a new word.
- the third preset threshold for example, 1.92
- the information entropy calculation formula is:
- the logarithm of the formula generally takes 2 as the base, and the unit is the bit; n refers to the number of the left adjacent word or the right adjacent word; P i refers to the probability of occurrence of each left or right neighbor word.
- the company name is extracted from the news corpus text by using the word segmentation and the predetermined company name library.
- the company has mature technology from the news corpus, so it will not be described again.
- the new words finally extracted from the news corpus text include “pollutant emissions”.
- the company names included in the news corpus are Yunnan Salinization, Sany Heavy Industry, and China Power Construction, respectively calculating “pollutant emissions” and “Yunnan Salt”.
- Mutual information values of “Zheyi”, “Sany Heavy Industry” and “China Power Construction” retain the company name whose mutual information value is greater than the fourth preset threshold (for example, 0.8) as the reference investment target.
- preset thresholds and the like involved in the foregoing embodiments need to be preset parameters, and can be set by the user according to actual conditions.
- the method for discovering the investment target by using the new word proposed in the above embodiment by processing the corpus text, terminating and stopping the word, extracting the new word to be determined from the corpus, and then calculating the word frequency, coagulation degree and freedom of the new word to be determined. Degree, screen out the real new words in the corpus text, and finally calculate the mutual information value of the new word and the company name in the corpus text to determine the final investment target, which improves the efficiency and accuracy of the investment target extraction.
- the embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium stores a program for discovering an investment target by using a new word, and when the program is executed by the processor, the following operations are implemented:
- A1 preprocessing the corpus in the corpus, obtaining corpus text data, forming a corpus text set;
- A2 reading a pre-processed corpus text, performing word segmentation and de-stop word processing on the corpus text, and obtaining a plurality of words of the corpus text;
- A5. Calculate the mutual information value of the new word and the company name in the corpus, and extract the company name and new word whose mutual information value meets the preset condition as the reference investment target.
- the step A4 comprises:
- A41 calculating a word frequency of each pending new word of the corpus text, and filtering out a new word to be determined whose word frequency is greater than a first preset threshold;
- step A42 Calculate the degree of coagulation of each new word to be determined selected by step A41, and select a new word to be determined whose degree of coagulation is greater than a second predetermined threshold;
- step A43 Calculate the degree of freedom of each pending new word selected by step A42, and select a new word to be determined whose degree of freedom is greater than a third preset threshold as a true new word of the corpus text.
- step A42 calculates the degree of freedom of each pending new word selected by step A42.
- the specific embodiment of the computer readable storage medium of the present application is substantially the same as the method and the electronic device for discovering the investment target by using the new word, and is not described herein.
- the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM as described above). , a disk, an optical disk, including a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the various embodiments of the present application.
- a terminal device which may be a mobile phone, a computer, a server, or a network device, etc.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Machine Translation (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种利用新词发现投资标的的方法、电子装置及计算机可读存储介质,该方法包括:对语料库中的语料进行预处理,得到语料文本数据(S1);读取经过预处理的语料文本,对该语料文本进行分词及去停用词处理,得到该语料文本的多个词段(S2);对该语料文本相邻的词段进行汇聚,将相邻的词段组合成待定新词(S3);根据该语料文本中每个待定新词的词频、凝固度及自由度与预设阈值的比较结果,筛选出该语料文本真正的新词(S4);及,计算筛选出的新词与公司名称在语料库中的互信息值,提取互信息值满足预设条件的公司名称及新词作为参考投资标的(S5)。该方案从新闻语料中筛选出的新词提取投资标的,提高投资效率及准确率。
Description
优先权申明
本申请基于巴黎公约申明享有2017年11月1日递交的申请号为CN201711059221.6、名称为“利用新词发现投资标的的方法、装置及存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合本申请中。
本申请涉及计算机技术领域,尤其涉及一种利用新词发现投资标的的方法、电子装置及计算机可读存储介质。
目前,在观察投资标的角度上,投资者缺乏对投资对象与热点主题的关联的观察,而这个观察可以在一定程度上提高对投资标的的业务规划、研发重点、业务增长、原料需求、团队建设等方面的预期认识。
随着网络的普及,每个新闻网站每天有成千上万条新闻,并且新闻会实时更新。如果能从海量的新闻语料中,提取并分析出当前市场的热点主题以及热点主题所涉及的企业,那么从投资者的角度来说,就可以得到投资标的企业的相关规划、研发方向、或潜在需求,进而发现商机、抢占商机。因此,如何从新闻语料中提取并分析新词,并利用从新闻语料中提取的新词发现投资标的是急需解决的问题。
发明内容
本申请提供一种利用新词发现投资标的的方法、电子装置及计算机可读存储介质,其主要目的在于通过从新闻语料中筛选并分析新词,并利用从新闻语料中筛选出的新词提取投资标的。
为实现上述目的,本申请提供一种电子装置,该装置包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的利用新词发现投资标的的程序,该程序被所述处理器执行时实现如下步骤:
A1、对语料库中的语料进行预处理,得到语料文本数据,形成语料文本集;
A2、读取一条经过预处理的语料文本,对该语料文本进行分词及去停用词处理,得到该语料文本的多个词段;
A3、对该语料文本相邻的词段进行汇聚,将相邻的词段组合成待定新词,构成该语料文本的待定新词集合;
A4、根据该语料文本中每个待定新词的词频、凝固度及自由度与预设阈值的比较结果,筛选出该语料文本真正的新词;及
A5、计算筛选出的新词与公司名称在语料库中的互信息值,提取互信息值满足预设条件的公司名称及新词作为参考投资标的。
此外,为实现上述目的,本申请还提供一种利用新词发现投资标的的方法,该方法包括:
S1、对语料库中的语料进行预处理,得到语料文本数据,形成语料文本集;
S2、读取一条经过预处理的语料文本,对该语料文本进行分词及去停用词处理,得到该语料文本的多个词段;
S3、对该语料文本相邻的词段进行汇聚,将相邻的词段组合成待定新词,构成该语料文本的待定新词集合;
S4、根据该语料文本中每个待定新词的词频、凝固度及自由度与预设阈值的比较结果,筛选出该语料文本真正的新词;及
S5、计算筛选出的新词与公司名称在语料库中的互信息值,提取互信息值满足预设条件的公司名称及新词作为参考投资标的。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有利用新词发现投资标的的程序,该程序被处理器执行时实现如上所述的利用新词发现投资标的的方法的任意步骤。
本申请提出的利用新词发现投资标的的方法、电子装置及计算机可读存储介质,通过对语料文本进行分词、去停用词等处理,从语料中提取出待定新词,然后通过计算待定新词的词频、凝固度及自由度,筛选出该语料文本中真正的新词,最后计算新词与该语料文本中公司名称的互信息值确定最终的投资标的,提升了投资标的提取的效率及准确性。
图1为本申请利用新词发现投资标的的方法较佳实施例的应用环境示意图;
图2为图1中利用新词发现投资标的的程序的模块示意图;
图3为本申请利用新词发现投资标的的方法较佳实施例的流程图;
图4为本申请利用新词发现投资标的的方法中步骤S4的细化流程图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种利用新词发现投资标的的方法,该方法应用于一种电子装置1。参照图1所示,为本申请利用新词发现投资标的的方法较佳实施例的应用环境示意图。
在本实施例中,所述电子装置1可以是PC(Personal Computer,个人电脑),也可以是智能手机、平板电脑、电子书阅读器、便携计算机等终端设备。该电子装置1包括存储器11、处理器12,通信总线13,以及网络接口14。
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是所述电子装置1的内部存储单元,例如该电子装置1的硬盘。存储器11在另一些实施例中也可以是所述电子装置1的外部存储设备,例如该电子装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括该电子装置1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于该电子装置1的应用软件及各类数据,例如利用新词发现投资标的的程序10及语料库00等,还可以用于暂时地存储已经输出或者将要输出的数据。具体地,语料指从各网站爬取的语料,例如新闻语料,所述语料库00中保存有大 量语料,本申请即从语料库00的语料中提取新词,并根据新词探索投资标的。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如利用新词发现投资标的的程序10等。
通信总线13用于实现这些组件之间的连接通信。
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置与其他电子设备之间建立通信连接。
图1仅示出了具有组件11-14的电子装置1,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
可选地,该电子装置1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括标准的有线接口、无线接口。
可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及有机发光二极管(Organic Light-Emitting Diode,OLED)触摸器等。其中,显示器也可以称为显示屏或显示单元,用于显示在电子装置1中处理的信息以及用于显示可视化的用户界面。
在图1所示的装置实施例中,存储器11中存储有利用新词发现投资标的的程序。处理器12执行存储器11中存储的利用新词发现投资标的的程序时实现如下步骤:
A1、对语料库中的语料进行预处理,得到语料文本数据,形成语料文本集;
A2、读取一条经过预处理的语料文本,对该语料文本进行分词及去停用词处理,得到该语料文本的多个词段;
A3、对该语料文本相邻的词段进行汇聚,将相邻的词段组合成待定新词,构成该语料文本的待定新词集合;
A4、根据该语料文本中每个待定新词的词频、凝固度及自由度与预设阈值的比较结果,筛选出该语料文本真正的新词;及
A5、计算筛选出的新词与公司名称在语料库中的互信息值,提取互信息值满足预设条件的公司名称及新词作为参考投资标的。
语料涉及多个不同的领域,本实施例以新闻语料为例,对本申请的具体方案进行说明,但不仅仅限于新闻领域。当投资方需要了解时下的新闻热点,以获取投资标的企业的相关规划、研发方向、或潜在需求等信息时,利用网络爬虫从互联网中爬取网络新闻,例如,通过爬虫爬取新浪、百度、腾讯等的网络新闻作为新闻语料。可以理解的是,随着时间的推移,新闻热点也会不断改变,因此,为了使投资者更准确的了解时下新闻热点,在时间维度上对爬取的网络新闻进行过滤,设置预设时间区间,只爬取该时间段的网络新闻,例如,只爬取当日的网络新闻。然后对爬取的网络新闻进行去重处理,并将网络新闻的标题存入语料库00中。由于新闻语料的来源具有多样性,因此,语料中格式类型比较多,为便于对语料进行后续处理,需对新闻语料进行预处理,得到新闻语料文本数据,形成新闻语料文本集。
在具体实施中,所述预处理可以将新闻语料的格式统一为文本格式,从新闻语料中去除广告噪声并过滤脏词、敏感词和停用词中的一种或多种。在将新闻语料的格式统一为文本格式时,可以将当前技术暂不能转换为文本格式的内容过滤掉。
在获取新闻语料文本后,使用分词工具逐个对获取到的每一行新闻语料文本进行分词处理,例如使用Stanford汉语分词工具、jieba分词等分词工具进行分词处理。例如,对于“昨天晚上去看了电影”进行分词,会得到如下结果“昨天|晚上|去|看|了|电影”。分词处理后保留分词结果。可以理解的是,为了进一步提高分词结果的有效性,对分词结果进行去停用词处理,去除语气助词、副词、介词、连接词形容词等无法体现新闻语料主题的功能词,这些功能词通常自身并无明确的意义,只有将其放入一个完整的句子中才有一定作用,如常见的“的”、“在”、“这”、“那”、“上”、“下”、“哪”,等等。在其他实施例中,对新闻预料文本进行分词处理后,最终只保留分词结果中的动词和/或名词的词段,例如上述例子中,可以只保留“电影”这个词。可以理解的是,经过分词处理后的分词结果可能为空,则过滤掉对应行的文本。在其他实施例中,对新闻语料文本进行分词的方法还可以包括:基于字符串匹配的分词方法、基于理解的分词方法、基于统计的分词方法及基于词典的分词方法中的一种或多种。
在其他实施例中,为了便于确定后续分词处理的范围,也可以在对每条 新闻语料文本进行分词处理之前,可通过分行处理对新闻语料文本进行初步分割,分行处理可以是对语料按照标点分行,例如在出现句号、逗号、叹号、问号等标点处分行。
然而,经过分词处理后的新闻语料文本,可能会出现将在某个领域内本应作为一个词的词语数据分成多个词语数据的情况,因此需要新词发现。若将分词结果中的相邻词段进行汇聚,形成新闻语料文本的待定新词。
接下来,需要从新闻语料文本的待定新词中确定新闻语料文本真正的新词,在其他实施例中,步骤A4具体包括:
A41、计算该语料文本的每个待定新词的词频,筛选出词频大于第一预设阈值的待定新词;
A42、计算步骤A41筛选出的每个待定新词的凝固度,从中筛选出凝固度大于第二预设阈值的待定新词;及
A43、计算步骤A42筛选出的每个待定新词的自由度,从中筛选出自由度大于第三预设阈值的待定新词作为该语料文本的真正新词。
可以理解的是,要从一条新闻语料文本中抽取新词,要明确的是:什么样的词才算一个新词?首先看这个词在一份语料文本、或是语料库00中出现的次数是否足够多,即词频。在本实施例中,词频通过逆向文件频率(Inverse Document Frequency,IDF)体现,IDF表征了一个词在文档中的频次,如果出现的频次越高,说明这个词在不同的环境中出现的概率更高,表征了该词在不同文章中的认同度。一般IDF越高,说明其认可度越高,越有可能是新词。但是如果IDF非常高,反而代表这个词非常普通,不一定有必要进入到新词集,尤其是为了防止造成新词污染。在该筛选步骤中,将所有词频超过第一预设阈值(例如在一条新闻语料文本中出现的次数超过5次)的待定新词筛选出来。
然而,经过上述筛选过程筛选出的待定新词有可能不是一个词,而是多个词构成的词组。因此,处理满足词频的要求之外,还需要考虑待定新词的凝固度,即一个待定新词中每个字与该待定新词中其他字一起出现的概率。例如在一条语料文本中,“的电影”出现了389次,“电影院”只出现了175次,然而我们却更倾向于把“电影院”当作一个词,因为直觉上看,“电影”和“院”凝固得更紧一些。凝固度最高的词就是诸如“蝙蝠”、“蜘蛛”、“彷徨”、“忐忑” 之类的词了,这些词里的每一个字几乎总是会和另一个字同时出现,即使是在其他场合中使用也如此。在该筛选步骤中,将所有凝固度超过第二预设阈值(例如0.02)的待定新词筛选出来。
具体地,以二元组词为例,词A和词B单独出现的概率分别是P(A)和P(B),假设这两个词是独立词则两个词同时出现的概率为P(A)*P(B)。若这两个词不是独立的,则两个词同时出现的概率会大于P(A)*P(B),即P(C)>>P(A)*P(B)。也就是说,待定新词的凝固度超过第二预设阈值需要满足的条件为:
P(C)-P(A)*P(B)>m
其中,A、B分别表示待定新词中的词,P(C)指词A、B同时出现的概率,m表示第二预设阈值。
除了满足上述词频及凝固度的要求之外,还要考虑一个词的自由度。自由度是指一个词的自由运用程度。光看一个词内部的凝合程度还不够,我们还需要从整体来看它在外部的表现。以“被子”和“辈子”这两个词为例,我们可以说“买被子”、“盖被子”、“进被子”、“好被子”、“这被子”等,在“被子”前面加各种字;但“辈子”的用法却非常固定,除了“一辈子”、“这辈子”、“上辈子”、“下辈子”,基本上“辈子”前面不能加别的字了。“辈子”这个词左边可以出现的字太有限,以至于直觉上我们可能会认为,“辈子”并不单独成词,真正成词的其实是“一辈子”、“这辈子”之类的整体。可见,一个词的自由运用程度也是判断它是否成新词的重要标准。如果一个词能够算作一个新词的话,它应该能够灵活地出现在各种不同的环境中,具有非常丰富的左邻字集合和右邻字集合。可以通过计算一个词的信息熵来衡量这个词的左邻字集合和右邻字集合的随机性。例如,在“吃葡萄不吐葡萄皮不吃葡萄倒吐葡萄皮”这句话中,“葡萄”一词出现了四次,其中左邻字分别为{吃,吐,吃,吐},右邻字分别为{不,皮,倒,皮}。根据信息熵计算公式,可分别计算得到“葡萄”一词的左邻字的信息熵约为0.693,右邻字的信息熵约为1.04。可见,在这个句子中,“葡萄”一词的右邻字更丰富。在本实施例中,一个词的自由度取其的左邻字信息熵和右邻字信息熵中的较小值。在该筛选步骤中,将所有自由度大于第三预设阈值(例如1.92)的待定新词筛选出来,作为该新闻预料文本真正的新词,因为“葡萄”一词的自由度小于第三预设阈值,则不会讲该词筛选出来作为新词。
具体地,所述信息熵计算公式为:
其中,式中对数一般取2为底,单位为比特;n指左邻字或右邻字的个数;P
i指出现每个左邻字或右邻字的概率。
进一步地,利用分词及预先确定的公司名称库从新闻语料文本中提取出公司名称,目前从新闻语料中提取公司名称已有成熟的技术,故不再赘述。假设从新闻语料文本中最终提取的新词包括“污染物排放”,新闻语料中包含的公司名称有云南盐化、三一重工、中国电建,则分别计算“污染物排放”与“云南盐化”、“三一重工”、“中国电建”的互信息值,并将互信息值大于第四预设阈值(例如0.8)的公司名保留下来,作为参考投资标的。
可以理解的是,上述各实施例中涉及到的预设阈值等需要预先设置的参数,可以用户根据实际情况进行设置。
上述实施例提出的电子装置1,通过对语料文本进行分词、去停用词等处理,从语料中提取出待定新词,然后通过计算待定新词的词频、凝固度及自由度,筛选出该语料文本中真正的新词,最后计算新词与该语料文本中公司名称的互信息值确定最终的投资标的,提升了投资标的提取的效率及准确性。
可选地,在其他的实施例中,利用新词发现投资标的的程序10还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行,以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段。例如,参照图2所示,为图1中利用新词发现投资标的的程序10的模块示意图,该实施例中,利用新词发现投资标的的程序10可以被分割为第一处理模块110、第二处理模块120、汇聚模块130、计算模块140以及提取模块150,所述模块110-150所实现的功能或操作步骤均与上文类似,此处不再详述,示例性地,例如其中:
第一处理模块110,用于对语料库中的语料进行预处理,得到语料文本数据,形成语料文本集;
第二处理模块120,用于读取一条经过预处理的语料文本,对该语料文本进行分词及去停用词处理,得到该语料文本的多个词段;
汇聚模块130,用于对该语料文本相邻的词段进行汇聚,将相邻的词段组合成待定新词,构成该语料文本的待定新词集合;
计算模块140,用于根据该语料文本中每个待定新词的词频、凝固度及自由度与预设阈值的比较结果,筛选出该语料文本真正的新词;及
提取模块150,用于计算筛选出的新词与公司名称在语料库中的互信息值,提取互信息值满足预设条件的公司名称及新词作为参考投资标的。
此外,本申请还提供一种利用新词发现投资标的的方法。参照图3所示,为本申请利用新词发现投资标的的方法较佳实施例的流程图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。
在本实施例中,利用新词发现投资标的的方法包括:
S1、对语料库中的语料进行预处理,得到语料文本数据,形成语料文本集;
S2、读取一条经过预处理的语料文本,对该语料文本进行分词及去停用词处理,得到该语料文本的多个词段;
S3、对该语料文本相邻的词段进行汇聚,将相邻的词段组合成待定新词,构成该语料文本的待定新词集合;
S4、根据该语料文本中每个待定新词的词频、凝固度及自由度与预设阈值的比较结果,筛选出该语料文本真正的新词;及
S5、计算筛选出的新词与公司名称在语料库中的互信息值,提取互信息值满足预设条件的公司名称及新词作为参考投资标的。
语料涉及多个不同的领域,本实施例以新闻语料为例,对本申请的具体方案进行说明,但不仅仅限于新闻领域。当投资方需要了解时下的新闻热点,以获取投资标的企业的相关规划、研发方向、或潜在需求等信息时,利用网络爬虫从互联网中爬取网络新闻作为新闻语料,例如,通过爬虫爬取新浪、百度、腾讯等的网络新闻。可以理解的是,随着时间的推移,新闻热点也会不断改变,因此,为了使投资者更准确的了解时下新闻热点,在时间维度上对爬取的网络新闻进行过滤,设置预设时间区间,只爬取该时间段的网络新闻,例如,只爬取当日的网络新闻。然后对爬取的网络新闻进行去重处理,并将网络新闻的标题存入语料库中。由于新闻语料的来源具有多样性,因此, 语料中格式类型比较多,为便于对语料进行后续处理,需对新闻语料进行预处理,得到新闻语料文本数据,形成新闻语料文本集。
在具体实施中,所述预处理可以将新闻语料的格式统一为文本格式,从新闻语料中去除广告噪声并过滤脏词、敏感词和停用词中的一种或多种。在将新闻语料的格式统一为文本格式时,可以将当前技术暂不能转换为文本格式的内容过滤掉。
在获取新闻语料文本后,使用分词工具逐个对获取到的每一行新闻语料文本进行分词处理,例如使用Stanford汉语分词工具、jieba分词等分词工具进行分词处理。例如,对于“昨天晚上去看了电影”进行分词,会得到如下结果“昨天|晚上|去|看|了|电影”。分词处理后保留分词结果。可以理解的是,为了进一步提高分词结果的有效性,对分词结果进行去停用词处理,去除语气助词、副词、介词、连接词形容词等无法体现新闻语料主题的功能词,这些功能词通常自身并无明确的意义,只有将其放入一个完整的句子中才有一定作用,如常见的“的”、“在”、“这”、“那”、“上”、“下”、“哪”,等等。在其他实施例中,对新闻预料文本进行分词处理后,最终只保留分词结果中的动词和/或名词的词段,例如上述例子中,可以只保留“电影”这个词。可以理解的是,经过分词处理后的分词结果可能为空,则过滤掉对应行的文本。在其他实施例中,对新闻语料文本进行分词的方法还可以包括:基于字符串匹配的分词方法、基于理解的分词方法、基于统计的分词方法及基于词典的分词方法中的一种或多种。
在其他实施例中,为了便于确定后续分词处理的范围,也可以在对每条新闻语料文本进行分词处理之前,可通过分行处理对新闻语料文本进行初步分割,分行处理可以是对语料按照标点分行,例如在出现句号、逗号、叹号、问号等标点处分行。
然而,经过分词处理后的新闻语料文本,可能会出现将在某个领域内本应作为一个词的词语数据分成多个词语数据的情况,因此需要新词发现。若将分词结果中的相邻词段进行汇聚,形成新闻语料文本的待定新词。
接下来,需要从新闻语料文本的待定新词中确定新闻语料文本真正的新词,参照图4所示,是本申请利用新词发现投资标的的方法中步骤S4的细化流程示意图,在其他实施例中,步骤S4具体包括:
S41、计算该语料文本的每个待定新词的词频,筛选出词频大于第一预设阈值的待定新词;
S42、计算步骤S41筛选出的每个待定新词的凝固度,从中筛选出凝固度大于第二预设阈值的待定新词;及
S43、计算步骤S42筛选出的每个待定新词的自由度,从中筛选出自由度大于第三预设阈值的待定新词作为该语料文本的真正新词。
可以理解的是,要从一条新闻语料文本中抽取新词,要明确的是:什么样的词才算一个新词?首先看这个词在一份语料文本、或是语料库中出现的次数是否足够多,即词频。在本实施例中,词频通过逆向文件频率(Inverse Document Frequency,IDF)体现,IDF表征了一个词在文档中的频次,如果出现的频次越高,说明这个词在不同的环境中出现的概率更高,表征了该词在不同文章中的认同度。一般IDF越高,说明其认可度越高,越有可能是新词。但是如果IDF非常高,反而代表这个词非常普通,不一定有必要进入到新词集,尤其是为了防止造成新词污染。在该筛选步骤中,将所有词频超过第一预设阈值(例如在一条新闻语料文本中出现的次数超过5次)的待定新词筛选出来。
然而,经过上述筛选过程筛选出的待定新词有可能不是一个词,而是多个词构成的词组。因此,处理满足词频的要求之外,还需要考虑待定新词的凝固度,即一个待定新词中每个字与该待定新词中其他字一起出现的概率。例如在一条语料文本中,“的电影”出现了389次,“电影院”只出现了175次,然而我们却更倾向于把“电影院”当作一个词,因为直觉上看,“电影”和“院”凝固得更紧一些。凝固度最高的词就是诸如“蝙蝠”、“蜘蛛”、“彷徨”、“忐忑”之类的词了,这些词里的每一个字几乎总是会和另一个字同时出现,即使是在其他场合中使用也如此。在该筛选步骤中,将所有凝固度超过第二预设阈值(例如0.02)的待定新词筛选出来。
具体地,以二元组词为例,词A和词B单独出现的概率分别是P(A)和P(B),假设这两个词是独立词则两个词同时出现的概率为P(A)*P(B)。若这两个词不是独立的,则两个词同时出现的概率会大于P(A)*P(B),即P(C)>>P(A)*P(B)。也就是说,待定新词的凝固度超过第二预设阈值需要满足的条件为:
P(C)-P(A)*P(B)>m
其中,A、B分别表示待定新词中的词,P(C)指词A、B同时出现的概率,m表示第二预设阈值。
除了满足上述词频及凝固度的要求之外,还要考虑一个词的自由度。自由度是指一个词的自由运用程度。光看一个词内部的凝合程度还不够,我们还需要从整体来看它在外部的表现。以“被子”和“辈子”这两个词为例,我们可以说“买被子”、“盖被子”、“进被子”、“好被子”、“这被子”等,在“被子”前面加各种字;但“辈子”的用法却非常固定,除了“一辈子”、“这辈子”、“上辈子”、“下辈子”,基本上“辈子”前面不能加别的字了。“辈子”这个词左边可以出现的字太有限,以至于直觉上我们可能会认为,“辈子”并不单独成词,真正成词的其实是“一辈子”、“这辈子”之类的整体。可见,一个词的自由运用程度也是判断它是否成新词的重要标准。如果一个词能够算作一个新词的话,它应该能够灵活地出现在各种不同的环境中,具有非常丰富的左邻字集合和右邻字集合。可以通过计算一个词的信息熵来衡量这个词的左邻字集合和右邻字集合的随机性。例如,在“吃葡萄不吐葡萄皮不吃葡萄倒吐葡萄皮”这句话中,“葡萄”一词出现了四次,其中左邻字分别为{吃,吐,吃,吐},右邻字分别为{不,皮,倒,皮}。根据信息熵计算公式,可分别计算得到“葡萄”一词的左邻字的信息熵约为0.693,右邻字的信息熵约为1.04。可见,在这个句子中,“葡萄”一词的右邻字更丰富。在本实施例中,一个词的自由度取其的左邻字信息熵和右邻字信息熵中的较小值。在该筛选步骤中,将所有自由度大于第三预设阈值(例如1.92)的待定新词筛选出来,作为该新闻预料文本真正的新词,因为“葡萄”一词的自由度小于第三预设阈值,则不会讲该词筛选出来作为新词。
具体地,所述信息熵计算公式为:
其中,式中对数一般取2为底,单位为比特;n指左邻字或右邻字的个数;P
i指出现每个左邻字或右邻字的概率。
进一步地,利用分词及预先确定的公司名称库从新闻语料文本中提取出公司名称,目前从新闻语料中提取公司名称已有成熟的技术,故不再赘述。假设从新闻语料文本中最终提取的新词包括“污染物排放”,新闻语料中包含的公司名称有云南盐化、三一重工、中国电建,则分别计算“污染物排放”与“云南盐化”、“三一重工”、“中国电建”的互信息值,并将互信息值大于第四预设 阈值(例如0.8)的公司名保留下来,作为参考投资标的。
可以理解的是,上述各实施例中涉及到的预设阈值等需要预先设置的参数,可以用户根据实际情况进行设置。
上述实施例提出的利用新词发现投资标的的方法,通过对语料文本进行分词、去停用词等处理,从语料中提取出待定新词,然后通过计算待定新词的词频、凝固度及自由度,筛选出该语料文本中真正的新词,最后计算新词与该语料文本中公司名称的互信息值确定最终的投资标的,提升了投资标的提取的效率及准确性。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有利用新词发现投资标的的程序,该程序被处理器执行时实现如下操作:
A1、对语料库中的语料进行预处理,得到语料文本数据,形成语料文本集;
A2、读取一条经过预处理的语料文本,对该语料文本进行分词及去停用词处理,得到该语料文本的多个词段;
A3、对该语料文本相邻的词段进行汇聚,将相邻的词段组合成待定新词,构成该语料文本的待定新词集合;
A4、根据该语料文本中每个待定新词的词频、凝固度及自由度与预设阈值的比较结果,筛选出该语料文本真正的新词;及
A5、计算筛选出的新词与公司名称在语料库中的互信息值,提取互信息值满足预设条件的公司名称及新词作为参考投资标的。
优选地,所述步骤A4包括:
A41、计算该语料文本的每个待定新词的词频,筛选出词频大于第一预设阈值的待定新词;
A42、计算步骤A41筛选出的每个待定新词的凝固度,从中筛选出凝固度大于第二预设阈值的待定新词;及
A43、计算步骤A42筛选出的每个待定新词的自由度,从中筛选出自由度大于第三预设阈值的待定新词作为该语料文本的真正新词。
优选地,所述“计算步骤A42筛选出的每个待定新词的自由度”的步骤包 括:
分别计算通过步骤A42筛选出的每个待定新词的左邻字信息熵和右邻字信息熵;及
取每个待定新词的左邻字信息熵和右邻字信息熵中的较小值,作为该新词的自由度。
本申请计算机可读存储介质具体实施方式与上述利用新词发现投资标的的方法和电子装置各实施例基本相同,在此不作累述。
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。
Claims (20)
- 一种利用新词发现投资标的的方法,应用于电子装置,其特征在于,该方法包括:S1、对语料库中的语料进行预处理,得到语料文本数据,形成语料文本集;S2、读取一条经过预处理的语料文本,对该语料文本进行分词及去停用词处理,得到该语料文本的多个词段;S3、对该语料文本相邻的词段进行汇聚,将相邻的词段组合成待定新词,构成该语料文本的待定新词集合;S4、根据该语料文本中每个待定新词的词频、凝固度及自由度与预设阈值的比较结果,筛选出该语料文本真正的新词;及S5、计算筛选出的新词与公司名称在语料库中的互信息值,提取互信息值满足预设条件的公司名称及新词作为参考投资标的。
- 如权利要求1所述的利用新词发现投资标的的方法,其特征在于,所述步骤S1中的预处理包括:将语料库中语料的格式统一为文本格式,从语料中去除广告噪声。
- 如权利要求1所述的利用新词发现投资标的的方法,其特征在于,所述对该语料文本进行分词的方法包括:基于字符串匹配的分词方法、基于理解的分词方法、基于统计的分词方法及基于词典的分词方法。
- 如权利要求3所述的利用新词发现投资标的的方法,其特征在于,所述步骤S2还包括:在对所述语料文本进行分词及去停用词处理之前,对所述语料文本按照标点进行分行处理。
- 如权利要求1所述的利用新词发现投资标的的方法,其特征在于,所述步骤S4包括:S41、计算该语料文本的每个待定新词的词频,筛选出词频大于第一预设阈值的待定新词;S42、计算步骤S41筛选出的每个待定新词的凝固度,从中筛选出凝固度大于第二预设阈值的待定新词;及S43、计算步骤S42筛选出的每个待定新词的自由度,从中筛选出自由度 大于第三预设阈值的待定新词作为该语料文本的真正新词。
- 如权利要求5所述的利用新词发现投资标的的方法,其特征在于,所述“计算步骤S42筛选出的每个待定新词的自由度”的步骤包括:分别计算通过步骤S42筛选出的每个待定新词的左邻字信息熵和右邻字信息熵;及取每个待定新词的左邻字信息熵和右邻字信息熵中的较小值,作为该待定新词的自由度。
- 一种电子装置,其特征在于,该装置包括:存储器、处理器,所述存储器上存储有可在所述处理器上运行的利用新词发现投资标的的程序,该程序被所述处理器执行时实现如下步骤:A1、对语料库中的语料进行预处理,得到语料文本数据,形成语料文本集;A2、读取一条经过预处理的语料文本,对该语料文本进行分词及去停用词处理,得到该语料文本的多个词段;A3、对该语料文本相邻的词段进行汇聚,将相邻的词段组合成待定新词,构成该语料文本的待定新词集合;A4、根据该语料文本中每个待定新词的词频、凝固度及自由度与预设阈值的比较结果,筛选出该语料文本真正的新词;及A5、计算筛选出的新词与公司名称在语料库中的互信息值,提取互信息值满足预设条件的公司名称及新词作为参考投资标的。
- 根据权利要求8所述的电子装置,其特征在于,所述步骤A1中的预处理包括:将语料库中语料的格式统一为文本格式,从新闻语料中去除广告噪声。
- 如权利要求8所述的电子装置,其特征在于,所述对该语料文本进行分词的方法包括:基于字符串匹配的分词方法、基于理解的分词方法、基 于统计的分词方法及基于词典的分词方法。
- 如权利要求8所述的电子装置,其特征在于,所述步骤A2还包括:在对所述语料文本进行分词及去停用词处理之前,对所述语料文本按照标点进行分行处理。
- 如权利要求8所述的电子装置,其特征在于,所述步骤A4包括:A41、计算该语料文本的每个待定新词的词频,筛选出词频大于第一预设阈值的待定新词;A42、计算步骤A41筛选出的每个待定新词的凝固度,从中筛选出凝固度大于第二预设阈值的待定新词;及A43、计算步骤A42筛选出的每个待定新词的自由度,从中筛选出自由度大于第三预设阈值的待定新词作为该语料文本的真正新词。
- 如权利要求12所述的电子装置,其特征在于,所述“计算步骤A42筛选出的每个待定新词的自由度”的步骤包括:分别计算通过步骤A42筛选出的每个待定新词的左邻字信息熵和右邻字信息熵;及取每个待定新词的左邻字信息熵和右邻字信息熵中的较小值,作为该新词的自由度。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有利用新词发现投资标的的程序,该程序被处理器执行时实现如下步骤:A1、对语料库中的语料进行预处理,得到语料文本数据,形成语料文本集;A2、读取一条经过预处理的语料文本,对该语料文本进行分词及去停用词处理,得到该语料文本的多个词段;A3、对该语料文本相邻的词段进行汇聚,将相邻的词段组合成待定新词, 构成该语料文本的待定新词集合;A4、根据该语料文本中每个待定新词的词频、凝固度及自由度与预设阈值的比较结果,筛选出该语料文本真正的新词;及A5、计算筛选出的新词与公司名称在语料库中的互信息值,提取互信息值满足预设条件的公司名称及新词作为参考投资标的。
- 根据权利要求15所述的计算机可读存储介质,其特征在于,所述步骤A1中的预处理包括:将语料库中语料的格式统一为文本格式,从新闻语料中去除广告噪声。
- 如权利要求15所述的计算机可读存储介质,其特征在于,所述对该语料文本进行分词的方法包括:基于字符串匹配的分词方法、基于理解的分词方法、基于统计的分词方法及基于词典的分词方法。
- 如权利要求15所述的计算机可读存储介质,其特征在于,所述步骤A2还包括:在对所述语料文本进行分词及去停用词处理之前,对所述语料文本按照标点进行分行处理。
- 如权利要求15所述的计算机可读存储介质,其特征在于,所述步骤A4包括:A41、计算该语料文本的每个待定新词的词频,筛选出词频大于第一预设阈值的待定新词;A42、计算步骤A41筛选出的每个待定新词的凝固度,从中筛选出凝固度大于第二预设阈值的待定新词;及A43、计算步骤A42筛选出的每个待定新词的自由度,从中筛选出自由度大于第三预设阈值的待定新词作为该语料文本的真正新词。
- 如权利要求19所述的计算机可读存储介质,其特征在于,所述“计算步骤A42筛选出的每个待定新词的自由度”的步骤包括:分别计算通过步骤A42筛选出的每个待定新词的左邻字信息熵和右邻字信息熵;及取每个待定新词的左邻字信息熵和右邻字信息熵中的较小值,作为该新词的自由度。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711059221.6 | 2017-11-01 | ||
CN201711059221.6A CN108038119A (zh) | 2017-11-01 | 2017-11-01 | 利用新词发现投资标的的方法、装置及存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019085335A1 true WO2019085335A1 (zh) | 2019-05-09 |
Family
ID=62093676
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/076174 WO2019085335A1 (zh) | 2017-11-01 | 2018-02-10 | 利用新词发现投资标的的方法、装置及存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108038119A (zh) |
WO (1) | WO2019085335A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111339403A (zh) * | 2020-02-11 | 2020-06-26 | 安徽理工大学 | 一种基于商品评论新词提取方法 |
WO2022104156A1 (en) | 2020-11-14 | 2022-05-19 | Biogen Ma Inc. | Biphasic subcutaneous dosing regimens for anti-vla-4 antibodies |
Families Citing this family (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109472022B (zh) * | 2018-10-15 | 2024-09-17 | 平安科技(深圳)有限公司 | 基于机器学习的新词识别方法及终端设备 |
CN109492224B (zh) * | 2018-11-07 | 2024-05-03 | 北京金山数字娱乐科技有限公司 | 一种词表构建的方法及装置 |
CN111309898A (zh) * | 2018-11-26 | 2020-06-19 | 中移(杭州)信息技术有限公司 | 一种用于新词发现的文本挖掘方法及装置 |
CN110457708B (zh) * | 2019-08-16 | 2023-05-16 | 腾讯科技(深圳)有限公司 | 基于人工智能的词汇挖掘方法、装置、服务器及存储介质 |
CN112541057A (zh) * | 2019-09-04 | 2021-03-23 | 上海晶赞融宣科技有限公司 | 分布式新词发现方法、装置、计算机设备和存储介质 |
CN110807322B (zh) * | 2019-09-19 | 2024-03-01 | 平安科技(深圳)有限公司 | 基于信息熵识别新词的方法、装置、服务器及存储介质 |
CN111666760A (zh) * | 2020-04-29 | 2020-09-15 | 深圳壹账通智能科技有限公司 | 基于并词处理的新词发现方法、装置和计算机设备 |
CN111639487A (zh) * | 2020-04-30 | 2020-09-08 | 深圳壹账通智能科技有限公司 | 基于分类模型的字段抽取方法、装置、电子设备及介质 |
CN112329458B (zh) * | 2020-05-21 | 2024-05-10 | 北京明亿科技有限公司 | 新组织描述词识别方法与装置、电子设备及存储介质 |
CN111626054B (zh) * | 2020-05-21 | 2023-12-19 | 北京明亿科技有限公司 | 新违法行为描述词识别方法与装置、电子设备及存储介质 |
CN111626053B (zh) * | 2020-05-21 | 2024-04-09 | 北京明亿科技有限公司 | 新作案手段描述词识别方法与装置、电子设备及存储介质 |
CN111832299A (zh) * | 2020-07-17 | 2020-10-27 | 成都信息工程大学 | 一种中文分词系统 |
CN111931491B (zh) * | 2020-08-14 | 2023-11-14 | 中国工商银行股份有限公司 | 领域词典构建方法及装置 |
CN111914554B (zh) * | 2020-08-19 | 2024-08-09 | 网易(杭州)网络有限公司 | 领域新词识别模型的训练方法、领域新词识别方法及设备 |
CN112883725B (zh) * | 2020-12-29 | 2024-10-18 | 科大讯飞(上海)科技有限公司 | 一种文案生成方法、装置、电子设备、存储介质 |
CN113064990A (zh) * | 2021-01-04 | 2021-07-02 | 上海金融期货信息技术有限公司 | 一种基于多层次聚类的热点事件识别方法和系统 |
CN112560448B (zh) * | 2021-02-20 | 2021-06-22 | 京华信息科技股份有限公司 | 一种新词提取方法及装置 |
CN113468317B (zh) * | 2021-06-26 | 2024-03-08 | 北京网聘信息技术有限公司 | 一种简历筛选方法、系统、设备和存储介质 |
CN113536787A (zh) * | 2021-07-14 | 2021-10-22 | 福建亿榕信息技术有限公司 | 一种建立审计专业词库的方法及设备 |
CN113449082A (zh) * | 2021-07-16 | 2021-09-28 | 上海明略人工智能(集团)有限公司 | 一种新词发现方法、系统、电子设备及介质 |
CN115719064A (zh) * | 2021-08-24 | 2023-02-28 | 北京有限元科技有限公司 | 行业新词识别方法、装置、系统和存储介质 |
CN113987118A (zh) * | 2021-09-29 | 2022-01-28 | 阿里巴巴(中国)有限公司 | 语料的获取方法、装置、设备及存储介质 |
CN114186557A (zh) * | 2022-02-17 | 2022-03-15 | 阿里巴巴达摩院(杭州)科技有限公司 | 主题词确定方法、设备及存储介质 |
CN114385792B (zh) * | 2022-03-23 | 2022-06-24 | 北京零点远景网络科技有限公司 | 一种工单数据提取词语的方法、装置、设备及存储介质 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105786991A (zh) * | 2016-02-18 | 2016-07-20 | 中国科学院自动化研究所 | 结合用户情感表达方式的中文情感新词识别方法和系统 |
CN105956158A (zh) * | 2016-05-17 | 2016-09-21 | 清华大学 | 基于海量微博文本和用户信息的网络新词自动提取的方法 |
CN106126606A (zh) * | 2016-06-21 | 2016-11-16 | 国家计算机网络与信息安全管理中心 | 一种短文本新词发现方法 |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3940656B2 (ja) * | 2002-09-30 | 2007-07-04 | 株式会社東芝 | テキスト情報の分類に用いられる辞書の洗練化方法およびプログラム |
US8849653B2 (en) * | 2006-05-09 | 2014-09-30 | International Business Machines Corporation | Updating dictionary during application installation |
CN102023967A (zh) * | 2010-11-11 | 2011-04-20 | 清华大学 | 一种面向股票领域的文本情感分类方法 |
CN105389349B (zh) * | 2015-10-27 | 2018-07-27 | 上海智臻智能网络科技股份有限公司 | 词典更新方法及装置 |
CN105786962A (zh) * | 2016-01-15 | 2016-07-20 | 优品财富管理有限公司 | 基于新闻传播力的大数据指数分析方法及系统 |
CN106934054A (zh) * | 2017-03-17 | 2017-07-07 | 前海梧桐(深圳)数据有限公司 | 基于大数据的企业细分行业精准分析方法及其系统 |
CN107292744A (zh) * | 2017-06-07 | 2017-10-24 | 前海梧桐(深圳)数据有限公司 | 基于机器学习的投资趋势分析方法及其系统 |
-
2017
- 2017-11-01 CN CN201711059221.6A patent/CN108038119A/zh active Pending
-
2018
- 2018-02-10 WO PCT/CN2018/076174 patent/WO2019085335A1/zh active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105786991A (zh) * | 2016-02-18 | 2016-07-20 | 中国科学院自动化研究所 | 结合用户情感表达方式的中文情感新词识别方法和系统 |
CN105956158A (zh) * | 2016-05-17 | 2016-09-21 | 清华大学 | 基于海量微博文本和用户信息的网络新词自动提取的方法 |
CN106126606A (zh) * | 2016-06-21 | 2016-11-16 | 国家计算机网络与信息安全管理中心 | 一种短文本新词发现方法 |
Non-Patent Citations (1)
Title |
---|
YAO, RONGPENG ET AL.: "Micro-blog New Word Discovery Method Based on Improved Mutual Information and Branch Entropy", JOURNAL OF COMPUTER APPLICATIONS, vol. 36, no. 10, 10 October 2016 (2016-10-10), pages 2773 - 2775, XP055608029 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111339403A (zh) * | 2020-02-11 | 2020-06-26 | 安徽理工大学 | 一种基于商品评论新词提取方法 |
CN111339403B (zh) * | 2020-02-11 | 2022-08-02 | 安徽理工大学 | 一种基于商品评论新词提取方法 |
WO2022104156A1 (en) | 2020-11-14 | 2022-05-19 | Biogen Ma Inc. | Biphasic subcutaneous dosing regimens for anti-vla-4 antibodies |
Also Published As
Publication number | Publication date |
---|---|
CN108038119A (zh) | 2018-05-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019085335A1 (zh) | 利用新词发现投资标的的方法、装置及存储介质 | |
AU2017408801B2 (en) | User keyword extraction device and method, and computer-readable storage medium | |
CN109271512B (zh) | 舆情评论信息的情感分析方法、装置及存储介质 | |
WO2020237856A1 (zh) | 基于知识图谱的智能问答方法、装置及计算机存储介质 | |
Jäschke et al. | Tag recommendations in folksonomies | |
Ding et al. | Entity discovery and assignment for opinion mining applications | |
US9251133B2 (en) | Approximate named-entity extraction | |
WO2020000717A1 (zh) | 网页分类方法、装置及计算机可读存储介质 | |
WO2021175009A1 (zh) | 预警事件图谱的构建方法、装置、设备及存储介质 | |
US9043413B2 (en) | System and method for extracting, collecting, enriching and ranking of email objects | |
WO2021017290A1 (zh) | 基于知识图谱的实体识别数据增强方法及系统 | |
US20140379719A1 (en) | System and method for tagging and searching documents | |
US20150120708A1 (en) | Information aggregation, classification and display method and system | |
US20130326338A1 (en) | Methods and systems for organizing content using tags and for laying out images | |
WO2018171295A1 (zh) | 一种给文章标注标签的方法、装置、终端及计算机可读存储介质 | |
US11640420B2 (en) | System and method for automatic summarization of content with event based analysis | |
CN113836131A (zh) | 一种大数据清洗方法、装置、计算机设备及存储介质 | |
WO2019071966A1 (zh) | 基于爬虫数据的用户行为分析方法、应用服务器及可读存储介质 | |
WO2022105497A1 (zh) | 文本筛选方法、装置、设备及存储介质 | |
WO2018205458A1 (zh) | 获取目标用户的方法、装置、电子设备及介质 | |
EP3301603A1 (en) | Improved search for data loss prevention | |
CN108875050B (zh) | 面向文本的数字取证分析方法、装置和计算机可读介质 | |
WO2019227705A1 (zh) | 图片录入方法、服务器及计算机存储介质 | |
EP3564833B1 (en) | Method and device for identifying main picture in web page | |
CN103092838B (zh) | 一种获取英文词的方法及装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 24.09.2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18873532 Country of ref document: EP Kind code of ref document: A1 |