Intelligent question answering method for tax questions, electronic equipment and storage medium

Through the combination of vectorized models and vector libraries, the Q&A prompt text matching the tax question is selected and the big model is questioned and answered, which solves the problem of insufficient accuracy of Q&A in the tax field in the existing technology, and achieves higher Q&A accuracy and user experience.

CN120045675APending Publication Date: 2025-05-27TANGSHAN QIAO TECH LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510141633.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-08
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The existing big models are not accurate enough when answering questions in specific areas such as taxation.

Method used

By obtaining the features of the tax problem entered by the user, using the vectorized model to obtain the feature vector, obtain multiple candidate vectors corresponding to the feature from the vector library through index, filter out the target vector matching the feature vector and its associated Q&A prompt text, and use the tax problem and target Q&A prompt text to perform Q&A on the big model.

Benefits of technology

Improves the accuracy of Q&A in the tax field, provides more professional, accurate and personalized answers, reduces maintenance costs and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045675A_ABST
    Figure CN120045675A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent question answering method for tax questions, electronic equipment and a storage medium. The method comprises the following steps: acquiring characteristics of a tax problem input by a user; utilizing a vectorization model to obtain feature vectors of the features; a plurality of candidate vectors corresponding to the features are obtained from a vector library through indexes, and all the candidate vectors in the vector library are associated with corresponding question and answer prompt texts; obtaining a target vector matched with the feature vector from the plurality of candidate vectors; obtaining a target question and answer prompt text associated with the target vector; and performing question and answer on a large model by utilizing the tax question and the target question and answer prompt text. According to the method, the tax question and the target question and answer prompt text are utilized to perform question and answer on the large model, so that the accuracy of the output result of the large model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and more specifically, to an intelligent question-answering method, electronic device, and storage medium for tax issues. Background Art

[0002] With the continuous development of artificial intelligence related technologies, intelligent question and answer has been widely used in many fields. In the intelligent question and answer process, the questions entered by users are input into large models such as GPT and Wenxinyiyan, so as to obtain the output results of the large models for the questions, and multiple users respond with the output results. However, since the current large models are usually general-purpose large models, when answering questions in specific fields such as taxation, their output results often have the problem of insufficient accuracy. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide an intelligent question-and-answer method, electronic device, and storage medium for tax issues, which are used to solve the problem that when answering questions in specific areas such as taxation, the output results often lack accuracy.

[0004] This application provides an intelligent question-answering method for tax issues, including:

[0005] Obtaining characteristics of the tax question entered by the user;

[0006] Using the vectorization model to obtain the feature vector of the feature;

[0007] Obtain multiple candidate vectors corresponding to the features from the vector library through the index, wherein each candidate vector in the vector library is associated with a corresponding question and answer prompt text;

[0008] Obtain a target vector that matches the feature vector from multiple candidate vectors;

[0009] Get the target question and answer prompt text associated with the target vector;

[0010] Question and answer large models using tax questions and targeted question and answer prompt text.

[0011] In one embodiment, using a vectorization model to obtain a feature vector of a feature specifically includes: using a BGE-M3 vectorization model to obtain a feature vector of a feature.

[0012] In one embodiment, the BGE-M3 vectorization model is used to obtain a feature vector of a feature, including:

[0013] A dense encoding workflow is used to obtain the initial vector corresponding to the feature;

[0014] The main features of the initial vector are extracted through the linear layer to obtain the feature vector.

[0015] In one embodiment, obtaining the features of the tax problem input by the user includes: splitting the input tax problem and parsing to obtain a plurality of features;

[0016] A dense encoding workflow is used to obtain the initial vector corresponding to the feature, including:

[0017] Multiple features are input into the encoding matrix for dense encoding to obtain multiple corresponding vectors;

[0018] The detailed features of multiple corresponding vectors are supplemented through a multi-layer neural network to form an initial vector;

[0019] Decode the output initial vector.

[0020] In one embodiment, the detailed features of multiple corresponding vectors are supplemented by a multi-layer neural network to form an initial vector, including:

