Slot extraction method and system based on large model and storage medium

Through the large-model-based slot extraction method, combined with confidence calculation and the construction of slot information sequence, the problem of low accuracy of slot extraction in the prior art is solved, and the reliability of slot value is improved.

CN119476205AActive Publication Date: 2025-02-18GUANGXI GUIYUNTONG TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411523054.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-02-18
Estimated Expiration
2044-10-29

AI Technical Summary

Technical Problem

In the prior art, the accuracy of slot extraction is low, resulting in insufficient reliability of slot value detection.

Method used

The slot extraction method based on the large model is adopted. By obtaining the text to be extracted and inputting it into the pre-trained large model for feature extraction, slot extraction is performed based on the text features, and the confidence calculation of the slot value is performed. If the predicted confidence level is less than the confidence threshold, the slot is requeried and the slot information sequence is constructed, and a large model is entered to improve the accuracy of slot extraction.

Benefits of technology

By calculating the confidence level of the slot value and re-extracting, the accuracy of the slot value is improved and the reliability of the slot value is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476205A_ABST
    Figure CN119476205A_ABST
Patent Text Reader

Abstract

The invention provides a slot extraction method and system based on a large model and a storage medium. The method comprises the steps of inputting a to-be-extracted text into a pre-trained large model for slot extraction to obtain a slot value, and performing confidence calculation on the slot value to obtain a prediction confidence; if the predicted confidence coefficient is smaller than a confidence coefficient threshold value, constructing a slot information sequence according to slot positions and slot values; adding the field description into the slot information sequence to obtain a slot prompt sequence, and inputting the slot prompt sequence into a pre-trained large model; and returning to execute the step of extracting the slot according to the text features to obtain the slot value and the subsequent steps until the predicted confidence coefficient of the slot value corresponding to the slot position is greater than or equal to the confidence coefficient threshold value, outputting the slot value corresponding to the slot position, and obtaining a slot extraction result. According to the embodiment of the invention, by inputting the slot prompt sequence into the pre-trained large model, the large model can effectively and more fully understand the representation meaning of the slot position, so that the slot extraction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a slot extraction method, system and storage medium based on a large model. Background Art

[0002] With the development of technology, the progress of deep learning technology has greatly promoted the development of artificial intelligence, and the field of natural language processing has also achieved key breakthroughs. The human-computer dialogue system is an important research direction in the field of natural language processing. The main purpose of the human-computer dialogue system is to enable machines and users to use language habits similar to human communication to exchange information and assist users in completing specific tasks. Natural language understanding is a key module for dialogue systems to understand human language. As an important part of natural language understanding, slot extraction is becoming more and more important in terms of accuracy.

[0003] In the existing slot extraction process, the extracted slot value is generally directly output as the slot extraction result, resulting in low slot extraction accuracy. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a slot extraction method, system and storage medium based on a large model to solve the problem of low slot extraction accuracy in the prior art.

[0005] The embodiment of the present invention is implemented as follows: a slot extraction method based on a large model, the method comprising:

[0006] Obtain the text to be extracted, and input the text to be extracted into the pre-trained large model for feature extraction to obtain text features;

[0007] Extracting slots according to the text features to obtain slot values, and calculating confidences of the slot values ​​to obtain prediction confidences;

[0008] If the prediction confidence is less than the confidence threshold, query the slot corresponding to the slot value, obtain the field description corresponding to the slot, and construct a slot information sequence according to the slot and the slot value;

[0009] Adding the field description to the slot information sequence to obtain a slot prompt sequence, and inputting the slot prompt sequence into the pre-trained large model;

[0010] Return to executing the step of extracting slots according to the text features to obtain slot values ​​and subsequent steps, until the predicted confidences of the slot values ​​corresponding to the slots are greater than or equal to the confidence threshold, output the slot values ​​corresponding to the slots to obtain the slot extraction results.

[0011] Preferably, performing confidence calculation on the slot value to obtain prediction confidence includes:

[0012]

[0013] c i is the prediction confidence of the i-th slot value, t j is the jth character in the i-th slot value, Yes j The character confidence, H is the output of the large model t j The corresponding input character sequence, P M is the confidence of the large model output.

[0014] Preferably, the text to be extracted is input into a pre-trained large model for feature extraction to obtain text features, including:

[0015] Performing character conversion on the text to be extracted according to the pre-trained large model to obtain a text character sequence, and performing padding convolution processing on the text character sequence to obtain a character feature matrix;

[0016] Performing intent recognition on the text to be extracted to obtain a text intent vector, and generating a text intent matrix according to the text intent vector;

[0017] The text to be extracted is subjected to word embedding processing to obtain a word vector, and the text feature is generated according to the word vector, the character feature matrix and the text intention matrix.

[0018] Preferably, generating the text feature according to the word vector, the character feature matrix and the text intention matrix includes:

[0019] Combining the character feature matrix and the text intent matrix to obtain a query matrix, and constructing a key matrix and a value matrix according to the word vectors;

[0020] A self-attention mechanism is calculated according to the query matrix, the key matrix and the value matrix to obtain a fusion matrix, and feature encoding is performed on the fusion matrix to obtain the text feature.

[0021] Preferably, the method further comprises: inputting the text to be extracted into the pre-trained large model for feature extraction to obtain text features;

[0022] Obtaining sample text, and inputting the sample text into the large model for feature extraction to obtain sample features;

[0023] Extracting slots according to the sample features to obtain sample slot values, and calculating confidence of the sample slot values ​​to obtain sample confidence;

[0024] The model loss is determined according to the sample features, the sample slot values ​​and the sample confidence, and the parameters of the large model are updated according to the model loss until the large model converges.

[0025] Preferably, determining the model loss according to the sample feature, the sample slot value and the sample confidence comprises:

[0026] Obtaining standard features, standard slot values, and standard confidences corresponding to the sample text, and performing loss calculation based on the standard features and the sample features to obtain a first loss;

[0027] Performing loss calculation according to the standard slot value and the sample slot value to obtain a second loss, and performing loss calculation according to the standard confidence and the sample confidence to obtain a third loss;

[0028] A weighted operation is performed on the first loss, the second loss, and the third loss to obtain the model loss.

[0029] Preferably, after obtaining the text to be extracted, the method further includes:

[0030] Performing syntactic analysis on the text to be extracted to obtain a syntactic tree structure, and performing syntactic matching between the syntactic tree structure and a structural dictionary;

[0031] Slot extraction is performed on the text to be extracted according to the syntactic matching result to obtain the slot value.

[0032] Another object of an embodiment of the present invention is to provide a slot extraction system based on a large model, the system comprising:

[0033] A feature extraction module is used to obtain the text to be extracted, and input the text to be extracted into the pre-trained large model for feature extraction to obtain text features;

[0034] A confidence calculation module, used to extract slots according to the text features to obtain slot values, and perform confidence calculation on the slot values ​​to obtain prediction confidence;

[0035] A correction module, configured to query the slot corresponding to the slot value, obtain a field description corresponding to the slot, and construct a slot information sequence according to the slot and the slot value if the prediction confidence is less than a confidence threshold;

[0036] Adding the field description to the slot information sequence to obtain a slot prompt sequence, and inputting the slot prompt sequence into the pre-trained large model;

[0037] The output module is used to return to execute the step of extracting slots according to the text features to obtain slot values ​​and subsequent steps, until the predicted confidence of the slot values ​​corresponding to the slots is greater than or equal to the confidence threshold, and then output the slot values ​​corresponding to the slots to obtain slot extraction results.

[0038] Preferably, the feature extraction module is also used for:

[0039] Performing character conversion on the text to be extracted according to the pre-trained large model to obtain a text character sequence, and performing padding convolution processing on the text character sequence to obtain a character feature matrix;

[0040] Performing intent recognition on the text to be extracted to obtain a text intent vector, and generating a text intent matrix according to the text intent vector;

