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

Through the large model-based slot extraction method, the reliability of the slot value is detected through feature extraction and confidence calculation, and re-extraction is carried out when the prediction confidence is insufficient, which solves the problem of low slot extraction accuracy and improves the accuracy and reliability of slot extraction.

CN119476205BActive Publication Date: 2025-09-26GUANGXI GUIYUNTONG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the existing slot extraction process, the slot extraction accuracy is low.

Method used

Through the slot extraction method based on the large model, the text to be extracted is obtained and feature extraction is performed, and the confidence of the slot value is calculated. If the predicted confidence is less than the threshold, the slot is queried to obtain the field description and construct a slot information sequence, which is then input into the large model for re-extraction until the confidence meets the conditions and the slot value is output.

Benefits of technology

The accuracy of slot extraction is improved. By detecting the reliability of slot values ​​and re-extracting when the prediction confidence is insufficient, we ensure a full understanding of the meaning of the slot representation and improve the reliability of the slot extraction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476205B_ABST
    Figure CN119476205B_ABST
Patent Text Reader

Abstract

The present invention provides a slot extraction method, system and storage medium based on a large model. The method includes: inputting the text to be extracted into a pre-trained large model for slot extraction to obtain slot values, performing confidence calculation on the slot values ​​to obtain prediction confidence; if the prediction confidence is less than a confidence threshold, constructing a slot information sequence according to the slot position and the slot value; adding a 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; returning to execute the step of extracting slots according to text features to obtain slot values ​​and subsequent steps, until the prediction confidence of the slot values ​​corresponding to the slots are all greater than or equal to the confidence threshold, outputting the slot values ​​corresponding to the slots to obtain slot extraction results. In an embodiment of the present invention, by inputting the slot prompt sequence into the pre-trained large model, the large model can effectively understand the meaning of the slots more fully, thereby improving the accuracy of slot extraction.
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, advances in deep learning have greatly fueled the growth of artificial intelligence, leading to key breakthroughs in natural language processing. Human-computer dialogue systems are a key research area within this field. The primary goal of human-computer dialogue systems is to enable information exchange between machines and users using language similar to human communication, assisting users in completing specific tasks. Natural language understanding is a key module in dialogue systems that understand human language. Slot extraction, as a crucial component of natural language understanding, is gaining increasing attention for its 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 based on the text features to obtain slot values, and performing confidence calculation on the slot values ​​to obtain prediction confidence;