[0021] Using a forward feed neural network to extract common features from multiple corresponding vectors to form multiple common feature vectors;

[0022] The self-attention neural network is used to extract special features from multiple general feature vectors to form an initial vector.

[0023] In one embodiment, the self-attention neural network includes a network convolution layer and a recurrent layer, and uses the self-attention neural network to extract special features from multiple general feature vectors to form an initial vector, including:

[0024] The convolutional layer is used to extract the special features of multiple general feature vectors, capture the short-range context information of multiple general feature vectors, and form multiple special feature vectors;

[0025] The recurrent layer is used to extract the temporal features of multiple special feature vectors, capture the long-distance contextual information of multiple special feature vectors, and form an initial vector.

[0026] In one embodiment, before the input tax problem is split and parsed to obtain multiple features, the following is further included:

[0027] Initialize the input tax problem; the initialization process is used to accelerate the convergence of the neural network;

[0028] LeakyReLU is used to avoid the occurrence of local optimal situations caused by accelerated convergence.

[0029] In one embodiment, obtaining multiple candidate vectors corresponding to the feature from the vector library through the index specifically includes:

[0030] According to the feature vector of the tax problem, the Lucene search engine is used to obtain feature vectors of similar problems of the tax problem in the vector library as candidate vectors.

[0031] In one embodiment, obtaining a target vector matching the feature vector from the multiple vectors specifically includes:

[0032] According to the similarities between the feature vector and multiple candidate vectors, a target vector is obtained, wherein the target vector is specifically a candidate vector among multiple candidate vectors whose similarity with the feature vector is greater than a preset threshold, or N candidate vectors among multiple candidate vectors whose similarity with the feature vector is the largest, and N is a positive integer greater than or equal to 1.

[0033] In one embodiment, the tax question and the target question and answer prompt text are used to ask and answer questions for the large model, specifically including:

[0034] Renders tax questions and target question and answer prompt text as prompts;

[0035] Input prompts into the large model to get output results from the large model.

[0036] In one embodiment, the method further comprises:

[0037] Optimize the output results;

[0038] Respond to the user with optimized output results.

[0039] In one embodiment, the method further includes: pre-establishing a vector library and an index through the corpus.

[0040] In one embodiment, pre-establishing a vector library and an index using corpus includes:

[0041] Standardize the original text to obtain the word frequency text;

[0042] Convert word frequency text into word frequency vectors and build a vector library;

[0043] Use inverted indexing.

[0044] In one embodiment, the present application further provides an electronic device, including:

[0045] Memory for storing computer programs;

[0046] A processor is used to execute a method as described in any one of the above embodiments.

[0047] In one embodiment, the present application further provides a storage medium, including: a program, which, when executed on an electronic device, enables the electronic device to execute a method as described in any one of the above embodiments.

[0048] The method provided in the embodiment of the present application is adopted: the features of the tax questions input by the user are obtained; the feature vectors of the features are obtained using a vectorization model; through feature vector matching, target vector screening and field-specific prompt texts, the system can provide more professional, accurate and personalized answers in the tax field, while reducing maintenance costs and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0050] Figure 1 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;

[0051] Figure 2 A schematic diagram of a specific process of the intelligent question-answering method for tax issues provided in one embodiment of the present application;

[0052] Figure 3 A schematic diagram of the steps of obtaining feature vectors using the BGE-M3 vectorization model provided in one embodiment of the present application;

[0053] Figure 4 A schematic diagram of a specific flow chart of step S31 provided in an embodiment of the present application;

[0054] Figure 5 A schematic diagram of a specific flow chart of step S42 provided in an embodiment of the present application;

[0055] Figure 6 A schematic diagram of the steps of establishing the vector library and the index provided in an embodiment of the present application;

[0056] Figure 7 Schematic diagram of an intelligent question-answering device. DETAILED DESCRIPTION

[0057] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. In the description of the present application, terms such as "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance or sequence.

[0058] As mentioned above, since current big models are usually general-purpose big models, their output results often lack accuracy when answering questions in specific areas such as taxation.

