Large model fine-tuning method and scene adaptation system for track domain knowledge base

Through the large model fine-tuning method of the track field knowledge base, combined with multi-modal speech recognition and graph neural network, the problem of high cost of large language model calling and output instability is solved, and the accuracy of the Text-to-SQL model is improved. and stability, achieving efficient query and operation of the database.

CN118606439BActive Publication Date: 2024-10-11NANJING HAOLIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411075693.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-10-11
Estimated Expiration
2044-08-07

AI Technical Summary

Technical Problem

In existing Text-to-SQL technology, the cost of calling large language models is high and the output is unstable. Traditional pre-question and answer classification errors may lead to errors in overall judgment and output instability.

Method used

Using the large model fine-tuning method of the track field knowledge base, through multi-stage error correction and post-processing, combined with multi-modal speech recognition and graph neural network, the number of word units is reduced, the error correction capability is enhanced, and the multi-head attention mechanism and automatic Adapt knowledge distillation method to improve model stability and accuracy.

Benefits of technology

It reduces the cost of relying on large language models, improves the accuracy of text data and the stability of the model, reduces the impact of pre-question and answer type classification errors on subsequent links, and enables efficient query and operation of the database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606439B_ABST
    Figure CN118606439B_ABST
Patent Text Reader

Abstract

The invention discloses a large model fine-tuning method and a scene adaptation system for a track domain knowledge base, the method comprising acquiring voice data, preprocessing the voice data, calling a preconfigured multimodal speech recognition model to convert the voice data into initial text data; constructing a track domain knowledge graph, performing multi-stage error correction processing on the initial text data, and obtaining error-corrected text data; post-processing the error-corrected text data to generate rewritten text data; acquiring historical conversation data, constructing a context representation, and forming model input data based on the context representation and the rewritten text data; constructing a Text‑to‑SQL model, training the Text‑to‑SQL model, generating an initial SQL query, optimizing the initial SQL query, and obtaining a final SQL query. The invention not only reduces the calling cost, but also improves the accuracy of the text data and the model, and enhances the stability of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of data management and discloses a large model fine-tuning method for a track field knowledge base and a scene adaptation system. Background Art

[0002] Text-to-SQL is a natural language processing technology that aims to convert natural language queries into database query languages, usually SQL (Structured Query Language). It builds a bridge between database queries and natural language understanding, allowing non-technical users to interact with databases in a natural language manner without having to understand complex query languages. In the past few years, Text-to-SQL technology has made great progress, thanks to the development of deep learning and natural language processing. Traditional methods usually rely on hand-designed rules and templates, while deep learning methods use neural network models to learn from a large amount of language-database pairing data, so that they can more accurately understand the intent of natural language queries and convert them into equivalent database query languages. With the development of language big models, relying on general language big models to do pre-input information in prompts has become a new trend in Text-to-SQL.

[0003] However, there are problems in actual use. The large language model is called through an interface. The cost of the call is related to the number of input tokens, and each call consumes a considerable cost. Traditional pre-question and answer type classification errors may be transmitted to subsequent links, resulting in overall judgment errors. In addition, the current large language model has defects such as output instability and the inability to guarantee system results. Summary of the invention

[0004] The purpose of the invention is to provide a large model fine-tuning method and a scene adaptation system for a track domain knowledge base to solve the above-mentioned problems existing in the prior art.

[0005] The technical solution is a large model fine-tuning method for the track domain knowledge base, which includes the following steps:

[0006] S1. Acquire speech data, preprocess the speech data, and call a preconfigured multimodal speech recognition model to convert the preprocessed speech data into initial text data;

[0007] S2. Construct a knowledge graph in the field of flight tracks, perform multi-stage error correction processing on the initial text data based on the knowledge graph in the field of flight tracks, and obtain the corrected text data; perform post-processing on the corrected text data, including digital recognition conversion and question structure rewriting, to generate rewritten text data;

[0008] S3, obtaining historical conversation data, constructing context representation based on the historical conversation data, and forming model input data based on the context representation and the rewritten text data;

[0009] S4. Build a Text-to-SQL model, and train the Text-to-SQL model based on the model input data to obtain a trained Text-to-SQL model;

[0010] S5. Use the trained Text-to-SQL model to generate an initial SQL query, optimize the initial SQL query, and obtain the final SQL query.

[0011] The scenario adaptation system of the track domain knowledge base includes:

[0012] at least one processor; and,

[0013] a memory communicatively connected to at least one of the processors; wherein,

[0014] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the large model fine-tuning method of the track domain knowledge base described in any of the above technical solutions.

[0015] Beneficial effects: The present invention reduces the number of words required for each call and the dependence on large language models through multi-stage error correction processing and post-processing, thereby reducing the call cost; enhances the error correction capability through multimodal fusion error recognition algorithm and graph neural network for contextual reasoning, reduces the impact of pre-question and answer type classification errors on subsequent links, and improves the accuracy of text data; enhances the stability and accuracy of the model by introducing multi-head attention mechanism, feedforward neural network and adaptive knowledge distillation method. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a flow chart of the present invention.

[0017] Figure 2 This is a flow chart of step S1 of the present invention.

[0018] Figure 3 This is a flow chart of step S2 of the present invention.

[0019] Figure 4 This is a flow chart of step S3 of the present invention.

[0020] Figure 5 This is a flow chart of step S4 of the present invention.

[0021] Figure 6 This is a flow chart of step S5 of the present invention.

[0022] Figure 7 is a flow chart of an embodiment of the present invention. DETAILED DESCRIPTION

[0023] like Figure 1 As shown, this application proposes a large model fine-tuning method for a track domain knowledge base, including the following steps:

[0024] S1. Acquire speech data, preprocess the speech data, and call a preconfigured multimodal speech recognition model to convert the preprocessed speech data into initial text data;

[0025] S2. Construct a knowledge graph in the field of flight tracks, perform multi-stage error correction processing on the initial text data based on the knowledge graph in the field of flight tracks, and obtain the corrected text data; perform post-processing on the corrected text data, including digital recognition conversion and question structure rewriting, to generate rewritten text data;

[0026] S3, obtaining historical conversation data, constructing context representation based on the historical conversation data, and forming model input data based on the context representation and the rewritten text data;

[0027] S4. Build a Text-to-SQL model, and train the Text-to-SQL model based on the model input data to obtain a trained Text-to-SQL model;

[0028] S5. Use the trained Text-to-SQL model to generate an initial SQL query, optimize the initial SQL query, and obtain the final SQL query.

[0029] In this embodiment, by acquiring and preprocessing voice data, and converting the voice data into initial text data using a multimodal speech recognition model, voice information can be effectively converted into text information, providing basic data support for subsequent processing. By constructing a track domain knowledge graph and performing multi-stage error correction processing on the initial text data based on the graph, the domain knowledge can be used to correct the text data and improve the accuracy and reliability of the data. Through post-processing steps such as digital recognition conversion and question structure rewriting, the quality of the text data is further optimized to make it more in line with actual application requirements. When forming model input data, the context information in the historical dialogue data is fully utilized to enhance the model's understanding and processing capabilities of the dialogue content and improve the accuracy and robustness of the model. A Text-to-SQL model is constructed and trained based on the model input data, so that the model can learn how to convert natural language queries into SQL queries, thereby achieving efficient query and operation of the database. The trained Text-to-SQL model can generate an initial SQL query, and through further optimization steps, the final SQL query is obtained.

[0030] This embodiment effectively improves the fine-tuning effect of the large model of the track domain knowledge base, which can not only improve the accuracy and reliability of the data, but also enhance the model's understanding and processing capabilities of the conversation content, and achieve efficient query and operation of the database, thereby providing strong technical support for practical applications.

[0031] like Figure 2 As shown, according to one aspect of the present application, step S1 is further:

[0032] S11, obtaining the user's voice data through a voice input device, and converting it into a digital audio signal, and obtaining a spectrum representation based on the digital audio signal by using a fast Fourier transform;

[0033] S12, performing noise reduction processing on the frequency spectrum representation, and converting the frequency spectrum representation after the noise reduction processing back to the time domain using an overlap-add method to obtain a noise-reduced audio signal;

[0034] S13, based on the denoised audio signal, using a speech segmentation algorithm to obtain independent speech segments;

[0035] S14. Input the independent speech fragment into a preconfigured multimodal speech recognition model to obtain a recognition result, and perform rule-based post-processing on the recognition result, including punctuation recovery, number and special symbol normalization, to generate initial text data.

[0036] According to another aspect of the present application, step S14 is further:

[0037] S141, extracting acoustic features of each independent speech segment, including logarithmic Mel filter bank energy features;

[0038] S142, determine whether there is available visual information, if not, proceed to step S143; if yes, extract lip reading features based on the visual information, use a multi-head attention mechanism to fuse the acoustic features and the lip reading features to obtain fused features;

[0039] S143, inputting the acoustic features or fusion features into a preconfigured multimodal speech recognition model, using a beam search algorithm to generate text hypotheses, calculating a language model score for each text hypothesis, and selecting a text hypothesis with a language model score higher than a preset threshold as a recognition result;

[0040] S144, restore punctuation marks, and normalize numbers and special symbols on the recognition results to generate initial text data.

[0041] In a specific embodiment, the voice data input by the user through the voice input device is subjected to noise suppression and voice segmentation processing, and then the processed voice data is converted into initial text data using a multimodal voice recognition model, specifically:

[0042] The user's voice data is obtained through the voice input device and converted into a digital audio signal. The digital audio signal is divided into audio segments of fixed length, and each segment overlaps by 50% to ensure continuity. Each audio segment is Fourier transformed to obtain its spectrum representation. Specifically: a high-precision microphone is used to collect the user's voice, and the analog signal is converted into a digital signal with a sampling rate of 48kHz and a bit depth of 24 bits; the digital audio signal is divided into 25 millisecond audio segments, and adjacent segments overlap by 12.5 milliseconds; a Hamming window function is applied to each audio segment, and then a 512-point fast Fourier transform (FFT) is performed to obtain the spectrum representation.

