A method, device and equipment for parsing inquiry corpus in the financial industry
By configuring business rule processors and performing inferences in the parsing of inquiry corpus in the financial industry, the problem of incomplete parsing by traditional tools is solved, and coverage of terminology specific to the financial field and comprehensiveness and accuracy of parsing results are achieved.
Patent Information
- Application Number
- CN202510935054.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-08
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-07-08
AI Technical Summary
Existing financial inquiry corpus parsing methods are incomplete and have poor accuracy. Traditional text parsing tools lack deep adaptation to the financial industry and find it difficult to cover terminology unique to the financial field.
Based on the financial industry terminology library, multiple business rule processors are configured. By splitting the corpus text, selecting the corresponding business rule processor for parsing, and making inferences based on the initial parsing results, the financial industry terminology library is used to cover unique terms to improve the pertinence and accuracy of the parsing.
It achieves comprehensive and accurate analysis of financial inquiry corpus, improves analysis efficiency and accuracy, can identify key information in complex corpus, and meet the diverse needs of financial business.
Smart Images

Figure CN120429478B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of text parsing technology, and in particular to a method, device and equipment for parsing inquiry corpus in the financial industry. Background Art
[0002] Financial inquiry corpus refers to the textual information generated by various entities in the financial market when conducting inquiry activities. It contains a wealth of financial business-related content, such as trading intentions, price expectations, and transaction conditions for various financial products. Analyzing financial inquiry corpus is of great significance in financial transactions, investment decision-making, and financial market supervision.
[0003] Currently, traditional text parsing tools, such as NLP (Natural Language Processing), general word segmentation tools (such as IK Analyzer), and simple keyword libraries, are commonly used to parse inquiry corpora. However, these tools lack deep adaptation to the financial industry and struggle to cover financial-specific terminology, such as "-5% discount," "overnight betting," and "T+0." Furthermore, these tools only provide preliminary analysis and lack in-depth analysis of the underlying financial content, resulting in incomplete and inaccurate analysis. Summary of the Invention
[0004] In view of this, the present invention provides a method, device and equipment for parsing inquiry corpus in the financial industry to solve the problems of incomplete analysis and poor accuracy in existing inquiry corpus parsing methods.
[0005] In a first aspect, the present invention provides a method for parsing inquiry corpus in the financial industry, the method comprising:
[0006] Configure multiple business rule processors based on the financial industry terminology library;
[0007] Split the corpus text to be parsed to obtain multiple single corpus texts;
[0008] Process each single corpus text to obtain the business text of the single corpus text;
[0009] Based on the business type of the corpus text to be parsed, the corresponding target business rule processor is called from multiple business rule processors, and the target business rule processor is used to parse the business text to obtain an initial parsing result;
[0010] The inference is performed based on the initial parsing result to obtain the inference result, and the inference result and the initial parsing result are used as the target parsing result of the single corpus text.
[0011] By introducing a term library for the financial industry, the present invention can effectively cover the specific terms in the financial field, so that the business rule processor based on this configuration can improve the pertinence and accuracy of the analysis. During the analysis, the complex corpus text is first decomposed into a single corpus text, which is convenient for improving the analysis efficiency and helps to accurately identify each corpus. The corresponding business rule processor is selected according to the business type of the corpus text, and the business text of the single corpus text is analyzed, avoiding the limitations of a single rule processor. Further calculations are performed on the basis of the initial analysis results to improve the analysis results, thereby improving the comprehensiveness and accuracy of the analysis.
[0012] In an optional embodiment, multiple business rule processors are configured based on the financial industry terminology library, including:
[0013] Extract the financial industry terminology database according to business type to obtain multiple configuration files;
[0014] Based on each configuration file, construct a data processing model, text fields, and attributes of each text field corresponding to the configuration file;
[0015] The data processing model, the text fields and the attributes of each text field are determined as the business rule processor corresponding to the configuration file.
[0016] The present invention extracts the financial industry terminology library according to business type to obtain multiple configuration files, ensuring that each business rule processor is targeted at a specific business type. Based on each configuration file, a corresponding data processing model, text fields and attributes of each text field are constructed, providing a clear structured framework for subsequent corpus parsing, which helps to improve the accuracy of parsing.
[0017] In an optional embodiment, the attributes of the text field include matching rules;
[0018] Use the target business rule processor to parse the business text and obtain the initial parsing results, including:
[0019] Use the data processing model in the target business rule processor to segment the business text and obtain multiple text arrays;
[0020] Based on the multiple text fields corresponding to the target business rule processor and the matching rules of each text field, a circular matching is performed with multiple text arrays, and all successfully matched text arrays and their corresponding text fields are determined as initial parsing results.
[0021] The present invention segments business texts through the data processing model in the target business rule processor, breaking down complex business texts into smaller, easier-to-process text arrays, thereby improving the accuracy of parsing. By utilizing multiple text fields and matching rules corresponding to the target business rule processor and performing cyclic matching with the segmented text array, the present invention can effectively parse the content that conforms to the text fields from the business text.
[0022] In an optional embodiment, based on multiple text fields corresponding to the target business rule processor and the matching rule of each text field, a cyclic matching is performed with multiple text arrays, including:
[0023] For each text array, based on all matching rules of the current text field, determine whether the text array satisfies all matching rules of the current text field;
[0024] If the text array satisfies all matching rules of the current text field, the text array successfully matches the current text field and continues to match the next text array; or
[0025] In the case that the text array does not satisfy any matching rule of the current text field, the text array fails to match the current text segment, and the text array is matched with the next text field.
[0026] The present invention compares a text array with all matching rules of the current text field, determines that the match is successful when the text array meets all matching rules, and continues to match the next text array; and jumps to the next text field for matching when no matching rule is met, thereby improving matching efficiency and ensuring the integrity of the parsing results.
[0027] In an optional embodiment, performing inference based on the initial parsing result to obtain the inference result includes:
[0028] Obtain the preset inference rules corresponding to the target business rule processor;
[0029] For each text array and its corresponding text field in the initial parsing result, determine whether the text field corresponding to the text array exists in the preset inference rule;
[0030] If the text field corresponding to the text array exists in the preset inference rules, the corresponding data interface is called according to the preset inference rules to obtain the inferred data;
[0031] The text array is inferred based on the initial parsing result and the inferred data to obtain the inferred result corresponding to the text field of the text array.
[0032] The present invention can effectively fill potential gaps in the initial parsing results and improve the integrity of the parsing results by performing inference according to the preset inference rules corresponding to the target business rule processor and utilizing the existing parsing results.
[0033] In an optional embodiment, the matching rule is a regular matching rule;
[0034] Based on all matching rules of the current text field, determine whether the text array meets all matching rules of the current text field, including:
[0035] Based on the properties of the current text field, get the regular expression corresponding to the current text field;
[0036] If the text array conforms to the regular expression, the text array is determined to meet the regular matching rules; or,
[0037] When the text array does not conform to the regular expression, it is determined that the text array does not meet the regular matching rules.
[0038] The present invention obtains the regular expression corresponding to the current text field and uses it to determine whether the text array conforms to the regular expression. The efficiency and flexibility of the regular expression enable rapid processing of complex text patterns, thereby improving parsing efficiency and accuracy.
[0039] In an optional implementation, the matching rule is a function matching rule;
[0040] Based on all matching rules of the current text field, determine whether the text array meets all matching rules of the current text field, including:
[0041] Based on the properties of the current text field, obtain the judgment function corresponding to the current text field;
[0042] The text array is judged based on the judgment function to obtain the judgment result;
[0043] If the result is correct, the text array is determined to meet the function matching rule; or,
[0044] When the judgment result is failure, it is determined that the text array does not meet the function matching rules.
[0045] The present invention obtains the judgment function corresponding to the current text field, uses the judgment function to judge the text array, and performs further matching based on the judgment result, which is beneficial to improving the accuracy and comprehensiveness of analysis.
[0046] In an optional implementation, the matching rule is a data source matching rule;
[0047] Based on all matching rules of the current text field, determine whether the text array meets all matching rules of the current text field, including:
[0048] Based on the properties of the current text field, obtain the data source corresponding to the current text field;
[0049] Query the text array from the data source;
[0050] When a text array is found, it is determined that the text array meets the data source matching rules; or,
[0051] When the text array cannot be found, it is determined that the text array does not meet the data source matching rules.
[0052] The present invention obtains the data source corresponding to the current text field, uses the metadata to query the stored data records, and performs further matching based on the data records and text arrays, which is beneficial to improving the accuracy and comprehensiveness of the analysis.
[0053] In a second aspect, the present invention provides a device for parsing inquiry corpus in the financial industry, the device comprising:
[0054] Configuration module, used to configure multiple business rule processors based on the financial industry terminology library;
[0055] The splitting module is used to split the corpus text to be parsed into multiple single corpus texts;
[0056] A processing module is used to process each single corpus text to obtain the business text of the single corpus text;
[0057] The first parsing module is used to call a corresponding target business rule processor from multiple business rule processors based on the business type of the corpus text to be parsed, and parse the business text using the target business rule processor to obtain an initial parsing result;
[0058] The second parsing module is used to perform inference based on the initial parsing result to obtain an inferred result, and use the inferred result and the initial parsing result as the target parsing result of the single corpus text.
[0059] In a third aspect, the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to execute the method for parsing financial industry inquiry corpus according to the first aspect or any corresponding embodiment thereof.
[0060] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for parsing financial industry inquiry corpus of the above-mentioned first aspect or any corresponding embodiment thereof.
[0061] In a fifth aspect, the present invention provides a computer program product comprising computer instructions for causing a computer to execute the method for parsing financial industry inquiry corpus according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0063] Figure 1 is a flowchart of a method for parsing financial industry inquiry corpus according to an embodiment of the present invention;
[0064] Figure 2 is a flowchart of matching a text array and a text field according to an embodiment of the present invention;
[0065] Figure 3 This is a structural block diagram of a device for parsing inquiry corpus in the financial industry according to an embodiment of the present invention;
[0066] Figure 4 Schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0067] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.
[0068] Existing inquiry corpus parsing methods use traditional text parsing tools, which suffer from incomplete and inaccurate parsing. This invention, by introducing a financial industry terminology library, can effectively cover the specific terms in the financial field. This configuration enables a business rule processor to improve the pertinence and accuracy of parsing. The corresponding business rule processor is selected based on the business type of the corpus text, avoiding the limitations of a single rule processor. Based on the initial parsing results, further calculations are performed to improve the parsing results, thereby improving the comprehensiveness and accuracy of the parsing.
[0069] According to an embodiment of the present invention, an embodiment of a method for parsing inquiry corpus in the financial industry 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.
[0070] In this embodiment, a method for parsing inquiry corpus in the financial industry is provided, which can be used in a server. Figure 1 FIG. 1 is a flow chart of a method for parsing inquiry corpus in the financial industry according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0071] Step S101, configure multiple business rule processors based on the financial industry terminology library. Specifically, when the existing text parsing tools are used to parse financial inquiry corpus in the related art, the text parsing tools lack deep adaptation for the financial industry and are difficult to cover the terminology specific to the financial field, resulting in poor parsing effect. Therefore, the embodiment of the present invention configures multiple business rule processors based on the financial industry terminology library. Each business rule processor is configured to process text of a specific business type to improve the pertinence and accuracy of the parsing. For example, for different business types such as bond trading business and repurchase business, corresponding business rule processors are respectively configured to enable them to accurately identify and process professional terms and text information in the corresponding business.
[0072] Step S102 splits the corpus to be parsed into multiple individual text pieces. Specifically, the corpus to be parsed is typically input by the user via the GRPC (Google Remote Procedure Call) interface specification or the HttpRestful (HyperText Transfer Protocol Representational State Transfer Interface) interface specification and contains a wealth of financial inquiry information. The corpus to be parsed is split into multiple individual text pieces using sequence numbers (e.g., 1, 2, 3) or line breaks (\n, \r\n). This method converts complex text into lightweight individual text pieces, improving parsing efficiency.
[0073] Step S103 processes each individual corpus text to obtain the business text for that individual corpus text. Specifically, by calling a string replacement function, all Chinese punctuation marks in the individual corpus text are converted to English punctuation marks, standardizing the punctuation format for easier recognition by the parser. Then, the initial paragraph numbers (e.g., 1, 2, 3, etc.) in the corpus text are deleted. Finally, the text is replaced with spaces, and full-width characters are converted to half-width characters. After these processes, the business text is obtained. By performing string processing on the individual corpus text, the corpus text is converted into a form that is easier to parse, thereby improving parsing efficiency and accuracy.
[0074] Step S104, based on the business type of the corpus to be parsed, calls the corresponding target business rule processor from multiple business rule processors, and uses the target business rule processor to parse the business text to obtain an initial parsing result. Specifically, according to the business type of the corpus to be parsed, a target business rule processor suitable for the business type can be selected from multiple business rule processors. For example, when the corpus to be parsed belongs to the repurchase business, a business rule processor specifically configured for the repurchase business is called. The processor can accurately parse the business text according to the characteristics and rules of the repurchase business and parse out the key information therein.
[0075] In step S105, an inference is performed based on the initial parsing result to obtain an inference result. The inference result and the initial parsing result are used as the target parsing result for the single corpus text. Specifically, to improve the comprehensiveness of the parsing, after parsing the business text of the single corpus text, further inference can be performed based on the initial parsing result to achieve in-depth mining of the single corpus text, thereby obtaining an inference result. Using the inference result and the initial parsing result together as the target parsing result can provide users with comprehensive and accurate financial inquiry information, meeting their diverse needs in financial services.
[0076] By introducing a term library for the financial industry, the present invention can effectively cover the specific terms in the financial field, so that the business rule processor based on this configuration can improve the pertinence and accuracy of the analysis. During the analysis, the complex corpus text is first decomposed into a single corpus text, which is convenient for improving the analysis efficiency and helps to accurately identify each corpus. The corresponding business rule processor is selected according to the business type of the corpus text, and the business text of the single corpus text is analyzed, avoiding the limitations of a single rule processor. Further calculations are performed on the basis of the initial analysis results to improve the analysis results, thereby improving the comprehensiveness and accuracy of the analysis.
[0077] In this embodiment, a method for parsing inquiry corpus in the financial industry is provided, which can be used in the above-mentioned server. The method specifically includes the following steps:
[0078] Step S201 : configuring multiple business rule processors based on a financial industry terminology database.
[0079] Specifically, the above step S201 includes:
[0080] In step S2011, the financial industry terminology database is extracted according to business type to obtain multiple configuration files. Specifically, because the content in the financial industry terminology database covers the entire financial field, its data volume is very large. Directly using it for text parsing would affect parsing efficiency. Therefore, all content in the financial industry terminology database is extracted according to business type to obtain multiple configuration files, such as XML configuration files. Each configuration file only contains information for a specific business type, which facilitates targeted parsing.
[0081] Step S2012 is to construct a data processing model, text fields, and attributes of each text field corresponding to each configuration file based on each configuration file. Specifically, after obtaining each configuration file, it is necessary to construct a data processing model, text fields, and attributes of each text field that match its business type based on the content of each configuration file. In actual operation, the data processing models corresponding to all configuration files are consistent in overall structure, but will be fine-tuned according to the characteristics of each configuration file. This ensures the unity of the overall framework and meets the special needs of different business types. For example, although the data processing models of different business types all contain the basic process of word segmentation, the word segmentation method will be adjusted according to the business characteristics.
[0082] Step S2013 determines the data processing model, text fields, and attributes of each text field as the business rule processor corresponding to the configuration file. Specifically, the data processing model, text fields, and attributes of each text field constructed for a specific business type are integrated to form a business rule processor. During the subsequent text parsing process, simply select the corresponding business rule processor to perform targeted parsing of text for a specific business type based on its pre-defined parsing configuration.
[0083] In some optional implementations, the static keyword libraries used in related technologies struggle to cope with the frequent updates of financial data, such as securities information and product code libraries, resulting in delayed parsing results. Embodiments of the present invention utilize MQ (MessageQueue) and scheduled tasks to synchronize the latest data with the financial industry terminology library in real time, updating the configuration files for each business type. This allows for dynamic updates to the business rule processor, ensuring that parsing results are consistent with the latest industry data and improving the timeliness and accuracy of parsing.
[0084] Step S202: Split the corpus text to be parsed to obtain multiple individual corpus texts. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0085] Step S203: Process each single corpus text to obtain the business text of the single corpus text. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0086] Step S204: Based on the business type of the corpus text to be parsed, a corresponding target business rule processor is called from multiple business rule processors, and the target business rule processor is used to parse the business text to obtain an initial parsing result. The attributes of the text field include matching rules.
[0087] Specifically, the above step S204 includes:
[0088] Step S2041 uses the data processing model in the target business rule processor to segment the business text, obtaining multiple text arrays. Specifically, based on the business type of the corpus text to be parsed, the corresponding target business rule processor is called. The data processing model in the target business rule processor is configured with a specialized segmentation method to segment the business text, obtaining multiple text arrays. Taking the text "1.99Y 010214 01 Guokai 14 3.07 2000 +0 A Securities issued to B Securities Asset Management Shanghai, [Request] Issue Gaohua Securities, 5 cents" as an example, the following 12 text arrays are obtained through word segmentation: [1.99Y], [010214], [01 Guokai 14], [3.07],
[2000] , [+0], [A Securities], [Issued], [B Securities Asset Management Shanghai], [Request], [Issued C Securities], [5 cents]. Optionally, due to differences in text structure and content characteristics between inquiry corpora of different business types within the financial industry, their segmentation rules differ, and therefore the word segmentation methods also differ. For example, in bond trading inquiry corpora, the word segmentation process may focus more on key information such as bond codes and transaction prices; while in stock trading inquiry corpora, the word segmentation process may focus on aspects such as stock names and transaction quantities.
[0089] Step S2042 , based on the multiple text fields corresponding to the target business rule processor and the matching rules of each text field, a circular matching is performed with multiple text arrays, and all successfully matched text arrays and their corresponding text fields are determined as initial parsing results.
[0090] In some optional implementations, step S2042 performs cyclic matching with multiple text arrays based on multiple text fields corresponding to the target business rule processor and the matching rule of each text field, including:
[0091] Step a1: for each text array, based on all matching rules of the current text field, determine whether the text array satisfies all matching rules of the current text field.
[0092] In some optional implementations, when the matching rule is a regular matching rule, step a1 includes:
[0093] Step b1: Based on the properties of the current text field, obtain the regular expression corresponding to the current text field. Specifically, assuming the target business rule processor corresponds to the repurchase inquiry business type, its corresponding text fields are: Security Code, Security Name, Clearing Speed, Yield, Quotation Method, Counterparty, Quotation Method, Amount, and Remaining Term. For example, if the current text field is "Securities Code," obtain the regular expression corresponding to the security code: "(\d*)(.sh|.sz|.ib)?$".
[0094] Step b2: If the text array matches the regular expression, determine that the text array satisfies the regular matching rule. Specifically, assume that the text array is "010214", which matches the regular expression "(\d*)(.sh|.sz|.ib)?$" for the aforementioned securities code. That is, "010214" meets the pattern requirement of consisting of numbers and possibly with a specific suffix. In this case, the text array is determined to meet the regular matching rule for "Securities Code".
[0095] Alternatively, in step b3, if the text array does not match the regular expression, the text array is determined to not satisfy the regular matching rule. Specifically, assuming the text array is "ABC123" and does not match the regular expression for the securities code, the text array is determined to not satisfy the regular matching rule, i.e., the text array fails to match the "securities code".
[0096] In some optional implementations, when the matching rule is a function matching rule, step a1 includes:
[0097] In step c1, based on the properties of the current text field, a judgment function corresponding to the current text field is obtained. Specifically, for the "Transaction Date" field, its properties may include information such as date format requirements and business-related time range restrictions. Based on these properties, a corresponding judgment function is configured. For example, the judgment function "numberTimesOver" is used to determine whether a text array is a date.
[0098] Step c2: judging the text array based on the judgment function to obtain a judgment result. Specifically, calling the judgment function of the "transaction date" field, bringing the text array into the judgment function, and obtaining a judgment result.
[0099] Step c3, if the judgment result is correct, determine whether the text array meets the function matching rule. Specifically, if the judgment result is correct, that is, the text array belongs to a date, then determine that the text array meets the function matching rule of the "transaction date" field.
[0100] Alternatively, in step c4, if the result of the judgment is failure, it is determined that the text array does not satisfy the function matching rule. Specifically, if the result of the judgment is failure and the text array does not belong to a date, it is determined that the text array does not satisfy the function matching rule of the "Transaction Date" field, that is, the text array fails to match the "Transaction Date".
[0101] In some optional implementations, when the matching rule is a data source matching rule, step a1 includes:
[0102] Step d1, based on the attributes of the current text field, obtain the data source corresponding to the current text field. Specifically, the attributes of the text field include the key features and related requirements of the text field in the financial business scenario. For example, for the "Securities Code" field, its attributes may involve information such as the format specification of the code and the market to which it belongs; for the "Counterparty" field, its attributes may include the type of counterparty, the industry to which it belongs, etc. Based on these attributes, configure the corresponding data source. The data source can be a database, a file system, or other data storage media. Taking "Securities Code" as an example, its corresponding data source can be a database table that stores all legal securities codes and their related information. The table contains fields such as securities code, securities name, and market to which it belongs.
[0103] Step d2: query the text array from the data source. Specifically, assuming the text array is "010214", query the text array from the data source corresponding to "Securities Code".
[0104] Step d3: If a text array is found, it is determined that the text array meets the data source matching rule. Specifically, if the text array can be found from the data source, it means that the text field has corresponding information support, and the text array is determined to meet the data source rule.
[0105] Alternatively, in step d4, if the text array cannot be found, it is determined that the text array does not meet the data source matching rule. Specifically, if the text array cannot be found in the data source, it is determined that the text array does not meet the data source rule.
[0106] In step a2, if the text array satisfies all matching rules for the current text field, the text array successfully matches the current text field, and matching continues with the next text array. Specifically, each text field corresponds to one or more matching rules. When the text array satisfies all matching rules for the current text field, the text array is considered to have successfully matched the text field, represented as "Securities Code: 010214," and stored as the initial parsing result. Matching then proceeds to the next text array until all text data has been matched.
[0107] Alternatively, in step a3, if the text array does not satisfy any matching rule of the current text field, the text array fails to match the current text field, and the text array is matched with the next text field. Specifically, if the text array does not satisfy any matching rule of the current text field, the text array is considered to have failed to match the current text field, and the text array is matched with the next text field. By performing a cyclic matching process based on the matching rules of the text field, the text array and the text field are matched to ensure matching accuracy.
[0108] In some optional embodiments, Figure 2 is a flowchart of matching text arrays and text fields according to an embodiment of the present invention, such as Figure 2 As shown, the target business rule processor is first determined. Based on this target business rule processor, the business text is segmented to obtain multiple text arrays. Then, based on the text field and its matching rules corresponding to the target business rule processor, the multiple text arrays are matched against the text field in a loop. For each text array, a determination is made as to whether the text array satisfies the first matching rule of the current text field. If so, the next matching rule is determined; if not, the matching process ends. When the text array satisfies all matching rules of the current text field, the text array is determined to have successfully matched the current text field and the result is stored in the initial parsing result.
[0109] Step S205 , performing inference based on the initial parsing result to obtain an inference result, and using the inference result and the initial parsing result as the target parsing result of the single corpus text.
[0110] Specifically, the above step S205 performs inference based on the initial analysis result to obtain the inference result, including:
[0111] Step S2051: Obtain the preset inference rules corresponding to the target business rule processor. Specifically, each business rule processor corresponds to a specific business type. The preset inference rules are a series of pre-defined rules for the business type corresponding to the target business rule processor. These rules specify how different text fields should be inferred for that business type. For example, for a text field containing a product name, which data interface should be called and what data processing method should be used. Optionally, the preset inference rules can be adjusted based on actual needs, and this is not limited in this embodiment of the present invention.
[0112] Step S2052 determines, for each text array and its corresponding text field in the initial parsing result, whether the text field corresponding to the text array exists within the preset inference rule. Specifically, since not all data can be inferred, the preset inference rule only specifies data that can be inferred. Therefore, it is first necessary to determine whether the text field in the initial parsing result exists within the preset inference rule to determine whether inference can be performed.
[0113] In step S2053, if the text field corresponding to the text array exists in the preset inference rules, the corresponding data interface is called according to the preset inference rules to obtain the inferred data. Specifically, when it is determined that the text field corresponding to a certain text array exists in the preset inference rules, a specific data interface is called. For example, if the text field is a bond code, the built-in bond information query interface is called, and by accessing the securities cache and other operations, detailed information related to the bond code (such as bond type, underwriter, issuer, listing date, issuance period, etc.) is ultimately obtained, and this information is used as the inferred data. If the text field is a product name, the built-in product information query interface is called, and by querying the product information cache, inferred data such as the product serial number and product code is obtained. By obtaining the inferred data, the required additional data for the text field is obtained, providing a basis for subsequent inference.
[0114] Step S2054 is to perform inference on the text array based on the initial parsing results and the inferred data to obtain the inferred results corresponding to the text fields of the text array. Specifically, after obtaining the initial parsing results and the inferred data obtained by calling the data interface, the text array is inferred according to the specific business logic and algorithm. For example, based on the initial parsing results of the known net price, security code, securities market and liquidation speed, as well as the inferred data of the securities cash flow and the remaining term of the bond, the net price to maturity yield interface is called to calculate the expected yield to maturity according to the specific calculation logic; based on the initial parsing results of the known weighted days, security code and securities market, as well as the inferred data of the basic attributes of the bond and the repurchase weighted type, the repurchase rate type is calculated. For other text arrays, similar inference operations are also performed according to the corresponding business rules and the obtained data, and the inferred results of the entire business processing are finally obtained. Optionally, the calculations involved in the data inference process are all existing technologies and will not be repeated here.
[0115] In some optional implementations, traditional text parsing tools usually only support the recognition of single-sentence corpora, which cannot meet the needs of batch processing in financial scenarios. For example, when parsing a large number of repurchase inquiry texts, traditional tools need to call APIs (Application Programming Interfaces) sentence by sentence, resulting in high network I / O (Input / Output) overhead and low processing efficiency. Therefore, the embodiment of the present invention supports List <string>This type of batch input allows multiple text entries to be entered at once, thus fulfilling the demand for batch text recognition. This not only simplifies the call process and significantly reduces network overhead, but the batch processing mechanism also reduces the frequency of context switches, further improving overall efficiency. Another significant drawback of traditional tools is their single-threaded processing mode, which fails to fully utilize multi-core CPU resources. For example, on an 8-core server, traditional tools can only utilize 12.5% of the computing power, resulting in processing speed limited by single-thread performance. Furthermore, sentence-by-sentence processing causes frequent CPU context switches, adding additional overhead. Therefore, embodiments of the present invention introduce a multi-threaded concurrent processing mechanism. By defining a configurable thread pool (with a default fixed thread pool size of 8), incoming corpus text to be parsed is distributed across multiple threads for parallel processing. For example, if a user submits 1,000 text entries to be parsed, they will be evenly distributed across 8 threads, each processing 125 text entries. Optionally, the thread pool size can be dynamically adjusted based on hardware resources (e.g., automatically adapting to the number of CPU cores), ensuring optimal performance in different environments.
[0116] By introducing a term library for the financial industry, the present invention can effectively cover the specific terms in the financial field, so that the business rule processor based on this configuration can improve the pertinence and accuracy of the analysis. During the analysis, the complex corpus text is first decomposed into a single corpus text, which is convenient for improving the analysis efficiency and helps to accurately identify each corpus. The corresponding business rule processor is selected according to the business type of the corpus text, and the business text of the single corpus text is analyzed, avoiding the limitations of a single rule processor. Further calculations are performed on the basis of the initial analysis results to improve the analysis results, thereby improving the comprehensiveness and accuracy of the analysis.
[0117] This embodiment also provides a device for parsing inquiry corpus from the financial industry. This device is used to implement the above-mentioned embodiments and preferred implementations, and details already described will not be repeated. As used below, the term "module" may refer to a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented using software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.
[0118] This embodiment provides a parsing device for financial industry inquiry corpus, such as Figure 3 Shown, including:
[0119] The configuration module 301 is used to configure multiple business rule processors based on the financial industry terminology library.
[0120] The splitting module 302 is used to split the corpus text to be parsed to obtain multiple single corpus texts.
[0121] The processing module 303 is used to process each single corpus text to obtain the business text of the single corpus text.
[0122] The first parsing module 304 is configured to call a corresponding target business rule processor from a plurality of business rule processors based on the business type of the corpus text to be parsed, and parse the business text using the target business rule processor to obtain an initial parsing result.
[0123] The second parsing module 305 is configured to perform inference based on the initial parsing result to obtain an inferred result, and use the inferred result and the initial parsing result as the target parsing result for the single corpus text.
[0124] In some optional implementations, the configuration module 301 includes:
[0125] The extraction unit is used to extract the financial industry terminology library according to business types to obtain multiple configuration files.
[0126] The construction unit is used to construct a data processing model, text fields and attributes of each text field corresponding to each configuration file based on the configuration file.
[0127] The configuration unit is used to determine the data processing model, the text field and the attributes of each text field as the business rule processor corresponding to the configuration file.
[0128] In some optional implementations, the attributes of the text field include matching rules;
[0129] The first parsing module 304 includes:
[0130] The word segmentation unit is used to use the data processing model in the target business rule processor to segment the business text and obtain multiple text arrays.
[0131] The matching unit is used to perform cyclic matching with multiple text arrays based on multiple text fields corresponding to the target business rule processor and the matching rules of each text field, and determine all successfully matched text arrays and their corresponding text fields as initial parsing results.
[0132] In some optional embodiments, the matching unit includes:
[0133] The matching subunit is used to determine, for each text array, whether the text array satisfies all matching rules of the current text field based on all matching rules of the current text field.
[0134] The first judgment subunit is configured to determine that, if the text array satisfies all matching rules of the current text field, the text array successfully matches the current text field and continues to match the next text array.
[0135] Alternatively, the second judgment subunit is configured to, when the text array does not satisfy any matching rule of the current text field, determine that the text array fails to match the current text segment, and match the text array with the next text field.
[0136] In some optional implementations, the second parsing module 305 includes:
[0137] The first acquisition unit is configured to acquire a preset inference rule corresponding to a target business rule processor.
[0138] The judgment unit is used to judge, for each text array and its corresponding text field in the initial parsing result, whether the text field corresponding to the text array exists in a preset inference rule.
[0139] The calling unit is used to call the corresponding data interface according to the preset inference rule to obtain the inferred data when the text field corresponding to the text array exists in the preset inference rule.
[0140] The inference unit is used to infer the text array based on the initial parsing result and the inferred data to obtain the inference result corresponding to the text field of the text array.
[0141] In some optional implementations, the matching rule is a regular matching rule;
[0142] The matching subunit is specifically used to obtain the regular expression corresponding to the current text field based on the attributes of the current text field; if the text array conforms to the regular expression, it is determined that the text array satisfies the regular matching rule; or, if the text array does not conform to the regular expression, it is determined that the text array does not satisfy the regular matching rule.
[0143] In some optional implementations, the matching rule is a function matching rule;
[0144] The matching subunit is specifically used to obtain the judgment function corresponding to the current text field based on the attributes of the current text field; judge the text array based on the judgment function to obtain a judgment result; if the judgment result is correct, it is determined that the text array meets the function matching rules; or, if the judgment result is a failure, it is determined that the text array does not meet the function matching rules.
[0145] In some optional implementations, the matching rule is a data source matching rule;
[0146] The matching subunit is specifically used to obtain the data source corresponding to the current text field based on the attributes of the current text field; query the text array from the data source; when the text array is queried, determine that the text array meets the data source matching rules; or, when the text array cannot be queried, determine that the text array does not meet the data source matching rules.
[0147] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0148] The parsing device for the financial industry inquiry corpus in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0149] The embodiment of the present invention also provides a computer device having the above Figure 3 The parsing device for the financial industry inquiry corpus shown.
[0150] See also Figure 4 , Figure 4 is a structural diagram of a computer device provided by an optional embodiment of the present invention, such as Figure 4 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.
[0151] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0152] The memory 20 stores instructions that can be executed by at least one processor 10, so as to enable at least one processor 10 to execute the method shown in the above embodiment.
[0153] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0154] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0155] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0156] The embodiment of the present invention also provides a computer-readable storage medium. The above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0157] A portion of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the form in which the computer program instruction exists in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc. Accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by the computer.
[0158] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.< / string>
Claims
1. A method for parsing inquiry corpus in the financial industry, characterized by: The method comprises: Configuring multiple business rule processors based on a financial industry terminology library, wherein the business rule processors include a data processing model, text fields, and attributes of each text field, wherein the attributes of the text field include matching rules; Split the corpus text to be parsed to obtain multiple single corpus texts; Processing each single corpus text to obtain the business text of the single corpus text; Based on the business type of the corpus text to be parsed, calling a corresponding target business rule processor from the multiple business rule processors, and using the target business rule processor to parse the business text to obtain an initial parsing result; Performing an inference based on the initial parsing result to obtain an inference result, and using the inference result and the initial parsing result as a target parsing result for the single corpus text; The process of parsing the business text using the target business rule processor to obtain an initial parsing result includes: Using the data processing model in the target business rule processor, segmenting the business text to obtain multiple text arrays; Based on the multiple text fields corresponding to the target business rule processor and the matching rule of each text field, performing cyclic matching with the multiple text arrays, and determining all successfully matched text arrays and their corresponding text fields as the initial parsing results; The performing of inference based on the initial analysis result to obtain an inference result includes: Obtaining a preset inference rule corresponding to the target business rule processor; For each text array and its corresponding text field in the initial parsing result, determining whether the text field corresponding to the text array exists in the preset inference rule; In the case where the text field corresponding to the text array exists in the preset inference rule, calling the corresponding data interface according to the preset inference rule to obtain the inferred data; The text array is inferred based on the initial parsing result and the inferred data to obtain a inferred result corresponding to the text field of the text array.
2. The method according to claim 1, characterized in that The configuration of multiple business rule processors based on the financial industry terminology library includes: Extracting the financial industry terminology library according to business types to obtain multiple configuration files; Based on each configuration file, construct a data processing model, text fields, and attributes of each text field corresponding to the configuration file; The data processing model, the text fields and the attributes of each text field are determined as the business rule processor corresponding to the configuration file.
3. The method according to claim 1, characterized in that The step of performing cyclic matching on the multiple text arrays based on the multiple text fields corresponding to the target business rule processor and the matching rule of each text field includes: For each text array, based on all matching rules of the current text field, determine whether the text array satisfies all matching rules of the current text field; If the text array satisfies all matching rules of the current text field, the text array is successfully matched with the current text field, and the next text array is matched; or In the case that the text array does not satisfy any matching rule of the current text field, the text array fails to match the current text segment, and the text array is matched with the next text field.
4. The method according to claim 3, characterized in that The matching rule is a regular matching rule; The determining whether the text array satisfies all matching rules of the current text field based on all matching rules of the current text field includes: Based on the properties of the current text field, get the regular expression corresponding to the current text field; If the text array conforms to the regular expression, determining that the text array satisfies the regular matching rule; or If the text array does not conform to the regular expression, it is determined that the text array does not satisfy the regular matching rule.
5. The method according to claim 3, characterized in that The matching rule is a function matching rule; The step of determining whether the text array satisfies all matching rules of the current text field based on all matching rules of the current text field further includes: Based on the properties of the current text field, obtain the judgment function corresponding to the current text field; Judging the text array based on the judgment function to obtain a judgment result; If the judgment result is correct, it is determined that the text array satisfies the function matching rule; or, When the judgment result is failure, it is determined that the text array does not satisfy the function matching rule.
6. The method according to claim 3, characterized in that The matching rule is a data source matching rule; The step of determining whether the text array satisfies all matching rules of the current text field based on all matching rules of the current text field further includes: Based on the properties of the current text field, obtain the data source corresponding to the current text field; Query the text array from the data source; In the case where the text array is found, determining that the text array satisfies the data source matching rule; or, If the text array cannot be found, it is determined that the text array does not satisfy the data source matching rule.
7. A parsing device for financial industry inquiry corpus, characterized in that: The device comprises: A configuration module, configured to configure a plurality of business rule processors based on a financial industry terminology library, wherein the business rule processors include a data processing model, text fields, and attributes of each text field, wherein the attributes of the text field include matching rules; The splitting module is used to split the corpus text to be parsed into multiple single corpus texts; A processing module, configured to process each single corpus text to obtain a business text of the single corpus text; A first parsing module is configured to call a corresponding target business rule processor from the multiple business rule processors based on the business type of the corpus text to be parsed, and parse the business text using the target business rule processor to obtain an initial parsing result; a second parsing module, configured to perform inference based on the initial parsing result to obtain an inferred result, and use the inferred result and the initial parsing result as a target parsing result for the single corpus text; The first parsing module is specifically configured to: Using the data processing model in the target business rule processor, segmenting the business text to obtain multiple text arrays; Based on the multiple text fields corresponding to the target business rule processor and the matching rule of each text field, performing cyclic matching with the multiple text arrays, and determining all successfully matched text arrays and their corresponding text fields as the initial parsing results; The second parsing module is specifically used for: Obtaining a preset inference rule corresponding to the target business rule processor; For each text array and its corresponding text field in the initial parsing result, determining whether the text field corresponding to the text array exists in the preset inference rule; In the case where the text field corresponding to the text array exists in the preset inference rule, calling the corresponding data interface according to the preset inference rule to obtain the inferred data; The text array is inferred based on the initial parsing result and the inferred data to obtain a inferred result corresponding to the text field of the text array.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for parsing financial industry inquiry corpus according to any one of claims 1 to 6 by executing the computer instructions.
Citation Information
Patent Citations
Stock file processing method and device
CN104408062A
Data processing method and device, electronic equipment and computer readable storage medium
CN116739805A