[0059] In view of this, the embodiments of the present application provide a method, device, electronic device and storage medium for intelligent question answering of tax issues, which can be used to solve this technical problem. Figure 1 FIG. 1 is a schematic diagram of a specific structure of an electronic device provided in this embodiment. The electronic device 1 includes: at least one processor 11 and a memory 12. Figure 1 A processor is used as an example. The processor 11 and the memory 12 may be connected via a bus 10, and the memory 12 stores instructions that can be executed by the processor 11, and the instructions are executed by the processor 11, so that the electronic device 1 can execute all or part of the process of the method in the embodiment of the present application.

[0060] The electronic device 1 may be a client electronic device, such as a user's mobile phone, computer, etc. The electronic device 1 may also be a server electronic device, such as a server node, etc.

[0061] like Figure 2 The figure shows a specific flow chart of the intelligent question-answering method for tax issues provided in the embodiment of the present application. The method can be Figure 1 The method is performed by the electronic device 1 shown in the figure, and comprises the following steps:

[0062] Step S21: Obtain the characteristics of the tax question input by the user.

[0063] In actual applications, users can usually input tax issues through a client on a client electronic device. For example, the client electronic device can be a mobile phone, computer, tablet computer, etc. used by the user. At this time, if the customer needs to ask questions about tax issues, the tax issue can be input through the client so that the server can receive the tax issue.

[0064] In actual applications, since the server is usually connected to multiple clients, different users can send tax issues to the server through these clients. Therefore, the server may receive tax issues sent by multiple clients in a short period of time, which will cause computing pressure on the server. To address this problem, in actual applications, a message queue can usually be pre-set on the server, so that the tax issues sent by each client can be added to the message queue in chronological order, and then the server can obtain the corresponding tax issues from the message queue in sequence according to its own load.

[0065] After obtaining the tax issue, as for the specific method of obtaining the characteristics of the tax issue in step S21, in actual application, the characteristics of the tax issue can be obtained through keyword matching. For example, a keyword table can be set in advance, and then the keywords in the keyword table can be used to perform keyword matching on the tax issue.

[0066] Step S22: using the vectorization model to obtain the feature vector of the feature.

[0067] The vectorization model in step S22 may be a BGE-M3 vectorization model, that is, the BGE-M3 vectorization model may be used to obtain the feature vector of the feature. Of course, the vectorization model may also be other types of vectorization models.

[0068] Among them, the BGE-M3 vectorization model (i.e. BGE M3-Embedding) comes from BAAI and the University of Science and Technology of China. It is an open source model of BAAI. The model performs well in multi-linguality, multi-functionality and multi-granularity, and can support more than 100 working languages.

[0069] Step S23: multiple candidate vectors corresponding to the feature are obtained from the vector library through indexing. Based on the feature vector of the tax question input by the user, the Lucene search engine is used to obtain multiple feature vectors of similar questions to the tax question input by the user in the vector library as candidate vectors; each candidate vector is associated with a corresponding question and answer prompt text; wherein, the Lucene search engine is an open source library for full-text retrieval and search, supported and provided by the Apache Software Foundation.

[0070] Step S24: Obtain a target vector that matches the feature vector from multiple candidate vectors.

[0071] The specific implementation method of step S24 may be, for example, obtaining the target vector based on the similarities between the feature vector and the multiple candidate vectors, wherein the target vector is specifically a vector among the multiple candidate vectors whose similarity with the feature vector is greater than a preset threshold, or N vectors among the multiple candidate vectors whose similarity with the feature vector is the largest, and N is a positive integer greater than or equal to 1.

[0072] Step S25: Obtain the target question and answer prompt text associated with the target vector.

[0073] Step S26: Use tax questions and target question and answer prompt text to ask and answer questions for the large model.

[0074] The specific implementation method of step S26 may be, for example, rendering the tax question and the target question and answer prompt text as a prompt, and inputting the prompt into the big model to obtain the output result of the big model.

