A financial knowledge retrieval method and system based on a vector database
By using a vector database-based financial knowledge retrieval method, the limitations of traditional financial knowledge retrieval methods in semantic modeling are overcome, enabling efficient and accurate retrieval of financial text data and improving the intelligence level of the financial knowledge base.
Patent Information
- Application Number
- CN202511648291.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2045-11-12
AI Technical Summary
Traditional financial knowledge retrieval methods based on keyword matching or rule-driven approaches exhibit significant limitations in handling semantic tasks such as cross-sentence semantics, indicator association logic, and context alignment. They struggle to address query intents that are semantically similar but expressed differently, and lack the ability to model the semantic space.
We employ a financial knowledge retrieval method based on vector databases. By acquiring financial text data and performing correlation processing, we conduct numerical correlation and semantic dependency reasoning, combine multi-head attention computation, generate a financial vector index, and construct an efficient financial knowledge base.
It improves the semantic expression and retrieval accuracy of financial knowledge retrieval, ensures the complete preservation of indicators, entities and contextual relationships, enhances the computability and structuring of financial corpora, supports efficient approximate retrieval, and improves the intelligence level of the financial knowledge base.
Smart Images

Figure CN121117191B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information retrieval technology, and in particular to a financial knowledge retrieval method and system based on a vector database. Background Technology
[0002] With the rapid increase in the volume of financial text data, traditional financial knowledge retrieval methods based on keyword matching or rule-driven approaches have shown significant limitations in handling semantic tasks such as cross-sentence semantics, indicator association logic, and context alignment. On the one hand, financial documents contain a large number of linguistic features such as polysemous words, pronouns, and unstructured indicator relationships, making it difficult to capture explicit dependencies between entities using shallow rules. On the other hand, traditional financial document query systems based on inverted indexes often lack the ability to model the semantic space, relying mainly on literal word matching and Boolean retrieval, making it difficult to handle semantically similar but differently expressed query intents. For example, there is a significant discrepancy in the search results for "net profit improvement" and "profit realization growth." Summary of the Invention
[0003] To address the aforementioned technical problems, this invention proposes a financial knowledge retrieval method and system based on a vector database, thereby resolving at least one of the aforementioned technical issues.
[0004] This application provides a financial knowledge retrieval method based on a vector database, the method comprising:
[0005] S1. Obtain financial text data and perform correlation processing based on the financial text data to obtain financial indicator correlation data;
[0006] S2. Perform numerical correlation reasoning on the financial indicator correlation data to obtain numerical correlation data; perform semantic dependency reasoning on the financial indicator correlation data to obtain semantic dependency data.
[0007] S3. Perform multi-head attention calculation based on numerical correlation data and semantic dependency data to obtain financial text feature data;
[0008] S4. Generate a vector index based on the financial text feature data to obtain financial vector index data, which will be used as an auxiliary task for building a financial knowledge base.
[0009] This invention significantly improves semantic expression and retrieval accuracy in financial knowledge retrieval scenarios: Financial text data undergoes association processing to ensure the complete preservation of indicators, entities, and contextual relationships, avoiding the information fragmentation problem inherent in traditional keyword methods; combining numerical association reasoning and semantic dependency reasoning, it simultaneously models numerical logical relationships and syntactic dependency structures in the text, enhancing the computability and structure of the financial corpus; based on multi-head attention computation, it achieves deep fusion of numerical and semantic features, enabling unified representation of related information from different sources; the generated financial vector index data supports efficient approximate retrieval in vector databases, balancing computational performance and semantic accuracy, thereby effectively improving the intelligence level of financial knowledge base construction and querying.
[0010] Optionally, the association process includes:
[0011] The financial text data is segmented and labeled with parts of speech to obtain the text part-of-speech data.
[0012] Financial entity data is obtained by extracting financial entity data from the part-of-speech data of the text.
[0013] Based on the financial entity data, entity referential elimination processing is performed to obtain entity-unique data;
[0014] Based on the unique entity data, entity indicator mapping is performed to obtain financial indicator-related data.
[0015] In this invention, word segmentation and part-of-speech tagging enable the original text to have clear grammatical unit divisions, facilitating subsequent processing; financial entity extraction can explicitly identify key information such as company names, stock codes, and financial indicators in the text, ensuring that the semantic core is not lost; entity referencing resolution effectively solves the ambiguity caused by pronouns and abbreviations such as "the company" and "its subsidiaries" in the text, ensuring the uniqueness of entity expression; and entity indicator mapping processing achieves a precise correspondence between entities and financial indicators, forming complete financial indicator association data.
[0016] Optionally, the numerical association reasoning includes:
[0017] Numerical feature data is obtained by identifying the numerical features of the data related to financial indicators.
[0018] Numerical feature data is subjected to index semantic clustering to obtain numerical feature clustered data;
[0019] Numerical dependency chains are generated based on clustered data with numerical features to obtain numerical relationship data.
[0020] Numerical logical reasoning is performed based on numerical relationship data to obtain numerical correlation data.
[0021] In this invention, numerical feature recognition ensures that key numerical values such as amount, ratio, and time involved in the text can be accurately extracted and standardized; indicator semantic clustering aggregates numerical features according to semantic attributes, so that similar indicators form natural groups in structure, improving the aggregation degree and interpretability of numerical information; numerical dependency chain generation establishes functional dependency relationships between different indicators, transforming scattered numerical values into computable logical chains; numerical logic reasoning can verify and deduce dependency chains, and identify potential anomalies or trends.
[0022] Optionally, the indicator semantic clustering includes:
[0023] Semantic label mapping is performed on numerical feature data to obtain numerical feature label data;
[0024] A similarity matrix is constructed based on the numerical feature label data to obtain similarity matrix data;
[0025] Similarity clusters are obtained by aggregating similarity data based on the similarity matrix data.
[0026] Semantic hierarchy refinement is performed based on similarity cluster data to obtain numerical feature cluster data.
[0027] In this invention, semantic label mapping endows the original numerical features with clear semantic categories, avoiding the limitations of simply relying on numerical size or format for classification; similarity matrix construction can quantify the semantic similarity between different indicators, providing an accurate calculation basis for subsequent aggregation; similarity aggregation forms a numerical cluster structure with stronger semantic consistency by merging the matrix results within the cluster, effectively reducing redundancy and noise; semantic hierarchy refinement decomposes the aggregated cluster into multi-level structured representations, enabling the system to flexibly switch between coarse-grained and fine-grained approaches.
[0028] Optionally, the generation of the numerical dependency chain includes:
[0029] Based on the numerical feature-based clustered data, the intra-cluster index order is analyzed to obtain the intra-cluster index order data.
[0030] Dependency candidate edges are constructed from the index sequence data within the cluster to obtain dependency candidate edge data;
[0031] Dependency chain data is obtained by filtering dependency candidate edge data;
[0032] Dependency chain graphs are constructed based on dependency chain data to obtain numerical relationship data.
[0033] In this invention, the intra-cluster index order parsing ensures that the indices in the same cluster are arranged in an orderly manner according to business logic or temporal logic, providing directionality for relation modeling; the dependency candidate edge construction generates a set of selectable dependencies by calculating the differences, ratios, or functional relationships between indices, enabling the potential logical connections to be quantitatively expressed; the dependency chain screening removes noisy edges based on thresholds and confidence levels, retaining only highly relevant links, thereby improving the accuracy of dependency modeling; and the dependency chain graph construction further organizes the chains into a graph structure, forming numerical relational data that can be used for reasoning and retrieval.
[0034] Optionally, the semantic dependency reasoning includes:
[0035] The data related to financial indicators are divided into syntactic units to obtain syntactic unit data.
[0036] Dependency relation identification is performed based on syntactic unit data to obtain dependency relation data;
[0037] Semantic anchor mapping is performed based on dependency relationship data to obtain cross-sentence semantic data;
[0038] A semantic dependency network is constructed from cross-sentence semantic data to obtain semantic dependency network data;
[0039] Semantic dependency data is obtained by performing logical consistency reasoning based on semantic dependency network data.
[0040] In this invention, syntactic unit division breaks down text into basic units with grammatical boundaries, facilitating refined analysis; dependency relation identification captures subject-predicate, modification, and parallel relationships between indicators and entities, thus forming intra-sentence logical links; semantic anchor mapping further realizes the correspondence between entities and indicators across sentences, solving the semantic breakage problem in scenarios such as pronouns and ellipsis; semantic dependency network construction makes cross-sentence relationships explicit in a graph structure, forming a scalable dependency network; logical consistency reasoning corrects contradictory relationships within the network, ensuring the self-consistency of the global dependency structure.
[0041] Optionally, the semantic anchor mapping includes:
[0042] Anchor candidate data is obtained by extracting anchor candidate data based on dependency relationship data.
[0043] Anchor point context data is obtained by binding anchor point candidate data to anchor point context data.
[0044] Anchor point cross-sentence matching is performed on the anchor point context data to obtain anchor point cross-sentence data;
[0045] An anchor point mapping graph is generated based on the cross-sentence anchor point data to obtain cross-sentence semantic data.
[0046] In this invention, anchor candidate extraction ensures that potential key entities and indicators in financial texts can be fully identified, avoiding the omission of key information; anchor context binding associates candidate anchors with surrounding dependent fragments and modifiers, giving anchors rich contextual information and thus improving the accuracy of cross-sentence matching; cross-sentence anchor matching establishes the correspondence between entities and indicators between different sentences, solving the problems of pronoun, omission, and ambiguous reference in financial texts; and anchor mapping graph generation makes the cross-sentence mapping results explicit in the form of a graph structure, forming an scalable and traceable semantic network.
[0047] Optionally, S3 includes:
[0048] Linear vector data is obtained by performing linear vector mapping based on numerical correlation data and semantic dependency data.
[0049] Semantic-structural dual-domain attention calculation is performed on linear vector data to obtain attention weight data;
[0050] Multi-head parallel computation is performed on linear vector data based on attention weight data to obtain multi-head attention fusion data;
[0051] Financial text feature data is generated by using multi-head attention fusion data.
[0052] This invention employs a semantic-structural dual-domain attention computation to simultaneously focus on modeling semantic connections and structural dependencies in financial texts, effectively improving the depth and accuracy of feature representation. Semantic domain attention captures semantic relationships between entities, such as logical deduction and causal relationships, while structural domain attention focuses on syntactic dependencies and contextual connections, strengthening the unified perception of cross-sentence indicator information. Through multi-head parallel computation driven by joint dual-domain weights, not only is the expressive power of the attention distribution improved, but the model's adaptability to complex indicator logical structures is also enhanced, providing a more discriminative embedded representation for vector retrieval construction.
[0053] Optionally, S4 includes:
[0054] Vector bucketing is performed on the financial text feature data to obtain vector bucketed data.
[0055] The index structure is constructed based on the vector bucketed data to obtain the index structure data;
[0056] Global index integration is performed based on the index structure data to obtain financial vector index data, which is used to assist in the construction of the financial knowledge base.
[0057] In this invention, vector bucketing divides high-dimensional feature data into several buckets based on distribution patterns, causing similar vectors to be clustered in a local area, thereby reducing the search space for subsequent retrievals. The index structure is built on the basis of bucketing to form an efficient data access path, such as an inverted index or graph index, ensuring fast query location and scalability. Global index integration unifies the merging of local indexes and generates an entry table, ensuring that the system can achieve consistency and completeness in cross-bucket retrieval in a large-scale financial knowledge base.
[0058] Optionally, this application also provides a financial knowledge retrieval system based on a vector database, used to execute the financial knowledge retrieval method based on a vector database as described above, wherein the financial knowledge retrieval system based on a vector database includes:
[0059] The financial text association processing module is used to acquire financial text data and perform association processing based on the financial text data to obtain financial indicator association data.
[0060] The numerical-semantic reasoning module is used to perform numerical association reasoning on financial indicator-related data to obtain numerical association data; and to perform semantic dependency reasoning on financial indicator-related data to obtain semantic dependency data.
[0061] The multi-head attention fusion module is used to perform multi-head attention calculations based on numerical correlation data and semantic dependency data to obtain financial text feature data.
[0062] The financial vector index generation module is used to generate vector indexes based on financial text feature data, thereby obtaining financial vector index data to assist in the construction of a financial knowledge base.
[0063] The purpose of this invention is to: S1 explicitly represent entities, indicators, and contextual relationships in financial texts through association processing, forming structured financial indicator association data and providing a unified input basis for calculations; S2 perform numerical association reasoning and semantic dependency reasoning on this basis, capturing not only the functional dependency chains and logical constraints between numerical indicators, but also constructing a semantic dependency network, solving the problem of the separation of numerical and semantic data in financial texts; S3 further utilizes a multi-head attention mechanism to fuse and model numerical and semantic features, achieving multi-angle and multi-granular feature alignment and weight allocation, ensuring that key financial entities and indicator relationships are highlighted in the global expression; S4 bins, indexes, and integrates the fused high-dimensional feature vectors to generate an efficient index structure suitable for vector databases, enabling fast and accurate similarity retrieval in massive financial knowledge bases. Attached Figure Description
[0064] Other features, objects, and advantages of this application will become more apparent from the following detailed description of the non-limiting embodiments, taken with reference to the accompanying drawings:
[0065] Figure 1 A flowchart illustrating the steps of a financial knowledge retrieval method based on a vector database according to one embodiment is shown.
[0066] Figure 2 A flowchart illustrating the steps of a financial indicator correlation processing method according to one embodiment is shown.
[0067] Figure 3 A flowchart illustrating the steps of a numerical correlation reasoning method according to an embodiment is shown;
[0068] Figure 4 A flowchart illustrating the steps of a multi-head attention fusion method according to one embodiment is shown.
[0069] Figure 5 A flowchart illustrating the steps of a financial vector index generation method according to an embodiment is shown.
[0070] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0071] The technical method of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0072] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. Functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.
[0073] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0074] Please see Figures 1 to 5This application provides a financial knowledge retrieval method based on a vector database, the method comprising:
[0075] S1. Obtain financial text data and perform correlation processing based on the financial text data to obtain financial indicator correlation data;
[0076] Specifically, heterogeneous financial text data from multiple sources, including financial reports, research reports, financial regulations, and information disclosure announcements, are collected and standardized using UTF-8 encoding. To eliminate redundant and interfering information, the original text is preprocessed to remove HTML tags, webpage style statements, special symbols, redundant spaces, and garbled characters. The financial text is segmented using a word segmentation model that incorporates an expanded financial thesaurus (e.g., Trie tree dictionary matching or BERT semantic segmentation). Words are then tagged with part-of-speech tags using a Conditional Random Field (CRF) model or a pre-defined part-of-speech tagging rule base. The tagging information includes, but is not limited to, basic part-of-speech categories such as nouns, verbs, numerals, time words, and proper nouns, providing a structural basis for subsequent entity recognition and dependency relationship analysis. Using predefined part-of-speech combination templates (such as "[Company Name] + [Time] + [Financial Indicators]") and regular expression rules, the system identifies and extracts financial entities specific to the financial field, such as company names, stock codes, financial indicators (such as "net profit" and "gross profit margin"), and time units (such as "2023" and "first quarter"), from the text, generating a structured list of financial entities. To address the common cross-sentence reference phenomenon in financial texts, a sliding window mechanism combined with inter-sentence co-reference rules is used for unified reference processing. For example, if pronouns such as "its" or "the company" appear in the current sentence, the system will trace back to the preceding text based on the nearest subject priority principle to identify the true referent and establish a consistency mapping table between the pronoun and the corresponding entity, thereby achieving entity uniqueness and standardization. After achieving entity uniqueness, the system further binds indicators based on the dependency relationships within the sentence in which the entity is located. Specifically, the system identifies verb structures or modifiers adjacent to entities, such as "net profit increased by 15%" or "revenue decreased year-on-year." It then associates and matches indicators such as "net profit" and "revenue" with their corresponding entities, thereby constructing association pairs in the form of "<entity, indicator>" to obtain financial indicator association data.
[0077] S2. Perform numerical correlation reasoning on the financial indicator correlation data to obtain numerical correlation data; perform semantic dependency reasoning on the financial indicator correlation data to obtain semantic dependency data.
[0078] Specifically, the numerical correlation reasoning includes the following: parsing all text fragments with quantitative features from financial indicator correlation data, including but not limited to information such as amount (e.g., "150 million yuan"), proportion (e.g., "year-on-year growth of 20%)", and change range (e.g., "decrease of 5 percentage points"). Standardization processing is performed for different units of expression; for example, "100 million yuan" is converted to a numerical value multiplied by 100 million, and "percentage points" are uniformly converted to the corresponding numerical proportion. For the identified numerical indicator information, combined with its contextual semantics and historical corpus tags, it is divided into different semantic categories according to its economic meaning, such as "profitability indicators", "risk indicators", and "growth indicators". Word embedding models (e.g., Word2Vec, BERT) are used to generate indicator vector representations, and the semantic closeness between indicators is calculated based on cosine similarity to construct a similarity matrix. Hierarchical clustering or density clustering methods are used to form semantically consistent indicator clusters. Within each indicator semantic cluster, dependency chains are constructed between indicators based on financial logic formulas (e.g., "net profit = revenue – cost") or semantic constraint rules (e.g., "gross profit margin is inversely proportional to cost ratio"). Specifically, a chain structure is established with indicators as nodes and formulas or constraints as directed edges. Dependency types (such as addition / subtraction relationships, multiplication relationships) and data source weights are appended to the edges to initially generate a structured dependency chain graph. The constructed numerical dependency chain is then used to perform consistency checks on numerical descriptions in financial texts. For example, when "revenue is positive" but "net profit is negative," the system can flag a potential anomaly and trace its cause. The inference results are categorized into compliance confirmation and risk warning, outputting structured numerical correlation data.
[0079] The semantic dependency reasoning includes the following: Sentence-level structural processing of financial text data is performed, using punctuation marks (such as periods, commas, semicolons, etc.) and conjunctions (such as "therefore" and "and") as boundary identification criteria to segment continuous text into basic syntactic units, establishing a basic granularity for dependency analysis and cross-sentence processing. Syntactic analysis tools (such as LTP, HanLP, or SpaCy) are used to perform dependency parsing on each syntactic unit, extracting dependency relation types such as subject-verb-object structures, attributive-head relations, and parallel structures. An intra-sentence dependency relation tree is constructed with words or phrases as nodes and dependency relations as edges to capture the grammatical constraint structure between words. Between syntactic units, anchor words or phrases with cross-sentence semantic connectivity are identified. Anchors include financial entities (such as company names, subsidiary names), key indicators (such as "the financial indicator" and "its growth rate"), or referential structures (such as "the company" and "its"). Cross-sentence referencing is resolved through coreference resolution mechanisms (such as referential mapping based on the shortest distance principle), establishing semantically consistent anchor mapping relationships. This paper integrates the dependency structures within each sentence with the anchor mappings between different sentences to construct a unified semantic dependency graph network. The nodes of this network represent financial entities and indicator phrases, while the edges represent various dependency types (intra-sentence dependency relations, cross-sentence references, indicator citations, etc.). The graph structure represents the semantic flow paths between sentence groups. Based on the constructed semantic dependency graph, logical consistency is checked to identify semantic conflicts or contradictory expressions, such as the inconsistency between "the subsidiary is significantly profitable" and "net profit has consistently been negative." Paths with contradictory chains are marked, and semantic dependency data with logical relationship descriptions is output.
[0080] S3. Perform multi-head attention calculation based on numerical correlation data and semantic dependency data to obtain financial text feature data;
[0081] Specifically, the aforementioned numerical correlation data is structured to extract key numerical attributes (e.g., financial indicator values, year-on-year / month-on-month ratios, logical reasoning result labels, etc.) and encoded into numerical vectors. Semantic dependency data is converted into graph-structured vector representations, such as semantic graph vectors generated using path encoding, adjacency matrix embedding, or graph neural networks. Numerical vectors and semantic vectors are concatenated to form a unified input vector sequence. A linear transformation is performed on this input vector sequence, constructing three types of representations for each input vector: query vector, key vector, and value vector. Different linear mapping weight matrices are used to project the original vectors, thus mapping all vectors to the same high-dimensional representation space. A scaled dot product attention mechanism is used to calculate the similarity between each set of query vectors and key vectors. The similarity results are normalized to generate an attention weight matrix. This weight matrix reflects the relative importance of each input unit in the global context. The attention calculation process is executed in parallel in multiple different subspaces, with each attention subheading using different linear projection parameters. The attention outputs of multiple sub-heads are concatenated and integrated after parallel processing. A linear mapping layer then remaps the concatenated result back to a unified output dimension, resulting in a fused feature representation containing multiple semantic cues. Based on the multi-head fusion result, residual connections and layer normalization mechanisms are applied to improve model stability and prevent gradient vanishing. The high-dimensional vector representation of the output is the financial text feature data.
[0082] S4. Generate a vector index based on the financial text feature data to obtain financial vector index data, which will be used as an auxiliary task for building a financial knowledge base.
[0083] Specifically, for the generated high-dimensional financial text feature vectors, a vector space partitioning algorithm (such as K-means clustering or other density-aware clustering methods) is used to divide the feature vectors into multiple vector buckets near the cluster centers. Each vector bucket is labeled with a unique bucket number, and a mapping relationship is established between the bucket number and its internal vector set. For each partitioned vector bucket, a corresponding local index structure is constructed. Specifically, an inverted index (suitable for sparse vectors), a hash table (suitable for hash mapping of dense data), or a graph-based approximate proximity structure (such as a hierarchical small-world graph HNSW) can be used. This index structure needs to record the index entries, distance metrics, and reference addresses pointing to the original features for all vectors within the bucket. After the local index is constructed, the local index structures of each bucket are further integrated into a unified global index system. Preferably, a two-level architecture design of "main entry index + bucket-level index" is adopted, that is, the identifier of each bucket, the cluster center vector, and the mapping path are maintained in the global entry index, thereby supporting the retrieval request to quickly locate the target bucket in the first stage and perform fine matching within the bucket in the second stage. The constructed global vector index structure is persistently stored. Optionally, the index data can be saved in JSON format or binary compressed format. Based on the vector index structure generated above, the original financial text data is bound to its corresponding feature vector and index number to construct semantic-level retrieval entries. This forms a set of financial knowledge entries containing original semantic text, high-dimensional vector representation, and index path, serving as the searchable basic unit in the financial knowledge base, thus forming the financial knowledge base for financial knowledge retrieval operations.
[0084] Optionally, the association process includes:
[0085] S11. Perform word segmentation and part-of-speech tagging on the financial text data to obtain the text part-of-speech data;
[0086] Specifically, the input financial text data includes, but is not limited to, Chinese financial documents such as annual report summaries, securities press releases, industry research reports, and information disclosure announcements. A word segmentation tool optimized for the financial sector is used to perform word segmentation on the input text. This tool can be customized and enhanced based on existing natural language processing tools (such as THULAC, HanLP, or Jieba) and supplemented and expanded with a custom financial dictionary. The custom dictionary preferably includes professional terms such as securities codes, industry terms, accounting subjects, and financial indicators to avoid incorrect word segmentation. For example, "net profit growth rate" is identified as a complete financial indicator term, rather than being incorrectly split into parts such as "net," "profit," and "growth rate." After word segmentation, a part-of-speech tagger built based on a Conditional Random Field (CRF) model or a Hidden Markov Model (HMM) model is used to identify the part of speech for each segmented result. Part-of-speech categories can include, but are not limited to: nouns (representing company names, industry names, financial terms, etc.), verbs (representing actions, trends, etc.), numerals (used to express amounts, growth rates, etc.), and proper nouns (such as organizational structures, product names, etc.). For typical numerical expressions (such as "500 million yuan" and "year-on-year growth of 10%) and time expressions (such as "third quarter of 2022", "this quarter", and "last year's period") appearing in the text, the system performs special annotations based on context rules and numerical patterns, classifying them into "numerical parts of speech" and "time-based parts of speech" respectively. The output is a sequence structure composed of text words and their corresponding part-of-speech tags, i.e., text part-of-speech data.
[0087] S12. Extract financial entities from the text part-of-speech data to obtain financial entity data;
[0088] Specifically, multiple extraction templates and regular expressions are constructed based on domain knowledge, and entity recognition is performed in conjunction with part-of-speech tags. Preferably, the following extraction categories can be included: Extraction of company names, stock abbreviations, and stock codes: Using regular expression patterns based on the structure of Chinese organization names (such as "XX Co., Ltd.", "Limited Liability Company", "XX Group"), combined with keywords such as "stock abbreviation" and "stock code" for location, name-type entities representing financial institutions, listed companies, etc., are extracted. Extraction of financial indicator terms: By constructing a financial indicator keyword library, keywords such as "net profit", "operating revenue", "gross profit margin", and "earnings per share" are matched, and entity recognition is performed in conjunction with noun part-of-speech tagging results. It can adapt to semantic variations of different expressions (such as "net profit attributable to parent company" and "year-on-year growth rate"). Extraction of time expressions: For time information that frequently appears in financial texts, regular expression templates for standard time expressions are constructed, such as "2023", "first quarter", "this year", and "last year's period", etc., and time range recognition is performed in conjunction with context rules. Numerical information extraction: For numerical expressions containing units or proportions, such as "500 million yuan", "year-on-year growth of 12.5%", and "debt ratio of 45%", numerical segment location and unit extraction are performed;
[0089] Each identified entity is uniformly mapped to a pre-defined standardized label based on its semantic category. Specifically, this includes entities such as organization names (labeled "Organization"); financial or operational indicator nouns (labeled "Indicator"); time-related expressions (labeled "Time"); and numerical fragments with specific meanings (labeled "Number"). The system records the start and end position offsets of each entity in the original text, i.e., the entity's "start character position" and "end character position." The output is a structured financial entity dataset containing entity content, entity type labels, and their position offset information in the original text.
[0090] S13. Perform entity identification elimination processing based on financial entity data to obtain entity-unique data;
[0091] Specifically, the system inputs generated financial entity data, which includes various financial entities extracted from the original text, along with their location information and type labels. The system uses three mechanisms to parse and map words with referential characteristics: Context-based referential judgment: When typical referential words (such as "its," "the company," or "the group") are detected in a sentence, the system prioritizes backtracking the preceding sentence or the two sentences above and below to check if only one institutional entity (i.e., the "Institutional (ORG)" label) appears. If the uniqueness condition is met, a referential link can be directly established, mapping the current pronoun to the entity appearing in the preceding text. Syntactic dependency-based referential tracing: For "its + indicator" structures appearing in a sentence (such as "its net profit," "its debt ratio," etc.), the system uses syntactic dependency analysis to determine that "its" is a subject modifier, and the corresponding indicator word is the object or core verb object. Further backtracking is performed to check if the same indicator word has appeared in the preceding text and to identify its subject entity, thereby inferring the actual corporate entity referred to by "its." Synonymous Abbreviation Unification Based on Semantic Similarity: For common abbreviations, aliases, and acronyms in Chinese financial texts (e.g., "Company A in a certain country" vs. "Company A", "Full name of Company B" vs. "Abbreviation of Company B"), the system calls pre-trained word vector models (such as Word2Vec, BERT, etc.) to compare their semantic embedding vectors. If the vector similarity exceeds a set threshold (e.g., 0.85), it is determined that they refer to the same entity. For entity phrases or pronouns with confirmed referential relationships, the system replaces their expression in the original text with a unified standardized entity identifier. This identifier can be determined based on the full name of the registered company, the publicly disclosed abbreviation of the stock exchange, or a unique knowledge base number set by the user. The output is a dataset of financial entities containing the results of the uniqueness processing. Each entity record is accompanied by its standard entity identifier, original expression, referential path information, and location information, forming a structured unified entity mapping table.
[0092] S14. Perform entity indicator mapping processing based on the entity uniqueness data to obtain financial indicator related data.
[0093] Specifically, based on deduplicated entity data, institutional entities and their corresponding indicator information are identified, and structured financial indicator relationships are extracted. When both an institutional entity (e.g., company name) and an indicator entity (e.g., "net profit") appear in the same sentence, a direct mapping relationship is established. If the sentence only contains the indicator and its value, but a similar institutional entity exists in the preceding text (e.g., referred to as "this company"), a reverse mapping relationship is established based on the contextual semantics. The numerical value (e.g., "15%)" and time information (e.g., "2023") corresponding to the indicator are extracted from the bound statement. Each mapping result is constructed into a standardized four-tuple format, including company name, indicator name, indicator value, and time field. Through the above processing, structured financial indicator relationship data is output.
[0094] Optionally, the numerical association reasoning includes:
[0095] S21. Perform numerical feature identification on the financial indicator correlation data to obtain numerical feature data;
[0096] Specifically, each financial indicator quadruple is traversed to identify its numerical fields, including expressions such as amount, percentage, multiple, and ratio. Units such as "hundred million yuan" and "million yuan" are converted to basic monetary units (e.g., multiplied by one hundred million or one million); percentage expressions like "%" are converted to decimal form; and expressions containing semantics such as "year-on-year growth" or "decline" are marked as positive or negative based on contextual information. Based on the semantic content of the numerical values, category labels are assigned, including RATIO (proportion or ratio feature), VALUE (absolute value feature), and CHANGE (change feature such as growth or decline). Through the above processing, standardized numerical feature data with a standardized field structure and directly usable values are output.
[0097] S22. Perform index semantic clustering on the numerical feature data to obtain numerical feature clustered data;
[0098] Specifically, based on a financial indicator dictionary, each indicator field is assigned a domain semantic label, such as "profitability," "debt repayment," "growth," and "risk," to clarify its economic semantic affiliation. A pre-trained financial language word vector model (such as Word2Vec or BERT) is used to vectorize each indicator name, constructing a semantic similarity matrix between indicators; only high-similarity indicator pairs with similarities exceeding a set threshold are retained. Unsupervised clustering is then performed on the similarity matrix, using density clustering (such as DBSCAN) or hierarchical clustering algorithms to obtain multiple indicator semantic clusters, each corresponding to a set of semantically similar indicators. The output is structured numerical feature clustered data.
[0099] S23. Generate numerical dependency chains based on the clustered data with numerical features to obtain numerical relationship data;
[0100] Specifically, for each set of indicators within an indicator cluster, the derivation order is extracted based on common financial analysis knowledge or industry standard models. For example, for the "profitability" indicator cluster, it is arranged in the order of "operating revenue → operating profit → net profit"; for the "liability repayment" indicator cluster, it is arranged in the order of "total liabilities → total assets → debt-to-equity ratio". Based on the above order, directed dependencies are established between adjacent indicators to form indicator pairs (such as <operating revenue, net profit>), and the calculation semantic type of each dependency is labeled, such as "difference calculation", "ratio calculation", or "recursive calculation". A graph structure is constructed with indicators as nodes and numerical derivation paths between indicators as edges, allowing one node to correspond to multiple outgoing edges, supporting multi-path merging and branching logic, forming an indicator evolution network with a graph topology.
[0101] S24. Perform numerical logic reasoning based on numerical relationship data to obtain numerical correlation data.
[0102] Specifically, based on the numerical dependencies between indicators, automated logical reasoning and consistency verification are performed on financial data to uncover potential anomalies and implicit connections. Each reasoning path in the dependency chain graph is traversed, and basic arithmetic derivations (such as addition, subtraction, multiplication, and division) are performed based on the known node values. For example, if a link contains nodes A (e.g., "total assets") and B (e.g., "liabilities"), and C (e.g., "net assets") exists, then it is verified whether C satisfies C=A−B. If the expected calculation relationship is not met, the corresponding residual value ε is recorded, calculated as ε=inferred value−actual value. A numerical residual threshold (e.g., error exceeding 10%) is set to identify inconsistent reasoning links; supplementary markings are added based on business logic rules (e.g., "debt-to-asset ratio greater than 60%" is considered financial risk) to enhance practical applicability. Each link is assigned a reasoning result label, such as "valid," "invalid," or "incomplete data." The generated numerical correlation data includes the calculation dependencies, consistency status, and risk indicators between each set of indicators.
[0103] Optionally, the indicator semantic clustering includes:
[0104] Semantic label mapping is performed on numerical feature data to obtain numerical feature label data;
[0105] Specifically, the numerical feature data consists of several structured records. Each record includes fields such as indicator name, value, unit, and type, organized as a set of four-tuples: <indicator name, value, unit, value type>. A semantic classification label table for financial indicators is established to categorize common indicators into predefined semantic categories. For example, "net profit" is categorized as profitability; "revenue year-on-year growth rate" is categorized as growth; and "asset-liability ratio" is categorized as solvency, etc. Matching is performed using a keyword mapping table combined with regular expressions. For indicator names containing compound phrases (such as "gross profit margin change rate"), the longest prefix matching principle is prioritized to ensure matching accuracy. A semantic label field is added to each numerical feature data record.
[0106] A similarity matrix is constructed based on the numerical feature label data to obtain similarity matrix data;
[0107] Specifically, the numerical feature data includes semantically labeled fields such as indicator name, value, unit, value type, and semantic label. A pre-trained language model (such as Word2Vec, FastText, or BERT) is used to semantically vectorize each indicator name, converting each indicator into an embedding vector of dimension d (e.g., 128 or 258) to represent its semantic features. The similarity between semantic vectors is calculated for all indicator pairs. Cosine similarity is used as the similarity measure; that is, for any two indicators, their similarity is determined by the cosine of the angle between their corresponding semantic vectors. The closer the cosine value is to 1, the more semantically similar the two indicators are. An N x N symmetric matrix is constructed using the pairwise similarity scores of the indicators, where N is the total number of indicators. Each element in the matrix represents the semantic similarity score between the corresponding two indicators. A similarity threshold (e.g., 0.85) can be set as needed to filter out indicator pairs with significant semantic relevance. The indicator similarity matrix data is then output.
[0108] Similarity clusters are obtained by aggregating similarity data based on the similarity matrix data.
[0109] Specifically, the semantic similarity matrix data between input indicators reflects the degree of semantic similarity between each pair of financial indicators. The clustering algorithm is selected based on the characteristics of the similarity matrix: when the similarity matrix is relatively dense and the number of indicators is moderate (when the proportion of elements in the similarity matrix greater than a threshold (e.g., 0.75) exceeds 80%, and the number of indicators to be clustered does not exceed 1000), a hierarchical clustering method, such as the average connectivity method, is used to merge indicators layer by layer; when the total number of indicators is large or the distribution is sparse (when the total number of indicators exceeds 2000, or the proportion of elements in the matrix higher than the similarity threshold (e.g., 0.85) is less than 30%), a density-based clustering method (e.g., density-based spatial clustering algorithm) is preferred, as it does not require a preset number of clusters and can adaptively mine high-density indicator regions; furthermore, when the similarity distribution does not exhibit extremely dense or extremely sparse characteristics, and the number of indicators is between 1000 and 2000, a spectral clustering method is preferred. This method obtains a low-dimensional embedding representation by performing spectral decomposition on the similarity matrix, and performs grouping operations such as KMeans based on this representation to mine the indicator cluster structure under nonlinear semantic relationships. Set a similarity threshold (e.g., 0.85) as the merging criterion; only indicators whose semantic similarity exceeds this threshold can be grouped into the same cluster. A minimum cluster size (e.g., no less than 3 members) can be set to filter semantic noise or isolated indicators. Output the names of the financial indicators contained in each cluster and their cluster center information. The cluster center can be the mean vector of the indicators within the cluster or the semantically most representative indicator.
[0110] Semantic hierarchy refinement is performed based on similarity cluster data to obtain numerical feature cluster data.
[0111] Specifically, the input consists of initial indicator clusters obtained through semantic similarity aggregation. Each cluster contains multiple financial indicators with high semantic relevance. Based on the semantic breadth and subdivision of the indicators, a labeling system is established at different levels: at the first level, indicators are categorized according to macro-level semantic categories, such as "profitability," "growth," and "solvency." At the second level, indicators are grouped according to their specific uses or calculation logic; for example, "profitability" can be further subdivided into "net profit" and "earnings per share." A tree-like semantic structure with parent-child relationships is constructed: each first-level category serves as the root node, with corresponding sub-indicator categories attached below it. The data structure can use a parent node identifier field (e.g., `parent_id`) for labeling, or a nested hierarchical structure for serialized storage (e.g., JSON format). During the construction process, if semantically conflicting labels appear within the same sub-cluster (e.g., an "growth" indicator mistakenly included in the "profitability" cluster), a consistency check mechanism is triggered. Check methods include automatic weight reduction to remove inconsistent items or outputting to a manual review module for label confirmation and rollback.
[0112] Optionally, the generation of the numerical dependency chain includes:
[0113] Based on the numerical feature-based clustered data, the intra-cluster index order is analyzed to obtain the intra-cluster index order data.
[0114] Specifically, the input is clustered data of numerical features, with each cluster being a set of indicators of the same semantic category. If historical time-series data exists, the causal order between indicators can be inferred based on the time lag characteristic, for example, by using Granger causality tests to determine the sequential influence relationship. If historical numerical data is lacking, the indicators are sorted according to a financial knowledge base or common financial logic, for example, "operating revenue" precedes "gross profit," and "gross profit" precedes "net profit." A sequential score is calculated for any two indicator pairs within a cluster. ,in The ranking score is the score among the indicators, representing the indicator's ranking score. Does it "prioritize" in semantic or temporal logic? , As an indicator and The lagged correlation coefficient, This refers to the indicator that appears first in the order of the cluster, i.e., the indicator to be inferred as the "cause," such as "operating revenue," "main business revenue," "total assets," and other driving or leading financial indicators. These are the indicators that appear later in the order of the cluster, i.e., the indicators to be inferred as "results," such as "net profit," "gross profit margin," "earnings per share," and other result-oriented or derivative indicators. is the weighting coefficient for the mutual information term, used to adjust the relative importance between lagged correlation and mutual information; it is a decimal between 0 and 1. As an indicator and The mutual information between the indicators is used to measure the non-linear dependency between them. The score consists of two parts: the first part is the lagged correlation coefficient between the indicators, which measures the correlation strength under time lag; the second part is the mutual information value between the indicators, which measures their non-linear correlation. The two are combined in a weighted manner, and the weight coefficient can be set according to the scenario (e.g., correlation coefficient or mutual information is the main factor). The inferred order relationship is organized into a directed order list within the cluster to obtain the index order data within the cluster.
[0115] This invention provides a formula for calculating a sequential score, which unifies the modeling of statistical correlation in the time dimension and nonlinear dependency in the information dimension, thereby more comprehensively reflecting the potential sequential logical relationships between indicators. The lagged correlation coefficient focuses on describing the trend linkage under time lag conditions and can be used to reveal driver-response relationships; mutual information can capture dependency structures in nonlinear or non-Gaussian cases, supplementing the shortcomings of linear methods. By weightedly fusing these two indicators, the robustness and discriminative power of the ranking results can be significantly improved. In certain financial scenarios with significant lag but nonlinearity (such as the impact of "debt-to-equity ratio" on "credit rating"), the introduction of the mutual information term can compensate for the bias of traditional lagged correlation. This score can serve as an important quantitative basis for constructing intra-cluster causal graphs, directed edge ranking, or dependency chain generation, helping to enhance the model's ability to model the sequential relationships of financial indicators and improve the rationality and interpretability of sequential graph construction.
[0116] Dependency candidate edges are constructed from the index sequence data within the cluster to obtain dependency candidate edge data;
[0117] Specifically, based on the parsed index sequence data, a systematic set of candidate edges with logical dependencies is generated. For the sorted index sequence in each index cluster, candidate dependency edge pairs are constructed according to the following rules: only unidirectional dependencies from preceding to subsequent indices are allowed, i.e., indices ranked higher in sequence can establish edges to indices ranked lower; only index pairs that are adjacent in sequence or whose interval does not exceed a set step size are considered to control the number of dependency edges and improve the sparsity of the graph structure. For each candidate edge, its dependency weight score is calculated: ,in The weight score of the candidate dependency edge from index i to index j. The semantic similarity score weighting coefficients between indicators To score the semantic similarity between indicators, the cosine similarity of the indicator word vectors can be calculated using language models such as BERT or SimCSE, representing the semantic substitutability or belonging consistency between the two. The unit convertibility score weighting coefficient. The unit conversion score between indicators reflects whether there are direct or indirect conversion rules (such as the multiple conversion between "ten thousand yuan / share" and "yuan / share"). The historical correlation score weighting coefficient between indicators The historical numerical correlation score between indicators can be calculated using Pearson correlation coefficient, mutual information, or time series co-variance trends. This score measures the strong correlation between the two indicators in actual data, considering the following three factors: First, the semantic similarity between indicators, reflecting their semantic substitutability or consistency of attribution; second, the convertibility between indicator units, i.e., whether there is a direct or indirect unit conversion path; and third, the numerical correlation between the two in historical data, reflecting their actual transmission potential. These three indicators are weighted and summed to form a dependency score, with weight coefficients configurable according to model requirements. Threshold filtering is applied to the calculated edge weights. If the score of a candidate edge is lower than a preset threshold, its dependency relationship is deemed insignificant and it is removed from the dependency graph, resulting in dependency candidate edge data.
[0118] This invention provides a weighted score calculation formula where all three scoring factors are normalized values, typically controlled within the [0,1] interval, facilitating uniform weighting; the unit convertibility score... This value measures whether a deducible conversion relationship exists between the units of two indicators. If the units are identical, the value is 1; if a direct multiple conversion relationship exists, the value is 0.8 to 0.95; if a conversion path can be derived indirectly from the units, the value is 0.5 to 0.7; otherwise, the value approaches 0, indicating no conversion. The weighting coefficient can be manually set or learned automatically during training to adapt to different corpora or model task preferences. In scenarios where financial indicators are highly homogeneous, the semantic similarity weight can be increased. In analyses where dimensional consistency is important, the weighting of unit convertibility can be increased. By integrating three-dimensional factors—semantic similarity, unit convertibility, and numerical correlation—to construct a dependency edge scoring system between indicators, the logical and statistical relationships between indicators can be more comprehensively and accurately characterized. At the same time, by adopting a configurable weighted fusion mechanism and threshold filtering strategy, the interpretability, robustness, and sparsity of the dependency graph structure are effectively improved, providing a high-quality structural foundation for path selection and causal analysis.
[0119] Dependency chain data is obtained by filtering dependency candidate edge data;
[0120] Specifically, from the constructed set of candidate dependency edges, effective dependency paths with strong logical rationality and numerical relevance are selected, while redundant links and noisy edges are removed. The directed graph composed of candidate dependency edges is topologically sorted, and all possible path sequences from the start point to the end point are enumerated, ensuring that the paths are consistent in direction and free from cyclic dependencies. For each candidate path, its overall path score is calculated. ,in Path scoring is used to measure the dependency quality of path P. Let be the path length, and represent the number of dependent edges contained in path P. Let be the edge weight from node i to node j, representing the semantic / numerical strength of the dependency. This is a path length penalty coefficient used to suppress lengthy paths. The base score can be set as the average weight of all edges in the path, i.e., the sum of the dependency strengths of all edges divided by the path length. The system pre-sets a path length penalty item, such as setting a penalty coefficient, to reduce the weight of excessively long paths, thereby prioritizing the retention of paths with simple structures and close connections. Based on the scoring results, all paths are sorted, and one of the following filtering methods is used: retaining the top-scoring paths (e.g., the top 10) as high-value dependency chains; or setting a minimum path score threshold to retain only paths with scores greater than the set threshold.
[0121] This invention provides a path score calculation formula, in which... This represents the cumulative weight of all dependent edges in path P, reflecting the total dependency strength along the entire path. The path length is the number of edges in the path. The average dependency strength per unit length of the path is obtained by normalizing the cumulative weights, i.e., dividing them by the path length. This is used to measure the average reliability of dependencies at each step of the path. To avoid systems favoring paths with verbose structures but diluted information, a path length penalty term is introduced. ,in This is an adjustable penalty coefficient. This term is used to suppress redundant dependency chains that, while having high dependency strength, are too long, thus guiding the model to prioritize high-value paths with simple structures and compact dependencies. This scoring formula implements a joint selection strategy of "strong dependency priority + shortest path priority." When dependency strength is high, the path score value... A larger path length is beneficial for selecting highly significant logical chains; however, when the path length is large, even with high dependency strength, the penalty term will significantly lower the score, thus inhibiting the selection of redundant structures. The system sorts all candidate paths according to their path scores, and can select effective dependency chains by retaining the top K or setting a score threshold.
[0122] Dependency chain graphs are constructed based on dependency chain data to obtain numerical relationship data.
[0123] Specifically, the selected numerical dependency chains are uniformly modeled as a graph structure, forming a numerical dependency graph with semantic attributes and causal orientation. Each financial indicator is abstracted as a node in the graph, with the node name being the indicator name and an attached semantic attribute label, such as the financial type it belongs to (e.g., profitability, debt repayment, etc.). Each selected dependency chain is transformed into a directed edge in the graph, with the starting and ending points of the edge corresponding to the dependency direction between indicators. Edge attributes include dependency strength (i.e., the aforementioned edge weight) and inference direction. The graph structure is organized using an adjacency list or converted into a graph database format that supports graph queries (such as Neo4j). Each node contains attribute fields, such as indicator name, indicator type, semantic label, etc.; each edge contains attribute fields, such as source indicator, target indicator, dependency weight, causal direction, etc. The constructed graph structure is checked for acyclicity to ensure the formation of a directed acyclic graph (DAG) to meet the requirements of causal inference and data flow modeling. At the same time, the in-degree and out-degree of the nodes are counted, and nodes with abnormally high numbers of in-degree and out-degree edges are flagged to assist manual checks for misjudgments or semantic conflicts. Based on the above, the system obtains numerical relationship data.
[0124] Optionally, the semantic dependency reasoning includes:
[0125] The data related to financial indicators are divided into syntactic units to obtain syntactic unit data.
[0126] Specifically, the system refines financial indicator-related text into language units with independent semantics and clear syntactic roles. The input is structured or semi-structured financial indicator expression text, such as short sentences like "net profit growth exceeds revenue growth." A rule-based sentence segmenter or pre-trained language model (such as BERT) is used to delineate sentence boundaries in the input text and extract complete expression units. For each sentence, dependency parsing tools (such as SpaCy, LTP, HanLP, etc.) are used to divide it into basic syntactic units and label their syntactic categories, such as noun phrases (NP), verb phrases (VP), attributives, adverbs, etc. Each language unit is accompanied by its original text and corresponding syntactic category; in addition, financial semantic attribute annotations can be added during the process, such as whether it is a "financial indicator item," a "numerical comparison term," or a "relational verb."
[0127] Dependency relation identification is performed based on syntactic unit data to obtain dependency relation data;
[0128] Specifically, the dependency structures between syntactic units are identified, clarifying the grammatical relationships and dependency directions between various language components. Using the syntactic unit data obtained in previous steps as input, a dependency parsing model (such as BiaffineParser or Deep Biaffine Parser) is invoked to construct a dependency tree structure, clarifying the head of each syntactic unit and its subordinate relationships. For each dependency pair, its grammatical type is labeled, including but not limited to subject-verb relations (nsubj), object relations (obj), adverbial modification (advmod), and comparative relations. For common compound terminology structures in the financial field (such as "year-on-year profit growth"), pattern recognition is used to break them down into more explicit binary dependency structures. For example, the expression is transformed into "profit" depending on "growth," and a "year-on-year" modifying relationship is assigned.
[0129] Semantic anchor mapping is performed based on dependency relationship data to obtain cross-sentence semantic data;
[0130] Specifically, based on the identified syntactic dependency relations, semantically dominant anchor units are extracted from sentences, and semantic similarity analysis is used to align semantic concepts between sentences, thereby constructing cross-sentence-level semantic association information. Semantically representative words are selected from the dependency structure as anchor candidates, prioritizing nouns (e.g., "net profit," "asset turnover"), domain-specific terminology, and verbs expressing trends (e.g., "rise," "fall," "growth"). Intra-sentence semantic binding is performed on anchor candidates, and coreference resolution algorithms are used to identify intra-sentence appositive expressions (e.g., pronouns, ellipsis, alternative names, etc.). A sliding window strategy (e.g., window size 3) is employed to analyze the context of adjacent sentences, obtaining modifiers, comparison objects, or constraints related to the anchor to enhance its semantic integrity. For anchor candidates across multiple sentences, pre-trained word vector models (e.g., BERT or SimCSE) are used to calculate the similarity between their semantic vectors. If the semantic similarity between a pair of anchor points is higher than a set threshold (e.g., 0.85), it is determined to be a semantically consistent item, an anchor point mapping relationship is established, and the semantic links between their corresponding sentences are recorded. The system obtains cross-sentence semantic data.
[0131] A semantic dependency network is constructed from cross-sentence semantic data to obtain semantic dependency network data;
[0132] Specifically, by integrating intra-sentence dependency relations and cross-sentence semantic anchor mapping relations, a semantic network structure for financial indicators covering multiple sentences is constructed to support subsequent semantic graph reasoning and indicator logic modeling. Semantic units, after syntactic segmentation and anchor mapping, are integrated and defined as nodes in the graph structure. Each node can include financial indicator terms, trend description verbs, modifiers, etc., retaining their original semantic labels and syntactic types. Semantic dependency edges are established between nodes. Edge types include intra-sentence dependency edges and cross-sentence anchor mapping edges, and each edge can be labeled with a relation type (such as "subject-verb," "modifier," "comparison object," "synonymous mapping"). For semantic nodes that are synonymous or have similar expressions (e.g., "gross profit increase" and "gross profit growth"), a graph compression strategy is used for merging. Equivalence can be determined based on criteria such as semantic similarity and grammatical role consistency. After merging, a unified node identifier is retained, and the connection relationships of all related edges are updated.
[0133] Semantic dependency data is obtained by performing logical consistency reasoning based on semantic dependency network data.
[0134] Specifically, based on the constructed semantic dependency network, logical consistency checks are performed on the semantic chains between financial indicators to identify potential conflicting paths and extract structured semantic dependency data. All paths in the semantic dependency graph starting from the core financial indicator are traversed, and the semantic direction (e.g., positive driving relationship, negative inhibiting relationship) in the paths is identified and labeled. Judgments are made according to a pre-defined set of causal logic rules; for example, "if operating revenue increases, gross profit should usually increase synchronously" is considered a positive consistent path. If the same target indicator node (e.g., "net profit") has contradictory dependency paths (e.g., one path infers its growth, another infers its decline), it is marked as a potential logical conflict or ambiguity. Such cases are recorded as conflict identifiers. The inferred path relationships are output in a structured form, including indicator name, path type (positive or negative), dependency chain order, conflict identifier, etc. The obtained semantic dependency data can be used as explicit relation feature input in attention computation.
[0135] Optionally, the semantic anchor mapping includes:
[0136] Anchor candidate data is obtained by extracting anchor candidate data based on dependency relationship data.
[0137] Specifically, semantically oriented core terms are extracted from dependency structures as anchor point candidates for semantic mapping and graph structure construction. Based on dependency relationship data, the following types of terms are preferentially extracted as anchor point candidates: noun terms, especially entities related to financial indicators (such as "net profit," "revenue," and "cost"); verbs or verb phrases, core verbs expressing trends or semantic events (such as "rise," "fall," "grow," and "return"); and keywords indicating comparison or correlation (such as "exceed," "below," and "maintain"). The extracted terms are filtered according to their dependency roles in the syntactic structure (such as subject, object, predicate center, and modifier attachment), retaining only terms with semantic independence or driving function, excluding prepositional connectors, function words without independent semantics, etc. Terms that meet the criteria are marked as anchor point candidate data.
[0138] Anchor point context data is obtained by binding anchor point candidate data to anchor point context data.
[0139] Specifically, each semantic anchor is combined and bound to its semantic modifiers within the sentence to form a semantic expression fragment. Centered on the anchor word, the dependency graph is expanded outwards by 1 to 2 hops to extract terms with direct dependencies, primarily including modifiers, attributives, and adverbs. Typical dependency relationships include adjective modification (adjective modifier), adverb modification (adverbial modifier), limiting components (quantifiers, time words), and noun combination relationships (compound structures, noun modifiers). The extracted modifiers are labeled and categorized according to semantic attributes, including time-related elements (indicating time of occurrence or statistical period, such as "this year," "first quarter," "end of 2022"); comparative elements (indicating reference targets or comparative relationships, such as "higher than the same period last year," "lower than the industry average"); and numerical quantifier elements (indicating specific degree of change or numerical value, such as "increased by 10%," "decreased by 120 million yuan"). The anchor word and its contextual elements are then used to construct a joint expression unit.
[0140] Anchor point cross-sentence matching is performed on the anchor point context data to obtain anchor point cross-sentence data;
[0141] Specifically, anchor pairs with potential referential or semantic continuation relationships in different sentences are identified to construct a cross-sentence semantic correspondence structure. Within a set sliding window (e.g., three adjacent sentences), all extracted anchors are paired to construct a candidate set of anchor pairs. For each candidate anchor pair, its contextual semantic representation is extracted. The preferred method is to use a pre-trained language model to encode the anchor and its context to generate semantic embedding vectors. The semantic similarity of the anchor pair is calculated based on a similarity measurement method between vectors (e.g., based on cosine similarity). If the similarity exceeds a set threshold (e.g., 0.85), the two anchors are considered semantically similar and can be regarded as cross-sentence synonymous anchors. If a candidate anchor contains non-entity expressions (e.g., "its," "this indicator," "this data," etc.), a referential resolution tool or model (e.g., a neural network-based referential resolution algorithm) is invoked to resolve the referentiality, in order to help determine whether the anchor constitutes the same semantic subject as the preceding anchor.
[0142] An anchor point mapping graph is generated based on the cross-sentence anchor point data to obtain cross-sentence semantic data.
[0143] Specifically, a cross-sentence semantic association structure is constructed between anchor points, representing the conceptual mapping relationship between anchor points in graph form. Each anchor point confirmed through cross-sentence matching is represented as a node in the graph. Each node is accompanied by its original terminology information and contextual semantic representation data, used to identify the semantic meaning and contextual source of the anchor point. For successfully matched anchor point pairs, graph edges representing semantic associations are established between the corresponding nodes. These graph edges contain two main attributes: semantic similarity, reflecting the degree of proximity of the two anchor points in the semantic space; and sentence distance, used to represent the sentence span in which the two anchor points appear in the text, such as increasing the distance by one for every other sentence. The structure composed of the above nodes and edges is organized into a traversable graph structure.
[0144] Optionally, S3 includes:
[0145] S31. Perform linear vector mapping based on numerical correlation data and semantic dependency data to obtain linear vector data;
[0146] Specifically, the representation dimensions of numerical and semantic information are unified. The input includes two parts: first, a numerical association vector generated from indicator logical reasoning, representing the quantitative relationship between indicators; second, a semantic dependency vector generated from anchor paths in the semantic dependency network, representing the structural relationship between syntax and semantics. Both types of vectors are normalized using linear mapping. That is, learnable mapping parameters are used to map the numerical and semantic vectors to a unified vector space. The mapped numerical and semantic vectors are then concatenated or weighted to form a joint linear vector with composite information. This joint vector simultaneously retains both numerical logical information and semantic structural features. If the system receives multiple sample units as input, the output is a sequence of linear vectors of equal dimensions.
[0147] S32. Perform semantic-structural dual-domain attention calculation based on linear vector data to obtain attention weight data;
[0148] Specifically, for each input linear vector, a corresponding query vector, key vector, and value vector are generated using a pre-defined trainable weight matrix. Based on the scaled dot product method, an attention score is calculated between any two vectors, i.e., the attention strength is measured by the similarity between the query vector and all other key vectors. Subsequently, the score vector of each vector is normalized so that its attention to all vectors forms a weighted distribution. The output is an attention weight matrix, i.e., attention weight data, where each row represents the distribution of the current vector's attention intensity to all other vectors.
[0149] Specifically, for each linear vector, its context window in the semantic sequence is extracted (e.g., expanding 2 to 5 vectors forward and backward from the current position). A local semantic attention distribution is formed by calculating the semantic similarity between this vector and other vectors within the window. Similarity is measured using a scaled dot product, and a weight distribution is generated through normalization to obtain the semantic attention weights. Based on the semantic dependency graph generated in the preceding steps, nodes in the graph represent the position of a vector in a sentence, and edges represent syntactic dependencies, coreference relations, or index referential relations. For each target vector, its adjacent nodes in the graph are collected, and structural attention weights are calculated using a learnable neural network based on adjacency relations and content features. ,in target vector For structural adjacency vectors Domain attention weights To perform a normalization operation on all adjacent nodes, ensuring that the sum of all structural attention weights is 1, For the activation function used to introduce nonlinear relationships, Let be the projection vector of the structural attention. This is a learnable vector transformation matrix used to unify the feature space. This is the semantic representation vector of the target node, representing the central index or central term currently being aggregated for adjacency information. The system will then fuse information from its neighboring nodes based on this vector. Let be the semantic representation vector of the adjacent nodes, representing the relationship with . For context nodes connected by dependent edges, the system uses an attention mechanism to determine their relationship to the context node. The degree of influence is used to reflect the importance of the semantic dependency structure in the graph. To combine semantic proximity and structural dependency, a weighted fusion approach is adopted to integrate semantic domain attention and structural domain attention: ,in For the merged attention weights, This is the semantic domain attention ratio factor, which can be a manually set constant or learned automatically during training. For semantic attention weights, The attention weights are for the structural domain. The fusion weights can be preset constants or learned automatically through model training, thereby dynamically balancing the contributions of the two types of attention to the semantic representation. To ensure the stability of the fused attention distribution and that it does not deviate from probability constraints, the fused attention weights are subjected to layer normalization, ensuring that their sum is 1 in each dimension, thus obtaining the attention weight data.
[0150] This invention provides a formula for calculating structural attention weights. This formula learns the differential weights between nodes through adjacency structure, thereby dynamically capturing the degree of semantic dependence in graph structure and improving the accuracy and expressive power of node semantic aggregation. Represents the target node Its structural adjacent nodes Domain attention weights reflect In update Indicates the degree of importance in the process. and These represent the semantic feature vectors of the central node and its adjacent nodes, respectively, and are mapped through a unified linear mapping matrix. Projecting to the same feature space is used to eliminate differences in the original feature dimensions; here These are the trainable parameters of the model. The result of concatenating the two is... Through vectors Perform inner product projection to measure the coupling strength between two nodes; Similarly, the trainable attention projection parameters determine how the system focuses on local structural relationships. To enhance nonlinear expressive power, the projection results are processed using the LeakyReLU activation function, introducing tolerance for weakly negatively correlated features. The system then focuses on the target node. All adjacent nodes are subjected to softmax normalization to ensure that all The sum of the weights is 1, thus forming a well-interpretable domain attention distribution.
[0151] This invention provides a weighted fusion calculation formula, wherein, This represents the semantic domain attention weighting factor, with a value range of [0,1]. It can be manually set by the user or automatically optimized as a learnable parameter during model training. A larger value indicates a higher weighting. The higher the value, the more the model focuses on semantic similarity relationships, while a lower value... The value then biases the model towards dependent paths within the graph structure. This formula treats existing structural connections in the graph as hard connections, extracting their importance through structural attention; simultaneously, it treats semantically similar but structurally disconnected node relationships as soft connections, supplementing the model with semantic attention. By fusing the results of both attention methods through a weighted average, it can take into account both explicit dependency structures and implicit semantic connections, thereby improving aggregation quality and representational power.
[0152] S33. Perform multi-head parallel computation on the linear vector data based on the attention weight data to obtain multi-head attention fusion data;
[0153] Specifically, the number of heads in the multi-head attention mechanism is set to h. For each attention head, a separate set of query, key, and value transformation matrices is initialized to extract attention feature representations of a specific dimension from the input linear vector. For each attention head, linear transformations of the query, key, and value are performed on the input linear vector, and attention weights are calculated using the dot product attention mechanism. Subsequently, the weights are multiplied by the value vector to obtain the feature output of that attention head. The outputs of all attention heads are concatenated column-wise to form a sequence of joint representation vectors with expanded dimensions. A unified output mapping matrix is used to perform a linear transformation on the concatenated result to restore it to the preset representation dimensions, thus obtaining the fused multi-head attention output data. The resulting multi-head fused representation is a vector sequence with consistent dimensions, yielding the multi-head attention fused data.
[0154] S34. Generate financial text features based on multi-head attention fusion data to obtain financial text feature data.
[0155] Specifically, financial text features with contextual understanding and structural semantic representation capabilities are extracted based on the results of multi-head attention fusion. The aforementioned multi-head attention fusion vector sequence undergoes feature compression processing, employing strategies such as mean pooling, max pooling, or attention-weighted aggregation to extract global semantic representations; alternatively, a Transformer encoder can be used to further enhance contextual interactivity and form semantic feature representations. Pre-trained financial domain language models (such as FinBERT or ERNIE-Fin) are introduced for domain transfer learning, fusing general language models with financial professional semantics; financial indicator labels (such as "price-to-earnings ratio" and "earnings per share") are added as label guidance signals to strengthen the model's ability to focus on core financial concepts. The generated financial text feature data is output in tensor form, with each sample corresponding to a vector.
[0156] Optionally, S4 includes:
[0157] S41. Perform vector bucketing processing on the financial text feature data to obtain vector bucketed data;
[0158] Specifically, the input is a set of financial text feature data, with each text corresponding to a vector representation, denoted as the feature set 𝔽, which includes multiple financial feature vectors with consistent dimensions. Depending on the application requirements, the system can choose different vector bucketing methods, including but not limited to using K-means clustering to divide all feature vectors into several clusters when local retrieval efficiency is prioritized, with each cluster corresponding to a vector bucket; when the system needs frequent incremental updates, Locality Sensitive Hash (LSH) is preferred, hashing vectors to different buckets based on their cosine similarity; if the financial features are relatively evenly distributed in the vector space, a hierarchical navigable small-world graph (HNSW) structure can be used to hierarchically divide the vector space to construct a multi-level bucketing structure. Each feature vector is labeled with its bucket number, forming a bucket identifier sequence; the system finally outputs a feature subset set composed of multiple buckets, with each bucket containing a group of text vectors with similar features.
[0159] S42. Construct the index structure based on the vector bucketed data to obtain the index structure data;
[0160] Specifically, the input is the set of vector buckets generated in the preceding steps, where each bucket contains several clustered financial text feature vectors. The system selects different types of local index structures based on actual retrieval needs and data dimensions, including: Inverted File Index (IVF): generating a centroid vector for each bucket and recording the distance between each member vector and the centroid for fast filtering and coarse ranking; Graph Structure Index (HNSW): constructing a hierarchical small-world graph for each bucket, achieving fast nearest neighbor search through multi-level skip-adjacency relationships; and Tree Structure Index (such as KD-Tree or Ball-Tree): achieving fast spatial positioning in a low-dimensional vector space through recursive dimensional partitioning, suitable for static, small-scale data. Each index structure contains the following fields: a unique identifier for the vector; an address pointer to the original data or document; and the distance metric used (e.g., Euclidean distance or cosine similarity). The system outputs the index file corresponding to each bucket, forming an index structure data set. This set consists of multiple local indexes, which can be loaded on demand or built in parallel.
[0161] S43. Perform global index integration based on the index structure data to obtain financial vector index data, which will be used to assist in the construction of the financial knowledge base.
[0162] Specifically, multiple local vector index structures are integrated into a unified global index system to support the rapid retrieval and management of large-scale textual semantic features in the financial knowledge base. For financial vector data in all local indexes, the system assigns a unique identifier globally, such as based on a globally incrementing number, UUID, or a combination of "bucket number + local ID". Simultaneously, each vector must be bound to its associated financial semantic tag (such as financial indicators or business terms) and original text content, forming a structured metadata mapping relationship. The system constructs a high-level vector routing structure to quickly determine the local index node to be accessed during the query phase. Methods include: performing clustering on all bucket centroid vectors to generate backbone KMeans centroids, or constructing a high-level skip node graph (such as the top layer of HNSW) based on graph indexing methods to improve cross-bucket retrieval efficiency. All local indexes are modularly mounted to the unified index management system, providing standardized query interfaces (such as Top-K similarity queries), incremental insertion, deletion, and update functions, and supporting RESTful APIs or local function encapsulation for easy integration into upper-layer knowledge base services. The system generates a unified global vector index structure (financial vector index data), which includes structured metadata, index routing information, and modular local index sets, forming the underlying vector support platform for building a financial knowledge base.
[0163] Optionally, this application also provides a financial knowledge retrieval system based on a vector database, used to execute the financial knowledge retrieval method based on a vector database as described above, wherein the financial knowledge retrieval system based on a vector database includes:
[0164] The financial text association processing module is used to acquire financial text data and perform association processing based on the financial text data to obtain financial indicator association data.
[0165] The numerical-semantic reasoning module is used to perform numerical association reasoning on financial indicator-related data to obtain numerical association data; and to perform semantic dependency reasoning on financial indicator-related data to obtain semantic dependency data.
[0166] The multi-head attention fusion module is used to perform multi-head attention calculations based on numerical correlation data and semantic dependency data to obtain financial text feature data.
[0167] The financial vector index generation module is used to generate vector indexes based on financial text feature data, thereby obtaining financial vector index data to assist in the construction of a financial knowledge base.
[0168] Therefore, the embodiments should be regarded as exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended application documents rather than the foregoing description. Thus, it is intended that all variations falling within the meaning and scope of the equivalents of the application documents be incorporated into the invention.
[0169] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.
Claims
1. A financial knowledge retrieval method based on a vector database, characterized in that, The method includes: S1. Obtain financial text data and perform correlation processing based on the financial text data to obtain financial indicator correlation data; S2. Perform numerical feature identification on the financial indicator correlation data to obtain numerical feature data; perform indicator semantic clustering on the numerical feature data to obtain numerical feature clustering data; generate numerical dependency chains based on the numerical feature clustering data to obtain numerical relationship data; perform numerical logic reasoning based on the numerical relationship data to obtain numerical correlation data; and perform semantic dependency reasoning on the financial indicator correlation data to obtain semantic dependency data. S3. Perform multi-head attention calculation based on numerical correlation data and semantic dependency data to obtain financial text feature data; S4. Generate a vector index based on the financial text feature data to obtain financial vector index data, which will be used as an auxiliary task for building a financial knowledge base. The generation of the numerical dependency chain includes: Based on the numerical feature-based clustered data, the intra-cluster index order is analyzed to obtain the intra-cluster index order data. Dependency candidate edges are constructed from the index sequence data within the cluster to obtain dependency candidate edge data; Dependency chain data is obtained by filtering dependency candidate edge data; Dependency chain graphs are constructed based on dependency chain data to obtain numerical relationship data; The semantic dependency reasoning includes: The data related to financial indicators are divided into syntactic units to obtain syntactic unit data. Dependency relation identification is performed based on syntactic unit data to obtain dependency relation data; Semantic anchor mapping is performed based on dependency relationship data to obtain cross-sentence semantic data; A semantic dependency network is constructed from cross-sentence semantic data to obtain semantic dependency network data; Semantic dependency data is obtained by performing logical consistency reasoning based on semantic dependency network data.
2. The method according to claim 1, characterized in that, The association processing includes: The financial text data is segmented and labeled with parts of speech to obtain the text part-of-speech data. Financial entity data is obtained by extracting financial entity data from the part-of-speech data of the text. Based on the financial entity data, entity referential elimination processing is performed to obtain entity-unique data; Based on the unique entity data, entity indicator mapping is performed to obtain financial indicator-related data.
3. The method according to claim 1, characterized in that, The semantic clustering of the indicators includes: Semantic label mapping is performed on numerical feature data to obtain numerical feature label data; A similarity matrix is constructed based on the numerical feature label data to obtain similarity matrix data; Similarity clusters are obtained by aggregating similarity data based on the similarity matrix data. Semantic hierarchy refinement is performed based on similarity cluster data to obtain numerical feature cluster data.
4. The method according to claim 1, characterized in that, The semantic anchor mapping includes: Anchor candidate data is obtained by extracting anchor candidate data based on dependency relationship data. Anchor point context data is obtained by binding anchor point candidate data to anchor point context data. Anchor point cross-sentence matching is performed on the anchor point context data to obtain anchor point cross-sentence data; An anchor point mapping graph is generated based on the cross-sentence anchor point data to obtain cross-sentence semantic data.
5. The method according to claim 1, characterized in that, S3 include: Linear vector data is obtained by performing linear vector mapping based on numerical correlation data and semantic dependency data. Semantic-structural dual-domain attention calculation is performed on linear vector data to obtain attention weight data; Multi-head parallel computation is performed on linear vector data based on attention weight data to obtain multi-head attention fusion data; Financial text feature data is generated by using multi-head attention fusion data.
6. The method according to claim 1, characterized in that, S4 include: Vector bucketing is performed on the financial text feature data to obtain vector bucketed data. The index structure is constructed based on the vector bucketed data to obtain the index structure data; Global index integration is performed based on the index structure data to obtain financial vector index data, which is used to assist in the construction of the financial knowledge base.
7. A financial knowledge retrieval system based on a vector database, characterized in that, For executing the financial knowledge retrieval method based on a vector database as described in claim 1, the financial knowledge retrieval system based on a vector database includes: The financial text association processing module is used to acquire financial text data and perform association processing based on the financial text data to obtain financial indicator association data. The numerical-semantic reasoning module is used to perform numerical association reasoning on financial indicator-related data to obtain numerical association data; and to perform semantic dependency reasoning on financial indicator-related data to obtain semantic dependency data. The multi-head attention fusion module is used to perform multi-head attention calculations based on numerical correlation data and semantic dependency data to obtain financial text feature data. The financial vector index generation module is used to generate vector indexes based on financial text feature data, thereby obtaining financial vector index data to assist in the construction of a financial knowledge base.
Citation Information
Patent Citations
Self-adaptive document encryption method based on text content and medium page number
CN119720258A
Knowledge graph-based content generation and optimization method and device, equipment and medium
CN120579627A