[0043] An adaptive noise suppression algorithm is applied to the obtained spectral representation. The background noise power spectrum is estimated, and the suppression strength is dynamically adjusted according to the estimated signal-to-noise ratio. The processed spectrum is converted back to the time domain to obtain the denoised audio signal. Specifically: the background noise power spectrum of each frequency band is estimated using the minimum statistics method, with a window size of 1 second and a step size of 100 milliseconds; the posterior signal-to-noise ratio of each time-frequency point is calculated, and the accuracy of the estimation is improved using the decision-oriented method; based on the calculated signal-to-noise ratio, the gain function is constructed using the Wiener filter to perform denoising on the original spectrum; the processed spectrum is converted back to the time domain using the overlap-add method to obtain the denoised audio signal.

[0044] A context-aware speech segmentation algorithm is applied to the obtained noise-reduced audio signal. Audio features are extracted using a sliding window, speech boundaries are identified through a deep neural network model, and the continuous speech stream is finally segmented into independent speech segments. Specifically: a 20-ms sliding window with a step size of 10 ms is used to extract Mel-frequency cepstral coefficient (MFCC) features. 13-dimensional MFCC features and their first-order and second-order differences are extracted for each frame to obtain a 39-dimensional feature vector; the extracted feature sequence is input into a pre-trained bidirectional long short-term memory network (Bi-LSTM), which contains 3 layers of Bi-LSTM, with 128 hidden units in each layer; the output of the Bi-LSTM passes through a fully connected layer and a Softmax layer to obtain the probability of each frame belonging to the beginning of speech, the end of speech, or a non-boundary; a dynamic programming algorithm is used to smooth the frame-level prediction results, determine the final speech boundary position, and segment the audio stream into independent speech segments based on the identified boundaries.

[0045] A multimodal speech recognition model is applied to each speech segment obtained. The model combines acoustic features and visual features (if available) to convert speech into text through a deep neural network. Finally, the recognition results are post-processed to generate the final initial text data. Specifically: extract the acoustic features of each speech segment, including the logarithmic Mel filter bank energy (FBANK) features, use a 25 millisecond window and a 10 millisecond step size to extract 80-dimensional FBANK features; if there is available visual information, extract lip reading features, use a pre-trained 3D convolutional neural network, extract features once every 25 frames (about 1 second) of video, and obtain a 2048-dimensional visual feature vector; use a multi-head attention mechanism to fuse acoustic features and visual features (if available), the attention layer contains 8 heads, each with a dimension of 64; input the fused features into the Transformer encoder-decoder architecture, the encoder and decoder each contain 12 layers, the model dimension is 512, and the feedforward network dimension is 2048; the decoder uses a beam search algorithm to generate text hypotheses, with the beam width set to 5, calculates the language model score for each hypothesis, and selects the hypothesis with the highest comprehensive score as the recognition result; apply rule-based post-processing to the recognition results, including punctuation recovery, number and special symbol normalization, and finally generate initial text data.

[0046] In another embodiment, voice data b input by a user through a voice input device a is obtained; an adaptive noise suppression algorithm is applied to the voice data b: the voice data b is converted into a time-frequency domain representation p1, i.e., an original spectrogram, using a short-time Fourier transform (STFT); a background noise power spectrum p2 is estimated and dynamically updated using a minimum statistics method; a posterior signal-to-noise ratio (SNR) of each time-frequency point is calculated. p3; based on the posterior signal-to-noise ratio p3, a gain function p4 is constructed using a Wiener filter; the gain function p4 is applied to the original spectrogram p1 to obtain an enhanced spectrogram p5; the enhanced spectrogram p5 is converted back to the time domain by an inverse short-time Fourier transform (ISTFT) to obtain the denoised speech data c; a context-aware speech segmentation algorithm is applied to the denoised speech data c, specifically: the speech data c is segmented into a fixed-length frame sequence q1 using a sliding window method; the Mel-frequency cepstral coefficient (MFCC) feature q2 is extracted for each frame; a bidirectional long short-term memory network (Bi-LSTM) is used to process the feature sequence q2 to obtain a context code q3; based on the context code q3, a conditional random field (CRF) model is used to predict the segmentation label q4 of each frame; according to the prediction result of the segmentation label q4, consecutive frames with the same label are merged to obtain the final speech fragment sequence d. Apply a multimodal speech recognition model (such as Whisper-large-v3 combined with visual information) to each speech segment to extract speech features r1 and corresponding visual features r2 (if any); use a multi-head attention mechanism to fuse speech features r1 and visual features r2 to obtain a multimodal representation r3; input the multimodal representation r3 into the Transformer encoder-decoder architecture to generate a text hypothesis r4; apply a transformer-based language model to correct and polish the text hypothesis r4 to obtain the final recognized text r5; concatenate the recognized texts of all speech segments in sequence to obtain the complete initial text data e.

[0047] This embodiment converts the speech signal into a spectrum representation through fast Fourier transform (FFT), then performs noise reduction on the spectrum, and uses the overlap-addition method to convert the noise-reduced spectrum back to the time domain, which effectively reduces the interference of background noise and improves the clarity and quality of the speech signal, thereby providing a better foundation for subsequent speech recognition; based on the noise-reduced audio signal, a speech segmentation algorithm is used to segment the continuous speech signal into independent speech segments, which helps to decompose long-term speech input into smaller and easier-to-process segments, thereby improving the efficiency and accuracy of speech recognition; the independent speech segments are input into a preconfigured multimodal speech recognition model, which not only utilizes acoustic features, but also can combine visual information (such as lip reading features) for recognition, through multi-modal speech recognition. The head attention mechanism fuses acoustic features and lip reading features to obtain more accurate fusion features, which can effectively improve the accuracy of speech recognition, especially in noisy environments or when the speech signal is unclear; in the speech recognition process, the beam search algorithm is used to generate multiple text hypotheses, and the language model score of each hypothesis is calculated. The text hypothesis with a language model score higher than the preset threshold is selected as the final recognition result, and the best one is selected from multiple candidate results, which improves the accuracy and reliability of the recognition result; the recognition results are post-processed based on rules, including punctuation recovery, number and special symbol normalization, which can make the generated text data more in line with the expression habits of natural language and improve the readability and practicality of the text data.

[0048] This embodiment effectively improves the accuracy and robustness of speech recognition by combining multiple technical means. The noise reduction processing and speech segmentation steps provide high-quality input signals for subsequent recognition; multimodal fusion and beam search algorithms improve the accuracy of recognition; and rule-based post-processing makes the generated text data more natural and standardized. In practical applications, this embodiment can improve the performance of the speech recognition system, especially in complex and noisy environments, and has important application value.

[0049] like Figure 3 As shown, according to one aspect of the present application, step S2 is further:

[0050] S21. Collect professional literature data, and based on the professional literature data, use graph embedding algorithm to learn entity and relationship vectors to build a knowledge graph in the field of track;

[0051] S22. Based on the initial text data and the track domain knowledge graph, a multi-head attention mechanism and a feedforward neural network are introduced to calculate the knowledge-enhanced word representation; the pre-trained general language model is fine-tuned using the knowledge-enhanced word representation to obtain a domain-adapted general language model;

[0052] S23. Based on the domain-adapted general language model and the initial text data, a multimodal fusion error recognition algorithm is used to generate a candidate error correction list. Based on the candidate error correction list, a graph neural network is used for context reasoning to obtain the corrected text data.

[0053] S24, performing digital recognition conversion and question structure rewriting on the error-corrected text data to generate rewritten text data.

[0054] According to one aspect of the present application, step S22 is further:

[0055] S221, use a word segmenter to segment the initial text data to obtain a word sequence, and input the word sequence into a pre-trained word vector model to obtain a word vector;

[0056] S222, based on the word sequence, retrieve relevant entities and relationship vectors in the track domain knowledge graph, and calculate the attention weight based on the word vectors, the retrieved entities and relationship vectors;

[0057] S223, based on the attention weight, weighted summing is performed on the retrieved entity and relationship vectors to obtain weighted knowledge graph information; the word vector is concatenated with the weighted knowledge graph information to obtain knowledge-enhanced word representation through a feedforward neural network;

[0058] S224. Fine-tune the pre-trained general language model using the knowledge-enhanced word representation to obtain a domain-adapted general language model.

[0059] In a specific embodiment, a knowledge graph in the field of flight tracks is constructed, and then the knowledge graph is used to enhance the general language model. The enhanced model is used to perform multi-stage error correction processing on the initial text data, including potential error identification, selection of the best error correction option, and dynamic strategy adjustment. The corrected text is post-processed, including digital recognition conversion and question structure rewriting, to generate rewritten text data. Specifically:

