WO2023197613A1 - 一种小样本微调方法、系统及相关装置 - Google Patents

一种小样本微调方法、系统及相关装置 Download PDF

Info

Publication number
WO2023197613A1
WO2023197613A1 PCT/CN2022/134801 CN2022134801W WO2023197613A1 WO 2023197613 A1 WO2023197613 A1 WO 2023197613A1 CN 2022134801 W CN2022134801 W CN 2022134801W WO 2023197613 A1 WO2023197613 A1 WO 2023197613A1
Authority
WO
WIPO (PCT)
Prior art keywords
candidate
input
template
prompt
word
Prior art date
Application number
PCT/CN2022/134801
Other languages
English (en)
French (fr)
Inventor
刘红丽
李峰
于彤
申冲
Original Assignee
苏州浪潮智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Publication of WO2023197613A1 publication Critical patent/WO2023197613A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/335Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri

Definitions

  • the present application relates to the field of computer technology, and in particular to a small sample fine-tuning method, system and related devices.
  • Pretrained language models can perform many tasks when the prompt template contains some training examples. But this type of few-shot learning can be very unstable: the choice of prompt template format, training samples, and even training sample order can cause accuracy to drift from close to chance to close to the state-of-the-art. This instability These biases stem from the language model's bias in predicting certain answers, for example, those placed near the end of the prompt, or answers that are common in pre-training data. These biases tend to cause changes in the model's output distribution. Therefore, different prompt templates have a great impact on the final accuracy.
  • prompt templates are designed based on human intuition.
  • finding a suitable and correct prompt template requires both professional knowledge and a full understanding of the inner workings of the language model.
  • manually designing prompt templates or tag words for different tasks is a thankless task. Therefore, the automated build prompt method should be adopted.
  • the search space of prompt template is very large, and when there is only a small amount of labeled data for template search, it can easily lead to overfitting.
  • the purpose of this application is to provide a small sample fine-tuning method, system, non-volatile readable storage medium and electronic device, which can reduce the differences between different prompt templates and improve the accuracy of downstream tasks.
  • the input data set and the input samples composed according to a fixed template include:
  • building a candidate tag word set and a candidate prompt template set includes:
  • automatically selecting candidate tag words includes:
  • automated selection of candidate prompt templates includes:
  • the initial prompt template is used to maximize the output probability in the training set
  • the beam search algorithm is used to decode the initial prompt template to obtain the candidate prompt template.
  • reinforcement learning is used to search for the best label word in the candidate label word set corresponding to the input sample, and the prompt template in the candidate prompt template set corresponding to the input sample includes:
  • the search space list is obtained by combining the candidate tag word set and the template set corresponding to the candidate prompt template;
  • the best label word in the candidate label word set corresponding to the input sample is determined through the search space list, and the prompt template in the candidate prompt template set corresponding to the input sample is determined.
  • This application also provides a small sample fine-tuning system, including:
  • the sample composition module is used to input data sets and form input samples according to fixed templates
  • the candidate set building module is used to build a candidate tag word set and a candidate prompt template set
  • the best selection module is used to search for the best label words in the candidate label word set corresponding to the input sample through reinforcement learning, and the prompt template in the candidate prompt template set corresponding to the input sample;
  • the output module is used to output the best tag word mapping relationship and the best prompt template format corresponding to the prompt template.
  • sample component modules include:
  • Input unit used to obtain input content
  • Conversion unit used to represent input content in a fixed template
  • the similarity calculation unit is used to calculate the cosine similarity between the input content and all samples in the training set;
  • the sampling unit is used to randomly sample from a preset percentage of training set samples to obtain input samples.
  • This application also provides a non-volatile readable storage medium on which a computer program is stored.
  • the computer program is executed by a processor, the steps of the above method are implemented.
  • This application also provides an electronic device, including a memory and a processor.
  • a computer program is stored in the memory.
  • the processor calls the computer program in the memory, the steps of the above method are implemented.
  • This application provides a small sample fine-tuning method.
  • the specific technical solution is as follows: input a data set and form input samples according to a fixed template; construct a candidate label word set and a candidate prompt template set; search for candidates corresponding to the input samples through reinforcement learning The best tag word in the tag word set and the prompt template in the candidate prompt template set corresponding to the input sample; output the best tag word mapping relationship and the best prompt template format corresponding to the prompt template.
  • This application constructs a candidate tag word set and selects the intersection of a synonym set and a conditional probability set to reduce the candidate tag word search space, while reducing the differences between different prompt templates and improving the accuracy of downstream tasks.
  • Using prompt to fine-tune the pre-trained model method reduces memory requirements and system complexity, especially to prevent over-fitting of small samples.
  • this application uses the reinforcement learning process to search for the best tag words and templates, solving the problem that general algorithms can easily fall into local optimality.
  • This application also provides a small sample fine-tuning system, a non-volatile readable storage medium and an electronic device, which have the above beneficial effects and will not be described again here.
  • Figure 1 is a flow chart of the small sample fine-tuning method provided by the embodiment of the present application.
  • Figure 2 is a schematic structural diagram of the small sample fine-tuning system provided by the embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • NLP Natural Language Processing
  • the input sentence is usually [CLS] Sentence 1 [SEP] or a pair of sentences [CLS] Sentence 1 [SEP] Sentence 2 [SEP], and then an additional classifier is added in the [CLS] part (Fully connected layer + softmax (normalized exponential function)).
  • This method will introduce new parameters and lead to local optima during the training process.
  • Adopting hint-based fine-tuning methods can effectively alleviate this problem, that is, treating the downstream task as an "auto-completion" task of a masked language model (MLM).
  • MLM masked language model
  • x 1 represents the input sentence
  • It was[MASK] represents a prompt template
  • the [MASK] part is a label word, which is used as a substitute word for the label of the class to which the current sentence belongs.
  • the label word For example, for the two-classification task of movie reviews, It contains positive (positive) and negative (negative), and you can use the two words great (good) and serious (bad) as the label words of the two categories respectively.
  • the original is the probability that given an input sentence x in , it belongs to a certain class y.
  • the probability that [MASK] in its prompt template is predicted to be the mapped label word M(y).
  • Tag word mapping M(y) That is, the vocabulary set output by [MASK] position prediction, which forms a mapping relationship with the real tag y.
  • Word2vec is an NLP tool launched by Google in 2013. Its feature is to vectorize all words, so that the relationship between words can be quantitatively measured and the connections between words can be mined.
  • the key factors in reinforcement learning include model carrier (Agent), environment (Environment), state (State), action (Action) and reward (Reward).
  • Agent model carrier
  • Environment environment
  • State state
  • Action Action
  • reward Reward
  • the goal of reinforcement learning is to learn a strategy that enables the agent to take appropriate actions at the right time to obtain the maximum reward.
  • the essence of the policy gradient algorithm is to establish a policy network, predict the current strategy that should be implemented by observing the environment state, execute this strategy, and obtain the maximum reward that can be obtained.
  • Prompt fine-tuning brings bias from the pre-training corpus. For example, in a zero-shot sentiment classification setting, given "N/A” as input, GPT-3 tends to predict "positive” rather than “negative” when it should assign a 50/50 probability to these two opposite Tag of. Another issue is that different representations of the same object (e.g., “computer” and “PC”) may compete for probability mass, resulting in a suboptimal distribution over task labels. Therefore correction is necessary in practical applications.
  • the core idea of this application is to compensate biased tag words and calibrate them to an unbiased state.
  • Figure 1 is a flow chart of a small sample fine-tuning method provided by an embodiment of the present application.
  • the method includes:
  • S103 Use reinforcement learning to search for the best label word in the candidate label word set corresponding to the input sample, and the prompt template in the candidate prompt template set corresponding to the input sample;
  • S104 Output the best tag word mapping relationship and the best prompt template format corresponding to the prompt template.
  • the initialization prompt template format T sentence (sentence), indicates that this evaluation is very __.
  • Input downstream task data divided into training set, verification set, and test set;
  • the SBERT sentence-BERT, semantic similarity pre-training model
  • the cosine similarity with all samples in the training set is calculated separately, and then only the preset percentage is Randomly sample the training set samples, for example, randomly sample the previous 50% of the training set samples to form the input;
  • Step S102 can be divided into two parts:
  • the first part is to first determine the set of candidate tag words, which may include the following steps;
  • the first step is to initialize the vocabulary
  • the third step is to pass the pre-trained model without fine-tuning For each category c in the training set, select the Topk words in the vocabulary that maximize the conditional probability, and the set is V c :
  • the fifth step is to synthesize the candidate label words under each category, and then find the distribution method that maximizes the accuracy of the training set as the temporary best label word;
  • the second part is to determine the set of candidate prompt templates. You can first determine the best candidate label words; generate an initial prompt template by filling in placeholders. The prompt template is used to maximize the output probability in the training set. Finally, a beam search algorithm is used to determine the initial prompt template. Decode to obtain the candidate prompt template. Since the generative-oriented natural language model is pre-trained based on a variety of unsupervised objectives, it is suitable to generate prompt templates by filling placeholders ⁇ X> and ⁇ Y>.
  • the above obtains the first n candidate label word sets for each category, expressed as ⁇ M 1 , M 2 ,..., M c ,..., M N ⁇ , where M c represents the candidate mapped when the category is c Tag word set, N represents the number of categories.
  • M c represents the candidate mapped when the category is c Tag word set
  • N represents the number of categories.
  • the two are combined into a search space such as the search space list in Table 1.
  • the goal is to find the best way to allocate tag words and templates during the fine-tuning process.
  • the coded number in L[0:N-1] represents the subscript of the candidate tag word in the corresponding set
  • the coded number in L[N] represents the subscript of the candidate template in the corresponding set. mark.
  • Table 2 is a comparison table of reinforcement learning and its meaning, including the reinforcement learning objects applied in this embodiment and their meanings:
  • the output is obtained. Compare the output result with the label, calculate the loss of both, and use the loss result as a reward to feed back to the agent.
  • the agent determines the direction of template and label word selection based on the reward until the best label word and prompt template are determined.
  • the embodiment of this application reduces the search space of candidate tag words by constructing a candidate tag word set and selecting the intersection of a synonym set and a conditional probability set, while reducing the differences between different prompt templates and improving the accuracy of downstream tasks.
  • using prompt to fine-tune the pre-trained model method reduces memory requirements and system complexity, especially to prevent over-fitting of small samples. Taking the candidate label words under each category as the intersection of the synonym set and the conditional probability set reduces the search space for label words.
  • this application uses the reinforcement learning process to search for the best tag words and templates, solving the problem that general algorithms can easily fall into local optimality.
  • the embodiment of this application takes the pre-trained GPT-3 model as an example to explain a specific application process of this application:
  • the embodiment of this application uses the Chinese natural language understanding data set from CLUE Benchmark (Chinese Language Understanding Benchmark), which includes multiple different types of tasks, including sentiment analysis tasks, natural language reasoning, multiple text classifications, text matching tasks and idioms Reading comprehension, etc.
  • CLUE Benchmark Choinese Language Understanding Benchmark
  • the following uses the e-commerce product review sentiment analysis data set (EPRSTMT) as an example to explain.
  • Each piece of data has three attributes, from front to back: id, sentence, and label. Where label is the label, Negative means negative, corresponding to 0. Positive means positive, corresponding to 1.
  • Step 1 Convert the original training and verification data into prompts input and a list of true_labels. For example, sentence: "There is a little wear on the outer packaging, and I feel good after listening to it” is an example of the verification set. Use the SBERT method to find similar samples s1 in the training set. : “The goods have been received and I tried listening to it. The sound quality is OK.” and s2: "The microphone sound is small and the phone can still play when the headphones are plugged in. Don't buy the headphones.”.
  • the final prompts are as follows:
  • GPT-3 does not consider delimiters such as [CLS][SEP] when pre-training input, so the corresponding downstream task input is not added.
  • Step 2 Automatically select candidate tag words
  • Step 3 Automatically select candidate templates
  • Step 4 Search for the best tag words and prompt templates through reinforcement learning
  • the input example is: "I actually have a broken headphone, and I'm too lazy to replace it.”
  • the input LM model is composed of a template format and the output label word ⁇ bad, good ⁇ corresponds to probability [0.000906262, 0.01283005], normalized [0.065975690.93402431] , predicted as "good” based on the maximum position, predicted incorrectly.
  • the calculated and corrected value based on W*p pre is [2.06080189, 0.96491567], and the prediction based on the maximum value position is "bad", and the prediction is correct.
  • the embodiment of this application updates the policy network with reward feedback based on the corrected accuracy rate, thereby outputting better label word and template selection.
  • a small-sample fine-tuning system provided by embodiments of the present application is introduced below.
  • the small-sample fine-tuning system described below and the small-sample fine-tuning method described above can be mutually referenced.
  • Figure 2 is a schematic structural diagram of a small-sample fine-tuning system provided by an embodiment of the present application.
  • the present application also provides a small-sample fine-tuning system, including:
  • the sample composition module is used to input data sets and form input samples according to fixed templates
  • the candidate set building module is used to build a candidate tag word set and a candidate prompt template set
  • the best selection module is used to search for the best label word in the candidate label word set corresponding to the input sample through reinforcement learning, and the prompt template in the candidate prompt template set corresponding to the input sample;
  • the output module is used to output the best tag word mapping relationship and the best prompt template format corresponding to the prompt template.
  • sample component modules include:
  • Input unit used to obtain input content
  • Conversion unit used to represent input content in a fixed template
  • the similarity calculation unit is used to calculate the cosine similarity between the input content and all samples in the training set;
  • the sampling unit is used to randomly sample from a preset percentage of training set samples to obtain input samples.
  • the storage medium can include: U disk, mobile hard disk, read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other various media that can store program code.
  • the present application also provides an electronic device, which may include a memory 11 and a processor 12.
  • the memory 11 stores a computer program.
  • the processor 12 calls the computer program in the memory 11, the above embodiments can be implemented. Steps provided.
  • the electronic device may also include various network interfaces, power supplies and other components.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Machine Translation (AREA)

