Intelligent question and answer method, device and equipment based on tax field and medium
By applying intelligent question-and-answer methods in the tax field, using regular expressions and large language models combined with knowledge base for problem preprocessing and data analysis, the accuracy of data analysis in the tax field and the consistency of cross-report data is solved, achieving more efficient and reliable data analysis results.
Patent Information
- Application Number
- CN202411803100.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The existing intelligent data analysis method based on large language models is difficult to accurately identify and answer specific problems in the tax field, and it fails to effectively solve the consistency and relevance of cross-report data, making it difficult to meet the comprehensive data analysis needs of tax personnel.
Provide an intelligent question-and-answer method based on the tax field. By using regular expressions to judge and preprocess user problems, perform target data analysis tasks in combination with preset large models, the first knowledge base (constructed based on report structure definition information) and the second knowledge base (constructed based on tax business indicator knowledge) to generate target answers.
This method can more accurately analyze user problems, enhance the system's understanding of tax terms, regulations changes and business logic, and improve the accuracy and reliability of data analysis, especially in cross-report data query and analysis.
Smart Images

Figure CN119623647A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an intelligent question-answering method, device, equipment and medium based on the tax field. Background Art
[0002] Existing intelligent data analysis methods based on big language models often lack in-depth understanding of specific fields. The professional terminology and regulatory requirements involved in tax reporting are a challenge for general big language models. This means that existing solutions may not be able to accurately identify and answer field-specific questions raised by tax officials, resulting in inaccurate or low-relevance analysis results; and existing technical solutions fail to effectively solve the consistency and correlation problems of cross-report data, making it difficult to meet the tax officials' needs for comprehensive data analysis.
[0003] From the above, it can be seen that how to conduct data analysis and intelligent question and answer on cross-report data in the tax field is an issue that needs to be solved urgently. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide an intelligent question-answering method, device, equipment and medium based on the tax field, which can perform data analysis and intelligent question-answering on cross-report data in the tax field. The specific scheme is as follows:
[0005] In the first aspect, the present application provides an intelligent question-answering method based on the tax field, including:
[0006] Using regular expressions to judge the validity of the user question input by the user end, and pre-processing and rewriting the user question based on the judgment result to obtain a rewritten question;
[0007] Based on the preset prompt word project, the rewritten question and the corresponding current report are identified to obtain the user's needs;
[0008] The target data analysis task corresponding to the user's needs is performed using the preset large model, the first knowledge base and the second knowledge base to obtain the execution results, and the execution results are summarized to obtain the target answers; the first knowledge base is a knowledge base built based on the report structure definition information; the second knowledge base is a knowledge base built based on the tax business indicator knowledge.
[0009] Optionally, the using of a regular expression to judge the validity of a user question input by a user terminal, and preprocessing and rewriting the user question based on the judgment result to obtain a rewritten question, includes:
[0010] Acquire a user question input by a user terminal, a current report corresponding to the user question, and a conversation history of the context of the user question;
[0011] Use regular expressions and a few-sample prompt technology based on a preset artificial intelligence question-answering model to judge the validity of the user's question;
[0012] If the user question meets the preset validity condition, the user question is cleaned to obtain a cleaned question, and the cleaned question and the conversation history are rewritten to obtain a rewritten question.
[0013] Optionally, the using of the preset large model, the first knowledge base, and the second knowledge base to perform a target data analysis task corresponding to the user demand to obtain an execution result includes:
[0014] Identifying key fields of the current report based on the user's needs to obtain a first target business field;
[0015] If the user demand is for current report data analysis, the user demand is converted into a data analysis instruction, and data analysis is performed on the data analysis instruction and the first target business field based on a preset large model to obtain an initial data analysis code;
[0016] The initial data analysis code is processed to obtain a corresponding execution code, and the execution code is executed to obtain a corresponding execution result; the code processing includes simplifying the relative path of the initial data analysis code, capturing the text content and visual charts in the initial data analysis code, and verifying and correcting the initial data analysis code.
[0017] Optionally, the using of the preset large model, the first knowledge base, and the second knowledge base to perform a target data analysis task corresponding to the user demand to obtain an execution result includes:
[0018] By parsing each report structure to obtain each field information, performing a first extraction and a first vectorization operation on each field information, and storing the obtained first vectorization information in a report structure knowledge base to obtain the first knowledge base;
[0019] If the user demand is cross-table query data analysis, the preset large model and the first knowledge base are used to execute the target data analysis task corresponding to the user demand to obtain the execution result.
[0020] Optionally, if the user requirement is cross-table query data analysis, the target data analysis task corresponding to the user requirement is executed using the preset large model and the first knowledge base to obtain an execution result, including:
[0021] If the user requirement is cross-table query data analysis, the user requirement is parsed to obtain target field information, and the target field information is vectorized to obtain vectorized field information;
[0022] Performing a first vector similarity calculation on the vectorized field information and the first knowledge base using the preset large model to obtain a target report structure definition, and generating a report query result based on the target report structure definition and the target field information;
[0023] Obtain target report data using the report query result, and identify key fields of the target report data to obtain a second target business field;
[0024] The user demand is converted into a data analysis instruction, and data analysis is performed on the data analysis instruction and the second target business field based on a preset large model to obtain an initial data analysis code, the initial data analysis code is processed into a corresponding execution code, and the execution code is executed to obtain a corresponding execution result.
[0025] Optionally, the using of the preset large model, the first knowledge base, and the second knowledge base to perform a target data analysis task corresponding to the user demand to obtain an execution result includes:
[0026] The second knowledge base is obtained by cleaning and preprocessing the original texts of various types of tax documents, performing a second extraction and a second vectorization operation on the processed texts, and storing the obtained second vectorization information in a business indicator knowledge base;
[0027] If the user demand is a business indicator knowledge analysis, vector conversion is performed on the user demand to obtain a converted demand;
[0028] A second vector similarity calculation is performed based on the converted requirements and the second knowledge base to obtain target business indicator data, and the target business indicator data is used as the execution result.
[0029] Optionally, summarizing the execution results to obtain a target answer includes:
[0030] The execution result output by the preset large model corresponding to the user question is obtained, the execution result is summarized by using a preset summary tool to obtain a target answer, and the target answer is sent to the user end.
[0031] In the second aspect, the present application provides an intelligent question-answering device based on the tax field, including:
[0032] A question rewriting module is used to judge the validity of the user question input by the user end, and pre-process the user question and rewrite the question based on the judgment result to obtain a rewritten question;
[0033] A demand identification module, used for identifying the demand of the rewritten question and the corresponding current report based on the preset prompt word project to obtain the user demand;
[0034] The summarization module is used to use the preset large model, the first knowledge base and the second knowledge base to perform the target data analysis task corresponding to the user needs to obtain the execution results, and summarize the execution results to obtain the target answer; the first knowledge base is a knowledge base built based on the report structure definition information; the second knowledge base is a knowledge base built based on the tax business indicator knowledge.
[0035] In a third aspect, the present application provides an electronic device, including:
[0036] Memory, used to store computer programs;
[0037] A processor is used to execute the computer program to implement the aforementioned intelligent question and answer method based on the tax field.
[0038] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned intelligent question-and-answer method based on the tax field.
[0039] The present application first uses regular expressions to judge the validity of user questions input by the user end, and pre-processes and rewrites the user questions based on the judgment results to obtain rewritten questions; identifies the needs of the rewritten questions and the corresponding current reports based on the preset prompt word project to obtain user needs; uses the preset large model, the first knowledge base and the second knowledge base to execute the target data analysis tasks corresponding to the user needs to obtain execution results, and summarizes the execution results to obtain target answers; the first knowledge base is a knowledge base constructed based on report structure definition information; the second knowledge base is a knowledge base constructed based on tax business indicator knowledge.
[0040] As can be seen from the above, before the application performs problem analysis based on user questions, it first uses regular expressions to judge the validity of the user questions, rewrites the user questions based on the judgment results to obtain the rewritten questions, and identifies the user questions and the corresponding current reports to obtain the user requirements corresponding to the user questions, and then uses the preset large model, the pre-created first knowledge base and the second knowledge base to perform the target data analysis tasks corresponding to the user requirements to obtain the corresponding execution results, so as to obtain the target answers by summarizing the execution results. In this way, the user questions input by the user end are judged for validity, preprocessed and rewritten, ensuring the validity and accuracy of subsequent data analysis; the first knowledge base and the second knowledge base constructed by the report structure definition information and business indicator knowledge in the tax field, even if it is a cross-report data query, can be used through the first knowledge base constructed by the report structure definition information in the tax field to query and analyze the report data, which enables the system to more accurately parse the questions raised by users, enhance the system's understanding of tax terminology, regulatory changes and business logic, and improve the accuracy and reliability of data analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0042] Figure 1 A flow chart of an intelligent question-answering method based on the taxation field disclosed in this application;
[0043] Figure 2 A schematic diagram for judging the validity of a user question provided for this application;
[0044] Figure 3 A schematic diagram of constructing a demand identification prompt word provided for this application;
[0045] Figure 4 A schematic diagram of constructing a key field recognition prompt word provided for this application;
[0046] Figure 5 A schematic diagram of a prompt word generated by an initial data analysis code provided in this application;
[0047] Figure 6 A schematic diagram of building a report structure definition knowledge base provided for this application;
[0048] Figure 7 A schematic diagram of a cross-table query process provided for this application;
[0049] Figure 8 A schematic diagram of building a tax business indicator knowledge base provided for this application;
[0050] Fig. 9 A flowchart of a specific intelligent question-answering method based on the tax field disclosed in this application;
[0051] Fig.10 A flow chart of a question-answering system provided for this application;
[0052] Fig.11 This is a schematic diagram of the structure of an intelligent question-and-answer device based on the taxation field disclosed in this application;
[0053] Fig.12 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.
[0055] The professional terminology, regulatory requirements, etc. involved in tax reports are a challenge for general large language models. This means that existing solutions may not be able to accurately identify and answer domain-specific questions raised by tax officials, resulting in inaccurate or low-relevance analysis results; and they cannot effectively solve the consistency and correlation problems of cross-report data, making it difficult to meet the tax officials' needs for comprehensive data analysis. To this end, this application provides an intelligent question-and-answer method based on the tax field. Even cross-report data queries can be queried and analyzed through the first knowledge base constructed by the report structure definition information in the tax field. It can more accurately parse questions raised by users, enhance the system's understanding of tax terminology, regulatory changes, and business logic, and improve the accuracy and reliability of data analysis.
[0056] See also Figure 1 As shown, the embodiment of the present invention discloses an intelligent question-answering method based on the tax field, including:
[0057] Step S11: Use regular expressions to determine the validity of the user question input by the user terminal, and pre-process and rewrite the user question based on the determination result to obtain a rewritten question.
[0058] In this embodiment, an analysis request including a user question, a current report, and a conversation history corresponding to the context of the user question is obtained from the user end, and the validity of the user question in the analysis request is judged using regular expressions and a few-sample prompt based on a preset artificial intelligence question-answering model, and the user question that meets the preset validity condition is preprocessed, and the processed question and the conversation history are rewritten to obtain the rewritten question. Specifically, the validity judgment of the user question input by the user end using regular expressions, and the user question is preprocessed and rewritten based on the judgment result to obtain the rewritten question, including: obtaining the user question input by the user end, the current report corresponding to the user question, and the conversation history of the context of the user question; judging the validity of the user question using regular expressions and a few-sample prompt technology based on a preset artificial intelligence question-answering model; if the user question meets the preset validity condition, the user question is cleaned to obtain the cleaned question, and the cleaned question and the conversation history are rewritten to obtain the rewritten question.
[0059] Figure 2 A schematic diagram of judging the validity of a user question provided for this embodiment. In a specific implementation, the Qianwen 32b model can be used to guide the large model to identify the validity of the user question through the Few-Shot Prompting technology, so as to automatically detect whether the user question input by the user terminal meets the preset validity conditions, so as to exclude the situation where it only contains punctuation, numbers or other non-semantic content. The standard of the preset validity condition can be set. For example, if the user question input by the user terminal contains a large number of repeated or irrelevant characters, it is deemed to not meet the preset validity conditions. If the user question input by the user terminal is too simple, it is also deemed to not meet the preset validity conditions. If the user question meets the preset validity conditions, 1 is output; if the user question does not meet the preset validity conditions, 0 is output. It should be pointed out that the preset validity conditions can be adjusted accordingly according to the actual situation, and no specific limitation is made here.
[0060] Step S12: Based on the preset prompt word project, the rewritten question and the corresponding current report are identified to obtain the user's needs.
[0061] In this embodiment, the requirements of the rewritten question and the corresponding current report are identified based on the preset prompt word project, and the corresponding available tools are determined according to the user requirements obtained through the identification results. Figure 3A schematic diagram of constructing a demand identification prompt word provided for this embodiment can divide the user demand into the following four categories: the first type, current report data analysis, this user demand indicates that the user terminal wants to perform statistical or analytical operations on the current report; the second type, cross-table query data analysis, indicates that the user demand can no longer be met by analyzing the current report, and it is necessary to retrieve other related reports and their data in the report platform; the third type, business indicator knowledge base (i.e., second knowledge base) query, indicates that the user demand involves tax business indicators, such as indicator definition, data collection caliber, measure suggestions and other information; the fourth type, chatting, indicates that the user demand is a general question that is not related to specific business, and the system will directly provide answers without the help of thinking chains or tools. After the demand identification of the rewritten question and the corresponding current report, one of the user demands in the above four categories is obtained.
[0062] Step S13: Use the preset large model, the first knowledge base and the second knowledge base to perform the target data analysis task corresponding to the user needs to obtain the execution results, and summarize the execution results to obtain the target answers; the first knowledge base is a knowledge base built based on the report structure definition information; the second knowledge base is a knowledge base built based on the tax business indicator knowledge.
[0063] In this embodiment, after obtaining the user demand, the corresponding target data analysis task is determined based on the user demand, and the target data analysis task is performed using the preset large model, the first knowledge base, and the second knowledge base. In the first specific implementation, if the user demand is the current report data analysis, the key fields of the current report are first identified to obtain the first target business field, Figure 4 A schematic diagram of constructing a key field identification prompt word provided for this embodiment, by performing key field identification on the current report, so as to obtain the first target business field that is most relevant to the user demand from the full fields of the current report, thereby ensuring the accuracy of the analysis result. In addition, through key field identification, we can also effectively reduce the information overload problem caused by data redundancy, further simplify the data processing process, and improve the system's operating efficiency and user experience. After obtaining the first target business field, first convert the user demand into a corresponding data analysis instruction, and then use the data analysis instruction and the first target business field of the Zhipu big model to perform data analysis to obtain the initial data analysis code. Figure 5 A schematic diagram of generating prompt words from an initial data analysis code provided in this embodiment. After obtaining the initial data analysis code, the initial data analysis code is processed to obtain a corresponding execution code, and the corresponding execution result is obtained by executing the execution code.
[0064] Specifically, the use of the preset big model, the first knowledge base and the second knowledge base to execute the target data analysis task corresponding to the user demand to obtain the execution result includes: identifying the key fields of the current report based on the user demand to obtain the first target business field; if the user demand is the current report data analysis, the user demand is converted into a data analysis instruction, and the data analysis instruction and the first target business field are analyzed based on the preset big model to obtain the initial data analysis code; the initial data analysis code is processed to obtain the corresponding execution code, and the execution code is executed to obtain the corresponding execution result; the code processing includes simplifying the relative path of the initial data analysis code, capturing the text content and visual charts in the initial data analysis code, and verifying and correcting the initial data analysis code.
[0065] In a second specific implementation, if the user demand is cross-table query data analysis, a first knowledge base is first constructed based on each report structure, so as to use the preset large model and the first knowledge base to perform the target data analysis task corresponding to the user demand to obtain the execution result. Specifically, the use of the preset large model, the first knowledge base and the second knowledge base to perform the target data analysis task corresponding to the user demand to obtain the execution result includes: parsing each report structure to obtain each field information, performing a first extraction and a first vectorization operation on each field information, and storing the obtained first vectorization information in the report structure knowledge base to obtain the first knowledge base; if the user demand is cross-table query data analysis, the preset large model and the first knowledge base are used to perform the target data analysis task corresponding to the user demand to obtain the execution result.
[0066] Figure 6 A schematic diagram for constructing a report structure definition knowledge base (i.e., a first knowledge base) provided for this embodiment, firstly, all report structure definitions (i.e., report structures) in a report platform are parsed and extracted to obtain definition information of each field (i.e., field information), a first extraction is performed on the field definition information to obtain first extracted information, and the first extracted information is stored in the report structure definition knowledge base; the first extracted information includes field name, field type, field definition, aggregation method, and expression; then a first vectorization operation is performed on the first extracted information to obtain first vectorized information, and the first vectorized information is stored in the report structure definition knowledge base as an embedded representation of the report.
[0067] Furthermore, Figure 7A schematic diagram of a cross-table query process is provided for this embodiment. After the first knowledge base is constructed, it is necessary to match other report data in the system based on the user needs, so the user needs are parsed to obtain target field information; the target field information includes dimension fields, metric fields and filtering conditions; the target field information is vectorized to obtain vectorized field information, and a first vector similarity calculation is performed based on the vectorized field information and the first knowledge base to obtain the most relevant target report structure definition through the calculation result, and then a report data query structure is generated through the target field information in the target report structure definition, and the target report data is obtained through the report data query structure; key fields of the target report data are identified to obtain a second target business field, and after the user needs are converted to obtain data analysis instructions, the same data analysis processing process as the current report data analysis is entered to obtain the corresponding execution result.
[0068] Specifically, if the user demand is a cross-table query data analysis, the preset big model and the first knowledge base are used to execute the target data analysis task corresponding to the user demand to obtain an execution result, including: if the user demand is a cross-table query data analysis, the user demand is parsed to obtain target field information, and the target field information is vectorized to obtain vectorized field information; a first vector similarity calculation is performed on the vectorized field information and the first knowledge base through the preset big model to obtain a target report structure definition, and a report query result is generated based on the target report structure definition and the target field information; the target report data is obtained by using the report query result, and the key fields of the target report data are identified to obtain a second target business field; the user demand is converted into a data analysis instruction, and the data analysis instruction and the second target business field are analyzed based on the preset big model to obtain an initial data analysis code, the initial data analysis code is processed to obtain a corresponding execution code, and the execution code is executed to obtain a corresponding execution result.
[0069] In a third specific implementation, if the user requirement is a business indicator knowledge base, a tax business indicator knowledge base (i.e., a second knowledge base) is constructed based on each tax document. Figure 8A schematic diagram of constructing a tax business indicator knowledge base (i.e., a second knowledge base) provided for this embodiment, firstly collect tax documents from multiple sources, and perform data cleaning and preprocessing on each of the tax documents to obtain each structure text (i.e., a report structure), and use text mining technology to extract key information (i.e., field information) of each of the structure texts, and save the key information to the business indicator knowledge base; the key information includes indicator title, relevant tax collection and management matters, indicator description, business definition, and response recommended measures; then perform first vectorization processing on the key information to obtain first vectorization information, and save the first vectorization information to the business indicator knowledge base.
[0070] After the second knowledge base is constructed, the user demand is vectorized to obtain the converted demand, and the second vector similarity calculation is performed on the converted demand and the second knowledge base to obtain the most relevant target business indicator data based on the calculation result, and the corresponding execution result is generated based on the target business indicator data. Specifically, the use of the preset large model, the first knowledge base and the second knowledge base to perform the target data analysis task corresponding to the user demand to obtain the execution result includes: cleaning and preprocessing the original text of each type of tax document, performing a second extraction and a second vectorization operation on the processed text, and storing the obtained second vectorization information in the business indicator knowledge base to obtain the second knowledge base; if the user demand is a business indicator knowledge analysis, the user demand is vectorized to obtain the converted demand; based on the converted demand and the second knowledge base, a second vector similarity calculation is performed to obtain the target business indicator data, and the target business indicator data is used as the execution result.
[0071] In a fourth specific implementation, if the user demand is to chat, after obtaining the user demand, the user demand is processed based on a general big model to obtain a corresponding processing result, and the processing result is used to generate an execution result corresponding to the user demand.
[0072] In this embodiment, after obtaining the execution result, the execution result is summarized to obtain a corresponding target answer, and the target answer is returned to the user terminal. Specifically, summarizing the execution result to obtain the target answer includes: obtaining the execution result corresponding to the user question output by the preset large model, summarizing the execution result using a preset summary tool to obtain the target answer, and sending the target answer to the user terminal.
[0073] As can be seen from the above, before the application performs problem analysis based on user questions, it first uses regular expressions to judge the validity of the user questions, rewrites the user questions based on the judgment results to obtain the rewritten questions, and identifies the user questions and the corresponding current reports to obtain the user requirements corresponding to the user questions, and then uses the preset large model, the pre-created first knowledge base and the second knowledge base to perform the target data analysis tasks corresponding to the user requirements to obtain the corresponding execution results, so as to obtain the target answers by summarizing the execution results. In this way, the user questions input by the user end are judged for validity, preprocessed and rewritten, ensuring the validity and accuracy of subsequent data analysis; the first knowledge base and the second knowledge base constructed by the report structure definition information and business indicator knowledge in the tax field, even if it is a cross-report data query, can be used through the first knowledge base constructed by the report structure definition information in the tax field to query and analyze the report data, which enables the system to more accurately parse the questions raised by users, enhance the system's understanding of tax terminology, regulatory changes and business logic, and improve the accuracy and reliability of data analysis.
[0074] It can be seen from the above embodiments that the present application utilizes a preset large model, a first knowledge base, and a second knowledge base to execute a target data analysis task corresponding to the user's needs. Therefore, the determination and processing process of the target data analysis task is described.
[0075] See also Fig. 9 As shown, the embodiment of the present invention discloses a specific intelligent question-answering method based on the tax field, including:
[0076] First, the user question input by the user end, the current report corresponding to the user question, and the conversation history corresponding to the context of the user question are obtained, and the validity of the user question is judged. The needs of the user question that meets the preset validity conditions are identified to obtain the user needs, and the corresponding target data analysis tasks are determined based on the user needs.
[0077] Fig.10A question-and-answer system flow chart is provided for this embodiment. If the target data analysis task is the current data report analysis, the key fields of the current report are identified based on the user needs to obtain the first target business field, and the user needs are converted into data analysis instructions, and then the data analysis instructions and the first business field are analyzed to obtain an initial data analysis code (i.e., data analysis code), and then the initial data analysis code is processed to obtain a corresponding execution code, and the execution code is executed to obtain a corresponding execution result; if the target data analysis task is cross-table query data analysis, the field information obtained by parsing each report structure is first extracted and vectorized to construct a report structure definition knowledge base (i.e., the first knowledge base), and then the user needs are parsed to obtain the target field information, the target field information is vectorized to obtain the vectorized field information, and the vectorized field information and the first knowledge base are compared. a first vector similarity calculation is performed on the knowledge base to obtain a target report structure definition, a report data query structure is generated based on the target report structure definition and the target field information, the target report data is queried using the report data query structure, key fields are identified on the target report data to obtain a second target business field, an initial data analysis code is obtained based on the data analysis instruction obtained by converting the user requirements and the second target business field, and then the initial data analysis code is processed to obtain an execution code, and an execution result is obtained by executing the execution code; if the target data analysis task is a business indicator knowledge base, a tax business indicator knowledge base (i.e., a second knowledge base) is constructed after preprocessing each tax document, the user requirements are converted to obtain converted requirements, the target business indicator data is obtained by performing a second vector similarity calculation on the converted requirements and the second knowledge base, and the corresponding execution result is obtained by summarizing the target business indicator data.
[0078] After obtaining the execution results, this embodiment summarizes the execution results to obtain the target answer, and returns the target answer to the user. In this way, not only the limitations of traditional tools in multi-report data are overcome, but also a knowledge base specifically for the tax field is built, which enhances the system's ability to understand tax terms, regulatory changes and business logic, so that the system can more accurately analyze the questions raised by the user and give more accurate answers in the tax field, thereby improving the accuracy and reliability of data analysis.
[0079] Accordingly, see Fig.11 As shown, the present application also provides an intelligent question-answering device based on the tax field, including:
[0080] The question rewriting module 11 is used to judge the validity of the user question input by the user terminal, and pre-process the user question and rewrite the question based on the judgment result to obtain a rewritten question;
[0081] A demand identification module 12 is used to identify the demand of the rewritten question and the corresponding current report based on the preset prompt word project to obtain the user demand;
[0082] The summarization module 13 is used to use the preset large model, the first knowledge base and the second knowledge base to perform the target data analysis task corresponding to the user needs to obtain the execution results, and summarize the execution results to obtain the target answer; the first knowledge base is a knowledge base built based on the report structure definition information; the second knowledge base is a knowledge base built based on the tax business indicator knowledge.
[0083] As can be seen from the above, before the application performs problem analysis based on user questions, it first uses regular expressions to judge the validity of the user questions, rewrites the user questions based on the judgment results to obtain the rewritten questions, and identifies the user questions and the corresponding current reports to obtain the user requirements corresponding to the user questions, and then uses the preset large model, the pre-created first knowledge base and the second knowledge base to perform the target data analysis tasks corresponding to the user requirements to obtain the corresponding execution results, so as to obtain the target answers by summarizing the execution results. In this way, the user questions input by the user end are judged for validity, preprocessed and rewritten, ensuring the validity and accuracy of subsequent data analysis; the first knowledge base and the second knowledge base constructed by the report structure definition information and business indicator knowledge in the tax field, even if it is a cross-report data query, can be used through the first knowledge base constructed by the report structure definition information in the tax field to query and analyze the report data, which enables the system to more accurately parse the questions raised by users, enhance the system's understanding of tax terminology, regulatory changes and business logic, and improve the accuracy and reliability of data analysis.
[0084] In some specific implementations, the question rewriting module 11 may specifically include:
[0085] A user question acquisition unit, used to acquire a user question input by a user terminal, a current report corresponding to the user question, and a conversation history of the user question context;
[0086] A user question judgment unit, used to judge the validity of the user question by using regular expressions and a small sample prompting technology based on a preset artificial intelligence question-answering model;
[0087] The user question cleaning unit is used to clean the user question to obtain a cleaned question if the user question meets a preset validity condition, and to rewrite the cleaned question and the conversation history to obtain a rewritten question.
[0088] In some specific implementations, the summarizing module 13 may specifically include:
[0089] A first field identification unit, configured to identify key fields of the current report based on the user's needs to obtain a first target business field;
[0090] A first data analysis unit is configured to, if the user demand is for current report data analysis, convert the user demand into a data analysis instruction, and perform data analysis on the data analysis instruction and the first target business field based on a preset large model to obtain an initial data analysis code;
[0091] An analysis code processing unit is used to perform code processing on the initial data analysis code to obtain a corresponding execution code, and execute the execution code to obtain a corresponding execution result; the code processing includes simplifying the relative path of the initial data analysis code, capturing the text content and visual charts in the initial data analysis code, and verifying and correcting the initial data analysis code.
[0092] In some specific implementations, the summarizing module 13 may specifically include:
[0093] A report structure parsing unit, used for obtaining each field information by parsing each report structure, performing a first extraction and a first vectorization operation on each field information, and storing the obtained first vectorization information into a report structure knowledge base to obtain the first knowledge base;
[0094] The first task execution unit is used to use the preset large model and the first knowledge base to execute the target data analysis task corresponding to the user demand if the user demand is cross-table query data analysis to obtain the execution result.
[0095] In some specific implementations, the summarizing module 13 may specifically include:
[0096] A user demand parsing unit, configured to parse the user demand to obtain target field information if the user demand is cross-table query data analysis, and vectorize the target field information to obtain vectorized field information;
[0097] A first vector similarity calculation unit, configured to perform a first vector similarity calculation on the vectorized field information and the first knowledge base using the preset large model to obtain a target report structure definition, and generate a report query result based on the target report structure definition and the target field information;
[0098] A second field identification unit is used to obtain target report data using the report query result, and perform key field identification on the target report data to obtain a second target business field;
[0099] The second data analysis unit is used to convert the user demand into a data analysis instruction, and perform data analysis on the data analysis instruction and the second target business field based on a preset large model to obtain an initial data analysis code, perform code processing on the initial data analysis code to obtain a corresponding execution code, and execute the execution code to obtain a corresponding execution result.
[0100] In some specific implementations, the summarizing module 13 may specifically include:
[0101] A text preprocessing unit, used for cleaning and preprocessing the original texts of various types of tax documents, performing a second extraction and a second vectorization operation on the processed texts, and storing the obtained second vectorization information into a business indicator knowledge base to obtain the second knowledge base;
[0102] A user demand conversion unit, configured to perform vector conversion on the user demand to obtain a converted demand if the user demand is a business indicator knowledge analysis;
[0103] A second vector similarity calculation unit is used to perform a second vector similarity calculation based on the converted requirements and the second knowledge base to obtain target business indicator data, and use the target business indicator data as the execution result.
[0104] In some specific implementations, the summarizing module 13 may specifically include:
[0105] The summarization and conclusion completion unit is used to obtain the execution result corresponding to the user question output by the preset large model, summarize the execution result using a preset summary tool to obtain a target answer, and send the target answer to the user end.
[0106] Furthermore, the present application also discloses an electronic device. Fig.12It is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the intelligent question-and-answer method based on the tax field disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0107] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0108] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0109] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the intelligent question-answering method based on the tax field executed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.
[0110] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed intelligent question-answering method based on the tax field is implemented. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0111] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0112] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0113] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0114] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0115] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An intelligent question-answering method based on the tax field, characterized in that: include: Using regular expressions to judge the validity of the user question input by the user end, and pre-processing and rewriting the user question based on the judgment result to obtain a rewritten question; Based on the preset prompt word project, the rewritten question and the corresponding current report are identified to obtain the user's needs; Utilize the preset large model, the first knowledge base and the second knowledge base to perform the target data analysis task corresponding to the user's needs to obtain the execution result, and summarize the execution result to obtain the target answer; the first knowledge base is a knowledge base constructed based on the report structure definition information; The second knowledge base is a knowledge base constructed based on tax business indicator knowledge.
2. The intelligent question-answering method based on the taxation field according to claim 1 is characterized in that: The method of using a regular expression to judge the validity of a user question input by a user terminal, and preprocessing and rewriting the user question based on the judgment result to obtain a rewritten question includes: Acquire a user question input by a user terminal, a current report corresponding to the user question, and a conversation history of the context of the user question; Use regular expressions and a few-sample prompt technology based on a preset artificial intelligence question-answering model to judge the validity of the user's question; If the user question meets the preset validity condition, the user question is cleaned to obtain a cleaned question, and the cleaned question and the conversation history are rewritten to obtain a rewritten question.
3. The intelligent question-answering method based on the taxation field according to claim 1 is characterized in that: The use of the preset large model, the first knowledge base, and the second knowledge base to perform the target data analysis task corresponding to the user demand to obtain the execution result includes: Identifying key fields of the current report based on the user's needs to obtain a first target business field; If the user demand is for current report data analysis, the user demand is converted into a data analysis instruction, and data analysis is performed on the data analysis instruction and the first target business field based on a preset large model to obtain an initial data analysis code; The initial data analysis code is processed to obtain a corresponding execution code, and the execution code is executed to obtain a corresponding execution result; the code processing includes simplifying the relative path of the initial data analysis code, capturing the text content and visual charts in the initial data analysis code, and verifying and correcting the initial data analysis code.
4. The intelligent question-answering method based on the taxation field according to claim 1 is characterized in that: The use of the preset large model, the first knowledge base, and the second knowledge base to perform the target data analysis task corresponding to the user demand to obtain the execution result includes: By parsing each report structure to obtain each field information, performing a first extraction and a first vectorization operation on each field information, and storing the obtained first vectorization information in a report structure knowledge base to obtain the first knowledge base; If the user demand is cross-table query data analysis, the preset large model and the first knowledge base are used to execute the target data analysis task corresponding to the user demand to obtain the execution result.
5. The intelligent question-answering method based on the taxation field according to claim 4 is characterized in that: If the user requirement is cross-table query data analysis, the target data analysis task corresponding to the user requirement is executed by using the preset large model and the first knowledge base to obtain an execution result, including: If the user requirement is cross-table query data analysis, the user requirement is parsed to obtain target field information, and the target field information is vectorized to obtain vectorized field information; Performing a first vector similarity calculation on the vectorized field information and the first knowledge base using the preset large model to obtain a target report structure definition, and generating a report query result based on the target report structure definition and the target field information; Obtain target report data using the report query result, and identify key fields of the target report data to obtain a second target business field; The user demand is converted into a data analysis instruction, and data analysis is performed on the data analysis instruction and the second target business field based on a preset large model to obtain an initial data analysis code, the initial data analysis code is processed to obtain a corresponding execution code, and the execution code is executed to obtain a corresponding execution result.
6. The intelligent question-answering method based on the taxation field according to claim 1 is characterized in that: The use of the preset large model, the first knowledge base, and the second knowledge base to perform the target data analysis task corresponding to the user demand to obtain the execution result includes: The second knowledge base is obtained by cleaning and preprocessing the original texts of various types of tax documents, performing a second extraction and a second vectorization operation on the processed texts, and storing the obtained second vectorization information in a business indicator knowledge base; If the user demand is a business indicator knowledge analysis, vector conversion is performed on the user demand to obtain a converted demand; A second vector similarity calculation is performed based on the converted requirements and the second knowledge base to obtain target business indicator data, and the target business indicator data is used as the execution result.
7. The intelligent question-answering method based on the taxation field according to any one of claims 1 to 6, characterized in that: The step of summarizing the execution results to obtain a target answer includes: The execution result output by the preset large model corresponding to the user question is obtained, the execution result is summarized by using a preset summary tool to obtain a target answer, and the target answer is sent to the user end.
8. An intelligent question-answering device based on the tax field, characterized in that: include: A question rewriting module is used to judge the validity of the user question input by the user end, and pre-process the user question and rewrite the question based on the judgment result to obtain a rewritten question; A demand identification module, used for identifying the demand of the rewritten question and the corresponding current report based on the preset prompt word project to obtain the user demand; The summarization module is used to perform the target data analysis task corresponding to the user's needs by using the preset large model, the first knowledge base and the second knowledge base to obtain the execution results, and summarize the execution results to obtain the target answer; the first knowledge base is a knowledge base constructed based on the report structure definition information; The second knowledge base is a knowledge base constructed based on tax business indicator knowledge.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor is used to execute the computer program to implement the intelligent question and answer method based on the tax field as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the intelligent question and answer method based on the tax field as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Electronic tax bureau docking method based on general report technology and big data knowledge base
CN113988038A
Knowledge base construction method and question and answer dialogue method and system based on generative large language model
CN117056471A
Tax text conversion method and device based on large model, equipment and storage medium
CN117271567A
Query demand processing method and device, computer equipment and storage medium
CN117827923A
Data processing method, system and device, storage medium and program product
CN118132684A
Cited By
Intelligent question answering system and method based on multi-source mixed retrieval and dynamic self-optimization
CN120045682A
Financial data analysis method and system based on large model and medium
CN120523927A
Large model-based financial data analysis method, system and medium
CN120523927B