[0041] The text to be extracted is subjected to word embedding processing to obtain a word vector, and the text feature is generated according to the word vector, the character feature matrix and the text intention matrix.

[0042] The embodiments of the present invention can effectively detect the reliability of the slot value by calculating the confidence of the slot value. When the prediction confidence is less than the confidence threshold, the slot value corresponding to the slot is re-extracted. By inputting the slot prompt sequence into the pre-trained large model, the large model can effectively understand the representation meaning of the slot more fully when returning to execute the slot extraction according to the text features, thereby improving the accuracy of the slot extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a flow chart of a slot extraction method based on a large model provided in a first embodiment of the present invention;

[0044] Figure 2 is a schematic structural diagram of a slot extraction system based on a large model provided in a second embodiment of the present invention;

[0045] Figure 3 It is a schematic diagram of the structure of a terminal device provided in the third embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0047] In order to illustrate the technical solution of the present invention, a specific embodiment is provided below for illustration.

[0048] Embodiment 1

[0049] See also Figure 1 , is a flow chart of a slot extraction method based on a large model provided in a first embodiment of the present invention. The slot extraction method based on a large model can be applied to any device or system. The slot extraction method based on a large model comprises the steps of:

[0050] Step S10, obtaining the text to be extracted, and inputting the text to be extracted into the pre-trained large model for feature extraction to obtain text features;

[0051] Among them, the text features can be set according to the needs, for example, the text features can be semantic features, emotional features or character features, etc. Optionally, the text to be extracted is input into a pre-trained large model for feature extraction to obtain text features, including:

[0052] According to the pre-trained large model, the text to be extracted is subjected to character conversion to obtain a text character sequence, and the text character sequence is subjected to padding convolution processing to obtain a character feature matrix; wherein, according to the character dictionary, the text to be extracted is subjected to character conversion to obtain a text character sequence, and the text character sequence is subjected to padding convolution processing through the convolution layer in the large model to obtain a character feature matrix;

[0053] Performing intent recognition on the text to be extracted to obtain a text intent vector, and generating a text intent matrix based on the text intent vector; wherein, performing a dilated convolution on the text to be extracted to obtain a text intent vector, and performing a matrix conversion on the text intent vector to obtain a text intent matrix;

[0054] The text to be extracted is subjected to word embedding processing to obtain a word vector, and the text feature is generated according to the word vector, the character feature matrix and the text intent matrix; wherein, by performing word embedding processing on the text to be extracted, the word vector of the text to be extracted can be effectively obtained, and by fusing the word vector, the character feature matrix and the text intent matrix, the text feature can be obtained.

[0055] Furthermore, generating the text feature according to the word vector, the character feature matrix and the text intention matrix includes:

[0056] The character feature matrix and the text intention matrix are combined to obtain a query matrix, and a key matrix and a value matrix are constructed according to the word vectors; wherein the word vectors are matrix-converted according to a preset matrix size to obtain a key matrix and a value matrix;

[0057] A self-attention mechanism is calculated according to the query matrix, the key matrix and the value matrix to obtain a fusion matrix, and feature encoding is performed on the fusion matrix to obtain the text feature; wherein, the self-attention mechanism is calculated on the query matrix, the key matrix and the value matrix through the dot product attention mechanism, which can effectively fuse the word vector, the character feature matrix and the text intent matrix to obtain a fusion matrix, and feature encoding is performed on the fusion matrix through a preset encoding layer to obtain the text feature.

[0058] Furthermore, before inputting the text to be extracted into the pre-trained large model for feature extraction and obtaining text features, the method further includes:

[0059] Obtain sample text, and input the sample text into the large model for feature extraction to obtain sample features; wherein the sample text can be set according to requirements;

[0060] Extracting slots according to the sample features to obtain sample slot values, and calculating confidence of the sample slot values ​​to obtain sample confidence;

