Financial knowledge graph-oriented relation extraction method and device, and storage medium
By segmenting news information, tagging parts of speech, and extracting important words, and combining the co-occurrence frequency of relation pairs, fully automatic unsupervised relation extraction is achieved. This solves the problems of manual dependence and trigger word dependence in existing technologies and can uncover a variety of potential entity relationships.
Patent Information
- Application Number
- CN202111087761.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-16
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2041-09-16
AI Technical Summary
Existing relation extraction algorithms in vertical domains rely on manual annotation and prior knowledge, which is labor-intensive and difficult to capture hidden relationships, especially in the absence of trigger words, making it impossible to identify the association between entities.
By segmenting and tagging news information, a list of important words is extracted and paired to form relation pairs. The frequency of co-occurrence of relation pairs in multiple news articles is used to extract possible relationships. A fully automatic and unsupervised method is adopted to avoid restrictions on the type of entity relationship.
It achieves fully automated, unsupervised relation extraction, which can uncover various potential relationships between entities, avoid subjectivity and human resource consumption, and cover hidden relationships and easily defined relationship types.
Smart Images

Figure CN113868431B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and in particular to a relation extraction method, computer device and storage medium for financial knowledge graphs. Background Technology
[0002] A knowledge graph is a structured representation of information that shows the relationships between meaningful transactions (entities) in a graph format. Knowledge graphs can be divided into two types: general-domain knowledge graphs, which summarize general knowledge; and vertical-domain knowledge graphs, which are typically applied within a specific industry or sector.
[0003] Relation extraction is the foundation of knowledge graph formation. For unstructured text data, such as news and patents, only through relation extraction can the relationships between entities be obtained. Existing relation extraction algorithms in vertical domains are mostly based on manually labeled data, which is prone to subjectivity and consumes human resources. Furthermore, they predefine possible entity relationship types, which easily relies on prior knowledge. Moreover, some algorithms depend on trigger words and have difficulty capturing hidden relationships. For example, in the case of "Zhang San is 42 years old this year," the hidden relationship (Zhang San, age, 42 years old) will not be identified without the trigger word "age." Summary of the Invention
[0004] Based on this, this application provides a relation extraction method, computer device, and storage medium for financial knowledge graphs.
[0005] Firstly, this application provides a relation extraction method for financial knowledge graphs, the method comprising:
[0006] Each news article in a series of news articles is segmented and tagged with its part of speech to obtain a list of words with known parts of speech for each news article.
[0007] For each news article, important information is extracted, and a list of important words corresponding to each news article is obtained from the list of words corresponding to each news article.
[0008] The important words in the list of important words for each news article are paired up to form relationship pairs, resulting in a list of relationship pairs for each news article.
[0009] Based on the number of times each pair of relationships in the relationship list corresponding to each news article appears in the multiple news articles and the preset filtering number, the relationship pairs that appear together more or less than the preset filtering number are extracted.
[0010] Secondly, this application provides a computer device, the computer device comprising: a memory and a processor; the memory for storing a computer program; the processor for executing the computer program and, when executing the computer program, implementing the relation extraction method for financial knowledge graphs as described above.
[0011] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the relationship extraction method for financial knowledge graphs as described above.
[0012] This application provides a method, apparatus, and storage medium for relation extraction from financial knowledge graphs. The method involves segmenting and tagging each news article in a set of multiple news articles to obtain a list of words with known parts of speech for each article; extracting important information from each news article by extracting a list of important words corresponding to each news article from its word list; pairwise combining the important words in each important word list to form relation pairs, resulting in a list of relation pairs for each news article; and extracting relation pairs whose frequency of co-occurrence is greater than or equal to the preset filtering count based on the number of times each relation pair in the relation pair list co-occurs in the multiple news articles and a preset filtering count. After obtaining a list of words with known parts of speech for each news article, important information is extracted. This involves extracting a list of important words for each news article, where the words are the key words in each article. These important words are then paired to obtain a list of relation pairs, each representing a potential relationship between entities. If a relation pair frequently co-occurs in the news articles, it indicates a high probability of a relationship. Therefore, a preset filtering count is set, and relation pairs that co-occur more or less frequently than this preset filtering count are extracted to obtain potentially related relation pairs. Thus, on the one hand, the entire process is fully automated and unsupervised, requiring no manual data manipulation or maintenance, thus avoiding subjectivity and the waste of human resources; on the other hand, it can uncover as many relationships as possible between entities, including both easily defined and difficult-to-define relationship types, avoiding the limitations of restricting the types of relationships between entities, avoiding cognitive blind spots and dependence on trigger words, and providing technical support for exhaustively exploring all possible relationship types between entities, such as: entities lacking trigger words but having hidden relationships, or a pair of entities potentially having two or more relationship types.
[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0014] Figure 1 This is a flowchart illustrating an embodiment of the relation extraction method for financial knowledge graphs in this application;
[0015] Figure 2 This is a flowchart illustrating another embodiment of the relation extraction method for financial knowledge graphs in this application;
[0016] Figure 3 This is a schematic diagram of relation pairs extracted in one embodiment of the relation extraction method for financial knowledge graphs in this application;
[0017] Figure 4 This is a schematic diagram of the structure of an embodiment of the computer device of this application. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0020] See Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the relation extraction method for financial knowledge graphs according to this application. The method includes:
[0021] Step S101: Perform word segmentation and part-of-speech tagging on each news article from multiple news articles to obtain a list of words with known parts of speech for each news article.
[0022] In this embodiment, word segmentation refers to the process of recombinizing a continuous sequence of characters into a separate sequence of words according to certain rules. Word segmentation methods can be divided into three main categories: string matching-based segmentation methods, understanding-based segmentation methods, and statistical segmentation methods. String matching-based segmentation methods, also known as mechanical segmentation methods, match the Chinese character string to be analyzed against entries in a sufficiently large machine dictionary according to a certain strategy. If a string is found in the dictionary, the match is successful (i.e., a word is identified). Understanding-based segmentation methods achieve word recognition by having the computer simulate human understanding of sentences. Statistical segmentation methods, given a large amount of already segmented text, use statistical machine learning models to learn the rules of word segmentation (called training), thereby achieving the segmentation of unknown text.
[0023] The basic unit of text comprehension is the word. Therefore, before using the text, it is necessary to use a word segmentation tool to cut the text sequence into basic word units so that the text can be used later.
[0024] Part-of-speech tagging (POS) is a text data processing technique in corpus linguistics that labels words in a corpus according to their meaning and context. Parts of speech are typically categorized as verbs, nouns, adverbs, adjectives, function words, directional words, etc. POS tagging can be performed using machine learning algorithms. Common machine learning algorithms for POS tagging include Hidden Markov Models (HMMs), Maximum Entropy Markov Models (MEMs), and Conditional Random Fields (CRFs).
[0025] Knowledge graphs represent meaningful relationships between entities. To determine these relationships, entity recognition is the first step. Entity recognition refers to identifying entities with specific meanings in text, primarily including names of people, places, organizations, and proper nouns. Typically, entity recognition is preceded by word segmentation and part-of-speech tagging.
[0026] In this embodiment, after word segmentation and part-of-speech tagging of each news article, the part of speech of each word is known, and the set of all words with known parts of speech constitutes the word list. Based on the results of word segmentation and part-of-speech tagging, entities can also be identified from it; therefore, the word list includes all entities identified during the word segmentation and part-of-speech tagging process.
[0027] For example, given the input text "Institution A will extend restrictions on bank dividends and repurchase agreements to the fourth quarter", after removing pause words (common words with no real meaning) such as "targeting", "and", "restrictions", and "to", the word segmentation result is: ['Institution A', 'bank dividends', 'repurchase agreements', 'extend', 'fourth', 'quarter']. The part-of-speech tagging result is: ['ORG', 'n', 'vn', 'v', 'm', 'n']. Here, "ORG" indicates that the corresponding word "Institution A" is an institution name, which is an identified institutional entity; the second "n" indicates that the corresponding word "bank dividends" is a noun; "vn" indicates that the corresponding word "repurchase agreements" is a gerund; "v" indicates that the corresponding word "extend" is a verb; "m" indicates that the corresponding word "fourth" is a quantifier; and "n" indicates that the corresponding word "quarter" is a noun.
[0028] The input text “Institution A will extend restrictions on bank dividends and buybacks to the fourth quarter” corresponds to the following word list: ['Institution A', 'bank dividends', 'buybacks', 'extend', 'fourth', 'quarter'] and ['ORG', 'n', 'vn', 'v', 'm', 'n'].
[0029] Step S102: Extract important information from each news article by extracting the list of important words corresponding to each news article from the word list corresponding to each news article.
[0030] Key information in news articles refers to information that summarizes the main content of the news. This key information is primarily found in the headline and body of the news article; if there is no headline, it is found in the body of the article.
[0031] By extracting key information from each news article, we can identify the important words that represent the main content and central idea of the news. Based on this, most words in the word list can be filtered out, leaving a list of key words for each news article. Each key word in this list represents a word in the word list and also indicates the main content and central idea of the news article.
[0032] Extracting key information from each news article can include extracting key information from the main body of the news article, or it can include extracting key information from the title and main body of the news article.
[0033] Keywords can be extracted from the main text of news articles. Generally, the keywords of an article are a high-level summary of the content, and you can usually get a general understanding of the event described in the article by looking at the keywords.
[0034] Stock names and related concepts can be extracted from news headlines. News headlines are typically a concise summary of the news content, so the stocks and concepts included in them must be central to the news story. Key information can be extracted from news headlines through methods such as stock code identification, stock name matching, and concept name matching.
[0035] For example, a news headline might read, "What's hottest this June? Company A and Company B lead the way as demand for silicon carbide, a new semiconductor material, takes off." The key information extracted is the stocks of "Company A" and "Company B," as well as the concept of "semiconductor."
[0036] Step S103: Combine the important words in the list of important words corresponding to each news article into pairs to form relationship pairs, and obtain the relationship pair list corresponding to each news article.
[0037] Step S104: Based on the number of times each pair of relationships in the relationship list corresponding to each news article appears in the multiple news articles and the preset filtering number, extract the relationship pairs whose number of appearances is greater than or equal to the preset filtering number.
[0038] This application embodiment performs word segmentation and part-of-speech tagging on each news article from multiple news articles to obtain a list of words with known parts of speech for each news article; it extracts important information from each news article by extracting an important word list for each news article from the word list; it pairs the important words in the important word list for each news article to form relation pairs, obtaining a relation pair list for each news article; and it extracts relation pairs whose co-occurrence frequency is greater than or equal to the preset filtering frequency based on the number of times each relation pair in the relation pair list for each news article appears in the multiple news articles and a preset filtering frequency. After obtaining a list of words with known parts of speech for each news article, important information is extracted. This involves extracting a list of important words for each news article, where the words are the key words in each article. These important words are then paired to obtain a list of relation pairs, each representing a potential relationship between entities. If a relation pair frequently co-occurs in the news articles, it indicates a high probability of a relationship. Therefore, a preset filtering count is set, and relation pairs that co-occur more or less frequently than this preset filtering count are extracted to obtain potentially related relation pairs. Thus, on the one hand, the entire process is fully automated and unsupervised, requiring no manual data manipulation or maintenance, thus avoiding subjectivity and the waste of human resources; on the other hand, it can uncover as many relationships as possible between entities, including both easily defined and difficult-to-define relationship types, avoiding the limitations of restricting the types of relationships between entities, avoiding cognitive blind spots and dependence on trigger words, and providing technical support for exhaustively exploring all possible relationship types between entities, such as: entities lacking trigger words but having hidden relationships, or a pair of entities potentially having two or more relationship types.
[0039] For example, BAT (Baidu, Alibaba, Tencent), such as Tencent investing in Meituan, Alibaba investing in Ele.me, can only determine that Tencent and Meituan have a cooperative relationship, and Alibaba and Ele.me have a cooperative relationship by judging by trigger words. There are no explicit official words to say that Tencent and Alibaba have a hidden relationship. Related technologies cannot extract the hidden relationship between Tencent and Alibaba. The method of this application embodiment can discover the hidden relationship between Tencent and Alibaba.
[0040] For example, if A and B cooperate in one field but compete in another, the relevant technologies will ultimately only select one type of relationship. The method in this application will extract that there is indeed a relationship between A and B, but will not limit the specific relationship type between A and B. Therefore, it can provide technical support to avoid missing other relationship types among the two or more possible relationship types between entities.
[0041] In one embodiment, before performing word segmentation and part-of-speech tagging on each of the multiple news articles in step S101, the method may further include step S105.
[0042] Step S105: Obtain the set of known named entity names.
[0043] At this point, step S101, which involves segmenting and tagging each news article in the multiple news articles, may include: segmenting and tagging each news article in the multiple news articles based on the name set, such as... Figure 2 As shown.
[0044] Before word segmentation and part-of-speech tagging, obtaining a set of known named entity names ensures that all relevant entities are accurately segmented and tagged, preventing the omission of entity information (e.g., stock name) due to the word segmentation algorithm / tool separating the entities of interest (e.g., stock name) during text segmentation, or entity recognition errors due to the error of the word segmentation algorithm / tool.
[0045] The known named entities in this embodiment include, but are not limited to: stock names and various abbreviations of stocks, listed company names, concept names, product names, industry names, etc.
[0046] The known set of named entity names includes, but is not limited to: the names of each stock that appear in the news, the names of listed companies, the concept names that securities companies usually use to classify stocks, commonly used industry names (such as "pharmaceuticals", "petroleum" and other industry names), commonly used product names (such as "mobile phone", "gold" and other names), and so on.
[0047] For example: the known set of named entity names includes the stock names of various stocks commonly used in news.
[0048] For example, taking "Times Group Holdings" as an example, since "Times," "Group," and "Holding" can all be independent and meaningful words, word segmentation tools might directly split this stock name into three words: "Times," "Group," and "Holding." To avoid this, a pre-extracted set of known named entity names can be input into the word segmentation algorithm / tool, allowing the algorithm / tool to know that "Times Group Holdings" is a meaningful proper noun. This way, the above situation will not occur during word segmentation.
[0049] In one embodiment, step S105, obtaining the set of names of known named entities, may include: sub-step S1051, and / or sub-step S1052 (including sub-step S1052A, sub-step S1052B, and sub-step S1052C), and sub-step S1053.
[0050] Sub-step S1051: Obtain a set of known first named entities from the data provided by the securities firm or data provider. The first named entity includes at least one of concept name, industry name, and product name.
[0051] For at least one of the concept name, industry name, and product name in the first named entity, it can be obtained from data provided by securities firms or data providers, and can be used after simple processing of the data provided by securities firms or data providers.
[0052] Currently, no data provider offers information on how stocks are referred to in news reports. However, this information can be extracted using the following sub-step S1052:
[0053] Sub-step S1052A: Extract all possible candidate names of the stock from the existing data, and use the extracted possible candidate names as the candidate name set of the stock.
[0054] Extract all possible candidate names for a stock from the existing data, and use them as the candidate name set set1={name1, name2, name3, ...}.
[0055] For example, in all data centers provided by data providers, Xiaomi, a well-known company, is stored as "Xiaomi Group" or "Xiaomi Group-W." For Tencent, another well-known company, all official financial data provides the name "Tencent Holdings." However, many news articles about these two companies directly use both "Xiaomi" and "Tencent." Therefore, by analyzing the spelling of stock names in official documents and the names that frequently appear in news reports, corresponding rules can be formulated to extract the names of stocks that may appear in news reports. The final set of candidate names for Xiaomi is {Xiaomi, Xiaomi Group, Xiaomi Group-W}, and the set of candidate names for Tencent is {Tencent, Tencent Holdings}.
[0056] Sub-step S1052B: Verify the existence of a combination form in the news information, wherein the combination form is a combination of the candidate name of the stock and the stock code of the stock.
[0057] Sub-step S1052C: If a candidate name exists, retain the candidate name of the stock; if it does not exist, delete the candidate name of the stock and use the retained candidate names as the name set of the stock.
[0058] For the candidate name set, the candidate name is verified in the news information by the combination of "candidate name (stock code)". If such a combination exists, the candidate name is retained; if such a combination does not exist, the candidate name is not retained, thus filtering the candidate name set.
[0059] For example, for the stock "Times Group Holdings", the candidate name set obtained through rule extraction is {Times, Times Group, Times Group Holdings}. We can then verify whether the combinations "Times (01023)", "Times Group (01023)", and "Times Group Holdings (01023)" have appeared in news reports. If they have, the corresponding candidate names are retained. Through analysis, it was found that the stock is generally referred to in only the latter two ways in news reports: "Times Group (01023)" and "Times Group Holdings (01023)". Ultimately, for this stock, through news report verification, the retained candidate names are {Times Group, Times Group Holdings}.
[0060] For example, Xiaomi's stock code is 01810, and its stock name is Xiaomi Group-W. However, in financial news and information, the names "Xiaomi" or "Xiaomi Group" are more commonly used. First, we analyze the characteristics of the stock name and its appearance in news headlines. Then, we formulate corresponding rules to extract all possible candidate names for the stock, forming a candidate name set of {Xiaomi, Xiaomi Group, Xiaomi Group-W}. Finally, we use combinations of "candidate names (stock codes)" to match the news headlines, retaining the successfully matched candidate names. For example, if "Xiaomi (01810)" appears in a headline, then "Xiaomi" is considered a name for stock 01810.
[0061] Sub-step S1053: Merge the name set of the first named entity and / or the name set of the stock into the name set of the known named entity.
[0062] In one embodiment, if the news article does not have a title, keywords can be extracted from the body of each news article, i.e., step S102. The important information extraction for each news article, which extracts the important word list corresponding to each news article from the word list corresponding to each news article, may include: sub-step S102A1 and sub-step S102A2.
[0063] Sub-step S102A1: Extract keywords from the main text of each news article, and extract the keyword list corresponding to each news article from the word list corresponding to each news article.
[0064] Sub-step S102A2: Use the keyword list corresponding to each news article as the important word list corresponding to each news article.
[0065] Keyword extraction can be used to summarize news information, extracting key words from a news article to help readers efficiently grasp the main idea. Especially in the internet age, with a massive influx of information daily, unprocessed information can become a burden for web browsers.
[0066] Keyword extraction algorithms can be categorized into supervised, semi-supervised, and unsupervised algorithms. Existing keyword extraction methods primarily employ unsupervised methods due to their greater applicability. Unsupervised keyword extraction algorithms can be broadly classified into three categories: keyword extraction algorithms based on statistical features, keyword extraction algorithms based on word graph models, and keyword extraction algorithms based on topic models.
[0067] Keyword extraction algorithms based on statistical features extract keywords from documents by utilizing statistical information about the words in the document. Typically, the text is preprocessed to obtain a candidate set of words, and then keywords are extracted from this candidate set using feature value quantization. The key to keyword extraction algorithms based on statistical features is choosing the appropriate feature value quantization metric. Currently, three common types are used: 1) feature quantization based on word weights, 2) feature quantization based on word document position, and 3) feature quantization based on word association information.
[0068] Term Frequency–Inverse Document Frequency (TF-IDF) is a feature quantification metric based on word association information. Because TF-IDF is simple to implement and relatively easy to understand, it will be explained below as an example:
[0069] The keyword extraction algorithm used in this embodiment can be TF-IDF. TF-IDF is a commonly used weighting technique for information retrieval and data mining. TF stands for Term Frequency, and IDF stands for Inverse Document Frequency.
[0070] The TF of a word refers to the frequency of this word in a document, while the IDF of a word is derived from a corpus and represents the frequency of this word in the entire corpus.
[0071] TF = (Number of times a word appears in the document) / (Total number of words in the document);
[0072] IDF = log (total number of documents in the corpus / (number of documents containing the word + 1));
[0073] TF-IDF = TF * IDF.
[0074] For each word in each document, a TF-IDF value is calculated using the formula above. For a given document, the top-k TF-IDF values are selected as the keywords by ranking the words in that document. TF-IDF, while very simple, is classic, effective, and fast.
[0075] For example, given a text in a text library, the keywords are: "Keywords are words that can express the central content of a document. They are commonly used in computer systems to index the content features of papers, retrieve information, and compile data for readers to review. Keyword extraction is a branch of text mining and is the foundational work for text mining research such as text retrieval, document comparison, summary generation, document classification, and clustering." Using the TF-IDF algorithm above, the keywords are: "document," "text," "keyword," "mining," and "text retrieval."
[0076] Among the existing keywords, the vast majority are nouns or gerunds. Generally, nouns are better able to express the main idea of an article compared to other parts of speech. Therefore, the extracted keywords can be filtered according to preset requirements. Thus, in one embodiment, keyword filtering can be performed. Specifically, sub-step S102A1, which involves extracting keywords from the body of each news article and obtaining a keyword list corresponding to each news article from the word list corresponding to each news article, may further include:
[0077] Sub-step S102A11: Extract keywords from the main text of each news article, and extract the first keyword list corresponding to each news article from the word list corresponding to each news article.
[0078] Sub-step S102A12: According to preset requirements, filter the first keyword list corresponding to each news article to obtain the second keyword list corresponding to each news article.
[0079] Sub-step S102A13: Use the second keyword list corresponding to each news article as the keyword list corresponding to each news article.
[0080] Since financial knowledge graphs primarily focus on two related entities, and the financial field pays more attention to meaningful proper nouns such as companies, people, and proprietary concepts, this embodiment filters keywords, retaining those with parts of speech as nouns, proper nouns, titles of works, stock names, organization names (including company names), personal names, concept names, product names, and industry names. Therefore, the preset requirements can refer to pre-defined requirements for parts of speech as nouns and requirements that satisfy the entities that the financial knowledge graph focuses on.
[0081] After extracting keywords, a first keyword list is obtained. Then, according to preset requirements, keyword filtering is performed to obtain a second keyword list corresponding to each news article. The second keyword list is the keyword list corresponding to each news article.
[0082] For example, if the keywords of an article are "Didi", "June 30, 2021", "United States", and "IPO", then "Didi" is a company entity, "June 30, 2021" is a time entity, and "United States" is a place name entity. By filtering the keywords, only the company entity "Didi" can be retained in the end.
[0083] In one embodiment, if the news information has a title and a body text, the title information can be extracted from the title of each news information and the keywords can be extracted from the body text, i.e., step S102. The step of extracting important information from each news information and extracting the important word list corresponding to each news information from the word list corresponding to each news information may include: sub-steps S102B1, S102B2 and S102B3.
[0084] Sub-step S102B1: Extract title information from the title of each news article, and extract the title word list corresponding to each news article from the word list corresponding to each news article.
[0085] Sub-step S102B2: Extract keywords from the main text of each news article, and extract the keyword list corresponding to each news article from the word list corresponding to each news article.
[0086] Sub-step S102B3: Merge the title word list and the keyword list to obtain the important word list corresponding to each news article.
[0087] In one embodiment, sub-step S102B1, which involves extracting title information from the title of each news article and extracting the title word list corresponding to each news article from the word list corresponding to each news article, may further include sub-steps S102B11, S102B12, and S102B13.
[0088] Sub-step S102B11: Use regular expressions to match the stock codes appearing in the title, and obtain the stock name corresponding to the stock code from the title of each news article.
[0089] Sub-step S102B12: Segment the title of the news information into words, obtain a set of known named entities, and extract a second named entity from the title of each news information based on the set of nouns. The second named entity includes at least one of stock name, concept name, industry name, and product name.
[0090] Sub-step S102B13: Extract the stock names and / or second named entities from the title as the title word list for each news article.
[0091] In one embodiment, before performing word segmentation and part-of-speech tagging on each news article in the multiple news articles in step S101, the method may further include: preprocessing each news article in the multiple news articles to obtain the effective news text of each news article; in this case, performing word segmentation and part-of-speech tagging on each news article in step S101 may include: performing word segmentation and part-of-speech tagging on the effective news text of each news article in the multiple news articles.
[0092] News articles typically have corresponding storage formats, and news articles from different sources will also have corresponding formats in the database. Therefore, news articles will contain many format-related characters. The preprocessing process can involve removing format strings, parsing the valid news text from various storage formats, and extracting the valid news text from the news articles.
[0093] The method of this application embodiment is illustrated below with a specific example.
[0094] (1) A news article is segmented and its parts of speech are tagged. The resulting word list includes 7 words (a, b, c, d, e, f, g), and the part of speech of each word is identified.
[0095] (2) Extract the title information from the title of the news information. The extracted title word list includes one word, a.
[0096] (3) Extract keywords from the main text of the news information. The first keyword list obtained includes 4 words, namely a, b, c and d. Filter the words in the first keyword list to further extract keywords that users are interested in (e.g., including entities or nouns). The second keyword list retained after filtering includes 3 words, namely a, b and c.
[0097] (4) Merge the words in the title word list and the words in the filtered second keyword list. The resulting important word list includes three words: a, b, and c.
[0098] (5) Form a pairwise relationship between the words in the list of important words to obtain a list of relationship pairs, including: relationship pairs (a, b), (a, c), (b, c).
[0099] (6) Count the number of news articles in which such pairwise relationships coexist, and use this count as the final extracted relationship pairs. For example, in 10 news articles, all 10 articles contain relationship pairs (a, b), 3 articles contain relationship pairs (a, c), and 2 articles contain relationship pairs (b, c); assuming the preset filtering count is 5, after filtering, only relationship pairs that coexist more than 5 times are retained, then relationship pair (a, b) is retained, such as... Figure 3 As shown.
[0100] In relevant financial knowledge graphs, due to the extraction algorithm, the final relationships between companies may only be "cooperation", "investment", "competition" and "supply". Relationships that are not in these types cannot be extracted. The method in this embodiment does not limit the types of relationships. It determines the relationships between entities by accumulating the co-occurrence of relationship pairs, and can effectively extract those entity pairs that are related but whose types are difficult to define.
[0101] For example, Ant Financial and Alibaba are not among the above relationship types, but from the public's perspective, these two companies are closely related and are often mentioned and discussed together in the news. The method in this embodiment can extract this kind of hidden and difficult-to-define relationship type.
[0102] See Figure 4 , Figure 4 This is a schematic diagram of the structure of a computer device according to an embodiment of this application. The computer device 100 includes: a memory 1 and a processor 2; the memory 2 is used to store a computer program; the processor 1 is used to execute the computer program and, when executing the computer program, implement the relation extraction method for financial knowledge graphs as described in any of the preceding claims. For detailed descriptions of related content, please refer to the relevant content regarding the relation extraction method for financial knowledge graphs described above, which will not be repeated here.
[0103] The memory 1 and the processor 2 are connected via a bus.
[0104] The processor 2 can be a microcontroller unit, a central processing unit, or a digital signal processor, etc.
[0105] Among them, memory 1 can be a Flash chip, read-only memory, disk, optical disk, USB flash drive, or portable hard drive, etc.
[0106] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to implement the relation extraction method for financial knowledge graphs as described in any of the preceding claims. For detailed explanations of the related content, please refer to the relevant content regarding the relation extraction method for financial knowledge graphs mentioned above; it will not be repeated here.
[0107] The computer-readable storage medium can be an internal storage unit of the aforementioned computer device, such as a hard disk or memory. It can also be an external storage device, such as an external hard disk, smart memory card, secure digital card, flash memory card, etc.
[0108] It should be understood that the terminology used in this application specification is for the purpose of describing particular embodiments only and is not intended to limit the application.
[0109] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0110] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A relation extraction method for financial knowledge graphs, characterized in that, The method includes: Obtain a set of known first named entities from data provided by securities firms or data providers. The first named entity includes at least one of concept names, industry names, and product names. And / or, Extract all possible candidate names of the stock from the existing data, and use the extracted possible candidate names as the candidate name set of the stock. Verify the existence of a combination form in news information, where the combination form is a combination of the candidate name of the stock and the stock code of the stock; If a candidate name exists, the candidate name of the stock is retained; if it does not exist, the candidate name of the stock is deleted, and the retained candidate names are used as the set of names of the stock. Merge the set of names of the first named entity and / or the set of names of the stock into a set of names of known named entities; Based on the known set of named entities, each news article in multiple news articles is segmented and tagged with its part of speech to obtain a list of words with known parts of speech corresponding to each news article; For each news article, important information is extracted, and a list of important words corresponding to each news article is obtained from the list of words corresponding to each news article. The important words in the list of important words for each news article are paired up to form relationship pairs, resulting in a list of relationship pairs for each news article. Based on the number of times each pair of relationships in the list of relationships corresponding to each news article appears in the multiple news articles and the preset number of filters, the relationship pairs that appear together more or less than the preset number of filters are extracted. The process of extracting key information from each news article involves retrieving a list of key words corresponding to each news article from its corresponding word list. This list includes: The title information of each news article is extracted, and the title word list corresponding to each news article is obtained from the word list corresponding to each news article. Keyword extraction is performed on the main text of each news article, and a keyword list corresponding to each news article is obtained from the word list corresponding to each news article; The title word list and the keyword list are merged to obtain the important word list corresponding to each news article; The step involves extracting title information from the title of each news article, specifically by extracting the title word list corresponding to each news article from the word list corresponding to each news article. This includes: By using regular expressions to match stock codes appearing in the titles, the names of the stocks corresponding to the stock codes in the titles of each news article can be obtained. The titles of news articles are segmented to obtain a set of known named entities. A second named entity is extracted from the title of each news article based on the set of names. The second named entity includes at least one of stock name, concept name, industry name, and product name. The stock names and / or second named entities extracted from the titles are used as the list of title words for each news article.
2. The method according to claim 1, characterized in that, The process of extracting key information from each news article involves retrieving a list of key words corresponding to each news article from its corresponding word list. This list includes: Keyword extraction is performed on the main text of each news article, and a keyword list corresponding to each news article is obtained from the word list corresponding to each news article; The list of keywords corresponding to each news article is used as the list of important words for each news article.
3. The method according to claim 2, characterized in that, The process of extracting keywords from the body of each news article involves extracting a keyword list corresponding to each news article from the word list corresponding to each news article, including: Keyword extraction is performed on the main text of each news article, and the first keyword list corresponding to each news article is obtained from the word list corresponding to each news article; According to the preset requirements, the first keyword list corresponding to each news article is filtered to obtain the second keyword list corresponding to each news article; The second list of keywords corresponding to each news article will be used as the keyword list for each news article.
4. The method according to claim 1, characterized in that, Before performing word segmentation and part-of-speech tagging on each of the multiple news articles, the following steps are included: Each news article in a series of news articles is preprocessed to obtain the effective news text for each article. The process of segmenting and tagging each news article within multiple news articles includes: Perform word segmentation and part-of-speech tagging on the valid news text of each of multiple news articles.
5. A computer device, characterized in that, The computer device includes: a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and, when executing the computer program, implement the relation extraction method for financial knowledge graphs as described in any one of claims 1-4.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the relation extraction method for financial knowledge graphs as described in any one of claims 1-4.
Citation Information
Patent Citations
A listed company knowledge graph construction method and device suitable for event attribution
CN109558492A
Method and device for calculating information associated stock
CN110889024A
Knowledge graph relation extraction method and system based on entity co-occurrence matrix
CN112487214A
Single document analysis method and device
CN113158673A