Financial archive query method and system based on text knowledge graph
By constructing a financial archives inquiry system based on text knowledge maps, the problems of backward technology, irregular management and low efficiency in financial archives management have been solved, and efficient financial archives inquiry and utilization have been achieved.
Patent Information
- Application Number
- CN202411304272.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2025-01-28
AI Technical Summary
There are problems in the management of existing financial archives, such as backward technology, irregular management and low utilization efficiency, resulting in inaccurate search, retrieval and storage efficiency, and financial archives are prone to damage or loss.
Using the financial file query method based on text knowledge diagram, through image pre -processing, layout, and character recognition to generate financial electronic files, perform text classification and key element extraction, build financial file knowledge maps, and present the financial archives of the Yuan universe in the virtual reality. Museum, achieve efficient inquiries and retrieval.
It improves the efficiency of financial archives inquiries and utilization, reduces the cost of manual classification and archives, ensures the security and integrity of the archives, and solves the problem of low efficiency in financial archives management.
Smart Images

Figure CN119377350A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial information processing technology or other related fields, and in particular to a financial archive query method and system based on a text knowledge graph. Background Art
[0002] At present, with the rapid development of information technology, electronic accounting archive management strategies have also been introduced for archive management, leading the trend of paperless, electronic, automated and intelligent archive management. Financial archive management is a key link in the financial system of an enterprise, and has an important impact on the financial operation, compliance management and risk control of the enterprise. However, there are some problems in the current financial archive management, including:
[0003] (1) Backward technology. Many financial archives are still using traditional paper management methods and lack modern information technology, which leads to low efficiency in query, retrieval, and storage, and easily causes financial archives to be damaged or lost.
[0004] (2) Irregular management. Some financial archives have incomplete management systems and irregular operations, which may lead to the loss or damage of archives. For example, there is a lack of complete records of archives entering and leaving the warehouse, or staff do not comply with regulations during operations.
[0005] (3) Insufficient utilization. The utilization efficiency of financial archives is low, and many valuable financial archives have been idle for a long time and have not been fully excavated and utilized.
[0006] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0007] The embodiments of the present invention provide a financial archive query method and system based on a text knowledge graph, so as to at least solve the technical problems of low utilization efficiency and low query efficiency of financial archives in related technologies.
[0008] According to one aspect of an embodiment of the present invention, a financial archive query method based on a text knowledge graph is provided, comprising: performing image preprocessing, page division and character recognition on financial archive images to obtain financial electronic archives; performing text classification on the financial electronic archives, and determining a text class label to which the document belongs based on text word frequency data of the financial electronic archives, wherein the text class label is used to index the text type of the financial electronic archives; extracting key elements of each type of the financial electronic archives, extracting associations between archive entities and elements, between archive entities and between key elements, and constructing a financial archive knowledge graph; presenting a metaverse financial archive containing the financial archive knowledge graph and all the financial electronic archives to a virtual reality VR device, and responding to an archive query request of the VR device to display target financial archive information.
[0009] According to another aspect of an embodiment of the present invention, a financial archive query system based on a text knowledge graph is provided, comprising: an image processing unit, used to perform image preprocessing, layout division and character recognition on financial archive images to obtain financial electronic archives; an archive classification unit, used to perform text classification on the financial electronic archives, and determine the text class label to which the document belongs based on the text word frequency data of the financial electronic archives, wherein the text class label is used to index the text type of the financial electronic archives; a knowledge graph construction unit, used to extract key elements of each type of the financial electronic archives, extract the associations between archive entities and elements, between archive entities and between key elements, and construct a financial archive knowledge graph; a financial archive information display unit, used to present the metaverse financial archives containing the financial archive knowledge graph and all the financial electronic archives to a virtual reality VR device, and respond to the archive query request of the VR device to display the target financial archive information.
[0010] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned financial archive query methods based on text knowledge graphs.
[0011] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the above-mentioned financial archive query methods based on text knowledge graphs.
[0012] According to another aspect of an embodiment of the present invention, a computer program product is also provided, including a computer program, which, when executed by a processor, implements the steps of any one of the above-mentioned financial archive query methods based on text knowledge graphs.
[0013] In the present disclosure, the financial archive images are subjected to image preprocessing, layout division and character recognition to obtain financial electronic archives, and the financial electronic archives are subjected to text classification. The text class label to which the document belongs is determined based on the text word frequency data of the financial electronic archives. The text class label is used to index the text type of the financial electronic archives, and the key elements of each type of financial electronic archives are extracted. The associations between archive entities and elements, between archive entities and between key elements are extracted, and a financial archive knowledge graph is constructed. The metaverse financial archives containing the financial archive knowledge graph and all financial electronic archives are presented to a virtual reality VR device, and the archive query request of the VR device is responded to to display the target financial archive information.
[0014] In the present disclosure, financial archives can be automatically classified and organized to reduce the labor costs caused by manual classification and archiving, extract the key elements of each type of financial electronic archives, extract the associations between archive entities and elements, between archive entities and between key elements, and build a financial archive knowledge graph. Through the knowledge graph, users can easily retrieve financial electronic documents and navigate archives, and then immersively search and view the original vouchers of financial archives and the knowledge graph associations between various financial archives based on the established Metaverse Financial Archives, thereby solving the technical problems of low utilization efficiency and low query efficiency of financial archives in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0016] Figure 1 is a flowchart of an optional financial archive query method based on text knowledge graph according to an embodiment of the present invention;
[0017] Figure 2 is a schematic diagram of an optional Metaverse financial archive visual retrieval system according to an embodiment of the present invention;
[0018] Figure 3 It is a schematic diagram of scene modeling of an optional Metaverse Financial Archives VR information retrieval system according to an embodiment of the present invention;
[0019] Figure 4 is a schematic diagram of an optional financial archive query system based on text knowledge graph according to an embodiment of the present invention;
[0020] Figure 5 It is a hardware structure block diagram of an electronic device (or mobile device) according to a financial archive query method based on a text knowledge graph according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] To facilitate those skilled in the art to understand the present invention, some terms or nouns involved in the embodiments of the present invention are explained below:
[0024] Optical Character Recognition, or OCR for short, is a technology that converts text in an image into editable text. It can be used in a variety of scenarios, including recognizing scanned documents, automatically filling in forms, digitizing books and documents, and extracting text information.
[0025] N-gram technology is a text processing technology used to analyze n consecutive words or character sequences in a text. By counting the frequency and probability of different N-grams in a text, text features can be extracted and text analysis and processing can be performed.
[0026] Knowledge graph is a technology that structures and presents knowledge in a graphical manner. It can help organize and manage large amounts of information and realize the association and discovery of knowledge by connecting different knowledge points.
[0027] Virtual reality, or VR for short, is a technology that uses computer technology to simulate or reproduce a virtual three-dimensional environment, allowing users to interact with the virtual environment as if they were there. By wearing a VR headset, users can immerse themselves in the virtual world and experience the feeling of being there.
[0028] Metaverse technology is a technology used in the fields of virtual reality, augmented reality and mixed reality. These technologies can help users immerse themselves in the virtual world, interact with the real world, or integrate virtual elements into the real world.
[0029] It should be noted that the financial archive query method based on text knowledge graph and its system in the present disclosure can be used in the field of financial information processing technology. In the case of interactive roaming and immersive financial archive query experience based on VR three-dimensional modeling and metaverse financial archives, it can also be used in any field outside the field of financial information processing technology. In the case of interactive roaming and immersive financial archive query experience based on VR three-dimensional modeling and metaverse financial archives, the present disclosure does not limit the application field of the financial archive query method based on text knowledge graph and its system.
[0030] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) collected by this disclosure are information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0031] The following embodiments of the present invention can be applied to various systems / applications / devices for financial archive query based on text knowledge graph. The present invention can learn selected text samples based on N-gram text classification technology, and automatically classify and organize archives according to the relational model. Users can enjoy an immersive financial archive query experience. Based on the visual retrieval of financial electronic archives, they can immersively search and view the original vouchers of financial archives and the knowledge graph association relationship between various financial archives in a VR scene.
[0032] In the present invention, the financial electronic archive images are automatically classified and sorted according to five types of financial archives, namely, accounting vouchers, accounting books, accounting reports, financial documents and other types, to ensure the accuracy of archive classification. The knowledge graph technology is used to construct the association relationship between the five types of financial archives, and the various types of entity relationships required to construct the financial archive knowledge graph are extracted to form a user-personalized knowledge network. A virtual reality platform is constructed based on VRML to realize interactive roaming query of the Metaverse Financial Archives, and interactive attribute viewing is performed on the three-dimensional archive model. At the same time, based on the fuzzy search algorithm, a vector space model is introduced to obtain the similarity of the search feature words through weighted calculation, so as to realize the three-dimensional visualization display of the financial electronic archive images and the knowledge graph.
[0033] The present invention is described in detail below in conjunction with various embodiments.
[0034] Embodiment 1
[0035] According to an embodiment of the present invention, an embodiment of a financial archive query method based on a text knowledge graph is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0036] Figure 1 is a flowchart of an optional financial archive query method based on text knowledge graph according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0037] Step S101, performing image preprocessing, page division and character recognition on the financial archive image to obtain the financial electronic archive.
[0038] It should be noted that, before generating electronic archives through financial archive images, this embodiment needs to scan known paper financial archives. During the scanning process, the original paper financial archives are sorted, and then the paper financial archive files are scanned using a scanner to form a financial electronic archive data set in an image format (such as PNG format, JPEG format, GIF format), and a financial archive image set is obtained, and then the financial electronic archive text can be extracted.
[0039] In this step, the text extraction of financial electronic archives is mainly based on OCR technology. The text extraction of financial electronic archives is completed after image processing, layout division, character recognition and other operations. Text extraction of financial electronic archives is performed based on OCR technology to realize automatic text classification and knowledge graph construction of financial electronic archives. After the image is preprocessed and corrected, the numerical features are identified and extracted for comparative identification. After the image of the financial electronic archive is processed, layout divided and character recognized, the editable text of the financial electronic archive is extracted.
[0040] Optionally, step S101 includes: preprocessing the financial archive image obtained after scanning the paper financial archive, wherein the preprocessing includes at least one of the following: binarizing the financial archive image through the Otsu binarization strategy and anti-skew processing of the financial archive image; using the Hough transform straight line extraction algorithm to divide the preprocessed financial archive image into a layout, wherein the layout division includes: based on the line segment length in the image layout, the minimum height and minimum width of the blank area, dividing the layout of the financial archive image into multiple parts, and the multiple parts include at least one of the following: archive title, archive table, archive date, archive handling object; using a preset character recognition strategy to extract numerical values and text in the financial archive, and comparing the extracted numerical values and text with the standard financial corpus respectively to obtain archive characters and archive values, and generate financial electronic archives.
[0041] Among them, the Otsu binarization strategy is an adaptive image binarization method, which determines a suitable threshold by calculating the grayscale histogram and inter-class variance of the image, and divides the image into black and white parts. The steps of binarizing the financial archive image by the Otsu binarization strategy include: 1. Calculating the grayscale histogram of the financial archive image to obtain the number of pixels at each grayscale level; 2. Traversing each possible threshold T (0-255), calculating the intra-class variance and inter-class variance under the threshold; 3. Binarization is performed according to the threshold corresponding to the maximum value of the inter-class variance. The optimal threshold can be selected according to the characteristics of the image, thereby improving the quality and accuracy of the image.
[0042] The anti-skew processing of the financial archive image refers to the situation that the content in the financial archive image is tilted or rotated, which may affect the quality and readability of the image. In order to solve the problem of image skew, the image anti-skew adjustment is performed. Here, the steps of anti-skew processing of the financial archive image include: rotation operation: by rotating the financial archive image, the content in the image is aligned horizontally or vertically, thereby removing the skew phenomenon; perspective transformation: by perspective transformation, the financial archive image is affine transformed to eliminate the skew effect; boundary detection and corner point detection: by detecting the boundary and corner points of the image, the degree of skew of the financial archive image can be determined, and corresponding correction processing can be performed; skew angle estimation: by using an image processing algorithm, the skew angle of the financial archive image is estimated, and then the financial archive image is corrected accordingly; straight line detection and straight line correction: by detecting the straight line in the financial archive image, the skew angle of the financial archive image can be determined, and a straight line correction operation is performed to make the straight line horizontal or vertical.
[0043] Hough transform is a method for detecting straight lines and curves in an image. It can help accurately detect and identify various shapes in an image by converting pixels in an image into parameter space to identify specific shapes in the image (such as straight lines, circles, etc.). In this embodiment, the straight line extraction algorithm of Hough transform can be used to divide the layout of the pre-processed financial archive image. The layout of the financial electronic archive image is divided into each part by the length and thickness of the line segment, the minimum height and minimum width of the blank area, and the title, table, date, and person in charge of the financial electronic archive are screened out.
[0044] Before realizing the recognition of printed characters and handwritten characters in the title, table, date, person in charge and other areas of the financial electronic archive divided by the layout division unit, learning and training can be carried out through the character recognition engine to build financial archive learning samples and corpus to obtain a standard financial corpus. Subsequently, the numerical values and texts in the financial archives are extracted using the preset character recognition strategy, and the recognized numerical values and texts can be compared with the standard financial corpus to generate a financial electronic archive corresponding to the financial archive image.
[0045] After obtaining the financial electronic archives, all archive texts need to be classified for subsequent retrieval.
[0046] Step S102, classifying the text of the financial electronic archive, and determining the text class label to which the document belongs according to the text word frequency data of the financial electronic archive, wherein the text class label is used to index the text type of the financial electronic archive.
[0047] Optionally, step S102 includes: using a preset marking strategy to mark text characters in the financial electronic archive, and extracting feature words in the financial electronic archive to obtain a feature word set; based on the character marking results and the feature word set, determining the importance of each feature word to the financial electronic archive; based on the importance of each feature word to the financial electronic archive, determining the text type and the text class label to which the document belongs.
[0048] It should be noted that, in this embodiment, the N-gram model is used during tagging to separate the text words of the financial electronic archive according to the tag type used. Optionally, a preset tagging strategy is used to tag the text characters in the financial electronic archive, and feature words in the financial electronic archive are extracted to obtain a feature word set, including: tagging the financial electronic archive using the N-gram model, wherein the tag types include: binary Bi-Gram or ternary Tri-Gram, binary Bi-Gram refers to a sequence of two adjacent characters, and ternary Tri-Gram refers to a sequence of three adjacent characters; extracting feature words in the financial electronic archive based on the binary Bi-Gram and ternary Tri-Gram in the character tagging results to obtain a feature word set.
[0049] This embodiment uses two types of N-gram tags, namely, Bi-Gram and Tri-Gram. Each text will be segmented according to these two types of N-grams, and n consecutive characters will be regarded as a gram unit. In order to reflect the financial terms of financial electronic archives, n is taken as 2 and 3, and text feature words are extracted based on Bi-Gram and Tri-Gram.
[0050] It should be noted that the financial electronic archives involved in this embodiment are mainly divided into five categories: accounting vouchers (including original vouchers, accounting vouchers, summary vouchers, etc.), accounting books (including general ledgers, detailed ledgers, journals, fixed asset cards, auxiliary ledgers, etc.), accounting reports (including monthly, quarterly, annual financial reports, etc.), financial documents and other materials (including tax declaration materials, bank statements, accounting archive transfer lists, etc.). This embodiment uses N-gram-based financial electronic archive text classification technology to classify financial electronic archive images and classify financial electronic archives into five types: accounting vouchers, accounting books, accounting reports, financial documents and others, so as to facilitate classified viewing of financial electronic archives.
[0051] The financial electronic archive text data after N-gram will become a set of feature words and stored as an index. Then the TD-IDF algorithm can be used to weight the text, that is, to extract the feature words with the highest frequency and higher weight. The feature word is an important word that can represent the category of the financial electronic archive document. The feature word comes from the results of N-gram tagging and feature word extraction.
[0052] Among them, the step of determining the importance of each feature word to the financial electronic archive based on the character tagging results and the feature word set includes: obtaining the frequency of occurrence of each feature word in the financial electronic archive based on the character tagging results and the feature word set; calculating the TF value, DF value and IDF value based on the frequency of occurrence of the feature word in the financial electronic archive, wherein the TF value refers to the frequency of occurrence of the feature word in the financial electronic archive, the DF value refers to the total number of documents containing the feature word, and the IDF value refers to the absolute value of the total number of documents divided by the DF value; determining the importance of each feature word to the financial electronic archive based on the product of the TF value and the IDF value.
[0053] The TD-IDF algorithm is used to weight the feature words. First, the TF value, DF value and IDF value are calculated. The TF value is the frequency of the term in a financial electronic archive text d, the DF value is the number of documents containing the feature word t, and the IDF value is the absolute value of the total number of documents divided by the DF value. After calculating these values, the TF-IDF method is used for calculation. The TF-IDF value is the product of the TF value and the IDF value, which indicates the importance of the feature word t to a certain text. Therefore, TF-IDF will calculate the weight of each feature word.
[0054] Taking the financial electronic archive as a document, the calculation formula used to calculate the importance of each feature word for the financial electronic archive includes:
[0055] TF(d,t)=f(d,t)
[0056] IDF(t)=log(Nd / df(t))
[0057] TF-IDF=TF(d,t)*IDF(t)
[0058] Among them, f(d,t) represents the frequency of feature word t in document d; Nd represents the total number of all documents; df(t) represents the total number of documents with feature word t.
[0059] It should be noted that the present embodiment also uses a naive Bayesian classification algorithm to classify financial electronic archives. Optionally, based on the importance of each feature word to the financial electronic archive, the step of determining the text type and the text class label to which the document belongs includes: using a naive Bayesian classifier to classify the financial electronic archive to obtain the text type and the text class label to which the document belongs;
[0060] The training process of the naive Bayes classifier includes: determining the text type according to the word frequency data of the financial electronic archives, dividing the text type into accounting voucher type, accounting book type, accounting report type, financial document type and other types, which are defined as {c1, c2, c3, c4, c5}; determining the probability value of each text type to which each training document belongs based on the first formula, and the first formula is: Among them, p(c j ) indicates that the document belongs to c j The probability of j is {1,2,3,4,5}, n(doc j ) represents the total number of j categories in the training documents, and n(sampel) represents the total number of all training documents; the occurrence probability of each feature word in each document type is determined based on the second formula, and the second formula is: Among them, p(x i |c j ) means c j Text type feature word x iThe probability of n i represents the frequency of occurrence of each text type feature word, n represents the total number of all feature words of a certain category in the training document, and |x| represents the total number of feature words in all training data; the text type of the text to be classified under the maximum conditional probability value is selected by the third formula, and the third formula is: p(c i |d)=argmax p(c j )p(x i |c j ); where p(c i |d) refers to the text type of the text to be classified under the maximum conditional probability value, and the text class label to which the document to be classified belongs is obtained based on the text type.
[0061] After obtaining the conditional probability of each type of file, we compare and select the maximum conditional probability p(c i |d), that is, the maximum value of the conditional probability of the text d to be classified in each category. The corresponding category is the category to which the document belongs, and the text class label to which the document belongs is determined, that is, the document to be classified belongs to one of the five categories: accounting voucher category, accounting book category, accounting report category, financial document category and other categories.
[0062] Step S103, extract the key elements of each type of financial electronic archives, extract the associations between archive entities and elements, between archive entities, and between key elements, and construct a financial archive knowledge graph.
[0063] Based on five types of accounting archives, namely accounting vouchers, accounting books, accounting reports, financial documents and others, we sorted out all the key elements of the five types of financial archives and extracted the relationships between entities and elements, between entities, and between elements.
[0064] Optionally, the steps of extracting key elements of each type of financial electronic archives, extracting the associations between archive entities and elements, between archive entities and between key elements, and constructing a financial archive knowledge graph include: for financial electronic archives of the accounting voucher type, extracting structured information on the accounting voucher document, obtaining a voucher attribute set, and establishing an association between the voucher attribute set and the target thing entity; for financial electronic archives of the accounting book type, extracting the account book attribute set in the accounting record, and establishing an association between the account book attribute set and the target accounting period entity; for financial electronic archives of the accounting report type, extracting the report attribute set in the financial report, and establishing an association between the report attribute set and the target accounting period entity; for financial electronic archives of the financial document type, extracting the file attribute set in the budget report, financial analysis report and audit report, and establishing an association between the file attribute set and the financial document name entity; based on the association between the voucher attribute set and the target thing entity, the association between the account book attribute set and the target accounting period entity, the association between the report attribute set and the target accounting period entity, and the association between the file attribute set and the financial document name entity, construct a financial archive knowledge graph.
[0065] When constructing a financial electronic archive knowledge graph, it is necessary to first construct a financial archive knowledge graph ontology. The financial archive knowledge graph ontology construction mainly defines entities, attributes, and relationship construction. This embodiment defines five core classes of ontology based on the entity characteristics of the financial archive field, including accounting vouchers, accounting books, accounting reports, financial documents, and others. According to the needs of the financial archive field, the financial archive ontology involved in this embodiment includes:
[0066] Accounting voucher: Original vouchers that record the economic activities of an enterprise, such as receipts, invoices, contracts, etc., are the basis of accounting. All the information filled in on the accounting voucher is structured information, including features such as date, number, quantity, amount, remarks, etc., which are attribute information. The feature itself is also a thing, such as a purchase order, project, contract, supplier, etc., and a relationship is established between the accounting voucher entity and it.
[0067] Accounting books: including various books, such as general ledger, detailed ledger, journal, etc., which are used to record and summarize the information in accounting vouchers to form the accounting records of the enterprise. The attributes mainly include unit, account period, account, beginning direction, beginning balance, debit occurrence, credit occurrence, ending direction, ending balance, etc. Among them, the unit is an entity and a relationship is established. The account period is an accounting period that is needed in various books, reports, etc., including the accounting year and account period. It can also be extracted as an entity and establish a relationship with the account summary table or the report. The others are attributes.
[0068] Accounting report category: refers to financial statements, such as balance sheet, income statement, cash flow statement, etc., which are used to show the financial status and operating results of the enterprise to internal and external stakeholders. The attributes mainly include report period, report unit, report item (horizontally and vertically combined), report cell formula, report cell data extraction result and other attributes; the period includes the associated fiscal year and account period, which can be related to the report management relationship.
[0069] Financial documents: including budget reports, financial analysis reports, internal audit reports, etc. These documents help management make decisions and control, and also include various financial-related notifications, decisions, approvals, etc. Attributes can include budget reports, financial analysis reports, internal audit reports, and can establish a relationship with the financial document name entity.
[0070] Other categories: including all other financial files that do not belong to the above four categories, such as accounting file custody lists, accounting file appraisal opinions, accounting file destruction lists, bank statements, etc.
[0071] In this embodiment, the financial electronic archive text classification technology based on N-gram and naive Bayes is used to classify and store the financial electronic archive image according to five types of accounting vouchers, accounting books, accounting reports, financial documents and other categories, so as to facilitate the classification and viewing of the financial electronic archive. First, N-gram is used to extract text feature words, then the TD-IDF algorithm is used to weight the feature words, and finally the naive Bayes classifier is used to classify the financial electronic archive. The financial electronic archive text classification technology combining N-Gram, TD-IDF weighted algorithm and naive Bayes automatically classifies and organizes the financial electronic archive image according to five types of financial archives, namely, accounting vouchers, accounting books, accounting reports, financial documents and other categories, to ensure the accuracy of archive classification.
[0072] After constructing the financial archives knowledge graph ontology, this embodiment needs to perform data cleaning on the financial archives text that has been identified and classified by OCR, and perform data cleaning operations such as processing missing values, processing invalid values, and deleting duplicate values. Then, the archive entities and specific relationships are extracted, and the semantic relationships between the various types of entities required to construct the financial archives knowledge graph are extracted. Finally, a graph database is used to store the knowledge graph.
[0073] The knowledge graph technology is used to construct the relationship between five types of financial archives. Based on the Bootstrapping algorithm, various types of entity relationships required to build the financial archive knowledge graph are extracted to form a user-personalized knowledge network.
[0074] Optionally, after constructing the financial archives knowledge graph, it also includes: storing the text category labels of the financial electronic archives and documents in a file server; storing the text data of the financial electronic archives in a relational database; and storing the constructed financial archives knowledge graph in a graph database.
[0075] Step S104, presenting the Metaverse Financial Archives containing the financial archives knowledge graph and all financial electronic archives to the virtual reality VR device, and responding to the archive query request of the VR device to display the target financial archives information.
[0076] After obtaining the financial archives knowledge graph and related archive text data, this embodiment can build a metaverse financial archive for users to immersively query financial electronic archives.
[0077] Optionally, the Metaverse Financial Archives includes: a virtual reality platform, including: a virtual reality modeling language VRML interpreter and a VR scene parser, wherein the VRML interpreter reads text data of financial electronic archives and a financial archive knowledge graph, and converts the archive data and archive scene description into three-dimensional graphic images, a financial archive database, including a file server, a relational database and a graph database; and a VR service terminal, which is used to respond to archive query requests from a financial archive management end or a financial archive query end, display the financial electronic archives and financial archive knowledge graph in the Metaverse Financial Archives, and display the target financial archive information in the query results.
[0078] The Metaverse Financial Archives visual retrieval based on VR equipment can achieve three-dimensional reproduction of the retrieval process and results of financial electronic archives and knowledge graphs.
[0079] In the interactive roaming mode of the Metaverse Financial Archives, the properties of the displayed filing cabinet archive model can be viewed. This can be achieved by using a variety of methods such as dynamically generating forms using database technology. For example, this embodiment can directly use the Anchor node that comes with VRML to achieve this. By setting the center, size, archive text prompt, browser additional information, URL of the archive file to be loaded, and node shape of the filing cabinet archive model in the Anchor, the basic properties of the archive can be displayed when the mouse cursor is moved to the target filing cabinet archive model in the Metaverse Financial Archives scene roaming.
[0080] When users search through the Metaverse Financial Archives, they can provide keywords through the input port, and then obtain the similarity of the search feature words through weighted calculation, thereby obtaining a three-dimensional visual display of the financial electronic archive images and knowledge graphs that need to be searched.
[0081] Through the above steps, the financial archive images can be preprocessed, divided into pages and recognized as characters to obtain financial electronic archives, and the financial electronic archives can be classified into text categories. The text class label of the document can be determined based on the text word frequency data of the financial electronic archives. The text class label is used to index the text type of the financial electronic archives, extract the key elements of each type of financial electronic archives, extract the associations between archive entities and elements, between archive entities and between key elements, construct a financial archive knowledge graph, present the metaverse financial archives containing the financial archive knowledge graph and all financial electronic archives to a virtual reality VR device, respond to the archive query request of the VR device, and display the target financial archive information. In this embodiment, financial archives can be automatically classified and organized to reduce the labor cost caused by manual classification and archiving, extract the key elements of each type of financial electronic archives, extract the associations between archive entities and elements, between archive entities and between key elements, and build a financial archive knowledge graph. Through the knowledge graph, users can easily retrieve financial electronic documents and navigate archives, and then immersively search and view the original vouchers of financial archives and the knowledge graph associations between various types of financial archives based on the established Metaverse Financial Archives, thereby solving the technical problems of low utilization efficiency and low query efficiency of financial archives in related technologies.
[0082] The following is a detailed description of another optional specific implementation method. The specific detailed implementation method of this embodiment includes:
[0083] 1. Digital storage of financial archives.
[0084] The digital storage of financial archives is divided into four steps: financial archive scanning, text extraction, text classification, and knowledge graph construction and storage.
[0085] (1) Scanning of paper financial records.
[0086] The original paper financial archives are sorted out, and then the paper financial archive files are scanned with a scanner to perform electronic processing of the paper financial archives to obtain a scanned copy data set of the financial archives, such as scanned copies in PDF, image files and other formats. In order to effectively recognize characters and extract text, a financial electronic archive data set in a specified format (such as PNG format) is selected.
[0087] (2) Text extraction from financial electronic archives.
[0088] This embodiment uses OCR technology to extract text from financial electronic archives to achieve automatic text classification and knowledge graph construction. After the image is preprocessed and corrected, the numerical features are identified and extracted for comparative identification. After the image of the financial electronic archive is processed, divided into pages, and recognized by characters, the editable text is extracted.
[0089] ① Image processing unit: The image processing unit mainly performs image preprocessing operations. Image preprocessing is mainly to ensure the effect of financial electronic file character recognition and eliminate interference information in the image to improve the quality of image recognition. The Otsu binarization method is used to binarize the financial electronic file image and to anti-distort the financial electronic file image.
[0090] ②Layout division unit: The layout division divides or re-divides the scanned and pre-processed financial electronic archive image. Since there are obvious dividing lines between the various parts of the financial electronic archive, this embodiment uses the straight line extraction algorithm of Hough transform to divide the layout of the financial electronic archive image, and divides the layout of the financial electronic archive image into each part by the length and thickness of the line segment, the minimum height and minimum width of the blank area, and selects the financial electronic archive title, table, date, person in charge and other parts.
[0091] ③ Recognition unit: The recognition unit extracts characteristic characters. The recognition unit realizes the recognition of printed characters and handwritten characters in the title, table, date, and person in charge of the financial electronic file divided by the layout division unit, which requires learning and training. For example, based on Tesseract (an open source OCR engine, an open source recognition library that supports Chinese character recognition), Pytesseract is used to build a financial file learning sample and corpus. The corpus contains standard financial text and data tables. Then, after the numerical values and text in the financial electronic file are extracted, they are compared with the standard corpus. Through the comparison, the samples corresponding to the extracted text and table are determined to complete the recognition of specific characters.
[0092] (3) Classification of financial electronic archive texts.
[0093] Financial archives are mainly divided into five categories: accounting vouchers (including original vouchers, accounting vouchers, summary vouchers, etc.), accounting books (covering general ledgers, detailed ledgers, journals, fixed asset cards, auxiliary ledgers, etc.), accounting reports (monthly, quarterly, and annual financial reports), financial documents and other materials (including tax declaration materials, bank statements, accounting archive transfer lists, etc.). This embodiment uses N-gram-based financial electronic archive text classification technology to classify financial electronic archive images and classify financial electronic archives into five types: accounting vouchers, accounting books, accounting reports, financial documents, and others, so as to facilitate classified viewing of financial electronic archives.
[0094] The N-gram-based text classification method mainly includes three steps: N-gram tagging, TD-IDF weighting and naive Bayes classification:
[0095] ①N-gram tagging.
[0096] N-gram is a tagging process that separates financial electronic archive text words according to the tag type used. This embodiment uses two types of n-gram tags, namely, bigram Bi-Gram and ternary Tri-Gram. Each text will be segmented according to these two types of n-grams, and n consecutive characters will be regarded as a gram unit. In order to reflect the financial terms of financial electronic archives, n takes the values of 2 and 3, and text feature words are extracted based on bigram Bi-Gram and ternary Tri-Gram.
[0097] ②TD-IDF weighting.
[0098] The financial electronic archive text data after N-gram will become a set of feature words and stored as an index. In this stage, the text is weighted, that is, the feature words with the highest frequency and higher weight are found. The feature word is an important word that can represent the category of the financial electronic archive document. The feature word comes from the results of N-gram tagging and feature word extraction.
[0099] The TD-IDF algorithm is used to weight the feature words. First, the TF value, DF value, and IDF value are calculated. The TF value is the frequency of the term in a financial electronic archive text d, the DF value is the number of documents containing the feature word t, and the IDF value is the absolute value of the total number of documents divided by the DF value. After calculating these values, the TF-IDF method is used for calculation. The TF-IDF value is the product of the TF value and the IDF value, which indicates the importance of the feature word t to a certain text. Therefore, TF-IDF will calculate the weight of each feature word. The calculation formula is as follows:
[0100] TF(d,t)=f(d,t)
[0101] IDF(t)=log(Nd / df(t))
[0102] TF-IDF=TF(d,t)*IDF(t)
[0103] Where f(d,t) represents the frequency of feature word t in document d; Nd represents the total number of all documents; df(t) represents the total number of documents with feature word t.
[0104] ③Naive Bayes classification.
[0105] The naive Bayes classifier is a classifier based on the conditional probability of Bayes' theorem and the strong independence assumption. It is a classifier based on the assumption that all features of a given classification variable are independent of each other. This embodiment uses the naive Bayes classifier to classify financial electronic files.
[0106] During the training process, the text type is determined according to the word frequency data of the financial electronic archive text, and the document categories are divided into five categories of labels: accounting vouchers, accounting books, accounting reports, financial documents and others, which are {c1, c2, c3, c4, c5} respectively.
[0107]
[0108] In the formula, p(c j ) indicates that the document belongs to c j The probability of j is {1,2,3,4,5}, n(doc j ) represents the total number of class j in the training documents, and n(sampel) represents the total number of training documents.
[0109]
[0110] In the formula, p(x i |c j ) means c j Category feature word x i The probability of n i represents the frequency of occurrence of feature words in each category, n represents the total number of feature words in a certain category in the document, and |x| represents the total number of feature words in all training data.
[0111] p(c i |d)=argmax p(c j )p(x i |c j )
[0112] After obtaining the conditional probability of each type of file, we compare and select the maximum conditional probability p(c i |d), that is, the maximum value of the conditional probability of the text d to be classified in each category. The corresponding category is the category to which the document belongs, and the text class label to which the document belongs is determined, that is, the document to be classified belongs to one of the five categories: accounting voucher category, accounting book category, accounting report category, financial document category and other categories.
[0113] (4) Construction of knowledge graph of financial electronic archives.
[0114] Based on the five types of accounting archives, namely accounting vouchers, accounting books, accounting reports, financial documents and others, we sorted out all the key elements of the five types of financial archives and extracted the relationships between entities and elements, between entities and between elements. The construction of the knowledge graph of financial electronic archives is mainly divided into the following steps:
[0115] ① Construction of financial archives knowledge graph ontology.
[0116] The construction of the financial archives knowledge graph ontology mainly defines entities, attributes and relationships. This embodiment defines five core classes of ontology based on the entity characteristics of the financial archives field, including accounting vouchers, accounting books, accounting reports, financial documents, and others. According to the needs of the financial archives field, the designed financial archives ontology is as follows:
[0117] Accounting voucher: Original vouchers that record the economic activities of an enterprise, such as receipts, invoices, contracts, etc., are the basis of accounting. All the information filled in on the accounting voucher is structured information, including features such as date, number, quantity, amount, remarks, etc., which are attribute information. The feature itself is also a thing, such as a purchase order, project, contract, supplier, etc., and a relationship is established between the accounting voucher entity and it.
[0118] Accounting books: including various books, such as general ledger, detailed ledger, journal, etc., which are used to record and summarize the information in accounting vouchers to form the accounting records of the enterprise. The attributes mainly include unit, account period, account, beginning direction, beginning balance, debit occurrence, credit occurrence, ending direction, ending balance, etc. Among them, the unit is an entity and a relationship is established. The account period is an accounting period that is needed in various books, reports, etc., including the accounting year and account period. It can also be extracted as an entity and establish a relationship with the account summary table or the report. The others are attributes.
[0119] Accounting report category: refers to financial statements, such as balance sheet, income statement, cash flow statement, etc., which are used to show the financial status and operating results of the enterprise to internal and external stakeholders. The attributes mainly include report period, report unit, report item (horizontally and vertically combined), report cell formula, report cell data extraction result and other attributes; the period includes the associated fiscal year and account period, which can be related to the report management relationship.
[0120] Financial documents: including budget reports, financial analysis reports, internal audit reports, etc. These documents help management make decisions and control, and also include various financial-related notifications, decisions, approvals, etc. Attributes can include budget reports, financial analysis reports, internal audit reports, and can establish a relationship with the financial document name entity.
[0121] Other categories: including all other financial files that do not belong to the above four categories, such as accounting file custody lists, accounting file appraisal opinions, accounting file destruction lists, bank statements, etc.
[0122] ②Cleaning of financial electronic archive data.
[0123] First, the financial archive text that has been identified and classified by OCR is cleaned, and data cleaning operations such as processing missing values, processing invalid values, and deleting duplicate values are performed on the data.
[0124] ③Entity identification and relationship extraction of financial electronic archives.
[0125] Entity recognition: This embodiment uses the ALBERT-BiLSTM-CRF model to realize the recognition of entities in financial electronic files.
[0126] Relationship extraction: This embodiment uses the Bootstrapping algorithm to extract semantic relationships between various types of entities required to build a financial archive knowledge graph from the data.
[0127] ④ Financial electronic archive knowledge storage.
[0128] This embodiment uses the Neo4j graph database to store the knowledge graph.
[0129] (5) Storage of financial electronic files.
[0130] Store unstructured data such as scanned financial electronic archives in PNG format and text-classified financial electronic archives in a file server, which is a dedicated server with sufficient storage space. Store text data of financial electronic archives extracted by OCR in a relational database, such as MySQL. Since the knowledge graph is a graph structure, store the constructed knowledge graph data in a graph database, such as Neo4j.
[0131] 2. Visual search of Metaverse Financial Archives.
[0132] The Metaverse Financial Archives visual retrieval based on VR terminal devices can achieve three-dimensional reproduction of the retrieval process and results of financial electronic archives and knowledge graphs.
[0133] Figure 2 is a schematic diagram of an optional Metaverse financial archive visual retrieval system according to an embodiment of the present invention. Figure 2 As shown in the figure, the Metaverse Financial Digital Archives Visual Retrieval System consists of a virtual reality platform, a financial archives database and a VR service terminal. Each part is introduced below.
[0134] Financial archive database: The financial archive database includes a file server, a relational database, and a graph database. The file server stores unstructured data such as scanned financial electronic archives and text-classified financial electronic archives; the relational database (such as MySQL) stores the text data of financial electronic archives extracted by OCR; the graph database (such as Neo4j) stores the constructed knowledge graph data.
[0135] Virtual reality platform: The core of the Metaverse Financial Archives Visual Information Retrieval System is the virtual reality platform. The system is built on the basis of the virtual reality modeling language VRML and implemented using 3DS MAX. The VRML modeling language uses Shape nodes to create models. The appearance, material and shape of all models in the virtual scene of the Metaverse Archives are basically created and controlled by Shape nodes. The scenes created with VRML can be transmitted through the Internet, displayed on the user's screen, and allow multi-user participation; in order to display the three-dimensional scene created by VRML in the user's browser, a VRML interpreter is required. The VRML interpreter can read VRML files and convert the three-dimensional models and scene descriptions therein into graphic images, so that users can see the three-dimensional world described by VRML through the browser; after the archives searched by the financial archives administrator and the financial archives query party and the archives knowledge graph data are dynamically integrated with the VR scene data, a visual three-dimensional display is performed on the user's screen.
[0136] VR service terminal: Financial archive administrators and financial archive inquirers can roam and search the Metaverse financial archives through PC or mobile browsers, as well as visualize the archive knowledge graph.
[0137] (2) Construction process.
[0138] The construction of the visual information retrieval system of Metaverse Financial Archives includes three steps: 3D scene modeling, roaming system and visual retrieval. First, a virtual scene is constructed by building actual-size building models of existing buildings, floors, partitions of various spaces, furniture, and archive racks in the real archives. Secondly, interactive roaming query of financial archives is realized based on VRML, and the properties of the displayed archive cabinet archive model are viewed. Finally, visual retrieval is performed, and the information retrieval interaction design for the archives 3D scene is completed according to the needs of the information retrieval mode and the various operations of the objects in the retrieval process.
[0139] ①Scene modeling.
[0140] The scene modeling of the VR information retrieval system of Metaverse Financial Archives includes three parts: scene acquisition, data acquisition and three-dimensional modeling. The real scene provides the basis and data for the establishment of the model, which usually comes from camera shooting or mapping documents. Data acquisition includes the precise specifications and real textures of archive buildings, furniture, and filing cabinets, which can be used for the modification and rendering of three-dimensional models. The specification and size data are obtained from the mapping documents, while the texture data is usually directly imported into the computer, corrected by image editing software, and then the real texture and texture data of the real object are collected. Three-dimensional modeling can be based on Creator Pro software and simulation software Vega Prime, supplemented by component-based MapObjects software.
[0141] Figure 3 is a schematic diagram of scene modeling of an optional Metaverse Financial Archives VR information retrieval system according to an embodiment of the present invention, such as Figure 3 As shown, scene modeling includes: using modeling software to build the archive's terrain module, indoor module, archive shelf module, channel module, natural scene module, texture rendering, display module and floor module.
[0142] The virtual scene is constructed by establishing actual-size building models of existing buildings, floors, partitions of various spaces, furniture, archive racks, etc. in the real archives. The three-dimensional modeling of the archives is carried out based on Creator Pro software and simulation software Vega Prime, supplemented by component-based MapObjects software.
[0143] ②Interactive roaming query of Metaverse Financial Archives.
[0144] In this embodiment, the interactive roaming of the Metaverse Financial Archives is mainly realized by combining the Navigation Info node and the Viewpoint node of VRML. The Navigation Info node describes the characteristics of the browsing avatar and the information such as the movement mode, speed, and visual distance in the virtual scene. The interactive roaming of the three-dimensional virtual archives is realized by setting the parameters such as the movement mode, speed, and visual distance.
[0145] In the interactive roaming mode of the Metaverse Financial Archives, the properties of the displayed filing cabinet archive model can be viewed. This can be achieved by using a variety of methods such as dynamically generating forms using database technology. This embodiment directly uses the Anchor node that comes with VRML to achieve this. By setting the center, size, archive text prompt, browser additional information, URL of the archive file that needs to be loaded, and node shape of the filing cabinet archive model in the Anchor, the basic properties of the archive can be displayed when the mouse cursor is moved to the target filing cabinet archive model in the Metaverse Financial Archives scene roaming.
[0146] ③Visual retrieval of financial electronic archives.
[0147] Financial electronic archive retrieval can find keywords from financial electronic archives, such as "title", "date" and "handler" and other feature words to obtain financial electronic voucher images. The database is processed by importing the Scr ipt node in VRML into the HTML text file. The visual retrieval of financial electronic archives adopts the fuzzy search method and introduces the concept of vector space model. The feature words in the text are weighted and introduced into the vector space, and the similarity of the text is obtained as follows:
[0148]
[0149] In the formula, d1 and d2 represent different texts, respectively, and the n-dimensional vector T i and T i ′ to indicate that w i is the weight of the feature word in this article.
[0150] The similarity of the search feature words is obtained through weighted calculation, so as to obtain a three-dimensional visual display of the financial electronic archive images and knowledge graphs that need to be searched.
[0151] In this embodiment, the visual retrieval of financial electronic archives adopts a fuzzy search method, introduces a vector space model, and obtains the similarity of search feature words through weighted calculation, thereby obtaining a three-dimensional visual display of the financial electronic archive images and knowledge graphs that need to be searched.
[0152] In this embodiment, VRML is used to construct a metaverse visual retrieval system, a virtual reality platform is built based on VRML, and interactive roaming queries of the metaverse financial archives are implemented. Interactive property viewing is performed on the three-dimensional archive model. At the same time, based on the fuzzy search algorithm, a vector space model is introduced, and the similarity of the search feature words is obtained through weighted calculation to achieve a three-dimensional visual display of financial electronic archive images and knowledge graphs.
[0153] The following is a detailed description in conjunction with another embodiment.
[0154] Embodiment 2
[0155] A financial archive query system based on a text knowledge graph provided in this embodiment includes multiple implementation units, each of which corresponds to each implementation step in the above-mentioned embodiment 1.
[0156] Figure 4 is a schematic diagram of an optional financial archive query system based on text knowledge graph according to an embodiment of the present invention, such as Figure 4 As shown, the financial archive query system based on text knowledge graph may include: an image processing unit 41, a archive classification unit 42, a knowledge graph construction unit 43, and a financial archive information display unit 44.
[0157] The image processing unit 41 is used to perform image preprocessing, page division and character recognition on the financial archive image to obtain the financial electronic archive.
[0158] Optionally, the image processing unit includes: a preprocessing module, which is used to preprocess the financial archive image obtained after scanning the paper financial archive, wherein the preprocessing includes at least one of the following: binarizing the financial archive image through the Otsu binarization strategy and anti-torsion processing of the financial archive image; a layout division module, which is used to divide the preprocessed financial archive image into a layout using a straight line extraction algorithm of the Hough transform, wherein the layout division includes: based on the line segment length in the image layout, the minimum height and minimum width of the blank area, dividing the layout of the financial archive image into multiple parts, and the multiple parts include at least one of the following: archive title, archive table, archive date, archive handling object; an information comparison module, which is used to extract numerical values and text in the financial archive using a preset character recognition strategy, and compare the extracted numerical values and text with the standard financial corpus respectively to obtain archive characters and archive values, and generate financial electronic archives.
[0159] The file classification unit 42 is used to perform text classification on the financial electronic file and determine the text class label to which the document belongs according to the text word frequency data of the financial electronic file, wherein the text class label is used to index the text type of the financial electronic file.
[0160] Optionally, the archive classification unit includes: a marking module, which is used to mark the text characters in the financial electronic archives using a preset marking strategy, and extract feature words in the financial electronic archives to obtain a feature word set; a feature word importance determination module, which determines the importance of each feature word to the financial electronic archives based on the character marking results and the feature word set; and a type determination module, which determines the text type and the text class label to which the document belongs based on the importance of each feature word to the financial electronic archives.
[0161] Optionally, the marking module includes: a marking submodule, which is used to mark the financial electronic archives using an N-gram model, wherein the marking types include: binary Bi-Gram or ternary Tri-Gram, binary Bi-Gram refers to a sequence consisting of two adjacent characters, and ternary Tri-Gram refers to a sequence consisting of three adjacent characters; a feature word extraction submodule, which extracts feature words in the financial electronic archives based on the binary Bi-Gram and ternary Tri-Gram in the character marking results to obtain a feature word set.
[0162] Optionally, the feature word importance determination module includes: a frequency statistics submodule, which obtains the frequency of occurrence of each feature word in the financial electronic archive based on the character tagging result and the feature word set; a numerical calculation submodule, which calculates the TF value, DF value and IDF value based on the frequency of occurrence of the feature word in the financial electronic archive, wherein the TF value refers to the frequency of occurrence of the feature word in the financial electronic archive, the DF value refers to the total number of documents containing the feature word, and the IDF value refers to the absolute value of the total number of documents divided by the DF value; an importance determination submodule, which determines the importance of each feature word to the financial electronic archive based on the product of the TF value and the IDF value.
[0163] Optionally, the type determination module includes: a classification submodule, which is used to classify the financial electronic archive using a naive Bayes classifier to obtain the text type and the text class label to which the document belongs;
[0164] The training process of the naive Bayes classifier includes: determining the text type according to the word frequency data of the financial electronic archives, dividing the text type into accounting voucher type, accounting book type, accounting report type, financial document type and other types, which are defined as {c1, c2, c3, c4, c5}; determining the probability value of each text type to which each training document belongs based on the first formula, and the first formula is: Among them, p(c j ) indicates that the document belongs to c j The probability of j is {1,2,3,4,5}, n(doc j ) represents the total number of j categories in the training documents, and n(sampel) represents the total number of all training documents; the occurrence probability of each feature word in each document type is determined based on the second formula, and the second formula is: Among them, p(x i |c j ) means c j Text type feature word x i The probability of n i represents the frequency of occurrence of each text type feature word, n represents the total number of all feature words of a certain category in the training document, and |x| represents the total number of feature words in all training data; the text type of the text to be classified under the maximum conditional probability value is selected by the third formula, and the third formula is: p(c i |d)=argmax p(c j )p(x i |c j ); where p(c i |d) refers to the text type of the text to be classified under the maximum conditional probability value, and the text class label to which the document to be classified belongs is obtained based on the text type.
[0165] The knowledge graph construction unit 43 is used to extract the key elements of each type of financial electronic archives, extract the associations between archive entities and elements, between archive entities and between key elements, and construct a financial archive knowledge graph.
[0166] Optionally, the knowledge graph construction unit includes: a structured information extraction module, which is used to extract structured information on accounting voucher documents for financial electronic archives of the accounting voucher type, obtain a voucher attribute set, and establish an association relationship between the voucher attribute set and the target thing entity; a first entity establishment module, which is used to extract a book attribute set in the accounting record for financial electronic archives of the accounting book type, and establish an association relationship between the book attribute set and the target accounting period entity; a second entity establishment module, which is used to extract a report attribute set in the financial report for financial electronic archives of the accounting report type, and establish an association relationship between the report attribute set and the target accounting period entity; a third entity establishment module, which is used to extract a file attribute set in the budget report, financial analysis report and audit report for financial electronic archives of the financial document type, and establish an association relationship between the file attribute set and the financial document name entity; a knowledge graph construction module, which constructs a financial archive knowledge graph based on the association relationship between the voucher attribute set and the target thing entity, the association relationship between the book attribute set and the target accounting period entity, the association relationship between the report attribute set and the target accounting period entity, and the association relationship between the file attribute set and the financial document name entity.
[0167] Optionally, the financial archive query system based on text knowledge graph also includes: a first storage unit, used to store the text class labels of the financial electronic archives and documents to a file server after constructing the financial archive knowledge graph; a second storage unit, used to store the text data of the financial electronic archives to a relational database; and a third storage unit, used to store the constructed financial archive knowledge graph to a graph database.
[0168] The financial archive information display unit 44 is used to present the metaverse financial archives including the financial archive knowledge graph and all financial electronic archives to the virtual reality VR device, and respond to the archive query request of the VR device to display the target financial archive information.
[0169] Optionally, the Metaverse Financial Archives includes: a virtual reality platform, including: a virtual reality modeling language VRML interpreter and a VR scene parser, wherein the VRML interpreter reads text data of financial electronic archives and a financial archive knowledge graph, and converts the archive data and archive scene description into three-dimensional graphic images, a financial archive database, including a file server, a relational database and a graph database; and a VR service terminal, which is used to respond to archive query requests from a financial archive management end or a financial archive query end, display the financial electronic archives and financial archive knowledge graph in the Metaverse Financial Archives, and display the target financial archive information in the query results.
[0170] Through the above-mentioned public content, financial archives can be automatically classified and organized, reducing the labor costs brought about by manual classification and archiving, extracting the key elements of each type of financial electronic archives, extracting the associations between archive entities and elements, between archive entities, and between key elements, and constructing a financial archive knowledge graph. Through the knowledge graph, users can easily retrieve financial electronic documents and navigate archives, and then immersively search and view the original vouchers of financial archives and the knowledge graph associations between various types of financial archives based on the established Metaverse Financial Archives, thereby solving the technical problems of low utilization efficiency and low query efficiency of financial archives in related technologies.
[0171] The above-mentioned financial archive query system based on text knowledge graph can also include a processor and a memory. The above-mentioned image processing unit 41, archive classification unit 42, knowledge graph construction unit 43, financial archive information display unit 44, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.
[0172] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the construction of the Metaverse Financial Archives based on text classification and knowledge graph and the retrieval of financial electronic texts can be realized by adjusting kernel parameters.
[0173] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (fl ash RAM), and the memory includes at least one storage chip.
[0174] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the financial archive query method based on text knowledge graph according to any one of the above-mentioned embodiments one.
[0175] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the financial archive query method based on text knowledge graph of any one of the above-mentioned embodiments one.
[0176] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the financial archive query method based on text knowledge graph described in each embodiment of the present application.
[0177] The present application also provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the financial archive query method based on text knowledge graph described in each embodiment of the present application are implemented.
[0178] Figure 5 1 is a hardware structure block diagram of an electronic device (or mobile device) for a financial archive query method based on a text knowledge graph according to an embodiment of the present invention. Figure 5 As shown, the electronic device may include one or more ( Figure 5 502a, 502b, ..., 502n are used to illustrate) processor 502 (processor 502 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), memory 504 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 5 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 5 More or fewer components as shown, or with Figure 5 Different configurations are shown.
[0179] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0180] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0181] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0182] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0183] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0184] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0185] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A financial archive query method based on text knowledge graph, characterized in that: include: Perform image preprocessing, layout division and character recognition on financial archive images to obtain financial electronic archives; Performing text classification on the financial electronic archive, and determining a text class label to which the document belongs based on the text word frequency data of the financial electronic archive, wherein the text class label is used to index the text type of the financial electronic archive; Extract the key elements of each type of financial electronic archives, extract the associations between archive entities and elements, between archive entities and between key elements, and construct a financial archive knowledge graph; The metaverse financial archives containing the financial archives knowledge graph and all the financial electronic archives are presented to a virtual reality VR device, and the archive query request of the VR device is responded to to display the target financial archives information.
2. The financial archive query method according to claim 1, characterized in that: The steps of performing image preprocessing, layout division and character recognition on the financial archive image to obtain the financial electronic archive include: Preprocessing the financial archive image obtained after scanning the paper financial archive, wherein the preprocessing includes at least one of the following: binarizing the financial archive image by using the Otsu binarization strategy, and performing anti-skew processing on the financial archive image; The pre-processed financial archive image is divided into pages by using a straight line extraction algorithm of Hough transform, wherein the page division includes: dividing the page of the financial archive image into multiple parts based on the length of the line segments in the image page, the minimum height and the minimum width of the blank area, and the multiple parts include at least one of the following: file title, file form, file date, and file handling object; The numerical values and text in the financial file are extracted by using a preset character recognition strategy, and the extracted numerical values and text are respectively compared with a standard financial corpus to obtain file characters and file values, thereby generating the financial electronic file.
3. The financial archive query method according to claim 1, characterized in that: The step of classifying the text of the financial electronic archive and determining the text class label to which the document belongs based on the text word frequency data of the financial electronic archive comprises: Using a preset marking strategy to mark text characters in the financial electronic file, and extracting characteristic words in the financial electronic file to obtain a characteristic word set; Determine the importance of each characteristic word to the financial electronic file based on the character marking result and the characteristic word set; Based on the importance of each feature word to the financial electronic archive, the text type and the text class label to which the document belongs are determined.
4. The financial archive query method according to claim 3, characterized in that: The step of using a preset marking strategy to mark the text characters in the financial electronic file and extracting feature words in the financial electronic file to obtain a feature word set includes: The financial electronic file is marked by using an N-gram model, wherein the marking types include: Bi-Gram or Tri-Gram, Bi-Gram refers to a sequence of two adjacent characters, and Tri-Gram refers to a sequence of three adjacent characters; Based on the Bi-Gram and Tri-Gram in the character tagging result, feature words in the financial electronic file are extracted to obtain the feature word set.
5. The financial archive query method according to claim 3, characterized in that: The step of determining the importance of each characteristic word to the financial electronic file based on the character marking result and the characteristic word set includes: Based on the character marking result and the characteristic word set, obtaining the occurrence frequency value of each characteristic word in the financial electronic file; Based on the frequency of occurrence of the feature words in the financial electronic archives, the TF value, DF value and IDF value are calculated, wherein the TF value refers to the frequency of occurrence of the feature words in the financial electronic archives, the DF value refers to the total number of documents containing the feature words, and the IDF value refers to the absolute value of the total number of documents divided by the DF value; The importance of each feature word to the financial electronic file is determined based on the product of the TF value and the IDF value.
6. The financial archive query method according to claim 3, characterized in that: The step of determining the text type and the text class label to which the document belongs based on the importance of each feature word to the financial electronic file includes: Using a naive Bayes classifier to classify the financial electronic files, and obtaining the text type and the text class label to which the document belongs; The training process of the naive Bayes classifier includes: Determine the text type based on the word frequency data of financial electronic archives, and divide the text type into accounting voucher type, accounting book type, accounting report type, financial document type and other types, which are defined as {c1, c2, c3, c4, c5}; The probability value of each text type to which each training document belongs is determined based on the first formula, wherein the first formula is: Among them, p(c j ) indicates that the document belongs to c j The probability of j is {1,2,3,4,5}, n(doc j ) represents the total number of class j in the training documents, and n(sampel) represents the total number of all training documents; The occurrence probability of each feature word in each document type is determined based on the second formula, where the second formula is: Among them, p(x i |c j ) means c j Text type feature word x i The probability of n i represents the frequency of occurrence of feature words of each text type, n represents the total number of feature words of a certain category in the training document, and |x| represents the total number of feature words in all training data; The text type of the text to be classified under the maximum conditional probability value is selected by the third formula, and the third formula is: p(c i |d)=argmaxp(c j )p(x i |c j ) Among them, p(c i |d) refers to the text type of the text to be classified under the maximum conditional probability value, and the text class label to which the document to be classified belongs is obtained based on the text type.
7. The financial archive query method according to claim 1, characterized in that: The steps of extracting the key elements of each type of financial electronic archives, extracting the associations between archive entities and elements, between archive entities and between key elements, and constructing a financial archive knowledge graph include: For financial electronic files of accounting vouchers, extract the structured information on the accounting voucher documents, obtain the voucher attribute set, and establish an association relationship between the voucher attribute set and the target transaction entity; For financial electronic archives of accounting books, extract the book attribute set in the accounting records, and establish an association relationship between the book attribute set and the target accounting period entity; For financial electronic files of accounting report type, extract the report attribute set in the financial report, and establish an association relationship between the report attribute set and the target accounting period entity; For financial electronic files of financial documents, extract the file attribute sets in the budget report, financial analysis report and audit report, and establish an association relationship between the file attribute set and the financial document name entity; Based on the association relationship between the voucher attribute set and the target thing entity, the association relationship between the account book attribute set and the target accounting period entity, the association relationship between the report attribute set and the target accounting period entity, and the association relationship between the file attribute set and the financial document name entity, a financial archive knowledge graph is constructed.
8. The financial archive query method according to claim 1, characterized in that: After building the financial archive knowledge graph, it also includes: Storing the financial electronic archives and the text-type tags to which the documents belong in a file server; Storing the text data of the financial electronic file in a relational database; The constructed financial archive knowledge graph is stored in a graph database.
9. The financial archive query method according to claim 1, characterized in that: The Metaverse Financial Archives include: The virtual reality platform includes: a virtual reality modeling language VRML interpreter and a VR scene parser, wherein the VRML interpreter reads the text data of the financial electronic archives and the financial archives knowledge graph, converts the archive data and the archive scene description into a three-dimensional graphic image, Financial archive databases, including file servers, relational databases, and graph databases; and The VR service terminal is used to respond to the archive query request of the financial archive management terminal or the financial archive query terminal, display the financial electronic archives and financial archive knowledge graph in the metaverse financial archives, and display the target financial archive information in the query results.
10. A financial archive query system based on text knowledge graph, characterized in that: include: An image processing unit is used to perform image preprocessing, layout division and character recognition on the financial archive image to obtain the financial electronic archive; An archive classification unit, used to perform text classification on the financial electronic archive, and determine the text class label to which the document belongs according to the text word frequency data of the financial electronic archive, wherein the text class label is used to index the text type of the financial electronic archive; A knowledge graph construction unit is used to extract key elements of each type of financial electronic archives, extract the associations between archive entities and elements, between archive entities and between key elements, and construct a financial archive knowledge graph; The financial archive information display unit is used to present the metaverse financial archives including the financial archive knowledge graph and all the financial electronic archives to a virtual reality VR device, and respond to the archive query request of the VR device to display the target financial archive information.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the financial archive query method based on text knowledge graph as described in any one of claims 1 to 9.
Citation Information
Cited By
Image upstream and downstream association map generation method, equipment and medium
CN120409648A
File full-text intelligent retrieval method and system based on knowledge graph and electronic equipment
CN121071127A