Large language model knowledge graph construction method in financial field
Identify the key entities and relationships in the financial sector through large language models and deep learning algorithms, and combine knowledge integration and verification of the integrated construction and reasoning engines to solve the problem of data integration problems and insufficient user interaction interface in financial knowledge maps, and realized high high. Accuracy and user -friendly financial knowledge map system.
Patent Information
- Application Number
- CN202411514598.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-01-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When processing multi-source data, existing financial knowledge graphs lead to data integration problems due to inconsistent data formats, entity redundancy and conflicts, and lack user-friendly interactive interfaces, which limits their popularity and practicality.
Using a large language model for natural language processing, identify the key entities in the financial field, and analyze the relationship between entities through deep learning algorithms to generate a preliminary knowledge map structure. Then, use the ontology to build and inference engines to verify and classify knowledge, integrate knowledge from different data sources, and provide user -friendly interactive interface through the intelligent Q & A system.
The accuracy and consistency of the construction of the knowledge map have been improved, and the user's technical threshold is reduced, so that non -technical personnel can also conduct inquiry and analysis of financial data, and improve the availability and popularity of the financial knowledge map.
Smart Images

Figure CN119378660A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of knowledge graph construction in the financial field, and specifically, relates to a method for constructing a large language model knowledge graph in the financial field. Background Art
[0002] With the explosive growth of financial market information, financial institutions are faced with the challenge of processing massive amounts of data. These data come from a wide range of sources, including news reports, financial reports, market trends, and social media, and most of them exist in unstructured form. Traditional data processing methods (such as manual extraction and rule-driven analysis) cannot meet the current financial industry's needs for real-time and accuracy, especially when dealing with rapidly changing market conditions. To address this problem, knowledge graph technology has become an important tool for data analysis in the financial field in recent years. Knowledge graphs can structure complex data and reveal semantic relationships between entities, thereby supporting deeper financial analysis and intelligent applications.
[0003] In the process of building a financial knowledge graph, relationship extraction and data integration are two crucial links. However, financial data comes from different data sources, such as multiple financial institutions, market research, etc., and the data format, structure and content expression of each data source may be very different. These inconsistencies may be manifested in the use of terminology, inconsistent data format standards, and redundancy or conflict in the same entity or relationship in different data sources. For example, different financial reports may use different names or abbreviations for the same company, resulting in duplicate or inconsistent entities. The problem of data redundancy will make the graph too large, increase the computational complexity, and affect query efficiency. Secondly, although the current financial knowledge graph has shown great potential in data analysis and decision support, its application is mainly concentrated in the background data processing and analysis, which is operated by professional data analysts or technical teams. Most financial knowledge graph systems lack user-friendly interactive interfaces, especially when facing end users, and it is difficult to provide convenient intelligent services. Users need to have a certain technical background to perform complex data query and analysis operations, which greatly limits the popularity and practicality of knowledge graphs.
[0004] In view of this, the present invention is proposed. Summary of the invention
[0005] The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art and provide a method for constructing a large language model knowledge graph in the financial field, thereby solving the problems raised in the above-mentioned background technology.
[0006] In order to solve the above technical problems, the basic concept of the technical solution adopted by the present invention is:
[0007] A method for constructing a large language model knowledge graph in the financial field, comprising the following steps:
[0008] Step S1: Acquire real-time data from multiple financial data sources, then use a large language model to perform natural language processing on the collected data to identify key entities in the financial field;
[0009] Step S2: Based on the knowledge graph technology, the relationship between the identified entities is analyzed through deep learning algorithms, relevant financial indicators, market dynamics and other related information are extracted, and a preliminary knowledge graph structure is generated;
[0010] Step S3: Integrate the knowledge extracted from different data sources, validate the knowledge using ontology construction and reasoning engine, and classify the knowledge using domain ontology;
[0011] Step S4: Automatically update the knowledge graph by monitoring market changes and the continuous input of new data. Finally, design an intelligent question-answering system based on the constructed knowledge graph, and users can query through natural language.
[0012] Optionally, the data sources include market data, news reports, social media, and other finance-related data, and the acquired data is integrated into a dataset, which is then split into a training set and a validation set.
[0013] Optionally, the steps of using a large language model to perform natural language processing on the collected data and identify key entities in the financial field are as follows:
[0014] The processed financial text data is input into the fine-tuned model, and the natural language understanding ability of the model is used to identify the key entities in the text. The identified entities are classified to ensure that they conform to the predetermined entity types, and duplicate or irrelevant entities are eliminated. Then, the identified entities are verified, the performance of the model is evaluated, and the accuracy, recall rate and F1 score are calculated to judge the effect of entity recognition. Then, the identified key entities are stored in the knowledge graph for subsequent query and analysis.
[0015] Optionally, a recurrent neural network is constructed as a relationship extraction model, which is expressed as formula (1). Then, the text data to be analyzed is input into the trained relationship extraction model to automatically identify the potential relationships between entities. Then, the model evaluation technology is used to verify the identified relationships. For the identified relationships, relevant financial indicators are further extracted. Then, natural language processing technology is used to identify and extract financial data from the original text and associate it with entity relationships. According to the identified entities and their relationships, a preliminary knowledge graph structure is generated. Then, the attributes of the nodes and edges are determined to construct the basic framework of the graph. Combined with the domain ontology, the knowledge graph structure is optimized, and the constructed knowledge graph is stored in a suitable database. Then, the model is trained to improve the understanding of financial terms and context. Then, the knowledge graph is accessed through the parsed query to extract relevant information and generate the answers required by the user.
[0016]
[0017] Among them, P(r ij |d i ; M) is the predicted probability of the model for the relationship, Θ is the model parameter, λ is the regularization coefficient, L(M) is the loss function of model M, It is a summation symbol, which means that for each sample (d i , r ij ) is accumulated, d i is the i-th sample in the dataset D, is the text data input to the model, r ij is the jth relationship in the i-th sample in the dataset, indicating that in sample d i The relationship between the entities extracted from ij |d i ; M) is the model M given in sample d i Prediction relationship ij The probability of log is a logarithmic operation used to convert the probability into a form more suitable for optimization. 2 This is the L2 norm of the model parameters Θ, representing the sum of the squares of all model parameters.
[0018] Optionally, the recurrent neural network adopts a long short-term memory network architecture, which has an input layer, a hidden layer, and an output layer. The steps of constructing the recurrent neural network are:
[0019] Set the number of nodes in the input layer according to the feature dimension of the input data, then add an RNN hidden layer according to the complexity of the problem, and use softmax as the activation function. Then, set the number of nodes in the output layer and the activation function to define the output layer according to the output target. Next, initialize the network weights and define the loss function. Use the training set to train the model, use SGD to update the weights and set hyperparameters. Finally, use the validation set to evaluate the model performance, calculate accuracy, loss and other indicators, and then deploy the trained model to actual applications to ensure that it can process new input data in real time.
[0020] Optionally, the number of nodes in the input layer is 100, the number of hidden layers is 2, the number of units in each layer is 128, the number of nodes in the output layer is 10, the learning rate is set to 0.01, the batch size is set to 32, the number of training rounds is set to 50, and the input layer is responsible for receiving external data and passing it to the neural network. Each node corresponds to a feature dimension, the hidden layer is responsible for feature extraction and transformation of the data, and the output layer is used to generate the final prediction result or classification label.
[0021] Optionally, when using ontology construction and reasoning engines to verify knowledge and adopting domain ontology to classify knowledge, first, determine the relevant data sources and extract knowledge from them, then design the domain ontology, define key concepts, attributes and their relationships to form a structured representation of knowledge, then determine the hierarchy and classification of the ontology, and then map the knowledge extracted from different data sources to the constructed domain ontology so that all knowledge is classified according to the structure of the ontology, then use the reasoning engine to verify the integrated knowledge, identify and repair logical errors, missing relationships and inconsistent information, then classify the knowledge according to the domain ontology, and organize the knowledge into appropriate categories and subcategories, and finally, record the metadata generated during the integration process, including the source, timestamp and verification status, then, based on the integrated and verified knowledge K′, construct a query interface Q, which allows users to query according to query requests q u Retrieval knowledge, whose expression is Q(q u )={k′ i |k i ′∈K′,q u (k′ i )=true} User's query q u Returns the knowledge set {k i ′}, where Q(q u ) is the query function representing the query request q sent by the user through the query system u After that, the result set returned is q u is the user's query request, is the query condition of the natural language query, k i′ is a knowledge item, which indicates the knowledge item updated after verification and reasoning. Here, i is the index of the knowledge item, which indicates the i-th knowledge in the knowledge base. The symbol ′ indicates that this knowledge item has been verified or processed. i ′ is the knowledge base or knowledge set updated after verification and reasoning, which contains all processed and confirmed knowledge items, k i The part ′∈K′ represents k i ′ belongs to the knowledge base K′, that is, a specific knowledge item k selected from the knowledge base i ′,(k i ′)=truequ is the query condition, indicating that the query q u Applied to knowledge item k i ′, if the knowledge item meets the query condition, it returns true, that is, k i ′ is included in the query results, and only knowledge items that meet this condition will be included in the returned results.
[0022] Optionally, the knowledge graph is automatically updated by monitoring market changes and continuous input of new data. Finally, based on the constructed knowledge graph, an intelligent question-answering system is designed. At the same time, natural language technology is used to identify and extract key entities and their relationships from new data. Then, new financial indicators, market dynamics and other related information are identified, and the knowledge base is updated. Then, the newly extracted knowledge is integrated into the existing knowledge graph, and the updated knowledge graph is verified by the reasoning engine. Then, based on the updated knowledge graph, the infrastructure of the intelligent question-answering system is built and the user query interface and data processing logic are defined. Subsequently, natural language understanding technology is implemented to convert the user's natural language input into structured queries.
[0023] Optionally, when a user makes a query through natural language, first, the natural language input by the user is processed, and then the pre-processed query is parsed using natural language processing technology to identify key entities and intents. Then, a structured query is constructed based on the identified entities and intents. Subsequently, the constructed query is executed, the knowledge graph is accessed, and relevant information is extracted. Then, the extracted information is organized and formatted to generate a clear answer. Finally, the final answer is generated based on the processed information and formatted as a natural language response.
[0024] After adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art. Of course, any product implementing the present invention does not necessarily need to achieve all the advantages described below at the same time:
[0025] The present invention introduces a deep learning algorithm to extract relationships, and uses domain ontology and reasoning engines to integrate and verify financial data from different data sources, thereby solving the data integration problems caused by inconsistent data formats, entity redundancy and conflicts in traditional methods, thereby greatly improving the accuracy and consistency of knowledge graph construction. This method can effectively eliminate the problems caused by inconsistent names or data redundancy in different financial institutions, market reports and government documents, reduce computational complexity, and improve query efficiency. Secondly, this application also reduces the technical threshold of users by introducing an intelligent question-and-answer system based on natural language, so that non-technical personnel can query and analyze financial data without mastering complex query languages. The present invention not only improves the availability and popularity of financial knowledge graphs, but also promotes the integrated development of financial decision support and intelligent interactive technologies.
[0026] The specific implementation modes of the present invention are further described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings described below are only some embodiments. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0028] In the figure:
[0029] Figure 1 Flowchart of the method for building a knowledge graph.
[0030] It should be noted that these drawings and textual descriptions are not intended to limit the conceptual scope of the present invention in any way, but are intended to illustrate the concept of the present invention for those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0031] The present invention will now be described in further detail with reference to the accompanying drawings.
[0032] See also Figure 1 As shown, in this embodiment, a method for constructing a large language model knowledge graph in the financial field is provided, including the following steps:
[0033] Step S1: Obtain real-time data from multiple financial data sources, then use the large language model to perform natural language processing on the collected data to identify key entities in the financial field; by using the large language model to perform natural language processing on the collected financial data, key entities in the financial field (such as companies, financial instruments, market events, etc.) can be more accurately identified, significantly improving the efficiency and accuracy of extracting information from unstructured data. Compared with traditional rule-based entity recognition methods, large language models have stronger language understanding capabilities and can handle complex and diverse financial texts.
[0034] Step S2: Based on the knowledge graph technology, the relationship between the identified entities is analyzed through the deep learning algorithm, relevant financial indicators, market dynamics and other related information are extracted, and a preliminary knowledge graph structure is generated; Based on the knowledge graph technology, the relationship between the identified entities is analyzed through the deep learning algorithm, relevant financial indicators, market dynamics and other important related information are extracted, and a preliminary knowledge graph is constructed. This process not only improves the automation of relationship extraction, but also reduces manual intervention, ensuring higher data processing efficiency and accuracy of relationship identification.
[0035] Step S3: Integrate the knowledge extracted from different data sources, use ontology construction and reasoning engines to verify the knowledge, and use domain ontology to classify the knowledge; Through ontology construction and reasoning engines, the knowledge extracted from different data sources is integrated and verified to ensure the integrity and consistency of all knowledge. This process uses domain ontology to classify knowledge so that knowledge items can be organized in appropriate categories and subcategories in an orderly manner. The reasoning engine can automatically identify and repair logical errors, missing relationships, and inconsistent information, further improving the accuracy of the knowledge graph.
[0036] Step S4: Automatically update the knowledge graph by monitoring market changes and continuous input of new data. Finally, design an intelligent question-answering system based on the constructed knowledge graph, and users can query through natural language. Based on the constructed knowledge graph, an intelligent question-answering system is designed to allow users to query through natural language. The system combines the natural language processing capabilities of the large language model and the structured information of the knowledge graph to provide users with fast and accurate answers to financial questions. Compared with traditional query systems, the intelligent question-answering system provides a more friendly and intelligent interactive experience, which is suitable for complex financial analysis and decision support.
[0037] In this embodiment, the data sources include market data, news reports, social media and other financial related data, and the acquired data are integrated into a data set, which is then divided into a training set and a validation set.
[0038] In this embodiment, the steps of using a large language model to perform natural language processing on the collected data and identify key entities in the financial field are as follows:
[0039] The processed financial text data is input into the fine-tuned model, and the natural language understanding ability of the model is used to identify the key entities in the text. The identified entities are classified to ensure that they conform to the predetermined entity types, and duplicate or irrelevant entities are eliminated. Then, the identified entities are verified, the performance of the model is evaluated, and the accuracy, recall rate and F1 score are calculated to judge the effect of entity recognition. Then, the identified key entities are stored in the knowledge graph for subsequent query and analysis.
[0040] In this embodiment, a recurrent neural network is constructed as a relationship extraction model, which is expressed as formula (1). Then, the text data to be analyzed is input into the trained relationship extraction model to automatically identify the potential relationship between entities. Then, the model evaluation technology is used to verify the identified relationship. For the identified relationship, relevant financial indicators are further extracted. Then, natural language processing technology is used to identify and extract financial data from the original text and associate it with the entity relationship. According to the identified entities and their relationships, a preliminary knowledge graph structure is generated. Then, the attributes of the nodes and edges are determined to construct the basic framework of the graph. Combined with the domain ontology, the knowledge graph structure is optimized, and the constructed knowledge graph is stored in a suitable database. Then, the model is trained to improve the understanding of financial terms and context. Then, the knowledge graph is accessed through the parsed query to extract relevant information and generate the answers required by the user.
[0041]
[0042] Among them, P(r ij |d i ; M) is the predicted probability of the model for the relationship, Θ is the model parameter, λ is the regularization coefficient, L(M) is the loss function of model M, It is a summation symbol, which means that for each sample (d i , r ij ) is accumulated, d i is the i-th sample in the dataset D, is the text data input to the model, r ij is the jth relationship in the i-th sample in the dataset, indicating that in sample d i The relationship between the entities extracted from ij |d i ; M) is the model M given in sample d i Prediction relationship ij The probability of log is a logarithmic operation used to convert the probability into a form more suitable for optimization. 2 This is the L2 norm of the model parameters Θ, representing the sum of the squares of all model parameters.
[0043] In this embodiment, the recurrent neural network adopts a long short-term memory network architecture, which has an input layer, a hidden layer, and an output layer. The steps of constructing the recurrent neural network are:
[0044] The number of nodes in the input layer is set according to the characteristic dimension of the input data, and then the RNN hidden layer is added according to the complexity of the problem, and softmax is used as the activation function. Then the number of nodes in the output layer and the activation function are set according to the output target to define the output layer. Then, the network weights are initialized and the loss function is defined. The model is trained using the training set, and the weights are updated using SGD and the hyperparameters are set. Finally, the model performance is evaluated using the validation set, and the accuracy, loss and other indicators are calculated. Subsequently, the trained model is deployed to practical applications to ensure that it can process new input data in real time. By adopting the long short-term memory (LSTM) network architecture, combined with the input layer, hidden layer, and output layer, the time series and long-term dependency problems in complex financial data can be effectively processed. By setting the number of nodes in the input layer to match the characteristic dimension of the input data, the data can be fully utilized, and the hidden layer is adjusted according to the complexity of the problem to ensure that the network extracts the characteristics of the data deeply enough. At the same time, using softmax as the activation function and combining the appropriate number of nodes in the output layer can achieve efficient classification tasks. By initializing the network weights, defining the loss function, and using stochastic gradient descent (SGD) to update the weights, the training efficiency and accuracy of the model are further improved. Finally, by testing the validation set, we ensure that the model has the ability to process new input data, so that it can be applied to actual scenarios and provide reliable financial forecasts and analysis.
[0045] In this embodiment, the number of nodes in the input layer is 100, the hidden layer is 2 layers, the number of units in each layer is 128, the number of nodes in the output layer is 10, the learning rate is set to 0.01, the batch size is set to 32, the number of training rounds is set to 50, and the input layer is responsible for receiving external data and passing it to the neural network. Each node corresponds to a feature dimension, the hidden layer is responsible for feature extraction and transformation of the data, and the output layer is used to generate the final prediction result or classification label.
[0046] The number of input layer nodes is set to 100, the hidden layer is two layers, each layer has 128 units, the number of output layer nodes is set to 10, the learning rate is 0.01, the batch size is 32, and the number of training rounds is 50. Such a configuration can achieve a good balance in more complex financial data processing: it not only ensures the computational efficiency of the network, but also ensures the accuracy of the model. The input layer is responsible for receiving external data and matching the number of nodes according to the feature dimension to ensure the effective transmission of data. The hidden layer is responsible for deep feature extraction and conversion of the data, thereby enhancing the model's ability to handle complex problems. The output layer generates the final prediction or classification results. By optimizing hyperparameters such as learning rate and batch size, this embodiment achieves a good balance between the training efficiency, convergence speed and generalization ability of the model, and ultimately ensures the real-time and accuracy of the model in practical applications.
[0047] In this embodiment, when using ontology construction and reasoning engine to verify knowledge and adopting domain ontology to classify knowledge, first, determine the relevant data sources and extract knowledge from them, then design the domain ontology, define key concepts, attributes and their relationships to form a structured representation of knowledge, then determine the hierarchy and classification of the ontology, and then map the knowledge extracted from different data sources to the constructed domain ontology, so that all knowledge is classified according to the structure of the ontology, then use the reasoning engine to verify the integrated knowledge, identify and repair logical errors, missing relationships and inconsistent information, then classify the knowledge according to the domain ontology, and organize the knowledge into appropriate categories and subcategories, and finally, record the metadata generated during the integration process, including the source, timestamp and verification status, then, based on the integrated and verified knowledge K′, construct a query interface Q, which allows the user to query according to the query request q u Retrieval knowledge, whose expression is Q(q u )={k i ′∈K′,q u (k i ′)=true user’s query q u Returns the knowledge set {k i ′}, where Q(q u ) is the query function representing the query request q sent by the user through the query system u After that, the result set returned is q u is the user's query request, which is a natural language query or a specific query condition, k i ′ is a knowledge item, which indicates the knowledge item updated after verification and reasoning. Here, i is the index of the knowledge item, which indicates the i-th knowledge in the knowledge base. The symbol ′ indicates that this knowledge item has been verified or processed. i ′ is the knowledge base or knowledge set updated after verification and reasoning, which contains all processed and confirmed knowledge items, k i The part ′∈K′ represents k i ′ belongs to the knowledge base K′, that is, a specific knowledge item k selected from the knowledge base i ′,(k i ′)=truequ is the query condition, indicating that the query q u Applied to knowledge item k i ′, if the knowledge item meets the query condition, it returns true, that is, k i′ is included in the query results, and only knowledge entries that meet this condition will be included in the returned results. By verifying and classifying knowledge through ontology construction and reasoning engine, this embodiment effectively solves the problem of wide sources and complex structures of financial data. By extracting knowledge from multiple data sources and mapping it to predefined domain ontologies, the standardization and consistency of knowledge are ensured. In addition, the use of the reasoning engine ensures the logic of the data, and improves the completeness and accuracy of knowledge by identifying and repairing logical errors, missing relationships, and inconsistent information. Finally, knowledge is managed in an orderly manner through classification and sub-classification, making queries more efficient. Recording metadata such as source, timestamp, and verification status during the integration process further improves the traceability and reliability of the data, lays a solid foundation for subsequent queries and knowledge updates, and ensures that the system can dynamically adapt to market changes.
[0048] In this embodiment, by monitoring market changes and continuous input of new data, the knowledge graph is automatically updated, and finally based on the constructed knowledge graph, an intelligent question-answering system is designed, and natural language technology is used to identify and extract key entities and their relationships from new data, and then new financial indicators, market dynamics and other related information are identified, and the knowledge base is updated. Then, the newly extracted knowledge is integrated into the existing knowledge graph, and then the updated knowledge graph is verified by the reasoning engine. Then, based on the updated knowledge graph, the infrastructure of the intelligent question-answering system is constructed and the interface and data processing logic of the user query are defined. Subsequently, the natural language understanding technology is implemented to convert the user's natural language input into a structured query. By constructing an intelligent question-answering system based on the financial knowledge graph and combining natural language processing technology, the query and interactive experience of financial information is greatly improved. The system can not only parse the user's query through natural language understanding (NLU) technology, identify financial entities and relationships, but also provide accurate and context-related answers through deep integration with the knowledge graph. This design greatly reduces the technical threshold of users, allowing non-professional users to obtain the required information from massive financial data without mastering complex query languages. At the same time, the intelligent question-and-answer system can generate the most timely answers in real time based on constantly updated market data, thereby providing users with accurate decision-making support and enhancing the application value and commercialization potential of the knowledge graph.
[0049] In this embodiment, when the user makes a query through natural language, first, the natural language input by the user is processed, and then the pre-processed query is parsed using natural language processing technology to identify key entities and intents. Then, a structured query is constructed based on the identified entities and intents. Subsequently, the constructed query is executed, the knowledge graph is accessed, and relevant information is extracted. Then, the extracted information is sorted and formatted to generate a clear answer. Finally, the final answer is generated based on the processed information and formatted as a natural language response. By combining natural language processing technology with knowledge graphs, this embodiment realizes efficient and intelligent financial information query. Users do not need to have a technical background, they only need to enter a natural language query, and the system can automatically parse its intent, extract relevant entities and construct a structured query, and then access the knowledge graph and retrieve matching results. Through the automated query execution and information extraction process, the system can obtain and organize accurate information from the knowledge graph and format it as a natural language response, greatly improving the accessibility and query efficiency of financial information. This intelligent query mechanism not only improves the user experience, but also provides a reliable support tool for financial analysis and decision-making, enabling financial institutions and individual investors to obtain key information in a shorter time and make quick and accurate decisions.
[0050] The present invention is not limited to the above-mentioned embodiments. Anyone should be aware that any structural changes made under the enlightenment of the present invention, and any technical solutions that are the same or similar to the present invention, fall within the protection scope of the present invention. The technology, shape, and structural parts not described in detail in the present invention are all well-known technologies.
Claims
1. A method for constructing a large language model knowledge graph in the financial field, characterized in that: The following steps are involved: Step S1: Acquire real-time data from multiple financial data sources, then use a large language model to perform natural language processing on the collected data to identify key entities in the financial field; Step S2: Based on the knowledge graph technology, the relationship between the identified entities is analyzed through deep learning algorithms, relevant financial indicators, market dynamics and other related information are extracted, and a preliminary knowledge graph structure is generated; Step S3: Integrate the knowledge extracted from different data sources, validate the knowledge using ontology construction and reasoning engine, and classify the knowledge using domain ontology; Step S4: Automatically update the knowledge graph by monitoring market changes and the continuous input of new data. Finally, design an intelligent question-answering system based on the constructed knowledge graph, and users can query through natural language.
2. According to claim 1, a method for constructing a large language model knowledge graph in the financial field is characterized in that: The data sources include market data, news reports, social media and other financial-related data. The acquired data are integrated into a dataset, which is then split into a training set and a validation set.
3. The method for constructing a large language model knowledge graph in the financial field according to claim 1, characterized in that: The steps to use the large language model to perform natural language processing on the collected data and identify key entities in the financial field are as follows: The processed financial text data is input into the fine-tuned model, and the natural language understanding ability of the model is used to identify the key entities in the text. The identified entities are classified to ensure that they conform to the predetermined entity types and irrelevant entities are eliminated. Then, the identified entities are verified, the performance of the model is evaluated, and the accuracy, recall rate and F1 score are calculated to judge the effect of entity recognition. Then, the identified key entities are stored in the knowledge graph for subsequent query and analysis.
4. The method for constructing a large language model knowledge graph in the financial field according to claim 1, characterized in that: Construct a recurrent neural network as a relationship extraction model, which is expressed as formula (1). Then, input the text data to be analyzed into the trained relationship extraction model to automatically identify the potential relationships between entities. Then, use the model evaluation technology to verify the identified relationships. For the identified relationships, further extract relevant financial indicators. Then, use natural language processing technology to identify and extract financial data from the original text and associate it with entity relationships. Generate a preliminary knowledge graph structure based on the identified entities and their relationships. Then, determine the attributes of nodes and edges to build the basic framework of the graph. Combined with the domain ontology, optimize the knowledge graph structure, store the constructed knowledge graph in a suitable database, and then train the model to improve the understanding of financial terms and context. Then, access the knowledge graph through the parsed query to extract relevant information and generate the answers required by the user. Among them, P(r ij |d i ; M) is the predicted probability of the model for the relationship, Θ is the model parameter, λ is the regularization coefficient, L(M) is the loss function of model M, It is a summation symbol, which means that for each sample (d i , r ij ) is accumulated, d i is the i-th sample in the dataset D, is the text data input to the model, r ij is the jth relationship in the i-th sample in the dataset, indicating that in sample d i The relationship between the entities extracted from ij |d i ; M) is the model M given in sample d i Prediction relationship ij The probability of log is a logarithmic operation used to convert the probability into a form more suitable for optimization. 2 This is the L2 norm of the model parameters Θ, representing the sum of the squares of all model parameters.
5. The method for constructing a large language model knowledge graph in the financial field according to claim 4, characterized in that: The recurrent neural network adopts the long short-term memory network architecture, which has an input layer, a hidden layer, and an output layer. The steps to construct a recurrent neural network are: Set the number of nodes in the input layer according to the feature dimension of the input data, then add an RNN hidden layer according to the complexity of the problem, and use softmax as the activation function. Then, set the number of nodes and activation function of the output layer according to the output target to define the output layer. Next, initialize the network weights and define the loss function. Use the training set to train the model, use SGD to update the weights and set the hyperparameters. Finally, use the validation set to evaluate the model performance, calculate the accuracy and loss, and then deploy the trained model to actual applications to ensure that it can process new input data in real time.
6. The method for constructing a large language model knowledge graph in the financial field according to claim 5, characterized in that: The number of nodes in the input layer is 100, the number of hidden layers is 2, the number of units in each layer is 128, the number of nodes in the output layer is 10, the learning rate is set to 0.01, the batch size is set to 32, and the number of training rounds is set to 50. The input layer is responsible for receiving external data and passing it to the neural network. Each node corresponds to a feature dimension. The hidden layer is responsible for feature extraction and transformation of the data. The output layer is used to generate the final prediction results or classification labels.
7. The method for constructing a large language model knowledge graph in the financial field according to claim 1, characterized in that: When using ontology construction and reasoning engines to verify knowledge and adopting domain ontology to classify knowledge, first, determine the relevant data sources and extract knowledge from them. Then, design the domain ontology, define key concepts, attributes and their relationships to form a structured representation of knowledge. Then, determine the hierarchy and classification of the ontology, and then map the knowledge extracted from different data sources to the constructed domain ontology so that all knowledge is classified according to the structure of the ontology. Then, use the reasoning engine to verify the integrated knowledge, identify and repair logical errors, missing relationships and inconsistent information. Then, classify the knowledge according to the domain ontology and organize the knowledge into appropriate categories and subcategories. Finally, record the metadata generated during the integration process, including the source, timestamp and verification status. Then, based on the integrated and verified knowledge K′, construct a query interface Q, which allows users to query according to the query request q u Retrieval knowledge, whose expression is Q(q u )={k i ′|k i ′∈K′,q u (k i ′)=true} User's query q u Returns the knowledge set {k i ′}, where Q(q u ) is the query function representing the query request q sent by the user through the query system u After that, the result set returned is q u is the user's query request, which is a natural language query or a specific query condition, k i ′ is a knowledge item, which indicates the knowledge item updated after verification and reasoning. Here, i is the index of the knowledge item, indicating the i-th knowledge in the knowledge base. The symbol ′ indicates that this knowledge item has been verified. i ′ is the knowledge base or knowledge set updated after verification and reasoning, which contains all processed and confirmed knowledge items, k i The part ′∈K′ represents k i ′ belongs to the knowledge base K′, that is, a specific knowledge item k selected from the knowledge base i ′,(k i ′)=truequ is the query condition, indicating that the query q u Applied to knowledge item k i ′, if the knowledge item meets the query condition, it returns true, that is, k i ′ is included in the query results, and only knowledge items that meet this condition will be included in the returned results.
8. The method for constructing a large language model knowledge graph in the financial field according to claim 1, characterized in that: By monitoring market changes and the continuous input of new data, the knowledge graph is automatically updated. Finally, based on the constructed knowledge graph, an intelligent question-answering system is designed. At the same time, natural language technology is used to identify and extract key entities and their relationships from new data. Then, new financial indicators, market dynamics and other related information are identified and the knowledge base is updated. Next, the newly extracted knowledge is integrated into the existing knowledge graph, and the updated knowledge graph is verified through the inference engine. Then, based on the updated knowledge graph, the infrastructure of the intelligent question-answering system is built and the user query interface and data processing logic are defined. Subsequently, natural language understanding technology is implemented to convert the user's natural language input into structured queries.
9. The method for constructing a large language model knowledge graph in the financial field according to claim 1, characterized in that: When a user makes a query using natural language, first, the natural language input by the user is processed, and then the pre-processed query is parsed using natural language processing technology to identify key entities and intents. Next, a structured query is constructed based on the identified entities and intents. Subsequently, the constructed query is executed, the knowledge graph is accessed, and relevant information is extracted. The extracted information is then organized and formatted to generate a clear answer. Finally, the final answer is generated based on the processed information and formatted as a natural language response.
Citation Information
Cited By
Large model generation effect optimization method and system based on knowledge graph guidance
CN119577103A
Data traceability analysis system and method based on big data
CN119722337A
A data tracing analysis system and method based on big data
CN119722337B
Emergency equipment efficient management system and method
CN119918808A
Enterprise global data analysis method based on knowledge graph and large language model
CN120218256A