Abstract

本申请提供一种小样本微调方法,涉及计算机技术领域,包括:输入数据集,按固定模板组成输入样例;构建候选标签词集合和候选prompt模板集合;通过强化学习搜索输入样例对应的候选标签词集合中的最佳标签词,和输入样例对应的候选prompt模板集合中的提示模板;输出最佳标签词映射关系以及提示模板对应的最佳prompt模板格式。本申请通过构建候选标签词集合,通过选择近义词集合和条件概率集合的交集,缩减候选标签词搜索空间,同时减少不同prompt模板之间的差异性,提高下游任务准确率。本申请还提供一种小样本微调系统、非易失性可读存储介质和电子设备,具有上述有益效果。

Description

一种小样本微调方法、系统及相关装置
相关申请的交叉引用
本申请要求于2022年04月15日提交中国专利局,申请号为202210392419.0,申请名称为“一种小样本微调方法、系统及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,特别涉及一种小样本微调方法、系统及相关装置。
背景技术
当前,在下游任务中微调预训练语言模型(LM)已成为NLP领域的通用做法。在标准的“预训练(pre-training)和微调(fine-tuning)”范式中,预训练阶段和下游任务之间的差距可能很大:它们训练目标不同。对于下游任务,通常需要引入新的参数。然而,随着语言模型的日益增大,很难有效地全参数微调预训练模型和新任务相关的参数,但是基于prompt的微调可以使得下游任务采用与预训练目标相同的格式,并且不需要新的参数。
当prompt模板包含一些训练示例时,预训练的语言模型可以执行许多任务。但是这种类型的小样本学习可能是非常不稳定的:prompt模板格式的选择、训练样本、甚至训练样本顺序都可能导致准确性在接近偶然到接近最先进水平之间漂移,这种不稳定性源于语言模型对预测某些答案的偏差,例如,那些被放在提示语末尾附近的答案,或在预训练数据中常见的答案,这些偏差往往会导致模型的输出分布发生变化。因此不同的prompt模板对最终准确性影响很大。
为了更好的完成相关下游任务,当前大多数prompt模板是根据人工直觉设计的。但是,找到一个合适的、正确的提示模板,既需要专业知识、又需要对语言模型内部的运作方式有着充分的理解。其实,针对不同任务,就人工手动设计提示模板或者标签词,是一件费力不讨好的事情。因此,应该采用自动化构建prompt方法。但是prompt模板的搜索空间很大,而且当只有少量标注数据进行模板搜索时,很容易导致过度拟合。
发明内容
本申请的目的是提供一种小样本微调方法、系统、非易失性可读存储介质和电子设备,能够减少不同prompt模板之间的差异性,提高下游任务准确率。
为解决上述技术问题,本申请提供一种小样本微调方法,具体技术方案如下:
输入数据集,按固定模板组成输入样例;
构建候选标签词集合和候选prompt模板集合;
通过强化学习搜索输入样例对应的候选标签词集合中的最佳标签词,和输入样例对应的候选prompt模板集合中的提示模板;
输出最佳标签词映射关系以及提示模板对应的最佳prompt模板格式。
在一些实施例中,输入数据集,按固定模板组成输入样例包括:
获取输入内容;
将输入内容以固定模板表示;
计算输入内容与训练集中所有样本之间的余弦相似度;
从前预设百分比的训练集样本中进行随机采样,得到输入样例。
在一些实施例中,构建候选标签词集合和候选prompt模板集合包括:
自动化选择最佳候选标签词;
自动化选择候选prompt模板。
在一些实施例中,自动化选择候选标签词包括:
初始化词表;
采用word2vec方法将词表中所有的词向量化,通过余弦相似度确定每个标签对应的近义词集合;
通过未经微调的预训练模型L,对于训练集中的每一个类别,在词表中选择使得条件概率最大的单词,以及包含单词的条件概率集合:
确定各类别下的候选标签词为近义词集合和条件概率几何交集的最大值;
综合各类别下的候选标签词,确定令训练集正确率最大的分配方式作为最佳候选标签词。
在一些实施例中,自动化选择候选prompt模板包括:
确定最佳候选标签词;
通过填充占位符生成初始提示模板;初始提示模板用于令训练集中的输出概率最大;
采用集束搜索算法对初始提示模板解码得到候选prompt模板。
在一些实施例中,通过强化学习搜索输入样例对应的候选标签词集合中的最佳标签词,和输入样例对应的候选prompt模板集合中的提示模板包括:
确定每个类别的前预设数量个候选标签词集合;
将候选标签词集合与候选prompt模板对应的模板集合组合得到搜索空间列表;
通过搜索空间列表确定输入样例对应的候选标签词集合中的最佳标签词,和输入样例对应的候选prompt模板集合中的提示模板。
本申请还提供一种小样本微调系统,包括:
样例组成模块,用于输入数据集,按固定模板组成输入样例;
候选集合构建模块,用于构建候选标签词集合和候选prompt模板集合;
最佳选择模块,用于通过强化学习搜索输入样例对应的候选标签词集合中的最佳标签词,和输入样例对应的候选prompt模板集合中的提示模板;
输出模块,用于输出最佳标签词映射关系以及提示模板对应的最佳prompt模板格式。
在一些实施例中,样例组成模块包括:
输入单元,用于获取输入内容;
转换单元,用于将输入内容以固定模板表示;
相似度计算单元,用于计算输入内容与训练集中所有样本之间的余弦相似度;
采样单元,用于从前预设百分比的训练集样本中进行随机采样,得到输入样例。
本申请还提供一种非易失性可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现如上的方法的步骤。
本申请还提供一种电子设备,包括存储器和处理器,存储器中存有计算机程序,处理器调用存储器中的计算机程序时实现如上的方法的步骤。
本申请提供一种小样本微调方法,具体技术方案如下:输入数据集,按固定模板组成输入样例;构建候选标签词集合和候选prompt模板集合;通过强化学习搜索所述输入样例对应的候选标签词集合中的最佳标签词,和输入样例对应的候选prompt模板集合中的提示模板;输出最佳标签词映射关系以及提示模板对应的最佳prompt模板格式。
本申请通过构建候选标签词集合,通过选择近义词集合和条件概率集合的交集,缩减候选标签词搜索空间,同时减少不同prompt模板之间的差异性,提高下游任务准确率。采用prompt微调预训练模型方法降低了内存需求和系统复杂性,尤其防止小样本过 拟合。同时本申请采用强化学习过程搜索最佳标签词和模板,解决通用算法容易陷入局部最优问题。
本申请还提供一种小样本微调系统、非易失性可读存储介质和电子设备,具有上述有益效果,此处不再赘述。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请实施例所提供的小样本微调方法的流程图;
图2为本申请实施例所提供的小样本微调系统结构示意图;
图3为本申请实施例所提供一种电子设备结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
下文先对本申请的相关概念进行说明:
一般而言NLP(Natural Language Processing,自然语言处理)高效预训练框架围绕三个部分进行:模型预训练、模型微调和模型推理。
当前对prompt(提示)的研究有两种不同的方向:一、对于像175B GPT-3和11B T5这样的超大型模型,微调它们比较困难而且成本很高,因此希望固定它们的参数,然后将不同的prompt应用到不同任务上,但是通常该方法精度无法和微调相比。二、采用基于prompt的微调方法,能够保持精度的同时大大缩减优化参数量。
在标准的微调方案中,通常输入句子为[CLS]语句1[SEP]或者成对的句子[CLS]语句1[SEP]语句2[SEP],然后在[CLS]部分添加一个额外的分类器(全连接层+softmax(归一化指数函数))。这种方法会引入新的参数,且在训练过程中会导致局部最优。
采用基于提示的微调方法能有效缓解,即将下游任务视为一种掩码语言模型 (masked language modeling,MLM)的“自动补全”任务。例如输入的句子是:
x prompt=[CLS]x 1It was[MASK].[SEP]
其中x 1表示输入的句子,It was[MASK]则表示一个prompt模板,其中[MASK]部分则为一个标签词,其作为当前句子所属类的标签的代替词,例如对于电影评论二分类任务,其包含positive(积极)和negative(消极),则可以分别使用great(好的)和terrible(坏的)两个词作为两个类的标签词。
值得注意的是:上述方法重新使用了预先训练的参数权重,并且没有引入任何新参数来进行微调。同时还减少了微调和预训练之间的差距,这可以更有效地用于小样本场景。
当作为分类任务时:
Figure PCTCN2022134801-appb-000001
原始是给定一个输入句子x in,其属于对应某个类y的概率。经过转化后,给定一个输入句子x prompt时,其prompt模板中[MASK]预测为映射的标签词M(y)的概率。
由上述分析,可以得知prompt由两部分构成:
模板T:例如It was[MASK]
标签词映射M(y):即[MASK]位置预测输出的词汇集合,与真实标签y构成映射关系。
在基于提示的微调方法中,不同的模板和标签词选择其实对最终结果影响很大:使用相同“标签词”,即使对“模板”进行较小改动(如换标点符号)也会呈现不同结果;使用相同“模板”,不同的“标签词”效果也不一样。
因此,如何缓解这种不稳定性并自动化构建有效提示模板是当前研究热点。
在做自然语言处理的过程中,经常会遇到需要找出相似语句或词语的场景,涉及到句子或词语相似度计算的问题。具体计算流程:首先对句子进行分词,然后对分好的每一个词获取其对应的Vector(向量),然后将所有Vector相加并求平均,得到句子Vector,最后再利用如下公式计算其夹角余弦值即可,余弦值越接近1(即夹角越小)表示语句或词语之间的相似度越高:
Figure PCTCN2022134801-appb-000002
其中利用word2vec模型计算Vector是目前常用方法之一。word2vec是google在2013年推出的一个NLP工具,它的特点是将所有的词向量化,这样词与词之间就可以定量的去度量他们之间的关系,挖掘词之间的联系。
强化学习中关键因素包括模型载体(Agent)、环境(Environment)、状态(State)、动作(Action)和奖励(Reward)。强化学习的目标是学习一个策略,使得智能体在合适的时候做出合适的动作,以获得最大的奖励。
强化学习中两种重要的方法是基于Q值的强化学习和基于策略梯度的强化学习。策略梯度算法的实质是建立一个策略网络(policy network),通过观察环境状态预测出目前应该执行的策略,执行这个策略,并获取可以获得的最大奖励。
Prompt微调会从预训练语料库带来偏置。例如,在零样本情感分类设置中,给定“N/A”作为输入,GPT-3倾向于预测为“positive”而不是“negative”,而本应该分配50/50的概率给这两个相反的标签。另一个问题是同一对象的不同表示(例如,“computer(电脑)”和“PC”)可能会竞争概率质量,导致任务标签上的分布不理想。因此在实际应用中校正很有必要。
本申请的核心思想是对带偏置的标签词进行补偿,把它们校准为无偏状态。具体流程首先输入无文本样例,即将无文本["N/A","","[MASK]"]分别和标签词组合,如"N/A"与标签词“好”组成Prompt:“N/A。这个评价很好”;然后将Prompts输入语言模型,输出标签词位置对应的所有类别概率(logits),并取平均值后归一化得到p_cf;根据公式W=[diag(p_cf)] -1计算校正矩阵;校正后类别概率p cal=softmax(W*p pre+b),本申请中b为零。
请参考图1,图1为本申请实施例所提供的小样本微调方法的流程图,该方法包括:
S101:输入数据集,按固定模板组成输入样例;
S102:构建候选标签词集合和候选prompt模板集合;
S103:通过强化学习搜索输入样例对应的候选标签词集合中的最佳标签词,和输入样例对应的候选prompt模板集合中的提示模板;
S104:输出最佳标签词映射关系以及提示模板对应的最佳prompt模板格式。
首先输入数据集并进行数据处理:
初始化提示模板格式T:sentence(句子),表示这个评价很__。
输入下游任务数据,分训练集、验证集、测试集;
可以采用SBERT(sentence-BERT,语义相似度预训练模型)方法对句子进行编码,对于验证集的每个输入,分别计算与训练集中所有样本之间的余弦相似度,然后仅从前预设百分比的训练集样本中进行随机采样,例如从前50%的训练集样本中进行随机采样,组成输入;
转换成prompts输入x prompt=T(x in)。
而对于步骤S102,可以分为两部分执行:
第一部分,先确定候选标签词集合,可以包括如下步骤;
第一步、初始化词表
Figure PCTCN2022134801-appb-000003
第二步、采用word2vec方法将词表中所有的词向量化,通过余弦相似度确定每个标签对应的近义词集合S c
第三步、通过未经微调的预训练模型
Figure PCTCN2022134801-appb-000004
对于训练集中的每一个类别c,在词表中选择使得条件概率最大的Topk单词,集合为V c
Figure PCTCN2022134801-appb-000005
其中
Figure PCTCN2022134801-appb-000006
表示基于模型
Figure PCTCN2022134801-appb-000007
的输出概率分布。
第四步、每个类别下的候选标签词为近义词集合和条件概率集合交集的最大Topn,即M c=Topn{S c∩V c},其中n<k;
第五步、综合每个类别下的候选标签词,然后找出使得训练集正确率最大的分配方式作为临时最佳标签词;
第二部分,确定候选prompt模板集合,可以先确定最佳候选标签词;通过填充占位符生成初始提示模板,提示模板用于令训练集中的输出概率最大,最后采用集束搜索算法对初始提示模板解码得到候选prompt模板。由于面向生成式的自然语言模型基于多种无监督目标进行预训练,适合通过填充占位符<X>和<Y>方式生成提示模板。
上文获取每一个类别的前n个候选标签词集合,表示为{M 1,M 2,...,M c,...,M N},其中M c表示类别为c时映射的候选标签词集合,N表示类别数目。结合上文得到的候选模板集合T。将两者组合为搜索空间如表1的搜索空间列表,目标是在微调过程中找到最佳的标签词与模板分配方式。通过(1*N+1)的列表L表示,L[0:N-1]中编码数字表示对应集合内候选标签词的下标,L[N]中编码数字表示对应集合内候选模板的下标。
表1 搜索空间列表
Figure PCTCN2022134801-appb-000008
而强化学习中关键因素在本申请中的含义可以参考表2,表2为强化学习及其含义对照表,包含了本实施例所应用的强化学习对象及其含义:
表2 强化学习及其含义对照表
强化学习 含义
智能体 策略网络(RNN控制器)
环境 语言模型环境
动作 标签词和模板选择(编码)
状态 当前标签词和提示模板
奖励 准确度
在将文本输入至模型,该模型包含语言模型环境,得到输出结果。将输出结果与标签相比,计算二者损失,将损失结果作为奖励,反馈给智能体,智能体根据奖励确定模板和标签词的选择方向,直至确定最佳标签词和提示模板。
本申请实施例通过构建候选标签词集合,通过选择近义词集合和条件概率集合的交集,缩减候选标签词搜索空间,同时减少不同prompt模板之间的差异性,提高下游任务准确率。此外,采用prompt微调预训练模型方法降低了内存需求和系统复杂性,尤其防止小样本过拟合。将每个类别下的候选标签词作为近义词集合和条件概率集合的交集,缩小了标签词的搜索空间。同时本申请采用强化学习过程搜索最佳标签词和模板,解决通用算法容易陷入局部最优问题。
下文中,本申请实施例以预训练好的GPT-3模型为例,对本申请的一种具体应用过程进行说明:
本申请实施例采用来自CLUE Benchmark(中文语言理解基准测)的中文自然语言理解数据集,包含多个不同类型的任务,包括情感分析任务、自然语言推理、多种文本分类、文本匹配任务和成语阅读理解等。下面以电商产品评论情感分析数据集(EPRSTMT)为实施例进行讲解。
数据量:训练集(32),验证集(32),测试集(753)
例子:{"id":23,"sentence":"外包装上有点磨损,试听后感觉不错","label":"Positive"}
每一条数据有三个属性,从前往后分别是id,sentence,label。其中label是标签,Negative表示负向,对应0。而Positive表示正向,对应1。
第一步:将原始训练和验证数据转换为prompts输入和true_labels列表,比如sentence:"外包装上有点磨损,试听后感觉不错"是验证集的一个示例,采用SBERT方法在训练集中找到相似样本s1:“已收货,试听了一下,音质可以”和s2:“话筒声小插上耳机手机还能外放破耳机别买。”。采用初始化模板格式和标签词,最后prompts的样例如下:
s1。这个评价很好。s2。这个评价很差。sentence。这个评价很[MASK]
需要注意,GPT-3在预训练输入时没有考虑[CLS][SEP]等分隔符,所以对应下游任务输入也不添加。
第二步:自动化选择候选标签词
假设结果为negative候选集合M 1:{差,难用,消极},positive候选集合M 2:{好,不错,积极}。
第三步:自动化选择候选模板
假设候选模板T:{sentence。这个评价很[MASK]。
sentence。消费者态度是[MASK]。
sentence。一个[MASK]的评价。}
第四步:通过强化学习搜索最佳标签词和提示模板
Figure PCTCN2022134801-appb-000009
注意,任务类别数目和候选数目越多,强化学习优势越明显。
假设搜索到标签词:{难用,不错},搜索到模板:这个评价很[MASK],则对应的无文本输入为:
N/A。这个评价很难用。
N/A。这个评价很不错。
这个评价很难用。
这个评价很不错。
[MASK]。这个评价很难用。
[MASK]。这个评价很不错。
假设无文本输入预训练模型,输出标签词对应概率取平均值后归一化得到p_cf:[0.03201457 0.96798543],可以看出当前模型对正面(positive)的标签词偏好非常明显;根据公式[diag(p_cf)] -1计算校正矩阵W:
Figure PCTCN2022134801-appb-000010
假设输入样例:“居然有个耳机是坏的,也懒得换嘞。”组成模板格式输入LM模型输出标签词{差,好}对应概率[0.000906262,0.01283005],归一化[0.065975690.93402431],根据最大值位置预测为“好”,预测错误。在实际应用中根据W*p pre计算较正后为[2.06080189,0.96491567],根据最大值位置预测为“差”,预测正确。
本申请实施例以校正后准确率为奖励反馈更新策略网络,以此输出更好的标签词和模板选择。
需要注意的是,本实施例以情感分类为基础进行说明,但在实际应用中不仅局限于分类,其它诸如完形填空、自然语言推理等下游任务均可以此方式进行改进。
下面对本申请实施例提供的一种小样本微调系统进行介绍,下文描述的小样本微调系统与上文描述的小样本微调方法可相互对应参照。
图2为本申请实施例所提供的小样本微调系统结构示意图,本申请还提供一种小样本微调系统,包括:
样例组成模块,用于输入数据集,按固定模板组成输入样例;
候选集合构建模块,用于构建候选标签词集合和候选prompt模板集合;
最佳选择模块,用于通过强化学习搜索输入样例对应的候选标签词集合中的最佳标签词,和输入样例对应的所述候选prompt模板集合中的提示模板;
输出模块,用于输出最佳标签词映射关系以及提示模板对应的最佳prompt模板格式。
基于上述实施例,作为一些实施方式,所述样例组成模块包括:
输入单元,用于获取输入内容;
转换单元,用于将输入内容以固定模板表示;
相似度计算单元,用于计算输入内容与训练集中所有样本之间的余弦相似度;
采样单元,用于从前预设百分比的训练集样本中进行随机采样,得到输入样例。
本申请还提供了一种非易失性可读存储介质,其上存有计算机程序,该计算机程序被执行时可以实现上述实施例所提供的步骤。该存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
参见图3所示,本申请还提供了一种电子设备,可以包括存储器11和处理器12,存储器11中存有计算机程序,处理器12调用存储器11中的计算机程序时,可以实现上述实施例所提供的步骤。当然所述电子设备还可以包括各种网络接口,电源等组件。
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例提供的系统而言,由于其与实施例提供的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。
还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。