[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 and obtaining 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, output the slot values ​​corresponding to the slots, and 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, It is t j The character confidence, H is the output of the large model t j The corresponding input character sequence, P M is the confidence level 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 based on 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 based on the word vector, the character feature matrix and the text intent matrix.

[0018] Preferably, generating the text features according to the word vectors, the character feature matrix, and the text intent 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 based on the word vectors;

[0020] A self-attention mechanism is calculated based on 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 performing confidence calculation on the sample slot values ​​to obtain sample confidence;

[0024] A model loss is determined according to the sample features, the sample slot values, and the sample confidence, and 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 features, the sample slot values ​​and the sample confidence comprises:

[0026] Obtaining standard features, standard slot values, and standard confidence 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 a loss calculation based on the standard slot value and the sample slot value to obtain a second loss, and performing a loss calculation based on 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 is used to extract slots based on 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, if the prediction confidence is less than a confidence threshold, 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;

[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 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, output the slot value corresponding to the slot, and obtain the slot extraction result.

[0038] Preferably, the feature extraction module is further used to:

[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 based on 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 based on the word vector, the character feature matrix and the text intent matrix.

[0042] The embodiments of the present invention can effectively detect the reliability of slot values ​​by performing confidence calculation on slot values. 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 representation meaning of the slot more fully when returning to execute slot extraction based on text features, thereby improving the accuracy of 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 by the first embodiment of the present invention;

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

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

[0046] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to 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, specific embodiments are provided below.

[0048] Example 1

[0049] See also Figure 1 , is a flow chart of a slot extraction method based on a large model provided by 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 includes the following steps:

[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 the pre-trained large model for feature extraction to obtain text features, including:

[0052] 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; wherein, performing character conversion on the text to be extracted according to the character dictionary to obtain a text character sequence, and performing padding convolution processing on the text character sequence 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 based on 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 the text feature is obtained by fusing the word vector, the character feature matrix and the text intent matrix.

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

[0056] Combining the character feature matrix and the text intent matrix to obtain a query matrix, and constructing a key matrix and a value matrix based on the word vectors; wherein the word vectors are matrix-converted according to a preset matrix size to obtain the key matrix and the value matrix;

[0057] A self-attention mechanism is performed on 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 features; wherein, the self-attention mechanism is performed 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 text features.

[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] Obtaining sample text, and inputting 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 performing confidence calculation on 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 features, the sample slot values ​​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 based on the standard slot value and the sample slot value to obtain a second loss, and a loss is calculated based on the standard confidence level and the sample confidence level to obtain a third loss; wherein the difference between the standard slot value and the sample slot value, and between the standard confidence level and the sample confidence level is calculated to obtain a slot difference value and a confidence difference value, and the slot difference value and the confidence difference value are mapped according to a preset mapping relationship to obtain the second loss and the third loss;

[0065] A weighted operation is performed on the first loss, the second loss and the third loss to obtain the model loss; wherein, during the weighted operation, 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, the following steps are also included:

[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 the matched extraction rules are used to perform slot extraction on the text to be extracted to obtain the slot value.

[0068] Step S20, extracting slots based on the text features to obtain slot values, and performing confidence calculation on the slot values ​​to obtain prediction confidence;

[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 of the large model output slot and slot value information (slot information sequence) 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, It is t 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 prompt sequence, and input the slot prompt 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 [[ID=..]] i to the back of the character sequence "s0 = [v0]…s [[ID=..]] 1<i<n = [v [[ID=..]] i " as the input of the large model. The specific input is o [[ID=..]] i = "s0 = [v0]…s [[ID=..]] 1<i<n = [v [[ID=..]] i (the description of slot s [[ID=..]] i is: d [[ID=..]] i , please re - output the corresponding slot value: ", in this step, by inputting the slot prompt sequence into the pre-trained large model, the large model can fully understand the representation meaning of the slot, so as to improve the accuracy of slot extraction.

[0077] Step S50, return to execute the step of slot extraction based on the text features 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 detection of all slot values corresponding to the slots is completed. Therefore, the output slot values are highly reliable, improving the accuracy of the slot extraction result.

[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 prompt sequence into the pre-trained large model, it can effectively make the large model more fully understand the representation meaning of the slot during the process of returning to execute the slot extraction based on the text features, thereby improving the accuracy of slot extraction.

[0080] Example 2

[0081] See also Figure 2 , is a schematic structural diagram of a large model-based slot extraction system 100 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 configured 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 a padded convolution process 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 based on 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 based on the word vector, the character feature matrix and the text intent matrix.

[0086] Furthermore, the feature extraction module 10 is further configured to: combine the character feature matrix and the text intent matrix to obtain a query matrix, and construct a key matrix and a value matrix based on the word vectors;

[0087] A self-attention mechanism is calculated based on 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 further configured 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 performing confidence calculation on the sample slot values ​​to obtain sample confidence;

[0090] A model loss is determined according to the sample features, the sample slot values, and the sample confidence, and 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 configured to: obtain standard features, standard slot values, and standard confidence levels 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 a loss calculation based on the standard slot value and the sample slot value to obtain a second loss, and performing a loss calculation based on 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 configured 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 structure 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, It is t j The character confidence, H is the output of the large model t j The corresponding input character sequence, P M is the confidence level of the large model output.

[0100] The correction module 12 is configured to query the slot corresponding to the slot value if the prediction confidence is less than a confidence threshold, obtain a 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 and obtaining the slot value and subsequent steps, until the predicted confidence of the slot value corresponding to the slot is greater than or equal to the confidence threshold, and 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 the text features, thereby improving the accuracy of the slot extraction.

[0104] Example 3

[0105] Figure 3 This 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 for the large-model-based slot extraction method. When the processor 20 executes the computer program 22, the steps of each of the aforementioned large-model-based slot extraction method embodiments 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 implement the present application. The one or more modules may be a series of computer program instruction segments capable of performing 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), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), 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.

[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. Furthermore, the memory 21 may include both an internal storage unit of the terminal device 2 and an external storage device. 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 about to be output.

[0109] In addition, the functional modules in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[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 process 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, etc. The computer-readable storage medium may include: any entity or device that can carry computer program code, recording medium, U disk, mobile hard disk, magnetic 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 telecommunications signals.

[0111] The above-described embodiments 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, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection 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 based on the text features to obtain slot values, and performing confidence calculation on the slot values ​​to obtain prediction confidence; 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 and obtaining 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, output the slot values ​​corresponding to the slots, and obtain the slot extraction results.

2. The slot extraction method based on a large model according to 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, It is t j The character confidence, H is the output of the large model t j The corresponding input character sequence, P M is the confidence level of the large model output.

3. The slot extraction method based on a large model according to 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 based on 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 based on the word vector, the character feature matrix and the text intent matrix.

4. The slot extraction method based on a large model according to claim 3, characterized in that: Generating the text features according to the word vector, the character feature matrix, and the text intent 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 based on the word vectors; A self-attention mechanism is calculated based on 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 according to claim 1, characterized in that: Inputting the text to be extracted into the pre-trained large model for feature extraction to obtain text features 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 performing confidence calculation on the sample slot values ​​to obtain sample confidence; A model loss is determined according to the sample features, the sample slot values, and the sample confidence, and 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 according to 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 confidence corresponding to the sample text, and performing loss calculation based on the standard features and the sample features to obtain a first loss; Performing a loss calculation based on the standard slot value and the sample slot value to obtain a second loss, and performing a loss calculation based on 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 according to 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 is used to extract slots based on the text features to obtain slot values, and perform confidence calculation on the slot values ​​to obtain prediction confidence; a correction module, configured to, if the prediction confidence is less than a confidence threshold, 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; 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 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, output the slot value corresponding to the slot, and obtain the slot extraction result.

9. The large model-based slot extraction system according to claim 8, characterized in that: The feature extraction module is also used to: 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 based on 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 based on the word vector, the character feature matrix and the text intent 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 value extraction method and device based on slot meaning of large model

    CN117669565A