[0061] The model loss is determined according to the sample features, the sample slot values ​​and the sample confidence, and the parameters of the large model are updated according to the model loss until the large model converges; wherein, the parameters of the large model are updated through the model loss so that the converged large model can effectively perform slot extraction and confidence calculation on the input text.

[0062] Preferably, determining the model loss according to the sample feature, the sample slot value and the sample confidence comprises:

[0063] Obtaining standard features, standard slot values, and standard confidences corresponding to the sample text, and performing loss calculation based on the standard features and the sample features to obtain a first loss; wherein, performing vector conversion on the standard features and the sample features to obtain a standard vector and a sample vector, and calculating the distance between the standard vector and the sample vector based on a Euclidean distance formula to obtain the first loss;

[0064] A loss is calculated according to the standard slot value and the sample slot value to obtain a second loss, and a loss is calculated according to the standard confidence and the sample confidence to obtain a third loss; wherein the difference between the standard slot value and the sample slot value, and between the standard confidence and the sample confidence is calculated to obtain a slot difference and a confidence difference, and the slot difference and the confidence difference are mapped according to a preset mapping relationship to obtain the second loss and the third loss;

[0065] The first loss, the second loss and the third loss are weighted to obtain the model loss; wherein, during the weighted calculation process, the weighting coefficients of the first loss, the second loss and the third loss can be set according to requirements.

[0066] In this step, after obtaining the text to be extracted, it also includes:

[0067] The text to be extracted is subjected to syntactic analysis to obtain a syntactic tree structure, the syntactic tree structure is syntactically matched with a structural dictionary, and slot extraction is performed on the text to be extracted according to the syntactic matching result to obtain the slot value; wherein, syntactic analysis can be performed using a bottom-up analysis method, a line graph analysis method, or a statistical algorithm-based method to obtain a syntactic tree structure of the text to be extracted, the syntactic tree structure is syntactically matched with a structural dictionary, and slot extraction is performed on the text to be extracted according to the matched extraction rules to obtain the slot value.

[0068] Step S20, extracting slots according to the text features to obtain slot values, and calculating confidences of the slot values ​​to obtain prediction confidences;

[0069] The slot set S is defined as {s0,s0…s n-1},s 0≤i<n Indicates the i-th slot, and its corresponding slot description (field description) is d i , the corresponding slot value is v i Represents; defines the text sequence (slot information sequence) of the large model output slot and slot value information O = "s0 = [v0] ... s 1<i<n =[v i ]…", if v i If verification (confidence calculation) is required, the output text sequence is O′="…s i =[v i ](Slots i The description is: i , please re-enter the corresponding slot value: v i ′)…";

[0070] Optionally, performing confidence calculation on the slot value to obtain prediction confidence includes:

[0071]

[0072] c i is the prediction confidence of the i-th slot value, t j is the jth character in the i-th slot value, Yes j The character confidence, H is the output of the large model t j The corresponding input character sequence, P Mis the confidence level output by the large model.

[0073] Step S30, if the predicted confidence level is less than the confidence threshold, query the slot corresponding to the slot value, obtain the field description corresponding to the slot, and construct a slot information sequence according to the slot and the slot value;

[0074] Among them, the confidence threshold T can be set according to requirements. If c i ≥T, the large model continues to output the information of the next slot and slot value. By constructing the slot information sequence, it effectively facilitates the addition of subsequent field descriptions.

[0075] Step S40, add the field description to the slot information sequence to obtain a slot hint sequence, and input the slot hint sequence into the pre-trained large model;

[0076] Among them, if c i <T, then add the description information d i corresponding to the slot s i to the back of the character sequence "s0 = [v0]…s 1<i<n = [v i " as the input of the large model. The specific input is o i = "s0 = [v0]…s 1<i<n = [v i (the description of slot s i is: d i , please re-output the corresponding slot value: ", in this step, by inputting the slot hint sequence into the pre-trained large model, the large model can fully understand the meaning of the slot representation, so as to improve the accuracy of slot extraction.