[0075] After obtaining the output results of the large model, one way of processing may be to directly use the output results to respond to the user. However, considering that the output results may have problems with language expression and accuracy, in practical applications, the output results can also be optimized first, such as optimizing the language expression of the output results to make it easier for users to read, and then use the optimized output results to respond to the user.

[0076] The above method provided by the present application is adopted, and the method includes: obtaining the features of the tax questions input by the user, and obtaining the feature vector of the features by using the vectorization model; obtaining multiple vectors corresponding to the features from the vector library by indexing, wherein each vector in the vector library is respectively associated with a corresponding question and answer prompt text, obtaining a target vector matching the feature vector from the multiple vectors, and obtaining a target question and answer prompt text associated with the target vector; and using the tax questions and the target question and answer prompt text to ask and answer questions to the large model. Since the method uses the tax questions and the target question and answer prompt text to ask and answer questions to the large model, the accuracy of the results output by the large model can be improved.

[0077] Among them, in step S22, obtaining the feature vector of the feature by using the vectorization model may specifically include: obtaining the feature vector of the feature by using the BGE-M3 vectorization model. BGE-M3 can capture the importance of each token through a more sophisticated method. Unlike BERT, BERT only focuses on the first token ([CLS]) when classifying or comparing similarities between tokens, while BGE-M3 expands the focus to each token in the sequence. This means that BGE-M3 not only relies on the representation of the [CLS] token, but also evaluates the contextual embedding of each token in the sequence; wherein the token here refers to each word or symbol in the input text, and [CLS] indicates the beginning of a sentence.

[0078] in, Figure 3 A schematic diagram of the steps of obtaining feature vectors using the BGE-M3 vectorization model provided in an embodiment of the present application; Figure 1-3 As shown, obtaining the feature vector using the BGE-M3 vectorization model specifically includes: steps S31 and S32.

[0079] Step S31: using a dense encoding workflow to obtain an initial vector corresponding to the feature; wherein dense encoding (dense embedding) is a method of converting discrete input features (such as words, category labels, etc.) into a real number vector representation of a fixed length.

[0080] Wherein, obtaining the features of the tax question input by the user further includes: splitting the input tax question and parsing to obtain a plurality of the features; for example, inputting the question: "Milvus is a vector database built for scalable similarity search", splitting and parsing the question can obtain the corresponding token sequence: ['[CLS]', 'mil', '##vus', 'is', 'a', 'vector', 'database', 'built', 'for', 'scala', '##ble', 'similarity', 'search', '[SEP]']; [CLS] indicates the beginning of a sentence, and [SEP] indicates the end of a sentence.

[0081] Figure 4 A specific flow chart of step S31 provided in an embodiment of the present application; Figure 1-4 As shown, after the features of the tax problem are obtained through this step, the initial vector corresponding to the features is obtained by step S31. Step S31 includes: steps S41 to S43.

[0082] Step S41: Input the multiple features into the encoding matrix for dense encoding to obtain multiple corresponding vectors, specifically including: dense encoding through Embedding, Embedding uses an embedding matrix to map each token (such as a word, character or) obtained in the above steps to a vector in a low-dimensional continuous space, each token has a corresponding vector representation, and these corresponding vectors capture the semantic information of the token.

[0083] Step S42: supplementing the detailed features of the plurality of corresponding vectors through a multi-layer neural network to form the initial vector; specifically comprising: supplementing the detailed features of the corresponding vectors through Encoding, wherein Encoding passes these corresponding vectors through a multi-layer encoder to refine the representation of each token according to the context provided by all other tokens.

[0084] Figure 5 A specific flow chart of step S42 provided in an embodiment of the present application; Figure 1-5As shown, each layer of encoder is composed of a self-attention and feed-forward neural network, and the specific steps include: step S51-step S52.

[0085] Step S51: Use a feed-forward neural network to extract common features from the multiple corresponding vectors to form multiple common feature vectors; the feed-forward neural network gradually extracts the common features of each vector by transmitting information layer by layer. The common features refer to the basic characteristics or common information that can be captured between multiple corresponding vectors.