[0060] Construct a knowledge graph in the field of track, extract entity, relationship and attribute information from professional literature and databases, use graph embedding algorithm to learn vector representation of entities and relationships, and build a fast retrieval index. Specifically, extract text data from predefined professional literature and databases in the field of track, use named entity recognition (NER) model to identify entities, which is based on the bidirectional encoder representation and conditional random field (BERT-CRF) architecture and fine-tuned on track data; use dependency syntactic analysis and semantic role labeling technology to extract the relationship between entities, and construct the initial knowledge triple (head entity, relationship, The TransE graph embedding algorithm is applied to map entities and relations into a 300-dimensional vector space. Negative sampling technology is used during training. Five negative samples are generated for each positive sample. The Adam optimizer is used with a learning rate of 0.001 and 50 training cycles (epochs) are used. The Faiss library is used to build a vector index. The Hierarchical Navigable Small World (HNSW) algorithm is used to build a fast retrieval index. The index parameters are set to: M (the maximum number of outgoing edges for each node) = 16, efConstruction (the search depth when building the index) = 500.

[0061] Construct an attention mechanism based on the knowledge graph to enhance the general language model. Segment the initial text data into words, retrieve relevant entities and relationships in the knowledge graph index, calculate the attention weight, generate knowledge-enhanced word representations, and fine-tune the large model to obtain a domain-adapted model. Specifically: use the Jieba word segmenter to segment the initial text data to obtain word sequences. For each word, use the Faiss index to retrieve the top 5 related entities and relationships in the knowledge graph; construct a multi-head attention mechanism, which includes 8 attention heads, each with a dimension of 64, and use word vectors and retrieved entities and relationships. The vector is used as the query, key and value, and the attention weight is calculated; the original word vector is concatenated with the weighted knowledge graph information, and the knowledge-enhanced word representation is obtained through a feedforward neural network (two layers, hidden layer dimension 1024, ReLU activation); the knowledge-enhanced word representation is used as an additional input to fine-tune the pre-trained GPT-3 model (175 billion parameter version), using the Adam optimizer with a learning rate of 5e-5, and trained for 5 epochs on a dataset containing 100,000 track domain texts to obtain a domain adaptation model.

[0062] The domain adaptation model is used to perform multi-stage error correction on the initial text data, a multimodal fusion error recognition algorithm is applied to generate a candidate error correction list, a graph neural network is used for contextual reasoning, and the error correction strategy is dynamically adjusted through reinforcement learning. Specifically: a multimodal feature tensor is constructed, including word vectors, character-level embeddings, and phoneme-level embeddings. The word vectors are obtained using a pre-trained Word2Vec model (300 dimensions). The character-level embedding uses a bidirectional GRU network (hidden layer dimension 128) to process character sequences, and the phoneme-level embedding uses a 1D-CNN (3 convolutional layers, kernel sizes of 3, 4, and 5, and 64 filters per layer) to process phoneme sequences; a three-layer attention mechanism is applied: word level, character level, and phoneme level, and each layer uses multi-head attention (8 heads, each head dimension 64), followed by residual connection and layer normalization. The output of the three-layer attention is passed through a fusion layer (fully connected layer, dimension 512, ReLU activation) to obtain the final attention representation; the attention representation is used to train a Transformer-based error detector (6 layers, 8 attention heads, hidden layer dimension 512), which outputs an error probability for each word; for words whose error probability exceeds a threshold (set to 0.5), an LSTM-based sequence-to-sequence model is used to generate the Top-5 candidate corrections. Both the encoder and decoder are two-layer LSTM with a hidden layer dimension of 256. They use attention mechanism and beam search (width of 5). Graph Neural Network (GNN) is applied for contextual reasoning to construct a graph with words as nodes. Edges represent the relationship between words. The graph is processed using Graph Attention Network, which contains 3 layers of GAT, 4 attention heads in each layer, and an output dimension of 128. A reinforcement learning algorithm based on DDPG (Deep Deterministic Policy Gradient) is constructed to dynamically adjust the error correction strategy. The state is the current text representation, the action is the probability distribution of selecting candidate words, and the reward is based on the degree of reduction in the perplexity of the text after correction. Two networks are used: the Actor network (3 layers fully connected, hidden layer dimensions [512, 256, 128]) and the Critic network (4 layers fully connected, hidden layer dimensions [512, 256, 256, 128]) to output the corrected text.

[0063] Post-processing of the correction text, including conversion of digital recognition and rewriting of question structure, uses the conditional random field (CRF) model combined with domain knowledge for digital recognition, and applies the question structure rewriting algorithm based on the graph attention network to adjust the sentence structure. Specifically: Use character-level word segmentation to convert the correction text into a character sequence. Construct a feature vector for each character, including the one-hot encoding of the character itself, the Unicode category feature, the n-gram feature of the three characters before and after, and the context-sensitive character embedding (768 dimensions) generated by the BERT model; extract numerical-related attribute information from the knowledge graph and construct a numerical knowledge embedding matrix (dimension is [number of attributes, 128]). The attention mechanism is used to calculate the relevance of each character to numerical knowledge to obtain knowledge enhancement features; a three-layer CRF model is constructed: character level, word level and phrase level. Each layer of CRF uses a linear chain CRF. The feature function includes transfer features and state features. The L-BFGS algorithm is used to optimize the CRF parameters, and the maximum number of iterations is set to 100; the results of the three layers of CRF are fused through a weighted voting mechanism, and the weights are optimized on the validation set through grid search. The Viterbi algorithm is used to decode the final label sequence, and the recognized text and numbers are converted into Arabic numerals based on this sequence; the pre-trained neural network dependency parser (based on deep bidirectional LSTM and multi-layer perceptron) is used to process the converted text to obtain the initial dependency tree; a graph attention network for question structure rewriting is constructed, and the dependency tree and knowledge graph are encoded into a graph structure, which is processed using a bidirectional graph attention layer. Each attention layer contains 8 heads and an output dimension of 256. The attention results are fused through a fully connected layer (dimension 512, ReLU activation); a Transformer-based encoder-decoder structure is constructed to generate the rewritten dependency structure. The encoder and decoder each contain 6 layers, and a multi-head attention mechanism (8 heads) is used. The decoder combines a pointer network and a copy mechanism to better handle domain-specific vocabulary; a graph neural network (3-layer GraphSAGE, hidden layer dimension 128) is used to optimize the generated dependency structure, taking into account long-range dependencies and global structural information; the optimized dependency structure is converted back to a linear sequence, and an LSTM-based morphological generation model (2-layer bidirectional LSTM, hidden layer dimension 256) is used to ensure the correctness of word form changes, and a template matching algorithm is applied to adjust domain-specific expressions to generate the final rewritten text data.

[0064] In another embodiment, entity, relationship and attribute information s1 in the field of track is extracted from professional literature and databases; a graph embedding algorithm (such as TransE) is used to learn vector representations s2 of entities and relationships in the entity, relationship and attribute information s1; a fast retrieval index s3 is constructed based on the vector representation s2; and the entity, relationship and attribute information s1, the vector representation s2 and the fast retrieval index s3 are combined into a complete knowledge graph representation h.

[0065] Construct an attention mechanism i based on the knowledge graph h to enhance the general language large model j (such as GPT-4), specifically: segment the initial text data e into words to obtain the word sequence t1; for each word in the word sequence t1, retrieve the relevant entities and relationships in the knowledge graph index s3 to obtain the candidate set t2; use the attribute information in the entity, relationship and attribute information s1 to enrich the entity and relationship descriptions in the candidate set t2 to obtain the enhanced candidate set t3; calculate the attention weight t4 between the word sequence t1 and the enhanced candidate set t3, and generate the knowledge-enhanced word representation t5; use the knowledge-enhanced word representation t5 as an additional input to fine-tune the large model j to obtain the domain-adapted model k.

[0066] The domain adaptation model k is used to perform multi-stage error correction processing on the initial text data e, including applying the edit distance and phoneme similarity algorithms to identify potential errors and generate a candidate error correction list u1; using a contextual reasoning algorithm based on a graph neural network, considering the semantic relationships in the knowledge graph h, the best error correction option is selected from the candidate error correction list u1 to obtain a preliminary error correction text u2; using the attribute information in the entity, relationship and attribute information s1 to verify whether the professional terms in the preliminary error correction text u2 are used appropriately, and adjustments are made when necessary to obtain a verified text u3; applying a reinforcement learning mechanism to dynamically adjust the error correction strategy according to the quality of the error correction results and the domain knowledge in the entity, relationship and attribute information s1, further optimize the text u3, and obtain the final error correction text u4.

[0067] The correction text u4 is post-processed, including using the conditional random field (CRF) model to perform digital recognition in combination with the numerical attribute information in the entity, relationship and attribute information s1, converting the alphanumeric characters into Arabic numerals to obtain text v1; applying the question structure rewriting algorithm based on dependency syntactic analysis to process text v1, and adjusting the sentence structure with reference to the relationship information to obtain text v2; using semantic role labeling technology to analyze the semantic roles in text v2, combining entity and relationship information to optimize question understanding, and obtaining the final rewritten text v3.

[0068] In a further embodiment, a multimodal fusion error recognition algorithm is applied to generate a candidate error correction list u1, specifically: the input text e is segmented to obtain a word sequence w1 = [w1 1 , w1 2 , ..., w1 n ]; for each word w1 i Generate its International Phonetic Alphabet (IPA) representation p1 i ; Construct word vector sequence v1 = [v1 1 , v1 2 , ..., v1 n ], where v1 iIt is w1 i Pre-trained word vectors.

[0069] Construct a multimodal feature tensor: for each word w1 i , create the feature tensor f1 i = [v1 i ; e1 i ; a1 i ], where e1 i is word w1 i Character-level embedding of a1 i It is the International Phonetic Alphabet for p1 i Phoneme-level embedding; all feature tensors f1 i Splicing, get the sequence feature tensor F1 = [f1 1 ; f1 2 ; ...; f1 n ].

[0070] Apply hierarchical attention network: build a three-layer attention mechanism: word level, character level and phoneme level, where word level attention is: att w = SelfAttention(F1), where SelfAttention( ) represents the self-attention mechanism; character-level attention is: att c = CharLevelAttention(e1 1 , e1 2 , ..., e1 n ), where CharLevelAttention() represents the character-level attention mechanism; phoneme-level attention is: att p =PhonemeLevelAttention(a1 1 , a1 2 , ..., a1 n ), where PhonemeLevelAttention() represents the phoneme-level attention mechanism; the fused attention is: att fusion = FusionLayer([att w ; att c ; att p ]), where FusionLayer represents the fusion attention mechanism.

[0071] Use fusion attention att fusionAs input, train a Transformer-based error detector D, which outputs the error probability sequence prob = [p1, p2, ..., pn] for each word; for the word w1 whose probability exceeds the threshold th in the error probability sequence prob, i , apply the candidate generation network G, the candidate generation network G adopts an encoder-decoder structure, and the input is the feature tensor f1 i and its context information; the decoder of the candidate generation network G uses beam search to generate top-k candidate words c1 i = [c1 i1 , c1 i2 , ..., c1 ik ].

[0072] Construct a dynamic weight function W(x, y), taking into account the semantic similarity and phoneme similarity of sequence x and sequence y; define the dynamic edit distance:

[0073] DED(x,y)=min(DED(x[:-1],y)+W(x[-1],''), DED(x,y[:-1])+W('',y[-1]), DED(x[:-1],y[:-1])+W(x[-1],y[-1]))

[0074] For each candidate word c1 ij , calculate the edit distance DED(w1 i , c1 ij ), and get the distance matrix D1.

[0075] Generate context-sensitive word embeddings using pre-trained models such as BERT i ; Calculate word embedding e2 i With candidate word c1 ij The cosine similarity between the embeddings is obtained to obtain the similarity matrix S1; the phoneme sequence alignment algorithm A is constructed, considering the pronunciation characteristics and position information of the phonemes, for each pair (w1 i , c1 ij ), apply the phoneme sequence alignment algorithm A to calculate its phoneme similarity and obtain the similarity matrix P1; construct a feature fusion network F, with the input being [D1; S1; P1], and the output being the comprehensive score matrix M1 for each candidate word; sort the candidate list of each word based on the comprehensive score matrix M1 to obtain the final candidate error correction list u1.

[0076] This embodiment uses multimodal feature fusion to combine word vectors, character-level and phoneme-level information to comprehensively capture all aspects of a word; uses a hierarchical attention mechanism to capture important information at different levels and improve the accuracy of error detection; uses dynamic edit distance to consider semantic and phoneme information, which is more flexible and accurate than traditional edit distance; uses context awareness to capture deep context information using pre-trained models to improve the accuracy of error correction; uses a phoneme alignment algorithm to consider the pronunciation features and position information of phonemes to improve the accuracy of phoneme similarity calculation; and uses multi-feature fusion sorting to comprehensively consider similarities in multiple aspects to obtain a more accurate candidate sorting.

[0077] In a further embodiment, a conditional random field (CRF) model is used to perform digital recognition in combination with the numerical attribute information in the entity, relationship and attribute information s1, and the literal numbers are converted into Arabic numerals to obtain the text v1, specifically: using character-level segmentation, the error correction text u4 is converted into a character sequence C = [c1, c2, ..., cn]; a feature vector fi is constructed for each character ci: the one-hot encoding of the character itself; the unicode category feature of the character; the n-gram features of the three characters before and after. The pre-trained BERT model is used to generate a context-sensitive character embedding ei, and the feature vector fi and the character embedding ei are combined to obtain an enhanced feature vector gi = [fi; ei].

[0078] From the numerical attribute information s1 in the knowledge graph num Extract the numerical range, unit, frequency and other information from the , and construct the numerical knowledge embedding matrix K, where each row represents the embedding of a numerical attribute; use the attention mechanism to calculate the correlation between each character and the numerical knowledge embedding matrix K: ai = Attention(gi, K), and generate knowledge enhancement features: hi = [gi; ai].

[0079] Construct three levels of CRF layers: character level, word level, and phrase level. The character-level CRF uses the knowledge-enhanced features hi as input and outputs the character-level label sequence L1; the word-level CRF aggregates the knowledge-enhanced features hi of adjacent characters and outputs the word-level label sequence L2; the phrase-level CRF considers longer-range dependencies and outputs the phrase-level label sequence L3. Construct a weighted voting mechanism, combine the results of L1, L2, and L3, use a dynamic programming algorithm to resolve label conflicts, and obtain the final label sequence L.

[0080] Identify alphanumeric fragments based on the label sequence L, build context-aware numeric conversion rules, process complex expressions (such as "three thousand five" to "3500"), apply conversion rules, and convert alphanumeric to Arabic numerals. Use regular expressions to process special formats (such as date, time, percentage, etc.), combined with numerical attribute information s1 in the knowledge graph num The unit information in , the standardized numerical representation, and the output processed text v1.

[0081] In a further embodiment, the text v1 is processed by applying a question structure rewriting algorithm based on dependency syntactic analysis, and the sentence structure is adjusted with reference to the relationship information to obtain the text v2, which is specifically:

[0082] Use the pre-trained neural network dependency parser to process the text v1 and obtain the initial dependency tree T1; extract the relationship information s1 from the entity, relationship and attribute information s1 rel , construct a relational knowledge graph G, where nodes are entities and edges are relationships; use a graph embedding algorithm (such as TransE) to learn the embedding representation E of the relational knowledge graph G. Convert the initial dependency tree T1 to a graph structure G1 and construct a bidirectional graph attention layer: attention from G to G1: att1 = GraphAttention(G, G1); attention from G1 to G: att2 = GraphAttention(G1, G); fusion attention: att fusion = FusionLayer([att1;att2]), where GraphAttention represents the graph attention mechanism. Construct an encoder-decoder architecture based on Transformer, and the input of the encoder is [T1; att fusion ], the decoder uses a pointer network based on a copy mechanism to generate a rewritten dependency structure. The generated dependency structure is processed by a graph neural network (GNN), which considers the long-range dependencies between nodes and the global structural information, and outputs the optimized dependency structure T2.

[0083] Build a rule-based consistency checker to ensure the grammatical correctness of the dependency structure T2. If inconsistencies are found, use beam search to generate alternative structures and select the best candidate. Convert the optimized dependency structure T2 back to a linear sequence and apply a morphological generation model to ensure the correctness of word form changes (such as tense and number agreement). Use relationship information s1 rel , adjust domain-specific expressions, build a template matching algorithm, identify and normalize domain-specific phrases, and output the rewritten text v2.

[0084] This embodiment collects professional literature data, uses graph embedding algorithms to learn entity and relationship vectors, and constructs a knowledge graph for the track domain. It can effectively structure the professional knowledge in the field to form a systematic knowledge base, providing rich background knowledge support for subsequent text processing; by fine-tuning the pre-trained general language model, a general language model adapted to the field is obtained, which can integrate domain knowledge into word representation, making the language model more accurate and effective when processing domain-specific texts; by combining information from multiple modalities, a candidate error correction list is generated, which can more comprehensively identify errors in the text and improve the accuracy of error correction. The graph neural network can effectively capture the contextual relationship in the text, perform deep reasoning and error correction, and make the error correction result more consistent with semantic logic; the text data after error correction is converted to digital recognition and rewritten into question structure to generate rewritten text data, which can further optimize the expression of the text, making it more consistent with the expression habits of natural language, and improving the readability and practicality of the text.

[0085] This embodiment effectively improves the accuracy and robustness of text error correction and rewriting by combining methods such as knowledge graph, multimodal fusion and graph neural network. The construction of the knowledge graph provides rich background knowledge support for text processing; the knowledge-enhanced word representation and domain-adapted general language model improve the accuracy of text processing; the multimodal fusion error recognition and contextual reasoning algorithms improve the comprehensiveness and depth of error correction; the text rewriting step makes the generated text more natural and standardized. In practical applications, this embodiment can improve the performance of text processing systems, especially in professional fields and complex text environments.

[0086] like Figure 4 As shown, according to one aspect of the present application, step S3 is further:

[0087] S31. Obtain historical conversation data, use a graph attention network to capture long-term dependencies in the historical conversation data, and obtain the context vector of the historical conversation;

[0088] S32, based on the rewritten text data, using adaptive knowledge distillation method to generate knowledge-enhanced query vectors;

[0089] S33, obtaining database schema information and an external knowledge base, and performing multi-granularity knowledge fusion based on the database schema information, the external knowledge base, and a predefined domain ontology to obtain a unified knowledge representation vector;

[0090] S34, based on the context vector of historical dialogues, the knowledge-enhanced query vector and the unified knowledge representation vector, a context dynamic adjustment algorithm based on meta-learning is used to calculate the context representation;

[0091] S35. Concatenate the context representation with the rewritten text data to form a concatenation vector, obtain a model input vector based on the concatenation vector through a feedforward neural network, and package the model input vector and the rewritten text data to form model input data.

[0092] According to one aspect of the present application, step S32 is further:

[0093] S321, based on the rewritten text data, retrieve relevant knowledge in the pre-trained general language model, and based on the relevant knowledge, use the Top-k sampling method to generate a predetermined number of knowledge candidates;

[0094] S322, constructing a knowledge relevance scoring network, using the knowledge relevance scoring network to sort the knowledge candidates, obtaining a sorting result, and selecting a predetermined number of most relevant knowledge based on the sorting result;

[0095] S323, using the attention mechanism to calculate the alignment score between the most relevant knowledge and the rewritten text data, and based on the alignment score, performing weighted summation on the most relevant knowledge to obtain a distilled knowledge vector;

[0096] S324. Use a gating mechanism to fuse the distilled knowledge vector and the rewritten text data to generate a knowledge-enhanced query vector.

[0097] In a specific embodiment, the rewritten text data is received, the graph attention network is used to process the historical dialogue, adaptive knowledge distillation is implemented, multi-granularity knowledge fusion is performed, and a meta-learning-based context dynamic adjustment algorithm is applied to generate an optimized context representation, which is concatenated with the rewritten query text to form a complete model input data, in preparation for the subsequent Text-to-SQL conversion, specifically:

[0098] Receive the rewritten text data, retrieve historical conversations related to the current query from the conversation history database, calculate the similarity using the TF-IDF algorithm, and select the top 10 relevant historical conversations; represent each conversation turn as a node, build a conversation graph structure, and initialize the node features to encode the conversation content using the BERT model (base version, 768-dimensional output); define the connection relationship of the edges: establish bidirectional edges between adjacent turns, and establish unidirectional edges between non-adjacent turns of the same topic, and use keyword matching and cosine similarity (threshold 0.7) to determine the topic relevance; apply the graph attention network (GAT) to process the constructed conversation graph. GAT contains 3 layers, 8 attention heads in each layer, and the hidden layer dimension is 256. The output of each layer is added to the input through residual connection and layer normalization; use the global average pooling operation to aggregate the final representation of all nodes to obtain the context vector (dimension 256) of the historical conversation.

[0099] Use the rewritten text data as the query to retrieve relevant knowledge in a large-scale pre-trained model (such as GPT-3, 175 billion parameters), and use the Top-k sampling method to generate 50 knowledge candidates, each of which is no more than 100 words long; build a knowledge relevance scoring network, which includes a bidirectional LSTM (2 layers, hidden layer dimension 128) and a feedforward neural network (2 layers, hidden layer dimension [256, 128]), with the input being the concatenation of the query and the knowledge candidates, and the output being the relevance score; use the knowledge relevance scoring network to sort the 50 candidates, select the Top-5 most relevant knowledge, and use the attention mechanism (8 heads, each head with dimension 32) to calculate the alignment score with the query for these 5 knowledge items; based on the alignment score, weighted sum the representations of the 5 knowledge items to obtain a distilled knowledge vector (dimension 256), and use a gating mechanism to fuse the distilled knowledge vector and the original query representation to generate a knowledge-enhanced query vector.

[0100] Extract schema information such as table structure, fields, and foreign key relationships from the database, and use a pre-trained table-text joint embedding model (such as TAPAS) to generate an embedding vector (dimension 768) for each table and field; extract concepts and relationships from the pre-defined track domain ontology, and use the RDF2Vec algorithm to learn the embedding representation of each entity and relationship in the ontology (dimension 300); access external knowledge bases (such as Wikidata), retrieve entities and attributes related to the query, and use pre-trained knowledge graph embedding models (such as TransE) to obtain vector representations of entities and relationships (dimension 200); construct a multi-granularity attention fusion network, which includes three parallel multi-head attention layers (8 heads per layer, output dimension 256), which process the embedding of database schema, domain ontology, and external knowledge base respectively; use a gating mechanism to dynamically adjust the importance of the three knowledge sources. The gating network is a three-layer fully connected network with hidden layer dimensions [128, 64, 3], and outputs the weights of the three knowledge sources; according to the gating weights, the attention outputs of the three knowledge are weighted and summed to obtain a unified knowledge representation vector (dimension 256).

[0101] Construct a task adaptation network, which includes a bidirectional LSTM (2 layers, hidden layer dimension 128) and a feedforward neural network (2 layers, hidden layer dimension [256, 128]), with the input being the concatenation of the current query and context representation, and the output being the task-specific adaptation parameters; construct a meta-learner, using a model-agnostic meta-learning algorithm (such as MAML), the meta-learner includes a 4-layer fully connected network with hidden layer dimensions [512, 256, 256, 128]; use the output of the task adaptation network to initialize the parameters of the meta-learner, and perform 5-step gradient updates on a small-scale task dataset (containing 100 similar queries and their ideal context representations) with a learning rate of 0.01; use the updated meta-learner parameters to fine-tune the historical dialogue context vector, knowledge-enhanced query vector, and unified knowledge representation vector; add the original vector to the fine-tuned vector through a residual connection to obtain the final optimized context representation (dimension 768).

[0102] Concatenate the optimized context representation (dimension 768) with the BERT encoding of the rewritten query text (dimension 768); use a feedforward neural network (2 layers, hidden layer dimension [1024, 768], ReLU activation) to process the concatenated vector to obtain the final model input vector (dimension 768); package the final model input vector together with the original rewritten query text to form the complete model input data.

[0103] In another embodiment, a graph attention network (GAT) is used to process historical conversations, specifically: the historical conversations are represented as a graph structure w1, in which the nodes are conversation turns and the edges are the relationships between turns; GAT is applied to encode the graph structure w1 to obtain a conversation representation w2 that takes into account long-term dependencies; knowledge related to the current query rewritten text v3 is extracted from a large-scale pre-trained model to generate a knowledge candidate set x1; the attention mechanism is used to calculate the relevance score x2 between the knowledge candidate set x1 and the rewritten text v3, and the most relevant distilled knowledge x3 is selected; database schema information y1, domain ontology y2 and external knowledge base y3 are integrated; a graph fusion algorithm is used to merge y1, y2, y3 with the knowledge graph h and the distilled knowledge x3 to obtain a unified knowledge representation y4; a task-specific meta-learner z1 is dynamically generated based on the rewritten text v3 and the unified knowledge representation y4; the meta-learner z1 is used to fine-tune the conversation representation w2 to obtain a context representation z2 optimized for the current query; the optimized context representation z2 is concatenated with the rewritten text v3 to obtain complete model input data aa.

[0104] This embodiment captures long-term dependencies in historical dialogue data through a graph attention network (GAT), which can effectively extract context information in the dialogue, better understand the overall structure and semantic relationship of the dialogue, and thus improve the context understanding ability of the dialogue system; an adaptive knowledge distillation method is used to generate a knowledge-enhanced query vector, and useful information in an external knowledge base is integrated into the query vector, which can improve the expression ability of the query vector, so that it can more accurately reflect the user's intentions and needs, thereby improving the response quality of the dialogue system; by obtaining database schema information and an external knowledge base, and performing multi-granularity knowledge fusion based on a predefined domain ontology, a unified knowledge representation vector is obtained, which can effectively integrate knowledge from different sources, thereby improving the knowledge coverage and knowledge utilization efficiency of the dialogue system; a meta-learning-based context dynamic adjustment algorithm dynamically adjusts the context representation according to the context vector of the historical dialogue, the knowledge-enhanced query vector and the unified knowledge representation vector, which can improve the adaptability of the dialogue system, so that it can be flexibly adjusted according to different dialogue scenarios and user needs, thereby improving the response accuracy and user satisfaction of the dialogue system; context information and user input are effectively combined to improve the input quality and prediction performance of the model.

[0105] like Figure 5 As shown, according to one aspect of the present application, step S4 is further:

[0106] S41. Building the optimal model structure of the Text-to-SQL model through neural architecture search;

[0107] S42, based on the model input data, constructing a predetermined number of expert sub-models in the optimal model structure to form a hybrid expert system, and obtaining a Text-to-SQL model with a hybrid expert system;

[0108] S43, based on the model input data, adopts the data enhancement technology based on contrastive learning to generate high-quality pseudo-label data;

[0109] S44, based on the pseudo-label data and the model input data, adopting a progressive learning strategy to obtain training data organized by difficulty level;

[0110] S45. Use the training data to train the Text-to-SQL model with the hybrid expert system to obtain a trained Text-to-SQL model.

[0111] In a specific embodiment, the optimal model structure is constructed through neural architecture search, and then a hybrid expert system is developed to implement data enhancement based on contrastive learning, introduce a progressive learning strategy, and apply meta-optimization technology. These optimization technologies are used to train the model to obtain an optimized Text-to-SQL model, which is specifically:

[0112] Define the search space, including different layer types (such as self-attention layer, feedforward layer, convolutional layer), connection methods (such as residual connection, dense connection) and hyperparameter options (such as number of layers, number of hidden units), use categorical variables to represent layer types and connection methods, and continuous variables to represent hyperparameters; implement neural architecture search based on evolutionary algorithm, with the initial population size set to 100, and the top 20% of individuals in each generation selected as parents, and offspring generated through crossover and mutation, with the mutation probability set to 0.1 and the crossover probability set to 0.8; for each candidate architecture, build a small-scale Text-to-SQL model (with no more than 10M parameters), use a small data set constructed from 1,000 samples output by S3 for fast training (5 epochs) and evaluation, and the evaluation indicator is the exact match accuracy of SQL queries; run 50 generations of evolution, select the architecture with the best performance in the validation set in the final population as the basic model structure, serialize the selected architecture into a configuration file, and pass it to the subsequent steps for use.

[0113] Based on the selected optimal architecture, five expert sub-models are constructed for selection (SELECT), condition (WHERE), grouping (GROUP BY), sorting (ORDER BY) and connection (JOIN) operations. Each sub-model has the same basic structure, but the last layer is specialized to process a specific type of SQL component; a gating network is constructed, including a bidirectional LSTM (2 layers, hidden layer dimension 256) and a feedforward neural network (2 layers, hidden layer dimension [512, 5]), the input is the model input data, and the output is the weight distribution of the five expert sub-models; a soft gating mechanism is implemented, and the output of the gating network is normalized by the Softmax function to obtain the weight of each expert sub-model; each expert sub-model independently processes the input data and generates its own output. These outputs are weighted and summed according to the weight distribution to obtain the final mixed output; a fusion layer (2-layer feedforward network, hidden layer dimension [1024, 768]) is constructed to convert the mixed output into a unified representation.

[0114] Use the model input data as anchor samples. For each anchor sample, generate 5 positive samples through synonym replacement, syntactic transformation and other methods, and generate 5 negative samples by random replacement, deletion or addition of elements. Construct an encoder network for contrastive learning, using the optimal architecture as the basis, but removing the last classification layer. The encoder output dimension is set to 512; the Normalized Temperature-scaled Cross Entropy (NT-Xent) loss function is implemented with the temperature parameter set to 0.07. For each anchor sample, its similarity with the positive sample is maximized while its similarity with the negative sample is minimized; the encoder is trained for 50 epochs using the Adam optimizer (learning rate 1e-4) on a large-scale dataset containing 1 million unlabeled queries; the trained encoder is used to generate embeddings for the unlabeled data, the data is grouped through k-means clustering (k=1000), and the center point of each cluster is selected as a representative sample; these 1000 representative samples are input into the hybrid expert system to generate corresponding SQL queries, which are manually reviewed and corrected as high-quality pseudo-labeled data.

[0115] Construct a progressive learning strategy, specifically: sort the training data (including raw data and pseudo-label data) by the complexity of the SQL query, which is calculated based on factors such as the length of the SQL, the number of nested layers, and the number of tables involved; construct a curriculum learning algorithm, divide the data into 5 difficulty levels, and use only the simplest 20% of the data in the initial stage. After every 10 epochs of training, gradually introduce the data of the next difficulty level; implement a sampling strategy based on competence. Competence is defined as the performance of the model at the current difficulty level. As training progresses, the sampling probability of samples of different difficulties is dynamically adjusted; at the end of each difficulty level, evaluate the model performance on the validation set. If the performance improvement is less than 1%, advance to the next difficulty level in advance; implement a model checkpoint saving mechanism, and save a checkpoint at the end of each difficulty level. If the performance degrades at a higher difficulty, you can fall back to the previous checkpoint and retrain.

[0116] Define the hyperparameter search space, including learning rate (1e-5 to 1e-3, logarithmic scale), batch size (32 to 256, step size 32), dropout rate (0.1 to 0.5, step size 0.1), L2 regularization coefficient (1e-5 to 1e-2, logarithmic scale), etc.; implement a hyperparameter search algorithm based on Bayesian optimization, using Gaussian process as a surrogate model and expected improvement (EI) as the acquisition function; for each set of hyperparameters, train the model for 10 epochs on a small dataset containing 10,000 samples, using the SQL exact matching accuracy on the validation set as the optimization target; run 50 rounds of Bayesian optimization, evaluate 5 sets of hyperparameters in each round, and select the hyperparameter combination with the best performance on the validation set; use the selected optimal hyperparameters to retrain the model on the complete training set to obtain the final optimized hyperparameter configuration.

[0117] Initialize the hybrid expert system, load the optimal model architecture and optimal hyperparameter configuration; implement a dynamic batching strategy to group samples according to the length of the input sequence to improve training efficiency, and keep the total number of tokens in each batch at around 12,000; organize training data using the constructed progressive learning strategy, and apply pseudo-label data for enhanced training at each difficulty level; use mixed precision training technology, use floating point numbers (float) 16 for forward and back propagation calculations, and float32 for parameter updates to speed up the training process and reduce memory usage; implement gradient accumulation technology to update model parameters every 4 small batches to simulate larger batch sizes, Improve training stability; use a learning rate scheduling strategy with warm-up and cosinedecay. The warm-up phase lasts for 3 epochs, and then decays the learning rate within the cosine period. During training, evaluate the model performance on the validation set every 1,000 batches. If the performance does not improve after 5 consecutive evaluations, decay the learning rate to 0.5 times the original value. Continue training until the performance of the model on the validation set does not improve after 10 consecutive evaluations, or the maximum number of epochs (set to 100) is reached. Select the model checkpoint with the best performance on the validation set as the final optimized Text-to-SQL model, and save the model parameters and configuration.

[0118] In another embodiment, a model structure optimization algorithm based on neural architecture search (NAS) is constructed, specifically: constructing a search space bb1, including different layer types, connection methods and hyperparameter options; using an evolutionary algorithm to search in the search space bb1 to generate a candidate model architecture bb2; quickly evaluating each candidate architecture on a small-scale data set to obtain a performance indicator bb3; and selecting the optimal architecture bb4 as the basic model structure according to the performance indicator bb3.

[0119] Based on the optimal architecture bb4, build multiple sub-models cc1 specifically for different types of SQL queries; build a gating network cc2 for dynamically selecting and combining sub-models; integrate the sub-model cc1 and the gating network cc2 to form a complete hybrid expert system cc3.

[0120] Use the complete model input data aa to generate positive sample pairs dd1; create negative samples dd2 by randomly replacing, deleting or adding elements; apply the contrastive loss function and train the discriminator model dd3; use the discriminator model dd3 to generate high-quality pseudo-label data dd4.

[0121] Sort the training data (including original data and dd4) by complexity to obtain the graded data set ee1; construct the curriculum learning algorithm ee2 to dynamically adjust the order and weights of training samples according to the current model performance; use the curriculum learning algorithm ee2 to control the training process and gradually increase the task difficulty and data complexity.

[0122] Construct a hyperparameter search space ff1, including learning rate, batch size, regularization parameter, etc.; use the Bayesian optimization algorithm to search in the hyperparameter search space ff1 to generate candidate hyperparameter combinations ff2; perform small-scale training and verification on each candidate hyperparameter to obtain the performance indicator ff3; based on the performance indicator ff3, select the optimal hyperparameter combination ff4.

[0123] The hybrid expert system cc3 is used as the initial model; the progressive learning strategy and the optimal hyperparameter ff4 are applied for training; during the training process, the pseudo-label data dd4 generated by contrastive learning is continuously used for data enhancement; after the training is completed, the optimized Text-to-SQL model gg is obtained.

[0124] This embodiment constructs the optimal model structure of the Text-to-SQL model through Neural Architecture Search (NAS), automatically explores and discovers the model architecture that best suits a specific task, can improve the performance and efficiency of the model, and reduce the time and cost of manually designing the model architecture; constructs a predetermined number of expert sub-models in the optimal model structure to form a hybrid expert system, which can make full use of the advantages of different sub-models and improve the performance of the overall model. The hybrid expert system can dynamically select the most suitable sub-model for processing according to the characteristics of the input data, thereby improving the accuracy and robustness of the model; adopts data enhancement technology based on contrastive learning to generate high-quality pseudo-label data, which can effectively expand the scale and diversity of the training data set. Contrastive learning can better capture the similarities and differences between data by introducing a contrastive loss function, thereby improving the generalization ability and robustness of the model. Based on pseudo-label data and model input data, a progressive learning strategy is adopted to obtain training data organized by difficulty level, which can gradually improve the learning ability of the model. Progressive learning enables the model to gradually adapt to data of different difficulty levels through a training process from simple to complex, thereby improving the stability and performance of the model. Using training data organized by difficulty level to train the Text-to-SQL model with a hybrid expert system can make full use of data at different difficulty levels and improve the learning effect of the model. The model can better understand and process complex query tasks, thereby improving the accuracy and practicality of the Text-to-SQL model.

[0125] This embodiment effectively improves the performance, generalization ability and robustness of the Text-to-SQL model by combining neural architecture search, hybrid expert system, contrastive learning and progressive learning strategies, thereby enhancing the overall performance and application value of the model.

[0126] like Figure 6 As shown, according to one aspect of the present application, step S5 is further:

[0127] S51, using the trained Text-to-SQL model to generate an initial SQL query;

[0128] S52, based on the initial SQL query, construct an abstract syntax tree of SQL and generate a standardized SQL query text;

[0129] S53, based on the normalized SQL query text, extract query features and construct a query feature vector; based on the query feature vector, use a context-aware rewriting algorithm to generate a rewritten SQL query;

[0130] S54. Based on the trained Text-to-SQL model and rewritten SQL query, the uncertainty quantification method is used to generate the final SQL query.

[0131] In a specific embodiment, the trained Text-to-SQL model is used in combination with the complete model input data to generate an initial SQL query. Then, SQL generation based on the abstract syntax tree is implemented, a context-aware SQL rewriting algorithm is developed, and an uncertainty quantification method is introduced to obtain an optimized SQL query; the optimized SQL query is executed, a multimodal result presentation algorithm is constructed, and a result explanation generator based on a graph neural network is developed. Finally, the processed results are returned to the user, and user feedback is collected for continuous optimization, specifically:

[0132] Generate the initial SQL representation using the optimized Text-to-SQL model, and output it as a token sequence; build an SQL AST parser, define SQL syntax rules, including the structure of clauses such as SELECT, FROM, WHERE, GROUP BY, HAVING, and ORDER BY, and use the ANTLR4 tool to generate the parser code; input the generated token sequence into the AST parser to build the initial abstract syntax tree (AST). If a syntax error is encountered during the parsing process, use the error recovery strategy to try to repair it and ensure that a valid AST is generated; implement the AST optimizer and apply a series of tree transformation rules: merge nested SELECT statements; simplify redundant subqueries; optimize the JOIN order; and delete useless conditions (such as WHERE 1=1). Perform semantic analysis on the optimized AST to check the validity of table names and column names, as well as type consistency, and verify it using database schema information. Convert the optimized and verified AST back to SQL text, implement an AST visitor, traverse the AST in depth first, and generate standardized SQL query text.

[0133] Analyze the normalized SQL query text, extract query features, including the tables, columns, operation types, conditional complexity, etc. involved, and construct a query feature vector (dimension 128); obtain the latest statistical information from the database management system, including table size, column cardinality, data distribution, etc. Encode this information into a statistical feature vector (dimension 128); retrieve historical query logs, select the 10 historical queries with the highest similarity to the current query and their execution plans. Encode each historical query using the Word2Vec model (dimension 100), and then aggregate through the attention mechanism to obtain a historical query feature vector (dimension 128); build a query cost estimation model. A deep neural network (4-layer fully connected, hidden layer dimensions [256, 512, 256, 1]) is used, with the input being the concatenation of the query feature vector, the statistical feature vector, and the historical query feature vector, and the output being the estimated query cost; a rule-based SQL rewriter is implemented, which includes the following optimization rules: predicate pushdown; subquery flattening; view merging; and UNION ALL transformation; these rules are applied to SQL queries to generate a set of candidate rewrite queries; for each candidate rewrite query, its execution cost is predicted using a cost estimation model, and the query with the lowest cost is selected as the preliminary optimization result; a reinforcement learning-based SQL rewrite optimizer is implemented, with the state space being the feature representation of the current SQL, the action space being the possible rewrite operations, and the reward function being based on cost estimation; a reinforcement learning model is trained (using the PPO algorithm) to explore in a defined environment, and the preliminary optimization results are further optimized to generate the final rewritten SQL query.

[0134] Apply Monte Carlo dropout to the Text-to-SQL model, keep the dropout layer activated during the inference phase, perform 50 forward propagations on the same input, and generate 50 SQL query variants; implement a SQL semantic similarity calculation function, use the pre-trained Sentence-BERT model to encode SQL queries into vectors, and then calculate cosine similarity; calculate semantic similarity for the 50 generated SQL query variants, and construct a similarity matrix; apply the spectral clustering algorithm to cluster the SQL query variants, automatically determine the optimal number of clusters (range 2-5), and select the cluster result with the highest silhouette coefficient; calculate the central query of each cluster (the query with the highest average similarity to other queries), and use the cluster size as the weight of the query; calculate the uncertainty score based on the clustering results, and use the normalized Shannon entropy to measure the uncertainty of the cluster distribution, with a score range of 0-1; implement a human-computer collaborative SQL review mechanism: if the uncertainty score is lower than the threshold (such as 0.2), automatically select the central query of the largest cluster as the final SQL; otherwise, submit the top-3 cluster central queries and their weights to manual review, and let experts select or modify the final SQL.

[0135] Execute optimized SQL queries. Connect to the target database system. Use database connection pool to manage connections to ensure efficient resource utilization; implement query preprocessor to perform security checks on the final SQL query to prevent security risks such as SQL injection; generate and analyze execution plans before executing actual queries. If the estimated execution time exceeds the threshold (such as 30 seconds), warn the user and request confirmation; execute SQL queries to obtain result sets. For queries that may return a large amount of data, implement streaming processing to obtain results in batches; perform preliminary processing on query results: handle NULL values, format date and time, round values, etc.; collect metadata of query execution, such as execution time, number of rows affected, etc., for subsequent query optimization and user feedback.

[0136] Construct a multimodal result presentation algorithm. Analyze query results and extract data features, including data type, value range, distribution characteristics, etc. Construct a data feature vector (dimension 256); retrieve user historical interaction records, extract user preference features, such as commonly used visualization types, color schemes, etc., and construct a user preference vector (dimension 128); construct a visualization strategy selector based on reinforcement learning, where the state space is a combination of data features and user preferences, and the action space is the available visualization types (such as tables, bar charts, line charts, scatter plots, etc.) and their configuration options; implement a reinforcement learning model based on Deep Q-Network (DQN), using a two-layer LSTM (hidden layer dimension 256) as the state encoder and a three-layer fully connected network (hidden layer dimensions [512, 256, 128]) as the Q value predictor. Use the visualization strategy selector to select the best visualization strategy. For the selected strategy, use a professional visualization library (such as Plotly) to generate interactive charts. Implement the attention mechanism to identify key information in the query results. Use the self-attention layer to calculate the importance score of each data point and highlight important data in the visualization. Generate a summary description of the visualization results. Use a pre-trained language model (such as GPT-3) to generate concise natural language descriptions based on the visualization data and type as input.

[0137] Develop a result explanation generator based on graph neural network. Convert the query results into a graph structure, with data items as nodes and relationships between data items (such as foreign key relationships, numerical comparison relationships) as edges; use a graph neural network model to process the graph structure, using a graph sampling and aggregation (GraphSAGE) structure, including 3 layers of graph convolution, each with an output dimension of 128, using ReLU activation function and residual connection; apply global average pooling to the output of the graph neural network to obtain a graph-level representation vector (dimension 128); combine knowledge graph information to build a knowledge enhancement layer, use the attention mechanism to calculate the relevance of query results and knowledge graph entities, and generate a knowledge enhancement vector (dimension 2 56); construct a multi-step reasoning mechanism, input the graph-level representation vector and knowledge enhancement vector into a Transformer decoder (6 layers, 8-head attention, hidden layer dimension 512); implement the reasoning process based on beam search, generate a reasoning statement at each step, set the maximum number of steps to 5, and the beam width to 3; apply consistency check to the generated reasoning sequence, use the pre-trained natural language reasoning model to verify the validity of each step of reasoning, and screen out the most reasonable reasoning path; convert the selected reasoning path into a natural language explanation, and use template filling combined with a fine-tuned T5 model to generate a fluent explanation text.

[0138] Result return and user feedback. Integrate visualization results, summary descriptions, and explanatory text to generate the final query response; build an interactive interface that allows users to view SQL queries, visualization results, text explanations, and provide drill-down and filtering functions; implement a user feedback collection mechanism, build a rating system (1-5 stars), and provide text feedback options; store user feedback in the feedback database and update the user preference model at the same time; based on user feedback, use online learning algorithms to fine-tune user preference vectors and visualization strategy selection models in real time; regularly (such as weekly) analyze accumulated user feedback and generate improvement reports to provide a basis for model optimization and function updates; return the final processed results, visualizations, and explanations to the user interface to complete the entire query process.

[0139] In another embodiment, the optimized model gg and the complete model input data aa are input to obtain an initial SQL representation hh1; a SQL AST parser hh2 is constructed to convert the initial SQL representation hh1 into an AST structure hh3; grammar rules and constraint checks are applied to optimize the AST structure hh3 to obtain an improved AST structure hh4; the improved AST structure hh4 is converted back into SQL text to obtain a structurally optimized SQL query hh5.

[0140] Analyze the query structure of SQL query hh5 and extract query features ii1; combine database statistical information ii2 and query history ii3 to build query cost model ii4; use heuristic rules to preliminarily optimize SQL query hh5 based on query cost model ii4 to obtain candidate query set ii5; apply reinforcement learning technology to train query optimizer ii6: use candidate query set ii5 as the initial state and construct an action space for possible query rewrite operations; use query cost model ii4 as the reward function to optimize query performance through multiple simulation executions; update the policy network of query optimizer ii6 to generate the final optimized SQL query ii7.

[0141] Apply Monte Carlo dropout to the optimized model gg to generate multiple model variants jj1(i); use each model variant jj1(i) to predict the input data aa to obtain the SQL query set jj2; calculate the consistency score jj3 of the SQL queries in the query set jj2 as the credibility score; according to the consistency score jj3, implement the human-computer collaborative SQL audit mechanism jj4: if the consistency score jj3 is higher than the threshold, it automatically passes the audit; otherwise, submit the final optimized SQL query ii7 and the consistency score jj3 to manual review to obtain the final confirmed SQL query jj5.

[0142] This embodiment uses the trained Text-to-SQL model to generate an initial SQL query, which can quickly convert a natural language query into an SQL query. It utilizes the learning ability of the model and can generate a preliminary SQL query, laying the foundation for subsequent optimization steps. Based on the initial SQL query, an Abstract Syntax Tree (AST) of SQL is constructed to generate a standardized SQL query text. By parsing and normalizing the SQL query, redundant and non-standard SQL statements can be eliminated, thereby improving the readability and execution efficiency of the SQL query. Based on the normalized SQL query text, query features are extracted and query feature vectors are constructed. A context-aware rewriting algorithm is used to generate a rewritten SQL query. By analyzing query features and combining context information, the SQL query is optimized and rewritten, thereby improving the accuracy and execution efficiency of the query. Based on the trained Text-to-SQL model and the rewritten SQL query, an uncertainty quantification method is used to generate a final SQL query. By quantifying the uncertainty of the model, the reliability and accuracy of the SQL query can be evaluated and optimized, thereby generating a more accurate and reliable SQL query.

[0143] This embodiment can effectively improve the generation quality and execution efficiency of SQL queries by combining multiple methods. Specifically, through the steps of initial SQL query generation, SQL abstract syntax tree construction, query feature extraction and rewriting, and uncertainty quantification, the structure and content of SQL queries can be gradually optimized, the accuracy and execution efficiency of queries can be improved, thereby improving the overall performance and application value of the Text-to-SQL model, which can not only improve the quality of SQL queries, but also enhance the robustness and adaptability of the model, making it perform better in different application scenarios.

[0144] According to another aspect of the present application, a large model fine-tuning method for a track domain knowledge base includes the following steps:

[0145] Step 1: The user records a voice through a microphone or other voice input device;

[0146] Step 2: Convert speech into text through speech recognition model;

[0147] Step 3: Correct and post-process the converted text. The error correction process uses a general language large model plus knowledge base injection to convert the recognition errors of proprietary terms in the track field into terminology form;

[0148] Step 4: Build the context of the Text-to-SQL model, including historical conversations, database table structure, field definitions, and key-value association information;

[0149] Step 5: The model outputs SQL statements and gives them to the SQL execution API.

[0150] like Figure 7 As shown, in another embodiment of the present application, the fine-tuning large model and scene adaptation strategy of the track domain knowledge base includes the following steps:

[0151] 1. The user records a voice through a microphone or other voice input device;

[0152] 2. Convert speech into text through speech recognition model;

[0153] 3. Correct the converted text. The correction process uses a general language large model + knowledge base injection to convert the recognition errors of proprietary terms in the track field into terminology;

[0154] 4. Continue to rewrite the converted text, convert the text and numbers into Arabic numerals, and rewrite the question structure;

[0155] 5. Build the context of the Text-to-SQL model, including historical conversations, database table structure, field definitions, and key-value association information;

[0156] 6. The model outputs SQL statements and gives them to the SQL execution API.

[0157] Through the speech recognition model, the speech is converted into text as follows:

[0158] 2.1. Download the whisper-small model weights from the open source faster-whisper library, input an audio file, such as a .wav file, and use Python to read the audio file and convert it into audio data, which is then input into the model. The model then outputs the text corresponding to the speech.

[0159] 2.2. Through Python's Flask library, the speech recognition function is packaged as an interface to provide services to the outside world.

[0160] Correct the converted text. The correction process uses a general language large model + knowledge base injection to convert the recognition errors of proprietary terms in the track field into terminology. Specifically:

[0161] 3.1. The error correction model uses Baichuan2-7B-Chat. The model weights are downloaded from the open source community. The local deployment uses the 4-bit quantization mode to reduce the video memory occupied.

[0162] 3.2. Constructing prompts. First, the task information is described as error correction of proper nouns in a specific field. Then, the knowledge base of the track domain is injected. Through the method of fixation + retrieval, several commonly used terms are fixed, and the retrieval is performed by matching the text similarity to recall the term dictionary with a similarity greater than 0.3. Then there are 3 error correction examples to further let the model understand the core of the task. Finally, the user's input sentence;

[0163] 3.3. The model outputs the rewritten sentence as the input sentence for the next step.

[0164] Continue to rewrite the converted text, convert the text and numbers into Arabic numerals, and rewrite the question structure, specifically:

[0165] 4.1. First, regular expressions are used to match consecutive Chinese numbers and dots, and the resulting text is translated into Arabic numerals to replace the original Chinese numbers and dots.

[0166] 4.2. Rewrite some colloquial questions, such as "how many kilometers away" needs to be rewritten as "the distance to the radar is greater than how many kilometers". Rewrite common colloquial expressions through regular matching to reduce the difficulty of model understanding.

[0167] Build the context of the Text-to-SQL model, including historical conversations, database table structure, field definitions, and key-value association information, specifically:

[0168] 5.1. Collect CSpider, DuSQL, and Chase datasets as datasets for Chinese Text-to-SQL training;

[0169] 5.2. Download the CodeLlama-13B-Chat model weights from the open source community;

[0170] 5.3. Multi-round data construction, including the original multi-round data set Chase, single-round and multi-round data are mixed, the data of CSpider and DuSQL are mixed and sampled, the Chase data set is sampled separately, and the single-round data is added to the beginning and end of the multi-round data to learn the beginning and end of the multi-round data, reducing the misleading of the model by historical data;

[0171] 5.4. Fine-tune the model on three datasets to obtain the final model weights;

[0172] 5.5. After obtaining the user input given in step 4, construct the model context, including historical conversations, database table structure, field interpretation and key-value association information, input the context into the model, and obtain the model inference result.

[0173] Since the recognition accuracy of the text converted by the open source speech recognition model Whisper-small is not high in terms of professional terms, if the speech recognition model is re-fine-tuned, a large amount of speech text comparison annotation data is required, which is too costly. The general language large model Baichuan2 is used to build an error correction prompt, and the relevant professional terms are injected into the prompt, so that the language model can correct the converted text. This not only effectively improves the recognition accuracy of the terms, but also keeps the cost under control. Post-processing of user requests mainly includes the processing of numbers and rewriting of question structures. Numbers are easily recognized as Chinese characters during speech recognition, and processing them into numbers has a positive gain for subsequent SQL statement generation. Question structure rewriting is to prevent the model from not recognizing spoken terms by converting colloquial professional terms into standardized terminology nouns. The CodeLlama-13B model is fine-tuned using the CSpider, DuSQL, and Chase Chinese Text-to-SQL datasets to improve the model's recognition ability for Chinese expressions. Combine single-round data with multi-round data, randomly select single-round data, randomly cut the number of rounds of multi-round data, and choose to insert single-table data before or after multi-round data to represent the end and start of a query, so that the model can learn the interval information between two queries, effectively reducing the model's error in multi-round dialogues that is easily biased by previous historical data. The construction of the prompt includes the database table structure, column name interpretation, and key-value relationship correspondence between tables. Under the principle of streamlining the prompt length, most of the important information is retained, achieving a balance between reasoning speed and reasoning accuracy. The model is packaged using VLLM technology to improve the reasoning speed, and the final reasoning speed reaches 0.5s per query.

[0174] According to another aspect of the present application, a scene adaptation system of a track domain knowledge base includes:

[0175] at least one processor; and,

[0176] a memory communicatively connected to at least one of the processors; wherein,

[0177] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the large model fine-tuning method of the track domain knowledge base described in any one of the above embodiments.

[0178] The preferred embodiments of the present invention are described in detail above; however, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all belong to the protection scope of the present invention.

Claims

1. Large model fine-tuning method for track domain knowledge base, It is characterized in that The steps include: S1. Acquire speech data, preprocess the speech data, and call a preconfigured multimodal speech recognition model to convert the preprocessed speech data into initial text data; S2. Construct a knowledge graph in the field of flight tracks, perform multi-stage error correction processing on the initial text data based on the knowledge graph in the field of flight tracks, and obtain the corrected text data; perform post-processing on the corrected text data, including digital recognition conversion and question structure rewriting, to generate rewritten text data; S3, obtaining historical conversation data, constructing context representation based on the historical conversation data, and forming model input data based on the context representation and the rewritten text data; S4. Build a Text-to-SQL model, and train the Text-to-SQL model based on the model input data to obtain a trained Text-to-SQL model; S5. Use the trained Text-to-SQL model to generate an initial SQL query, optimize the initial SQL query, and obtain a final SQL query; Step S1 is further as follows: S11, obtaining the user's voice data through a voice input device, and converting it into a digital audio signal, and obtaining a spectrum representation based on the digital audio signal by using a fast Fourier transform; S12, performing noise reduction processing on the frequency spectrum representation, and converting the frequency spectrum representation after the noise reduction processing back to the time domain using an overlap-add method to obtain a noise-reduced audio signal; S13, based on the denoised audio signal, using a speech segmentation algorithm to obtain independent speech segments; S14, inputting the independent speech segment into a preconfigured multimodal speech recognition model to obtain a recognition result, performing rule-based post-processing on the recognition result, including punctuation recovery, number and special symbol normalization, and generating initial text data; Step S2 is further as follows: S21. Collect professional literature data, and based on the professional literature data, use graph embedding algorithm to learn entity and relationship vectors to build a knowledge graph in the field of track; S22. Based on the initial text data and the track domain knowledge graph, a multi-head attention mechanism and a feedforward neural network are introduced to calculate the knowledge-enhanced word representation; Fine-tune the pre-trained general language model using knowledge-enhanced word representation to obtain a domain-adapted general language model; S23. Based on the domain-adapted general language model and the initial text data, a multimodal fusion error recognition algorithm is used to generate a candidate error correction list. Based on the candidate error correction list, a graph neural network is used for context reasoning to obtain the corrected text data. S24, performing digital recognition conversion and question structure rewriting on the text data after error correction to generate rewritten text data; Step S3 is further as follows: S31. Obtain historical conversation data, use a graph attention network to capture long-term dependencies in the historical conversation data, and obtain the context vector of the historical conversation; S32, based on the rewritten text data, using adaptive knowledge distillation method to generate knowledge-enhanced query vectors; S33, obtaining database schema information and an external knowledge base, and performing multi-granularity knowledge fusion based on the database schema information, the external knowledge base, and a predefined domain ontology to obtain a unified knowledge representation vector; S34, based on the context vector of historical dialogues, the knowledge-enhanced query vector and the unified knowledge representation vector, a context dynamic adjustment algorithm based on meta-learning is used to calculate the context representation; S35, concatenating the context representation with the rewritten text data to form a concatenated vector, obtaining a model input vector based on the concatenated vector through a feedforward neural network, and packaging the model input vector and the rewritten text data to form model input data; Step S4 is further as follows: S41. Building the optimal model structure of the Text-to-SQL model through neural architecture search; S42, based on the model input data, constructing a predetermined number of expert sub-models in the optimal model structure to form a hybrid expert system, and obtaining a Text-to-SQL model with a hybrid expert system; S43, based on the model input data, adopts the data enhancement technology based on contrastive learning to generate high-quality pseudo-label data; S44, based on the pseudo-label data and the model input data, adopting a progressive learning strategy to obtain training data organized by difficulty level; S45, training the Text-to-SQL model with the hybrid expert system using the training data to obtain a trained Text-to-SQL model; Step S5 is further as follows: S51, using the trained Text-to-SQL model to generate an initial SQL query; S52, based on the initial SQL query, construct an abstract syntax tree of SQL and generate a standardized SQL query text; S53, based on the normalized SQL query text, extract query features and construct a query feature vector; based on the query feature vector, use a context-aware rewriting algorithm to generate a rewritten SQL query; S54, based on the trained Text-to-SQL model and rewritten SQL query, the uncertainty quantification method is used to generate the final SQL query; Step S14 is further as follows: S141, extracting acoustic features of each independent speech segment, including logarithmic Mel filter bank energy features; S142, determine whether there is available visual information, if not, proceed to step S143; if yes, extract lip reading features based on the visual information, use a multi-head attention mechanism to fuse the acoustic features and the lip reading features to obtain fused features; S143, inputting the acoustic features or fusion features into a preconfigured multimodal speech recognition model, using a beam search algorithm to generate text hypotheses, calculating a language model score for each text hypothesis, and selecting a text hypothesis with a language model score higher than a preset threshold as a recognition result; S144, restore punctuation marks, and normalize numbers and special symbols on the recognition results to generate initial text data.

2. The large model fine-tuning method of the track domain knowledge base according to claim 1, It is characterized in that Step S22 is further as follows: S221, use a word segmenter to segment the initial text data to obtain a word sequence, and input the word sequence into a pre-trained word vector model to obtain a word vector; S222, based on the word sequence, retrieve relevant entities and relationship vectors in the track domain knowledge graph, and calculate the attention weight based on the word vectors, the retrieved entities and relationship vectors; S223, based on the attention weight, weighted summing is performed on the retrieved entity and relationship vectors to obtain weighted knowledge graph information; the word vector is concatenated with the weighted knowledge graph information to obtain knowledge-enhanced word representation through a feedforward neural network; S224. Fine-tune the pre-trained general language model using the knowledge-enhanced word representation to obtain a domain-adapted general language model.

3. The large model fine-tuning method of the track domain knowledge base according to claim 1, It is characterized in that Step S32 is further as follows: S321, based on the rewritten text data, retrieve relevant knowledge in the pre-trained general language model, and based on the relevant knowledge, use the Top-k sampling method to generate a predetermined number of knowledge candidates; S322, constructing a knowledge relevance scoring network, using the knowledge relevance scoring network to sort the knowledge candidates, obtaining a sorting result, and selecting a predetermined number of most relevant knowledge based on the sorting result; S323, using the attention mechanism to calculate the alignment score between the most relevant knowledge and the rewritten text data, and based on the alignment score, performing weighted summation on the most relevant knowledge to obtain a distilled knowledge vector; S324. Use a gating mechanism to fuse the distilled knowledge vector and the rewritten text data to generate a knowledge-enhanced query vector.

4. Scenario adaptation system of track domain knowledge base, It is characterized in that include: at least one processor; as well as, a memory communicatively connected to at least one of the processors; wherein, The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the large model fine-tuning method of the track domain knowledge base described in any one of claims 1 to 3.