Claims (20)

  1. 一种小样本微调方法,其特征在于,包括:
    输入数据集,按固定模板组成输入样例;
    构建候选标签词集合和候选prompt模板集合;
    通过强化学习搜索所述输入样例对应的候选标签词集合中的最佳标签词,和所述输入样例对应的所述候选prompt模板集合中的提示模板;
    输出所述最佳标签词映射关系以及所述提示模板对应的最佳prompt模板格式。
  2. 根据权利要求1所述的小样本微调方法,其特征在于,所述方法还包括:
    所述数据集划分为训练集、验证集、测试集;
    所述训练集用于随机采样,组成输入样例;
    所述验证集用于计算余弦相似度。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    基于id属性,sentence属性,label属性组成数据集中的数据;其中,所述id属性用于表示所述数据的id,所述sentence属性用于表示所述数据的内容,所述label属性用于表示所述数据的标签词。
  4. 根据权利要求1所述的小样本微调方法,其特征在于,所述输入数据集,按固定模板组成输入样例包括:
    获取输入内容;
    将所述输入内容以固定模板表示;
    计算所述输入内容与所述训练集中所有样本之间的余弦相似度;
    从前预设百分比的训练集样本中进行随机采样,得到输入样例。
  5. 根据权利要求4所述的小样本微调方法,其特征在于,所述方法还包括:
    初始化提示模板格式;
    将所述输入内容以初始化提示模板的格式表示。
  6. 根据权利要求4所述的小样本微调方法,其特征在于,所述计算所述输入内容与所述训练集中所有样本之间的余弦相似度的步骤包括:
    采用SBERT方法对输入内容进行编码;
    对于所述验证集的每个输入内容,分别计算与所述训练集中所有样本之间的所述余弦相似度。
  7. 根据权利要求3所述的小样本微调方法,其特征在于,所述方法还包括:
    将所述输入样例转化成prompts输入。
  8. 根据权利要求1所述的小样本微调方法,其特征在于,构建候选标签词集合和候选prompt模板集合包括:
    自动化选择最佳候选标签词;
    自动化选择候选prompt模板。
  9. 根据权利要求8所述的小样本微调方法,其特征在于,所述自动化选择候选标签词包括:
    初始化词表;
    采用word2vec方法将所述词表中所有的词向量化,通过余弦相似度确定每个标签对应的近义词集合;
    通过未经微调的预训练模型,对于训练集中的每一个类别,在所述词表中选择使得条件概率最大的单词,以及包含所述单词的条件概率集合:
    确定各类别下的候选标签词为所述近义词集合和所述条件概率的几何交集的最大值;
    综合各类别下的候选标签词,确定令所述训练集正确率最大的分配方式作为最佳候选标签词。
  10. 根据根据权利要求9所述的小样本微调方法,其特征在于,所述方法还包括:所述条件概率集合通过公式
    Figure PCTCN2022134801-appb-100001
    确定;
    其中,Topk为条件概率最大的单词,v为初始化词表;
    Figure PCTCN2022134801-appb-100002
    为未经微调的预训练模型;c为所述训练集中的每一个类别;
    Figure PCTCN2022134801-appb-100003
    表示基于模型
    Figure PCTCN2022134801-appb-100004
    的输出概率分布,T(X in)为输入样例。
  11. 根据权利要求9所述的小样本微调方法,其特征在于,所述自动化选择候选prompt模板包括:
    确定所述最佳候选标签词;
    通过填充占位符生成初始提示模板;所述初始提示模板用于令所述训练集中的输出概率最大;
    采用集束搜索算法对所述初始提示模板解码得到候选prompt模板。
  12. 根据权利要求11所述的小样本微调方法,其特征在于,通过强化学习搜索所述输入样例对应的候选标签词集合中的最佳标签词,和所述输入样例对应的所述候选prompt模板集合中的提示模板包括:
    确定每个类别的前预设数量个候选标签词集合;
    将所述候选标签词集合与所述候选prompt模板对应的模板集合组合得到搜索空间列表;
    通过所述搜索空间列表确定所述输入样例对应的候选标签词集合中的最佳标签词,和所述输入样例对应的所述候选prompt模板集合中的提示模板。
  13. 根据权利要求12所述的小样本微调方法,其特征在于,所述方法还包括:
    通过将所述候选标签词集合与所述候选prompt模板对应的模板集合组合得到所述搜索空间列表,以在微调过程中确定最佳的所述候选标签词与所述候选prompt模板分配方式。
  14. 根据权利要求1所述的小样本微调方法,其特征在于,所述方法还包括:
    通过所述强化学习中的关键因素确定所述最佳标签词和所述提示模板,所述关键因素包括:智能体、环境、动作、状态、奖励。
  15. 根据权利要求14所述的小样本微调方法,其特征在于,确定最佳标签词以及所述最佳prompt模板格式的步骤包括:
    将文本输入至模型,得到输出结果;所述模型包含语言模型环境;
    计算所述输出结果与标签词的损失;
    将所述损失作为所述奖励反馈至所述智能体;
    所述智能体依据所述奖励确定模板与标签词的选择方向,直至确定最佳标签词和提示模板。
  16. 根据权利要求1所述的小样本微调方法,其特征在于,所述方法还包括:
    当输入无文本时,输出标签词对应概率取平均值后归一化得到归一概率p_cf;根据公式[diag(p_cf)] -1计算校正矩阵。
  17. 一种小样本微调系统,其特征在于,包括:
    样例组成模块,用于输入数据集,按固定模板组成输入样例;
    候选集合构建模块,用于构建候选标签词集合和候选prompt模板集合;
    最佳选择模块,用于通过强化学习搜索所述输入样例对应的候选标签词集合中的最佳标签词,和所述输入样例对应的所述候选prompt模板集合中的提示模板;
    输出模块,用于输出所述最佳标签词映射关系以及所述提示模板对应的最佳prompt模板格式。
  18. 根据权利要求17所述的小样本微调系统,其特征在于,所述样例组成模块包括:
    输入单元,用于获取输入内容;
    转换单元,用于将所述输入内容以固定模板表示;
    相似度计算单元,用于计算所述输入内容与训练集中所有样本之间的余弦相似度;
    采样单元,用于从前预设百分比的训练集样本中进行随机采样,得到输入样例。
  19. 一种非易失性可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-16任一项所述的方法的步骤。
  20. 一种电子设备,其特征在于,包括存储器和处理器,所述存储器中存有计算机程序,所述处理器调用所述存储器中的计算机程序时实现如权利要求1-16任一项所述的方法的步骤。