[0086] Step S52: Use the self-attention neural network to extract special features from the plurality of general feature vectors to form the initial vector. The core idea of ​​self-attention is to let each element in the sequence pay attention to other elements in the sequence, so as to capture the long-distance dependencies within the sequence. The self-attention mechanism can focus on the important parts of the basic characteristics or common information data in each general feature, and weight these parts to extract special features. Special features refer to more detailed and specific features in the basic characteristics or common information data of each general feature, such as the unique or more prominent features of a general feature relative to other general features.

[0087] The corresponding vectors processed by the multi-layer encoder are the initial vectors. These initial vectors contain the special features of the corresponding vectors and can be used for subsequent tasks.

[0088] Among them, the self-attention neural network includes a network convolution layer and a loop layer; the convolution layer is used to extract the special features of multiple common feature vectors, capture the short-range context information of multiple common feature vectors, such as the local grammatical structure in the text or the short-term dependency in the time series data, and form multiple special feature vectors; the loop layer is used to extract the time series features of multiple special feature vectors, capture the long-range context information of multiple special feature vectors, and form the initial vector; the output of the loop layer at each time step depends not only on the current input, but also on the output of the previous time step, thereby forming a "memory" for processing time series data with long-term dependencies; the time step refers to each time point in the data or each individual element in the sequence. By setting the loop layer, the tax issues sent by the client can be sorted in the message queue according to the order of time.

[0089] Step S43: decoding and outputting the initial vector, specifically comprising: using Output to output the initial vector, wherein the initial vector is an embedding vector, which is a vector representation of mapping high-dimensional data into a low-dimensional space.

[0090] Step S32: Calculate the importance weight of each token through a linear layer; the importance weight of a token represents the relative importance of the token in the current context, that is, the linear layer multiplies the hidden state of the token (H[i]) by the weight matrix (W_{lex}), and then obtains the term weight (w_{t}) of each token by applying the LeakyReLU (rectified linear unit with leakage) activation function. Using LeakyReLU ensures that the term weight is non-negative, which helps to enhance the sparsity of the vector.

[0091] Among them, Figure 1-3 As shown, before the input tax issue is split and parsed to obtain the features in step S31, the following is also included:

[0092] Step S30: Initialize the input tax problem; initialization includes: segmenting the input problem, extracting keywords, etc.; used to accelerate the convergence of the neural network; accelerating convergence is to speed up the search, but accelerating convergence will lead to local optimal situations. Local optimality means that the parameters stagnate in certain areas and cannot jump out of these local optimal points, resulting in the inability to find the global optimal solution (i.e., the best parameter configuration that minimizes the loss function). The gradient is usually zero at the local optimal solution. When the gradient is zero, the parameters cannot be updated, and thus stagnate at the local optimal solution or saddle point. The gradient is a guiding signal for the optimization algorithm when training a deep learning model, which is used to guide the update direction of the model parameters.

[0093] At this time, LeakyReLU is used to avoid the occurrence of local optimal situations caused by accelerated convergence. LeakyReLU (Leaky Rectified Linear Unit) is an activation function that provides a small slope when a negative value is input, so that the negative part has a non-zero output and the gradient does not disappear in the negative interval. This helps to transmit information and update weights more efficiently and reduce the "stagnation" phenomenon in training.

[0094] Figure 6 A schematic diagram of the steps of establishing the vector library and the index provided in an embodiment of the present application; Figure 1-6 As shown, before executing step S23: obtaining multiple vectors corresponding to the feature from the vector library through the index, it also includes: pre-establishing the vector library and the index through the corpus;

[0095] Step S61: Standardize the original text to obtain a word frequency text; herein, standardizing the original text means removing punctuation marks, stop words, and non-alphabetic characters from the original text, and performing word segmentation according to a professional thesaurus, etc.; after standardization, count the occurrence frequency (i.e., word frequency) of each word in the text to obtain a word frequency text.

[0096] Step S62: Convert the word frequency text into a word frequency vector and establish the vector library; convert each word frequency text into a corresponding word frequency vector, where each word frequency vector represents the position of the word frequency text in space, and store these word frequency vectors in a library to form a vector library. Subsequently, a hash table can be used to query, update, or perform other processing on this vector library.