[0077] Step S50, return to execute the step of performing slot extraction according to the text feature to obtain the slot value and subsequent steps until the predicted confidence levels of the slot values corresponding to the slots are all greater than or equal to the confidence threshold, and output the slot values corresponding to the slots to obtain the slot extraction result;

[0078] Among them, when the predicted confidence levels of the slot values corresponding to the slots are all greater than or equal to the confidence threshold, it is determined that the confidence level detections of all the slot values corresponding to the slots are completed. Therefore, the output slot values are highly reliable, and the accuracy of the slot extraction result is improved.

[0079] In this embodiment, by calculating the confidence level of the slot value, the reliability of the slot value can be effectively detected. When the predicted confidence level is less than the confidence threshold, the extraction of the slot value corresponding to the slot is re-performed. By inputting the slot hint sequence into the pre-trained large model, it can effectively make the large model more fully understand the meaning of the slot representation in the process of returning to execute the slot extraction according to the text feature, thereby improving the accuracy of slot extraction.

[0080] Embodiment 2

[0081] See also Figure 2 , is a schematic diagram of the structure of a slot extraction system 100 based on a large model provided in a second embodiment of the present invention, comprising:

[0082] The feature extraction module 10 is used to obtain the text to be extracted, and input the text to be extracted into the pre-trained large model for feature extraction to obtain text features.

[0083] Optionally, the feature extraction module 10 is further used to: perform character conversion on the text to be extracted according to the pre-trained large model to obtain a text character sequence, and perform padding convolution processing on the text character sequence to obtain a character feature matrix;

[0084] Performing intent recognition on the text to be extracted to obtain a text intent vector, and generating a text intent matrix according to the text intent vector;

[0085] The text to be extracted is subjected to word embedding processing to obtain a word vector, and the text feature is generated according to the word vector, the character feature matrix and the text intention matrix.

[0086] Furthermore, the feature extraction module 10 is also used to: combine the character feature matrix and the text intention matrix to obtain a query matrix, and construct a key matrix and a value matrix according to the word vector;

[0087] A self-attention mechanism is calculated according to the query matrix, the key matrix and the value matrix to obtain a fusion matrix, and feature encoding is performed on the fusion matrix to obtain the text feature.

[0088] Furthermore, the feature extraction module 10 is also used to: obtain sample text, and input the sample text into the large model for feature extraction to obtain sample features;

[0089] Extracting slots according to the sample features to obtain sample slot values, and calculating confidence of the sample slot values ​​to obtain sample confidence;

[0090] The model loss is determined according to the sample features, the sample slot values ​​and the sample confidence, and the parameters of the large model are updated according to the model loss until the large model converges.

[0091] Preferably, the feature extraction module 10 is further used to: obtain standard features, standard slot values ​​and standard confidences corresponding to the sample text, and perform loss calculation based on the standard features and the sample features to obtain a first loss;

[0092] Performing loss calculation according to the standard slot value and the sample slot value to obtain a second loss, and performing loss calculation according to the standard confidence and the sample confidence to obtain a third loss;

[0093] A weighted operation is performed on the first loss, the second loss, and the third loss to obtain the model loss.

[0094] In this embodiment, the feature extraction module 10 is further used to: perform syntactic analysis on the text to be extracted to obtain a syntactic tree structure, and perform syntactic matching between the syntactic tree structure and a structural dictionary;

[0095] Slot extraction is performed on the text to be extracted according to the syntactic matching result to obtain the slot value.

[0096] The confidence calculation module 11 is used to extract slots according to the text features to obtain slot values, and perform confidence calculation on the slot values ​​to obtain prediction confidence.

[0097] Optionally, performing confidence calculation on the slot value to obtain prediction confidence includes:

[0098]

[0099] c i is the prediction confidence of the i-th slot value, t j is the jth character in the i-th slot value, Yes j The character confidence, H is the output of the large model t j The corresponding input character sequence, P M is the confidence of the large model output.