PCT/CN2022/134801 2022-04-15 2022-11-28 一种小样本微调方法、系统及相关装置 WO2023197613A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210392419.0 2022-04-15
CN202210392419.0A CN114492363B (zh) 2022-04-15 2022-04-15 一种小样本微调方法、系统及相关装置

Publications (1)

Publication Number Publication Date
WO2023197613A1 true WO2023197613A1 (zh) 2023-10-19

Family

ID=81489169

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/134801 WO2023197613A1 (zh) 2022-04-15 2022-11-28 一种小样本微调方法、系统及相关装置

Country Status (2)

Country Link
CN (1) CN114492363B (zh)
WO (1) WO2023197613A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117493587A (zh) * 2023-12-28 2024-02-02 苏州元脑智能科技有限公司 一种文章生成的方法、装置、设备及介质
CN117540012A (zh) * 2024-01-04 2024-02-09 阿里云计算有限公司 文本生成方法以及系统
CN117609444A (zh) * 2023-11-08 2024-02-27 天讯瑞达通信技术有限公司 一种基于大模型的搜索问答方法
CN117725223A (zh) * 2023-11-20 2024-03-19 中国科学院成都文献情报中心 面向知识发现的科学实验知识图谱构建方法及系统

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114492363B (zh) * 2022-04-15 2022-07-15 苏州浪潮智能科技有限公司 一种小样本微调方法、系统及相关装置
CN115248846B (zh) * 2022-07-26 2023-05-23 贝壳找房(北京)科技有限公司 文本识别方法、设备、介质
CN117272988B (zh) * 2023-11-13 2024-04-19 荣耀终端有限公司 优化提示词的方法、电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200387812A1 (en) * 2019-06-05 2020-12-10 dMASS, Inc. Machine learning systems and methods for automated prediction of innovative solutions to targeted problems
CN113468877A (zh) * 2021-07-09 2021-10-01 浙江大学 语言模型的微调方法、装置、计算设备和存储介质
CN113961705A (zh) * 2021-10-29 2022-01-21 聚好看科技股份有限公司 一种文本分类方法及服务器
CN114492363A (zh) * 2022-04-15 2022-05-13 苏州浪潮智能科技有限公司 一种小样本微调方法、系统及相关装置

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109522850B (zh) * 2018-11-22 2023-03-10 中山大学 一种基于小样本学习的动作相似度评估方法
CN112784879A (zh) * 2020-12-31 2021-05-11 前线智能科技(南京)有限公司 一种基于小样本域自适应的医学影像分割或分类方法
CN113868380A (zh) * 2021-06-21 2021-12-31 四川启睿克科技有限公司 一种少样本意图识别方法及装置
CN113901799B (zh) * 2021-12-07 2022-03-08 苏州浪潮智能科技有限公司 模型训练、文本预测方法、装置、电子设备及介质
CN114254642A (zh) * 2021-12-16 2022-03-29 北京百度网讯科技有限公司 实体信息处理方法、装置、电子设备和介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200387812A1 (en) * 2019-06-05 2020-12-10 dMASS, Inc. Machine learning systems and methods for automated prediction of innovative solutions to targeted problems
CN113468877A (zh) * 2021-07-09 2021-10-01 浙江大学 语言模型的微调方法、装置、计算设备和存储介质
CN113961705A (zh) * 2021-10-29 2022-01-21 聚好看科技股份有限公司 一种文本分类方法及服务器
CN114492363A (zh) * 2022-04-15 2022-05-13 苏州浪潮智能科技有限公司 一种小样本微调方法、系统及相关装置

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117609444A (zh) * 2023-11-08 2024-02-27 天讯瑞达通信技术有限公司 一种基于大模型的搜索问答方法
CN117725223A (zh) * 2023-11-20 2024-03-19 中国科学院成都文献情报中心 面向知识发现的科学实验知识图谱构建方法及系统
CN117493587A (zh) * 2023-12-28 2024-02-02 苏州元脑智能科技有限公司 一种文章生成的方法、装置、设备及介质
CN117493587B (zh) * 2023-12-28 2024-04-09 苏州元脑智能科技有限公司 一种文章生成的方法、装置、设备及介质
CN117540012A (zh) * 2024-01-04 2024-02-09 阿里云计算有限公司 文本生成方法以及系统
CN117540012B (zh) * 2024-01-04 2024-04-30 阿里云计算有限公司 文本生成方法以及系统

