Retrieval method and system for tax knowledge question-answering system and electronic equipment
By performing word segmentation, part-of-speech annotation and professional term recognition on tax problem query sentences, combined with tax factor extraction and query vector construction, the problem that the existing system cannot accurately identify professional terms and key elements is solved, and the intelligence and search quality of tax question and answers are significantly improved.
Patent Information
- Application Number
- CN202411785195.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-14
AI Technical Summary
The existing tax knowledge retrieval system cannot accurately identify the professional terms and key elements in the query statement, resulting in a large deviation from the search results and the user's actual consultation intention, which affects the quality of question and answers.
By performing word segmentation and part-of-speech annotation on the tax problem query statements entered by the user, a pre-constructed tax professional dictionary is used to identify tax professional terms, and tax elements are extracted based on the preset tax element identification rules, and finally, a query vector is constructed to perform search matching in the tax knowledge base.
It can accurately identify professional terms and key elements in the query statement, improve the intelligence level and search quality of tax Q&A, and improve the accuracy and user experience of search results.
Smart Images

Figure CN119622930A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of retrieval, and in particular to a retrieval method and system and electronic equipment for a tax knowledge question and answer system. Background Art
[0002] As tax policies become increasingly complex, taxpayers' demand for tax consulting continues to grow. In order to improve the efficiency and quality of tax services, local tax authorities are actively exploring the application of intelligent question-and-answer technology, providing taxpayers with timely and accurate consulting services by automatically searching and matching relevant policy documents.
[0003] The current tax knowledge retrieval system mainly uses the vector space model to convert user queries and knowledge base documents into feature vectors, and matches them by calculating the cosine similarity of the vectors to retrieve relevant tax policy documents.
[0004] However, since the existing retrieval system does not take into account the professional characteristics of the tax field, the system cannot accurately identify the professional terms and key elements in the query statements, resulting in a large deviation between the retrieval results and the user's actual consulting intentions, affecting the quality of questions and answers; this situation needs to be further improved. Summary of the invention
[0005] In order to solve the problem that the existing retrieval system cannot accurately identify the professional terms and key elements in the query statement, which affects the quality of question and answer, this application provides a retrieval method, system and electronic device for a tax knowledge question and answer system, which adopts the following technical solutions: In a first aspect, the present application provides a retrieval method for a tax knowledge question-answering system, comprising the following steps: Receive tax query statements input by users; Performing word segmentation and part-of-speech tagging on the query sentence to obtain a word segmentation sequence with part-of-speech tags; Based on the word segmentation sequence, using a pre-built tax professional dictionary to identify and mark the tax professional terms therein, and generating a target sequence marked with tax terminology; Based on the target sequence, extracting tax elements using preset tax element identification rules; A query vector is constructed based on the extracted tax elements, and retrieval matching is performed in the tax knowledge base.
[0006] By adopting the above technical solution, the existing technology cannot recognize some complete tax subject concepts, and it is difficult to extract key tax elements, resulting in the search results deviating from the user's actual consultation intention; this application first segments the query statement and tags the parts of speech to form basic language units, and then uses a pre-built tax professional dictionary to identify standard terms, and extracts key information based on preset tax element identification rules, and finally constructs a query vector that incorporates professional knowledge to perform retrieval, which can accurately identify professional terms and key elements in the query statement, thereby improving the intelligence level and retrieval quality of tax questions and answers.
[0007] Optionally, the query statement is segmented and POS tagged to obtain a segmented word sequence with POS tagged, which specifically includes the following steps: Use the word segmenter to perform preliminary word segmentation on the query statement to obtain an initial word segmentation sequence; Matching the initial word segmentation sequence with a preset tax abbreviation comparison table to identify tax professional abbreviations; According to the tax abbreviation comparison table, the identified tax professional abbreviations are replaced with corresponding standard terms to obtain a standardized word segmentation sequence; Part-of-speech tagging is performed on the standardized word segmentation sequence to obtain a word segmentation sequence with part-of-speech tagging.
[0008] By adopting the above technical solution, in order to solve the problem of unsatisfactory retrieval results caused by the extensive use of non-standard abbreviations in tax query statements, this application first uses a word segmenter to obtain an initial sequence, and then uses a tax abbreviation comparison table to identify and replace them with standard terms to obtain a standardized sequence, and finally performs part-of-speech tagging to obtain a tagged sequence, which can more accurately understand query statements containing abbreviations and improve user experience.
[0009] Optionally, based on the word segmentation sequence, a pre-built tax professional dictionary is used to identify and mark the tax professional terms therein, and a target sequence marked with tax terminology is generated, which specifically includes the following steps: Matching the continuous phrases in the word segmentation sequence with the tax professional dictionary, identifying standard tax professional terms, and obtaining a preliminary tag sequence; For the unrecognized phrases in the preliminary tag sequence, calculating the character similarity with each term in the tax professional dictionary to obtain a similarity result set; Filter out phrases with similarity higher than a preset threshold and corresponding standard tax terminology from the similarity result set to obtain a fuzzy matching sequence; The preliminary tag sequence and the fuzzy matching sequence are merged to generate a target sequence with tax term tags.
[0010] By adopting the above technical solution, in order to solve the problem of incomplete professional terminology recognition caused by users using non-standard expressions in tax queries, this application first matches the word segmentation sequence with the tax professional dictionary to identify some standard terms; for phrases that are not successfully matched, the edit distance or character overlap between them and the terms in the dictionary is calculated. When the similarity exceeds a preset threshold, it is marked as the corresponding standard term. Finally, the preliminary marking and the results of fuzzy matching are merged to generate a complete terminology marking sequence, which can more comprehensively cover various expression variants and improve the accuracy and recall rate of terminology recognition.
[0011] Optionally, based on the target sequence, the tax elements are extracted using a preset tax element identification rule, specifically including the following steps: Matching the target sequence with a preset associated word table, identifying the associated words and their positions in the sequence, and obtaining an associated word position sequence; According to the associated word position sequence, the target sequence is divided into a plurality of subsequences to obtain a subsequence set; Using a preset tax element identification rule, respectively extract tax elements from the subsequence set to obtain a preliminary element set; According to the semantic types of the associated words in the associated word position sequence, the logical relationships between the elements in the preliminary element set are marked to generate a complete element set including the elements and the associated relationships.
[0012] By adopting the above technical solution, the present application first identifies the position of the associated words and divides the query sequence into multiple subsequences; then extracts basic elements such as tax type, tax rate, policy type, etc. from each subsequence; finally, based on the semantic characteristics of the associated words, marks the parallel relationship between the tax type elements and the subordinate relationship with the tax rate elements, thereby improving the accuracy of complex queries.
[0013] Optionally, after performing search and matching in the tax knowledge base, the following steps are also included: Combine the retrieved candidate knowledge list with the user's original query sentence to construct an input prompt; The input prompt is passed into the large language model to obtain the relevance analysis result of each candidate knowledge; Based on the correlation analysis result, extracting the correlation score of each candidate knowledge; Reorder the candidate knowledge according to the relevance scores to generate a result list; Determine whether the highest score in the result list exceeds the preset threshold. If so, return the corresponding knowledge as a response.
[0014] By adopting the above technical solution, in order to solve the problem that the traditional tax knowledge retrieval system only relies on vector similarity and cannot accurately understand the query semantics, resulting in inaccurate retrieval results; this application first combines the user query and candidate knowledge into a prompt, and inputs it into a large language model to obtain a detailed correlation analysis; then extracts the correlation score from the analysis result; finally, re-ranks based on the score, and uses the knowledge with a score exceeding the threshold as the final answer, which improves the retrieval method's understanding of the query intent and greatly improves the accuracy of the retrieval results and the user experience.
[0015] Optionally, when the highest score in the result list does not exceed a preset threshold, the method further includes the following steps: Extracting knowledge items with a relevance score not lower than a preset recommendation threshold from the result list to generate a candidate recommendation set; Sorting each knowledge item in the candidate recommendation set in descending order according to the relevance score to generate an ordered recommendation list; The ordered recommendation list is formatted into a user-readable recommendation interface and returned.
[0016] By adopting the above technical solution, in order to solve the problem of poor user experience when the tax knowledge question and answer system cannot find a completely matching answer, the application extracts knowledge items whose relevance scores are not lower than the preset recommendation threshold, generates a candidate recommendation set, sorts each knowledge item in the candidate recommendation set in descending order according to the relevance score, generates an ordered recommendation list, and then formats the ordered recommendation list into a user-readable recommendation interface and returns it. Through the multi-level threshold and recommendation display mechanism, the user experience when the retrieval results are not ideal is improved, and the practicality of the system is improved.
[0017] Optionally, after returning the corresponding knowledge as a reply, the following steps are also included: Generate an interaction record containing user query, returned knowledge ID, and return time, and assign a unique identifier; Based on the identifier corresponding to the interaction record, receiving and recording the user's feedback information, and generating a feedback record; Calculating a weight adjustment value of the knowledge item according to the feedback type in the feedback record; The weight adjustment value is added to the original weight value of the corresponding entry in the knowledge base to update the original weight value.
[0018] By adopting the above technical solution, the present application first generates a unique interaction ID for each query response, records the user query content, the returned knowledge number and time information; then collects the user's feedback on the response, and saves it in association with the interaction ID; then calculates the weight adjustment value based on different types of feedback, applies the adjustment value to the original weight of the knowledge item, and dynamically updates the retrieval sorting basis, so that it can continuously learn from user feedback to optimize the sorting of retrieval results, so that the system can gradually adapt to user needs and improve user experience.
[0019] In a second aspect, the present application provides a retrieval system for a tax knowledge question-and-answer system, comprising: A receiving module, used for receiving a tax query statement input by a user; A word segmentation and tagging module, used to perform word segmentation and part-of-speech tagging on the query sentence to obtain a word segmentation sequence with part-of-speech tagging; A term tagging module is used to identify and tag the tax terminology therein based on the word segmentation sequence using a pre-built tax terminology dictionary to generate a target sequence with tax term tags; An element extraction module, used to extract tax elements based on the target sequence using preset tax element identification rules; The retrieval and matching module is used to construct a query vector based on the extracted tax elements and perform retrieval and matching in the tax knowledge base.
[0020] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned retrieval method for a tax knowledge question and answer system when executing the computer program.
[0021] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned retrieval method for a tax knowledge question and answer system.
[0022] In summary, the present application includes at least one of the following beneficial technical effects: 1. This application first performs word segmentation and part-of-speech tagging on the query statement to form basic language units, then uses a pre-built tax professional dictionary to identify standard terms, and extracts key information based on preset tax element identification rules, and finally constructs a query vector that incorporates professional knowledge to perform retrieval, which can accurately identify professional terms and key elements in the query statement, thereby improving the intelligence level and retrieval quality of tax Q&A; 2. In order to solve the problem of unsatisfactory retrieval results caused by the large number of non-standard abbreviations used in tax query statements, this application first uses a word segmenter to obtain an initial sequence, then identifies and replaces them with standard terms through a tax abbreviation comparison table to obtain a standardized sequence, and finally performs part-of-speech tagging to obtain a tagged sequence, which can more accurately understand query statements containing abbreviations and improve user experience; 3. In order to solve the problem that the traditional tax knowledge retrieval system only relies on vector similarity and cannot accurately understand the query semantics, resulting in inaccurate retrieval results; this application first combines the user query and candidate knowledge into a prompt, and inputs it into a large language model to obtain a detailed correlation analysis; then extracts the correlation score from the analysis result; finally, re-ranks based on the score, and uses the knowledge with a score exceeding the threshold as the final answer, which improves the retrieval method's understanding of the query intent and greatly improves the accuracy of the retrieval results and the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a flowchart of a retrieval method for a tax knowledge question and answer system according to an embodiment of the present application; Figure 2 It is a flowchart of step S120 in a retrieval method for a tax knowledge question and answer system according to an embodiment of the present application; Figure 3 It is a flowchart of step S130 in a retrieval method for a tax knowledge question and answer system according to an embodiment of the present application; Figure 4 It is a flowchart of step S140 in a retrieval method for a tax knowledge question and answer system according to an embodiment of the present application; Figure 5 It is a flowchart of correlation analysis in a retrieval method for a tax knowledge question-and-answer system according to an embodiment of the present application; Figure 6 It is a flowchart of a knowledge item recommendation in a retrieval method for a tax knowledge question-and-answer system according to an embodiment of the present application; Figure 7 It is a flowchart of updating the recommendation weight in a retrieval method for a tax knowledge question-and-answer system according to an embodiment of the present application; Figure 8 This is a module diagram of a retrieval system for a tax knowledge question and answer system according to an embodiment of the present application; Fig. 9 It is a diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more listed items.
[0025] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0026] The embodiments of the present application are further described in detail below in conjunction with the drawings in the specification.
[0027] In the first aspect, the present application provides a retrieval method for a tax knowledge question-answering system, referring to Figure 1 , including the following steps: S110: receiving a tax query statement input by a user.
[0028] In this embodiment, the user interface of the system receives a tax query sentence input by the user in natural language. The query sentence can be a complete question sentence, such as "What is the corporate income tax rate?", or a keyword combination, such as "VAT threshold for small-scale taxpayers."
[0029] Specifically, the system first preprocesses the received query statement, including removing redundant spaces, normalizing punctuation marks, converting full-width characters to half-width characters, etc., to ensure the consistency of subsequent processing. For example, "corporate income tax rate?" is processed as "corporate income tax rate".
[0030] S120: Perform word segmentation and part-of-speech tagging on the query sentence to obtain a word segmentation sequence with part-of-speech tagging.
[0031] In this embodiment, a word segmentation method based on statistical probability is used in combination with a preset dictionary to segment the query statement. The system pre-maintains a comprehensive dictionary containing common and professional vocabulary to guide the word segmentation process and improve the accuracy of word segmentation, especially the recognition ability of tax-specific vocabulary.
[0032] Specifically, the system first performs preliminary word segmentation on the text using the maximum matching algorithm, and then tags the part-of-speech for each segmented word. For example, for the query sentence "What is the tax rate of enterprise income tax", the word segmentation and tagging results are "enterprise income tax / n of / u tax rate / n is / v how much / r", where n represents a noun, u represents a particle, v represents a verb, and r represents a pronoun.
[0033] S130. Based on the word segmentation sequence, use the pre-constructed tax professional dictionary to identify and mark the tax professional terms therein, and generate a target sequence with tax term markings.
[0034] In this embodiment, the system performs term identification through a pre-constructed tax professional dictionary. This dictionary contains standard tax terms and their common variant forms, supporting exact matching and fuzzy matching of tax professional terms to ensure accurate identification of professional terms in the user's query.
[0035] Specifically, the system traverses the continuous phrases in the word segmentation sequence and matches them with the tax professional dictionary. When a matching item is found, it is identified with a special mark, thereby generating a target sequence with semantic markings.
[0036] S140. Based on the target sequence, extract tax elements using preset tax element identification rules.
[0037] In this embodiment, the system extracts key elements in the query based on predefined tax element identification rules. These rules contain identification patterns for elements such as tax types, taxpaying entities, levy objects, tax rates, etc., and can extract the core semantic information of the query from the marked sequence.
[0038] Specifically, the system identifies various elements in the sequence through rule matching, extracts the tax type element and the query attribute element, and marks the subordinate relationship between them.
[0039] S150. Construct a query vector based on the extracted tax elements and perform a retrieval match in the tax knowledge base.
[0040] In this embodiment, the system converts the extracted tax elements into a structured query vector and performs a matching retrieval in the knowledge base. A large amount of tax policies, regulations, and practical guides are stored in the system's knowledge base.
[0041] Specifically, the system assigns different weights to each dimension in the query vector. For example, the weight of the tax type dimension is relatively high, and the attribute dimension is the second. When performing the retrieval, the weighted cosine similarity calculation method is used to find the knowledge entry most similar to the query vector.
[0042] In one embodiment, refer to Figure 2In step S120, the query statement is segmented and POS tagged to obtain a segmented sequence with POS tagged, which specifically includes the following steps: S121. Perform preliminary word segmentation on the query statement using a word segmenter to obtain an initial word segmentation sequence.
[0043] In this embodiment, the system adopts a word segmentation method based on a combination of a dictionary and a statistical model. The word segmenter loads a preset dictionary library, which includes a general vocabulary dictionary and a tax-specific dictionary. Each entry contains basic attribute information such as word frequency and part of speech.
[0044] Specifically, the word segmenter first uses the maximum forward matching algorithm to perform preliminary segmentation on the text, and at the same time combines the statistical language model to calculate the probabilities of different segmentation schemes and select the segmentation result with the highest probability. When encountering ambiguous segmentation, the system refers to the word frequency information and contextual relationship to disambiguate and select the optimal segmentation path.
[0045] S122. Match the initial word segmentation sequence with a preset tax abbreviation comparison table to identify tax professional abbreviations.
[0046] In this embodiment, the system maintains a special tax abbreviation comparison table in advance, which includes common professional abbreviations in the tax field and their corresponding standard full names. The abbreviation comparison table is stored in the form of key-value pairs, including information such as abbreviations, full names, and usage frequency, and supports two matching modes: exact matching and fuzzy matching.
[0047] Specifically, the system matches and compares each word in the initial word segmentation sequence with the abbreviation comparison table. For example, when the user enters professional abbreviations such as "IIT" (individual income tax), "CIT" (corporate income tax), "VAT" (value-added tax), and "RTF" (stamp duty), the system can accurately identify these abbreviations. For common industry abbreviations such as "self-employed" in "individual business", "special invoice" in "special value-added tax invoice", and "general invoice" in "general value-added tax invoice", the system can also complete accurate matching through the comparison table.
[0048] S123. According to the tax abbreviation comparison table, the identified tax professional abbreviations are replaced with corresponding standard terms to obtain a standardized word segmentation sequence.
[0049] In this embodiment, the system replaces the identified abbreviations with the corresponding standard full names according to the mapping relationship in the abbreviation comparison table.
[0050] Specifically, when the system finds an abbreviation in a word segmentation sequence, it directly calls the standard full name in the comparison table for replacement.
[0051] S124, performing part-of-speech tagging on the standardized word segmentation sequence to obtain a word segmentation sequence with part-of-speech tags.
[0052] In this embodiment, the system uses a part-of-speech tagger based on conditional random fields. The tagger has been trained on a large-scale tax text corpus and can accurately identify the part-of-speech of tax-specific vocabulary. The tag set includes basic parts of speech such as nouns, verbs, and adjectives, as well as special tags such as tax types, tax rates, and deadlines.
[0053] Specifically, the tagger performs part-of-speech determination on each word in the standardized word segmentation sequence, and determines the part-of-speech according to the context of the word and the characteristics of the word itself.
[0054] In one embodiment, referring to Figure 3 In step S130, based on the word segmentation sequence, the tax professional terms therein are identified and marked using a pre-built tax professional dictionary to generate a target sequence marked with tax terminology, which specifically includes the following steps: S131. Match the continuous phrases in the word segmentation sequence with the tax professional dictionary, identify standard tax professional terms, and obtain a preliminary tag sequence.
[0055] In this embodiment, the system uses a multi-level matching strategy to process the word segmentation sequence. The tax professional dictionary is classified and stored according to different dimensions such as tax category, collection management, and tax payer. Each term contains attribute information such as standard name, category tag, and synonym set.
[0056] Specifically, the system performs a sliding window scan on the phrases in the word segmentation sequence, with the window size decreasing from the maximum phrase length, and matches them with professional dictionaries in turn.
[0057] S132. For the unrecognized phrases in the preliminary tag sequence, calculate the character similarity with each term in the tax professional dictionary to obtain a similarity result set.
[0058] In this embodiment, the system uses a character similarity calculation method to perform fuzzy matching on phrases that fail to match accurately. The similarity calculation comprehensively considers multiple factors such as edit distance, character overlap, and position weight, and generates a candidate term list for each phrase to be matched.
[0059] Specifically, the system calculates the similarity between phrases. For example, when a user enters a non-standard expression such as "corporate tax incentives", the system calculates the similarity between it and terms such as "corporate income tax incentives" and "tax incentives" in the dictionary, and records the similarity score.
[0060] S133. Filter out phrases with similarity higher than a preset threshold and corresponding standard tax terminology from the similarity result set to obtain a fuzzy matching sequence.
[0061] In this embodiment, the system sets a dynamic similarity threshold mechanism. The basic threshold is set to 0.75, and the system dynamically adjusts the threshold based on the query context and phrase length. For shorter phrases, the system uses a higher threshold to ensure matching accuracy; for longer phrases, the threshold is lowered to improve recall.
[0062] Specifically, the system sorts and filters the similarity result set. For example, when "corporate tax incentives" are identified, if the similarity with "corporate income tax preferential policies" is 0.82, which exceeds the threshold, it will be recorded in the fuzzy matching sequence and marked.
[0063] S134. Merge the preliminary tag sequence and the fuzzy matching sequence to generate a target sequence with tax term tags.
[0064] In this embodiment, the system uses a priority strategy to handle the merging of tag sequences. Exact matching results have the highest priority, followed by fuzzy matching results. When overlapping tags appear, the system will select the optimal tagging scheme based on the priority rules and coverage.
[0065] Specifically, the system merges the tags in the preliminary tag sequence and the fuzzy matching sequence in order according to their positions in the original text.
[0066] In one embodiment, referring to Figure 4 In step S140, based on the target sequence, the tax elements are extracted using the preset tax element identification rules, which specifically includes the following steps: S141 . Match the target sequence with a preset associated word table, identify the associated words and their positions in the sequence, and obtain an associated word position sequence.
[0067] In this embodiment, the system maintains a word list including multiple categories of logical words, conditional words, time words, etc. Each category of words is marked with its semantic function and usage scenario, and the system understands the semantic structure of the query statement by identifying these words.
[0068] Specifically, the system traverses the target sequence and matches each phrase with the associated word list. For example, for the query "corporate income tax and value-added tax rates and the threshold for small-scale taxpayers", the system identifies the positions of the associated words "and" and "and", and marks them as parallel associated words. S142. Divide the target sequence into multiple subsequences according to the associated word position sequence to obtain a subsequence set.
[0069] In this embodiment, the system uses a divide-and-conquer strategy to divide the target sequence into multiple semantically complete subsequences according to the positions of the identified associated words.
[0070] Specifically, taking the above query as an example, the system first divides the sequence into three subsequences based on the two associated words "and" and "as well as": "Corporate income tax rate", "VAT rate", and "Tax threshold for small-scale taxpayers". Each subsequence retains the original tax terminology mark to facilitate subsequent element extraction.
[0071] S143. Using the preset tax element identification rules, extract the tax elements from the subsequence set respectively to obtain a preliminary element set.
[0072] In this embodiment, the system uses a rule-based element identification method, and the system defines specific identification rules for different types of tax elements (such as tax types, tax rates, deadlines, conditions, etc.).
[0073] Specifically, for each subsequence, the system applies the corresponding element identification rules for processing. For example, for the subsequence "Corporate income tax rate", the system identifies the tax type element "Corporate income tax" and the attribute element "tax rate" through the rules; for "Tax threshold for small-scale taxpayers", the system identifies the tax subject element "Small-scale taxpayers" and the attribute element "Tax threshold". The original and standardized expressions of the elements will be retained during the extraction process to form a preliminary element set.
[0074] S144. According to the semantic types of the associated words in the associated word position sequence, the logical relationships between the elements in the preliminary element set are marked to generate a complete element set including the elements and the associated relationships.
[0075] In this embodiment, the system constructs a logical relationship network between elements based on the semantic types of associated words. The system defines multiple relationship types including parallel, subordinate, conditional, transitional, etc., which are used to describe the semantic connection between different elements. The final generated complete element set not only contains the specific content of each element, but also the logical association relationship between them, forming a structured semantic network.
[0076] In one embodiment, referring to Figure 5 After performing search and matching in the tax knowledge base, the following steps are also included: S510: Combine the retrieved candidate knowledge list with the user's original query statement to construct an input prompt.
[0077] In this embodiment, the system adopts a templated prompt word construction method and pre-designs a special prompt word template to guide the large language model to analyze the relevance between the query and the candidate knowledge. The prompt word template contains multiple parts: the original query description, the candidate knowledge content, the task description and the scoring requirements, etc., and organizes this information in a structured way.
[0078] Specifically, the system combines user queries and candidate knowledge according to preset templates. For example, for the query "What is the VAT rate for small-scale taxpayers?", the system may construct the following prompt: "Please analyze the relevance of the following tax policies to the user query 'What is the VAT rate for small-scale taxpayers': [Candidate knowledge content]. Please evaluate from the three dimensions of professionalism, completeness, and timeliness, and give a comprehensive score of 0-10." S520: passing the input prompt into the large language model to obtain the relevance analysis result of each candidate knowledge.
[0079] In this embodiment, the system inputs the constructed prompts into a pre-tuned large language model. The model is specially trained with tax domain knowledge and can accurately understand the professional content and nuances of tax policy texts, thereby making accurate judgments on the relevance of knowledge.
[0080] S530: Based on the correlation analysis result, extract the correlation score of each candidate knowledge.
[0081] In this embodiment, the system uses regular expressions and text parsing rules to extract numerical scores from the analysis text output by the model. The system will identify the scores of different dimensions and the final comprehensive score, and perform rationality verification to ensure that the extracted scores are within the expected range.
[0082] S540: Reorder the candidate knowledge according to the relevance scores and generate a result list.
[0083] In this embodiment, the system ranks candidate knowledge based on relevance scores, while considering other attributes of knowledge, such as policy timeliness, file level, etc. The ranking algorithm adopts a weighted ranking method, and the weights of different attributes can be adjusted according to the actual application scenario.
[0084] Specifically, the system arranges the candidate knowledge in descending order according to the comprehensive scores and generates a new result list.
[0085] S550, determining whether the highest score in the result list exceeds a preset threshold, and if so, returning the corresponding knowledge as a response.
[0086] In this embodiment, the system sets a dynamic threshold mechanism, and the basic threshold is 7 points. The system will dynamically adjust the threshold based on factors such as the complexity of the query and the number of candidate knowledge. When the highest score exceeds the threshold, the system considers that the knowledge is sufficiently relevant and can be returned as a valid answer.
[0087] In one embodiment, referring to Figure 6 , when the highest score in the result list does not exceed the preset threshold, the following steps are also included: S610: Extract knowledge items whose relevance scores are not lower than a preset recommendation threshold from the result list to generate a candidate recommendation set.
[0088] In this embodiment, the system sets a recommendation threshold lower than the main threshold to screen potential related knowledge. The system collects all knowledge items with scores above the recommendation threshold to form a candidate recommendation pool.
[0089] Specifically, the system traverses each knowledge item in the result list and checks whether its score reaches the recommendation threshold. For example, for a result list containing 10 pieces of knowledge, if 4 of them have scores of 6.8, 6.5, 5.8 and 5.2 respectively, and the recommendation threshold is 5 points, then these 4 pieces of knowledge will be included in the candidate recommendation set. The system will also record the key attributes of each piece of knowledge, such as the policy validity period, scope of application, etc., for subsequent display sorting.
[0090] S620 , sorting the relevance scores of each knowledge item in the candidate recommendation set in descending order to generate an ordered recommendation list.
[0091] In this embodiment, the system adopts a multi-dimensional ranking strategy, which not only considers the relevance score, but also combines factors such as the timeliness, frequency of use, document source, etc. of the knowledge items. The system assigns a weight to each dimension and obtains the final ranking score through weighted calculation.
[0092] S630: Format the ordered recommendation list into a user-readable recommendation interface and return.
[0093] In one embodiment, referring to Figure 7 , after returning the corresponding knowledge as a reply, it also includes the following steps: S710: Generate an interaction record including user query, returned knowledge ID, and returned time, and assign a unique identifier.
[0094] In this embodiment, the system uses a distributed ID generation algorithm to generate a globally unique identifier for each query interaction. The interaction record contains user information (de-sensitized), query content, ID of returned knowledge, interaction timestamp, query source, etc.
[0095] Specifically, when the system returns a piece of tax policy knowledge, an interaction record will be created immediately.
[0096] S720: Receive and record user feedback information based on the identifier corresponding to the interaction record, and generate a feedback record.
[0097] In this embodiment, the user's feedback information includes explicit feedback (such as user's active evaluation) and implicit feedback (such as browsing time, whether to collect, etc.). The feedback information is associated with the aforementioned interaction record through a unique identifier to form a complete user experience data chain.
[0098] S730. Calculate the weight adjustment value of the knowledge item according to the feedback type in the feedback record.
[0099] In this embodiment, the system designs a corresponding weight adjustment algorithm according to different types of feedback. The algorithm considers factors such as the type of feedback, the user's activity, and the timeliness of the feedback, and obtains the final adjustment value through weighted calculation.
[0100] S740: Add the weight adjustment value to the original weight value of the corresponding entry in the knowledge base to update the original weight value.
[0101] In this embodiment, the system adopts a progressive weight update strategy to modify the original weight of the knowledge item by accumulating the adjustment values of multiple feedbacks. The time decay factor is considered in the update process, so that the recent feedback has a greater influence. The system also regularly normalizes the weight values to maintain the balance of the overall weight distribution.
[0102] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0103] On the second aspect, the present application provides a retrieval system for a tax knowledge question and answer system. The retrieval system for a tax knowledge question and answer system of the present application is described below in combination with the above-mentioned retrieval method for a tax knowledge question and answer system.
[0104] Reference Figure 8 , a retrieval system for a tax knowledge question answering system, comprising: A receiving module, used for receiving a tax query statement input by a user; A word segmentation and tagging module is used to segment and tag the query statements to obtain a word segmentation sequence with part-of-speech tags; A term tagging module is used to identify and tag tax terminology in a word segmentation sequence using a pre-built tax term dictionary to generate a target sequence with tax term tags; An element extraction module is used to extract tax elements based on the target sequence using preset tax element identification rules; The retrieval and matching module is used to construct a query vector based on the extracted tax elements and perform retrieval and matching in the tax knowledge base.
[0105] In one embodiment, the word segmentation and tagging module includes: A preliminary word segmentation unit is used to perform preliminary word segmentation on the query statement using a word segmenter to obtain an initial word segmentation sequence; The abbreviation recognition unit is used to match the initial word segmentation sequence with the preset tax abbreviation comparison table to identify tax professional abbreviations; A standardization unit is used to replace the identified tax professional abbreviations with corresponding standard terms according to the tax abbreviation comparison table to obtain a standardized word segmentation sequence; The part-of-speech tagging unit is used to perform part-of-speech tagging on the standardized word segmentation sequence to obtain a word segmentation sequence with part-of-speech tags.
[0106] In one embodiment, the term tagging module includes: A standard term recognition unit is used to match the continuous phrases in the word segmentation sequence with the tax professional dictionary, recognize the standard tax professional terms, and obtain a preliminary tag sequence; A similarity calculation unit is used to calculate the character similarity between the unrecognized phrases in the preliminary tag sequence and the terms in the tax professional dictionary to obtain a similarity result set; A fuzzy matching unit is used to select phrases with similarity higher than a preset threshold and corresponding standard tax professional terms from the similarity result set to obtain a fuzzy matching sequence; The sequence merging unit is used to merge the preliminary marking sequence and the fuzzy matching sequence to generate a target sequence with tax term markings.
[0107] In one embodiment, the feature extraction module includes: A related word recognition unit is used to match the target sequence with a preset related word table, recognize the related words and positions in the sequence, and obtain a related word position sequence; A sequence division unit is used to divide the target sequence into multiple subsequences according to the position sequence of the associated words to obtain a subsequence set; An element recognition unit is used to extract tax elements from the subsequence set respectively by using a preset tax element recognition rule to obtain a preliminary element set; The relationship marking unit is used to mark the logical relationship between the elements in the preliminary element set according to the semantic type of the associated words in the associated word position sequence, and generate a complete element set including the elements and the associated relationships.
[0108] In one embodiment, it further includes: A prompt construction module is used to combine the retrieved candidate knowledge list with the user's original query sentence to construct an input prompt; The relevance analysis module is used to pass the input prompt into the large language model and obtain the relevance analysis results of each candidate knowledge; A score extraction module is used to extract the relevance score of each candidate knowledge based on the relevance analysis results; A sorting module is used to re-rank the candidate knowledge according to the relevance score and generate a result list; The judgment return module is used to judge whether the highest score in the result list exceeds the preset threshold. If it exceeds, the corresponding knowledge is returned as a response.
[0109] In one embodiment, it further includes: A recommendation set generation module, used to extract knowledge items whose relevance scores are not less than a preset recommendation threshold from the result list and generate a candidate recommendation set; A recommendation sorting module is used to sort the relevance scores of each knowledge item in the candidate recommendation set in descending order to generate an ordered recommendation list; The recommendation display module is used to format the ordered recommendation list into a user-readable recommendation interface and return it.
[0110] In one embodiment, it further includes: The interaction record module is used to generate an interaction record including user query, returned knowledge ID, and returned time, and assign a unique identifier; A feedback record module, used to receive and record user feedback information based on an identifier corresponding to the interaction record, and generate a feedback record; A weight calculation module, used to calculate the weight adjustment value of the knowledge item according to the feedback type in the feedback record; The weight updating module is used to add the weight adjustment value to the original weight value of the corresponding entry in the knowledge base to update the original weight value.
[0111] In one embodiment, the present application provides an electronic device, which may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a retrieval method for a tax knowledge question and answer system is implemented.
[0112] Those skilled in the art will understand that Fig. 9The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0113] In one embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0114] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the above-mentioned computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0115] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.
Claims
1. A retrieval method for a tax knowledge question-answering system, characterized in that: The steps include: Receive tax query statements input by users; Performing word segmentation and part-of-speech tagging on the query sentence to obtain a word segmentation sequence with part-of-speech tags; Based on the word segmentation sequence, using a pre-built tax professional dictionary to identify and mark the tax professional terms therein, and generating a target sequence marked with tax terminology; Based on the target sequence, extracting tax elements using preset tax element identification rules; A query vector is constructed based on the extracted tax elements, and retrieval matching is performed in the tax knowledge base.
2. The retrieval method for the tax knowledge question and answer system according to claim 1, characterized in that: Perform word segmentation and part-of-speech tagging on the query sentence to obtain a word segmentation sequence with part-of-speech tagging, which specifically includes the following steps: Use the word segmenter to perform preliminary word segmentation on the query statement to obtain an initial word segmentation sequence; Matching the initial word segmentation sequence with a preset tax abbreviation comparison table to identify tax professional abbreviations; According to the tax abbreviation comparison table, the identified tax professional abbreviations are replaced with corresponding standard terms to obtain a standardized word segmentation sequence; Part-of-speech tagging is performed on the standardized word segmentation sequence to obtain a word segmentation sequence with part-of-speech tagging.
3. The retrieval method for the tax knowledge question and answer system according to claim 1, characterized in that: Based on the word segmentation sequence, the tax professional terms therein are identified and marked using a pre-built tax professional dictionary to generate a target sequence marked with tax terminology, which specifically includes the following steps: Matching the continuous phrases in the word segmentation sequence with the tax professional dictionary, identifying standard tax professional terms, and obtaining a preliminary tag sequence; For the unrecognized phrases in the preliminary tag sequence, calculating the character similarity with each term in the tax professional dictionary to obtain a similarity result set; Filter out phrases with similarity higher than a preset threshold and corresponding standard tax terminology from the similarity result set to obtain a fuzzy matching sequence; The preliminary tag sequence and the fuzzy matching sequence are merged to generate a target sequence with tax term tags.
4. The retrieval method for the tax knowledge question and answer system according to claim 1, characterized in that: Based on the target sequence, the tax elements are extracted using the preset tax element identification rules, which specifically includes the following steps: Matching the target sequence with a preset associated word table, identifying the associated words and their positions in the sequence, and obtaining an associated word position sequence; According to the associated word position sequence, the target sequence is divided into a plurality of subsequences to obtain a subsequence set; Using a preset tax element identification rule, respectively extract tax elements from the subsequence set to obtain a preliminary element set; According to the semantic types of the associated words in the associated word position sequence, the logical relationships between the elements in the preliminary element set are marked to generate a complete element set including the elements and the associated relationships.
5. The retrieval method for the tax knowledge question and answer system according to claim 1, characterized in that: After performing search and matching in the tax knowledge base, the following steps are also included: Combine the retrieved candidate knowledge list with the user's original query sentence to construct an input prompt; The input prompt is passed into the large language model to obtain the relevance analysis result of each candidate knowledge; Based on the correlation analysis result, extracting the correlation score of each candidate knowledge; Reorder the candidate knowledge according to the relevance scores to generate a result list; Determine whether the highest score in the result list exceeds the preset threshold. If so, return the corresponding knowledge as a response.
6. The retrieval method for the tax knowledge question and answer system according to claim 5, characterized in that: When the highest score in the result list does not exceed the preset threshold, the following steps are also included: Extracting knowledge items with a relevance score not lower than a preset recommendation threshold from the result list to generate a candidate recommendation set; Sorting each knowledge item in the candidate recommendation set in descending order according to the relevance score to generate an ordered recommendation list; The ordered recommendation list is formatted into a user-readable recommendation interface and returned.
7. The retrieval method for the tax knowledge question and answer system according to claim 5, characterized in that: After returning the corresponding knowledge as a reply, the following steps are also included: Generate an interaction record containing user query, returned knowledge ID, and return time, and assign a unique identifier; Based on the identifier corresponding to the interaction record, receiving and recording the user's feedback information, and generating a feedback record; Calculating a weight adjustment value of the knowledge item according to the feedback type in the feedback record; The weight adjustment value is added to the original weight value of the corresponding entry in the knowledge base to update the original weight value.
8. A retrieval system for a tax knowledge question-answering system, characterized in that: include: A receiving module, used for receiving a tax query statement input by a user; A word segmentation and tagging module, used to perform word segmentation and part-of-speech tagging on the query sentence to obtain a word segmentation sequence with part-of-speech tagging; A term tagging module is used to identify and tag the tax terminology therein based on the word segmentation sequence using a pre-built tax terminology dictionary to generate a target sequence with tax term tags; An element extraction module, used to extract tax elements based on the target sequence using preset tax element identification rules; The retrieval and matching module is used to construct a query vector based on the extracted tax elements and perform retrieval and matching in the tax knowledge base.
9. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the retrieval method for a tax knowledge question-and-answer system described in any one of claims 1 to 7 are implemented. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the retrieval method for a tax knowledge question and answer system described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Architectural design element question answering method and system based on large language model technology
CN120892534A
Problem processing method, device and equipment
CN122220481A