[0097] Step S63: Use the inverted index method to traverse all documents for searching; herein, an inverted index means mapping each word frequency text to a corresponding document list, filtering stop words using a word frequency threshold, and establishing a high-density index mode for high-frequency words and professional words; perform the query operation in an inverted order.

[0098] Among them, stop words refer to words that appear frequently in the text but contribute less to semantic analysis, such as "of", "is", etc. For these words, they can usually be filtered when constructing the inverted index to avoid occupying storage space and increasing the computational complexity of retrieval; word frequency threshold filtering means: calculate the frequency of occurrence of each word frequency. If the frequency of occurrence of a certain word frequency is higher than a certain threshold, it is considered a stop word and removed from the index. For example: if the frequency of occurrence of a certain word frequency exceeds a certain percentage (such as 70%) of the total number of documents, then this word can be considered a stop word and filtered; high-frequency words refer to common words in the document list; professional words refer to words specific to a particular field, which may be rarely seen in general documents but are crucial in a specific field. In this case, special attention needs to be paid to their indexing; high-density indexing means preprocessing and optimizing the document list where these high-frequency words or professional words are located, and being able to store them in multiple forms, storing the data in a compact in-memory sequence (such as a balanced tree structure like a B+ tree) to optimize disk I / O (Input / Output) operations, so that relevant documents can be located more quickly during query. Among them, a B+ tree (B-Plus Tree) is a special balanced tree data structure widely used in database systems and file systems, mainly for efficiently performing data insertion, deletion, search, and range query operations.

[0099] Based on the same inventive concept as the intelligent question-answering method for tax problems provided in the embodiments of the present application, the embodiments of the present application also provide an intelligent question-answering device for tax problems. If there are any unclear points, the corresponding content of the method embodiments can be referred to. Figure 7is a schematic diagram of an intelligent question-answering device, such as Figure 7 As shown, the device 700 includes: a first acquisition unit 701, a second acquisition unit 702, a third acquisition unit 703, a fourth acquisition unit 704, a fifth acquisition unit 705 and a question-answering unit 706, wherein:

[0100] A first acquisition unit 701 is used to acquire the characteristics of the tax problem input by the user;

[0101] A second acquisition unit 702 is used to acquire a feature vector of the feature using a vectorization model;

[0102] The third acquisition unit 703 is used to acquire multiple candidate vectors corresponding to the feature from the vector library through the index, wherein each vector in the vector library is respectively associated with a corresponding question and answer prompt text;

[0103] A fourth acquisition unit 704 is used to acquire a target vector matching the feature vector from the multiple candidate vectors;

[0104] A fifth acquisition unit 705 is used to acquire a target question and answer prompt text associated with the target vector;

[0105] The question-and-answer unit 706 is used to use the tax question and the target question-and-answer prompt text to conduct question-and-answer on the large model.

[0106] The device 700 provided in the embodiment of the present application is adopted. Since the device 700 adopts the same inventive concept as the method provided in the embodiment of the present application, on the premise that the method can solve the technical problem, the device 700 can also solve the technical problem, which will not be repeated here.

[0107] The device 700 may further include: an optimization response unit, configured to optimize the output result; and respond to the user using the optimized output result.

[0108] The device 700 may further include a building unit, configured to pre-build the vector library and the index through corpus.

[0109] The embodiment of the present invention further provides a storage medium, including: a program, which, when running on an electronic device, enables the electronic device to execute all or part of the process of the method in the above embodiment. The storage medium may be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD). The storage medium may also include a combination of the above types of memories.

[0110] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. An intelligent question-answering method for tax issues, characterized in that: The method comprises: Obtaining characteristics of the tax question entered by the user; Obtaining a feature vector of the feature using a vectorization model; Acquire multiple candidate vectors corresponding to the feature from a vector library through an index, wherein each candidate vector in the vector library is respectively associated with a corresponding question and answer prompt text; Acquire a target vector matching the feature vector from the plurality of candidate vectors; Obtaining a target question and answer prompt text associated with the target vector; The tax question and the target question and answer prompt text are used to conduct question and answer operations on the large model.