[0100] The correction module 12 is used to query the slot corresponding to the slot value if the prediction confidence is less than the confidence threshold, obtain the field description corresponding to the slot, and construct a slot information sequence according to the slot and the slot value.

[0101] The field description is added to the slot information sequence to obtain a slot prompt sequence, and the slot prompt sequence is input into the pre-trained large model.

[0102] The output module 13 is used to return to execute the step of extracting the slot according to the text features to obtain the slot value and the subsequent steps, until the predicted confidence of the slot value corresponding to the slot is greater than or equal to the confidence threshold, and then output the slot value corresponding to the slot to obtain the slot extraction result.

[0103] In this embodiment, by calculating the confidence of the slot value, the reliability of the slot value can be effectively detected. When the predicted confidence is less than the confidence threshold, the slot value corresponding to the slot is re-extracted. By inputting the slot prompt sequence into the pre-trained large model, the large model can effectively understand the meaning of the slot more fully when returning to execute the slot extraction based on text features, thereby improving the accuracy of slot extraction.

[0104] Embodiment 3

[0105] Figure 3 2 is a block diagram of a terminal device 2 provided in the third embodiment of the present application. Figure 3 As shown, the terminal device 2 of this embodiment includes: a processor 20, a memory 21, and a computer program 22 stored in the memory 21 and executable on the processor 20, such as a program of a slot extraction method based on a large model. When the processor 20 executes the computer program 22, the steps in each embodiment of the slot extraction method based on a large model are implemented.

[0106] Exemplarily, the computer program 22 may be divided into one or more modules, which are stored in the memory 21 and executed by the processor 20 to complete the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 22 in the terminal device 2. The terminal device may include, but is not limited to, a processor 20 and a memory 21.

[0107] The processor 20 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0108] The memory 21 may be an internal storage unit of the terminal device 2, such as a hard disk or memory of the terminal device 2. The memory 21 may also be an external storage device of the terminal device 2, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 2. Further, the memory 21 may also include both an internal storage unit and an external storage device of the terminal device 2. The memory 21 is used to store the computer program and other programs and data required by the terminal device. The memory 21 may also be used to temporarily store data that has been output or is to be output.

[0109] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional unit.

[0110] If the integrated module is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Among them, the computer-readable storage medium can be non-volatile or volatile. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in computer-readable storage media can be appropriately increased or decreased according to the requirements of legislation and patent practices in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practices, computer-readable storage media do not include electrical carrier signals and telecommunication signals.

[0111] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A slot extraction method based on a large model, characterized in that: The method comprises: Obtain the text to be extracted, and input the text to be extracted into the pre-trained large model for feature extraction to obtain text features; Extracting slots according to the text features to obtain slot values, and calculating confidences of the slot values ​​to obtain prediction confidences; If the prediction confidence is less than the confidence threshold, query the slot corresponding to the slot value, obtain the field description corresponding to the slot, and construct a slot information sequence according to the slot and the slot value; Adding the field description to the slot information sequence to obtain a slot prompt sequence, and inputting the slot prompt sequence into the pre-trained large model; Return to executing the step of extracting slots according to the text features to obtain slot values ​​and subsequent steps, until the predicted confidences of the slot values ​​corresponding to the slots are greater than or equal to the confidence threshold, output the slot values ​​corresponding to the slots to obtain the slot extraction results.

2. The slot extraction method based on a large model as claimed in claim 1, characterized in that: Calculating the confidence of the slot value to obtain the prediction confidence includes: c i is the prediction confidence of the i-th slot value, t j is the jth character in the i-th slot value, Yes j The character confidence, H is the output of the large model t j The corresponding input character sequence, P M is the confidence of the large model output.