Also Published As

Publication number Publication date
CN114492363A (zh) 2022-05-13
CN114492363B (zh) 2022-07-15

Similar Documents

Publication Publication Date Title
WO2023197613A1 (zh) 一种小样本微调方法、系统及相关装置
US11113479B2 (en) Utilizing a gated self-attention memory network model for predicting a candidate answer match to a query
CN110717039A (zh) 文本分类方法和装置、电子设备、计算机可读存储介质
CN111553479B (zh) 一种模型蒸馏方法、文本检索方法及装置
CN111783993A (zh) 智能标注方法、装置、智能平台及存储介质
US20050021334A1 (en) Information-processing apparatus, information-processing method and information-processing program
CN111368545B (zh) 一种基于多任务学习的命名实体识别方法和装置
US11475220B2 (en) Predicting joint intent-slot structure
US20230023789A1 (en) Method for identifying noise samples, electronic device, and storage medium
WO2019154411A1 (zh) 词向量更新方法和装置
CN114817538B (zh) 文本分类模型的训练方法、文本分类方法及相关设备
WO2023137911A1 (zh) 基于小样本语料的意图分类方法、装置及计算机设备
WO2022052484A1 (zh) 文本情绪识别方法、装置、终端设备和存储介质
CN112699215B (zh) 基于胶囊网络与交互注意力机制的评级预测方法及系统
CN112084301B (zh) 文本修正模型的训练方法及装置、文本修正方法及装置
CN112825114A (zh) 语义识别方法、装置、电子设备及存储介质
CN115687610A (zh) 文本意图分类模型训练方法、识别方法、装置、电子设备及存储介质
Liu et al. Cross-domain slot filling as machine reading comprehension: A new perspective
Zhao The state-of-art applications of nlp: Evidence from chatgpt
CN113722439A (zh) 基于对抗性类别对齐网络的跨领域情感分类方法及系统
WO2023134676A1 (en) Method and system for automatically formulating optimization problem using machine learning
US20230368003A1 (en) Adaptive sparse attention pattern
US20230289528A1 (en) Method for constructing sentiment classification model based on metaphor identification
Kreyssig Deep learning for user simulation in a dialogue system
Ghasemi et al. Accelerating radio spectrum regulation workflows with large language models (llms)

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22937245

Country of ref document: EP

Kind code of ref document: A1