2. The method according to claim 1, characterized in that The method of using a vectorization model to obtain a feature vector of the feature specifically includes: using a BGE-M3 vectorization model to obtain a feature vector of the feature.

3. The method according to claim 2, characterized in that The using the BGE-M3 vectorization model to obtain the feature vector of the feature includes: Using a dense coding workflow to obtain an initial vector corresponding to the feature; The main features of the initial vector are extracted through a linear layer to obtain the feature vector.

4. The method according to claim 3, characterized in that The obtaining of the characteristics of the tax problem input by the user includes: splitting the input tax problem and parsing to obtain a plurality of the characteristics; The adopting of a dense coding workflow to obtain an initial vector corresponding to the feature includes: Inputting a plurality of the features into a coding matrix for dense coding to obtain a plurality of corresponding vectors; Supplement the detailed features of the plurality of corresponding vectors through a multi-layer neural network to form the initial vector; The decoding outputs the initial vector.

5. The method according to claim 4, characterized in that The method of supplementing the detailed features of the plurality of corresponding vectors by a multi-layer neural network to form the initial vector includes: Extracting common features from the plurality of corresponding vectors using a forward feed neural network to form a plurality of common feature vectors; A self-attention neural network is used to extract special features from the plurality of common feature vectors to form the initial vector.

6. The method according to claim 5, characterized in that The self-attention neural network includes a network convolution layer and a recurrent layer. The self-attention neural network is used to extract special features from the plurality of general feature vectors to form the initial vector, including: Extracting special features of the plurality of general feature vectors using a convolutional layer, capturing short-range context information of the plurality of general feature vectors, and forming a plurality of special feature vectors; The time series features of the plurality of special feature vectors are extracted by using a recurrent layer to capture the long-distance context information of the plurality of special feature vectors; and the initial vector is formed.

7. The method according to claim 4, characterized in that Before splitting the input tax issue and parsing to obtain a plurality of the features, the method further includes: Initializing the input tax problem; the initialization process is used to accelerate the convergence of the neural network; LeakyReLU is used to avoid the occurrence of local optimal situations caused by accelerated convergence.

8. The method according to claim 1, characterized in that The step of obtaining a plurality of candidate vectors corresponding to the feature from a vector library through an index specifically includes: According to the feature vector of the tax problem, the feature vectors of similar problems to the tax problem are obtained in the vector library using a Lucene search engine as the candidate vectors.

9. The method according to claim 1, characterized in that: Acquiring a target vector matching the feature vector from the multiple vectors specifically includes: The target vector is obtained according to the similarities between the feature vector and the multiple candidate vectors, wherein the target vector is specifically a candidate vector among the multiple candidate vectors whose similarity with the feature vector is greater than a preset threshold, or N candidate vectors among the multiple candidate vectors whose similarity with the feature vector is the largest, and N is a positive integer greater than or equal to 1.

10. The method according to claim 1, characterized in that Using the tax question and the target question and answer prompt text, the large model is asked and answered, including: rendering the tax question and the target question and answer prompt text as prompts; The prompt is input into the large model to obtain the output result of the large model.

11. The method according to claim 5, characterized in that The method further comprises: Optimizing the output result; The user is responded to using the optimized output result.

12. The method according to claim 1, characterized in that The method further includes: pre-establishing the vector library and the index through corpus.

13. The method according to claim 12, characterized in that The pre-establishing of the vector library and the index through the corpus includes: Standardize the original text to obtain the word frequency text; Convert the word frequency text into a word frequency vector and establish the vector library; Use inverted indexing.

14. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the method according to any one of claims 1 to 13.

15. A storage medium, characterized in that: The invention comprises: a program, which, when running on an electronic device, enables the electronic device to execute the method according to any one of claims 1 to 14.

Citation Information

Cited By

  • Traffic query method and device based on large model, and electronic equipment

    CN120892440A