3. The slot extraction method based on a large model as claimed in claim 1, characterized in that: The text to be extracted is input into the pre-trained large model for feature extraction to obtain text features, including: Performing character conversion on the text to be extracted according to the pre-trained large model to obtain a text character sequence, and performing padding convolution processing on the text character sequence to obtain a character feature matrix; Performing intent recognition on the text to be extracted to obtain a text intent vector, and generating a text intent matrix according to the text intent vector; The text to be extracted is subjected to word embedding processing to obtain a word vector, and the text feature is generated according to the word vector, the character feature matrix and the text intention matrix.

4. The slot extraction method based on a large model as claimed in claim 3, characterized in that: Generating the text feature according to the word vector, the character feature matrix and the text intention matrix includes: Combining the character feature matrix and the text intent matrix to obtain a query matrix, and constructing a key matrix and a value matrix according to the word vectors; A self-attention mechanism is calculated according to the query matrix, the key matrix and the value matrix to obtain a fusion matrix, and feature encoding is performed on the fusion matrix to obtain the text feature.

5. The slot extraction method based on a large model as claimed in claim 1, characterized in that: The text to be extracted is input into the pre-trained large model for feature extraction to obtain text features, and the method also includes: Obtaining sample text, and inputting the sample text into the large model for feature extraction to obtain sample features; Extracting slots according to the sample features to obtain sample slot values, and calculating confidence of the sample slot values ​​to obtain sample confidence; The model loss is determined according to the sample features, the sample slot values ​​and the sample confidence, and the parameters of the large model are updated according to the model loss until the large model converges.

6. The slot extraction method based on a large model as claimed in claim 5, characterized in that: Determining a model loss according to the sample feature, the sample slot value, and the sample confidence includes: Obtaining standard features, standard slot values, and standard confidences corresponding to the sample text, and performing loss calculation based on the standard features and the sample features to obtain a first loss; Performing loss calculation according to the standard slot value and the sample slot value to obtain a second loss, and performing loss calculation according to the standard confidence and the sample confidence to obtain a third loss; A weighted operation is performed on the first loss, the second loss, and the third loss to obtain the model loss.

7. The slot extraction method based on a large model as claimed in claim 1, characterized in that: After obtaining the text to be extracted, it also includes: Performing syntactic analysis on the text to be extracted to obtain a syntactic tree structure, and performing syntactic matching between the syntactic tree structure and a structural dictionary; Slot extraction is performed on the text to be extracted according to the syntactic matching result to obtain the slot value.

8. A slot extraction system based on a large model, characterized in that: The system comprises: A feature extraction module is used to obtain the text to be extracted, and input the text to be extracted into the pre-trained large model for feature extraction to obtain text features; A confidence calculation module, used to extract slots according to the text features to obtain slot values, and perform confidence calculation on the slot values ​​to obtain prediction confidence; A correction module, configured to query the slot corresponding to the slot value, obtain a field description corresponding to the slot, and construct a slot information sequence according to the slot and the slot value if the prediction confidence is less than a confidence threshold; Adding the field description to the slot information sequence to obtain a slot prompt sequence, and inputting the slot prompt sequence into the pre-trained large model; The output module is used to return to execute the step of extracting slots according to the text features to obtain slot values ​​and subsequent steps, until the predicted confidence of the slot values ​​corresponding to the slots is greater than or equal to the confidence threshold, and then output the slot values ​​corresponding to the slots to obtain slot extraction results.

9. The large model-based slot extraction system according to claim 8, characterized in that: The feature extraction module is also used for: Performing character conversion on the text to be extracted according to the pre-trained large model to obtain a text character sequence, and performing padding convolution processing on the text character sequence to obtain a character feature matrix; Performing intent recognition on the text to be extracted to obtain a text intent vector, and generating a text intent matrix according to the text intent vector; The text to be extracted is subjected to word embedding processing to obtain a word vector, and the text feature is generated according to the word vector, the character feature matrix and the text intention matrix.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method and system for extracting slot position information

    CN112926313A

  • Slot prediction method and device for multi-intention text and computer equipment

    CN113887237A

  • Slot value extraction method and device based on slot meaning of large model

    CN117669565A

  • Slot identification method and electronic device

    WO2021190259A1