WO2022160490A1 - 信息提取模型训练方法、装置、终端设备及存储介质 - Google Patents

信息提取模型训练方法、装置、终端设备及存储介质 Download PDF

Info

Publication number
WO2022160490A1
WO2022160490A1 PCT/CN2021/091081 CN2021091081W WO2022160490A1 WO 2022160490 A1 WO2022160490 A1 WO 2022160490A1 CN 2021091081 W CN2021091081 W CN 2021091081W WO 2022160490 A1 WO2022160490 A1 WO 2022160490A1
Authority
WO
WIPO (PCT)
Prior art keywords
label
information
vector
vocabulary
sample text
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2021/091081
Other languages
English (en)
French (fr)
Inventor
殷子墨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2022160490A1 publication Critical patent/WO2022160490A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Definitions

  • the present application relates to the field of artificial intelligence, and in particular, to an information extraction model training method, device, terminal device and storage medium.
  • Data information structuring refers to the process of extracting the time, place, person, and core of the event from the data information. .
  • the inventor realizes that the structuring of the existing data information is based on the information extraction model for information extraction, but in the training process of the existing information extraction model, the labels are set manually. This leads to cumbersome user operations and low accuracy of manual label setting, which reduces the training effect of the information extraction model.
  • the embodiments of the present application provide an information extraction model training method, device, terminal device and storage medium, so as to solve the problems caused by manual label setting in the information extraction model training process of the prior art.
  • the problem of low training effect of information extraction model is
  • a first aspect of the embodiments of the present application provides an information extraction model training method, including:
  • a model training set is constructed according to the labeled feature vector, and model training is performed on the information extraction model according to the model training set until the information extraction model converges.
  • a second aspect of the embodiments of the present application provides an information extraction method, including:
  • the data to be extracted is acquired, and the data to be extracted is input into the information extraction model trained by the information extraction model training method provided in the first aspect to perform information extraction to obtain target information.
  • a third aspect of the embodiments of the present application provides an apparatus for training an information extraction model, including:
  • the label extraction unit is configured to obtain sample text, and perform label extraction on the sample text according to a preset label extraction method to obtain label information;
  • a label setting unit configured to obtain a label type corresponding to the preset label extraction method, and perform label setting on the label information according to the label type;
  • the label marking unit is used to extract the feature vector of the sample text, and label the feature vector according to the label information after the label setting;
  • a model training unit configured to construct a model training set according to the labelled feature vector, and perform model training on an information extraction model according to the model training set until the information extraction model converges.
  • a fourth aspect of the embodiments of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and running on the terminal device, where the processor implements when executing the computer program:
  • a model training set is constructed according to the labeled feature vector, and model training is performed on the information extraction model according to the model training set until the information extraction model converges.
  • a fifth aspect of the embodiments of the present application provides a storage medium, where the storage medium stores a computer program, and the computer program is executed by a processor to implement:
  • a model training set is constructed according to the labeled feature vector, and model training is performed on the information extraction model according to the model training set until the information extraction model converges.
  • the embodiments of the present application have the following beneficial effects: by obtaining sample text and performing label extraction on the sample text according to a preset label extraction method, different label information in the sample text can be effectively extracted according to requirements. , by obtaining the label type corresponding to the preset label extraction method, and setting the label information according to the label type, the label setting of the label information can be automatically performed, which effectively prevents the label setting accuracy caused by manual label setting. phenomenon, which in turn improves the training effect of the information extraction model.
  • Fig. 1 is the realization flow chart of a kind of information extraction model training method provided by the embodiment of the present application
  • Fig. 2 is the realization flow chart of a kind of information extraction model training method provided by another embodiment of the present application.
  • Fig. 3 is a flow chart of the specific implementation steps of step S31 in Fig. 2;
  • FIG. 4 is a structural block diagram of an information extraction model training device provided by an embodiment of the present application.
  • FIG. 5 is a structural block diagram of a terminal device provided by an embodiment of the present application.
  • the information extraction model training method involved in the embodiments of the present application may be executed by a control device or terminal (hereinafter referred to as a "mobile terminal").
  • FIG. 1 shows an implementation flowchart of an information extraction model training method provided by an embodiment of the present application, including:
  • Step S10 Obtain sample text, and perform label extraction on the sample text according to a preset label extraction method to obtain label information.
  • the sample text is obtained by receiving preset event information, and the event information can be transmitted in the form of text information, voice information or image information. If the event information is transmitted in the form of voice information, the Voice conversion is performed on the event information to obtain the sample text corresponding to the event information. If the event information is transmitted in the form of image information, image text recognition is performed on the event information to obtain the sample text corresponding to the event information.
  • At least two different preset label extraction methods are set, and the preset label extraction methods can be used to extract the label information corresponding to the label type in the sample text, and the labels corresponding to different preset label extraction methods
  • the types are not the same, that is, the label information extracted by different preset label extraction methods is not the same.
  • this embodiment includes a first preset label extraction method, a second preset label extraction method, and a third preset label extraction method.
  • the label type corresponding to the first preset label extraction method is time
  • the The tag type corresponding to the second preset tag extraction method is location
  • the tag type corresponding to the third preset tag extraction method is person, then according to the first preset tag extraction method, the second preset tag extraction method and the The three preset label extraction methods respectively perform label extraction on the sample text to obtain label information a1 corresponding to the time label, second label information corresponding to the location label, and label information a3 corresponding to the person label.
  • this step performing label extraction on the sample text according to a preset label extraction method to obtain label information, including:
  • the sample text includes at least one sentence, and each sentence includes at least one vocabulary.
  • the word segmentation vocabulary is obtained by matching the sentences in the sample text with the vocabulary lookup table respectively, and in the vocabulary lookup table Pre-set specified vocabulary is stored. If the vocabulary in the sentence matches any specified vocabulary, the vocabulary in the sentence is segmented according to the matched specified vocabulary, and the segmented vocabulary is obtained.
  • the label vocabulary list stores preset label words.
  • this embodiment includes a first preset label extraction method, a second preset label extraction method, and a third preset label extraction method, then according to the first preset label extraction method, the second preset label extraction method
  • the tag extraction method and the extracted tags of the third preset tag extraction method respectively query the vocabulary list to obtain the first tag vocabulary list, the second tag vocabulary list and the third tag vocabulary list. It should be noted that different presets The extraction labels corresponding to the label extraction methods are different.
  • the obtained tag vocabulary list includes the first tag vocabulary list, the second tag vocabulary list and the third tag vocabulary list, the first tag vocabulary list, the second tag vocabulary list and the third tag vocabulary list are respectively combined with Participle words are matched.
  • the word segmentation word matches any label word in the label list, it is determined that the word segmentation word is the label information of the corresponding sample text.
  • the word segmentation word is the label information of the corresponding sample text.
  • the second label word list and the third label word list The matching result between the list and the word segmentation vocabulary, to obtain the label information a1 corresponding to the first preset label extraction method, the label information a2 corresponding to the second preset label extraction method, and the third preset label extraction method corresponding to the label information a3.
  • Step S20 Obtain a label type corresponding to the preset label extraction method, and perform label setting on the label information according to the label type.
  • the label type is used to set the label for the label information extracted by the preset label extraction method.
  • this embodiment includes the first preset label extraction method, the second preset label extraction method, and the The third preset label extraction method, the label information extracted by the first preset label extraction method, the second preset label extraction method and the third preset label extraction method includes label information a1, label information a2 and label information Information a3, the label types corresponding to the first preset label extraction method, the second preset label extraction method and the third preset label extraction method are label type b1, label type b2 and label type b3, then according to the label type Label setting is performed on the label information a1 by b1, label setting is performed on the label information a2 according to the label type b2, and label setting is performed on the label information a3 according to the label type b3.
  • the label information a1 is set as the time label in the sample text
  • the label information a2 is set as the location label in the sample text
  • the tag information a3 is set as the person tag in the sample text.
  • acquiring the label type corresponding to the preset label extraction method, and performing label setting on the label information according to the label type includes:
  • the tag information matched with the same tag vocabulary list is set according to the tag type, wherein, by performing tag setting on the tag information matched with the same tag vocabulary list according to the tag type, the accuracy of the tag information is effectively improved. Label information for label setting accuracy.
  • Step S30 extract the feature vector of the sample text, and label the feature vector according to the label information after label setting.
  • the feature vector is used to represent the text features in the sample text
  • the text features include lexical content features, lexical position features, text order features, character features, and overlapping word features
  • the lexical content features are used to represent the lexical content of the sample text.
  • the lexical position feature is used to represent the position of the corresponding word in the sample text
  • the text order feature is used to represent the order of the corresponding sentence in the sample text
  • the character feature is used to represent the content of the corresponding character
  • the overlapping word feature is used to represent the corresponding vocabulary
  • the number of times the sample text can be split into the specified phrase.
  • the feature vector is labeled according to the label information after the label setting, so as to achieve the effect of labeling the feature vector as a sample.
  • a one-to-one correspondence is formed between them, which effectively improves the accuracy of subsequent information extraction model training.
  • Step S40 constructing a model training set according to the feature vector marked with the label, and performing model training on the information extraction model according to the model training set, until the information extraction model converges.
  • the model training set is constructed by storing the labeled feature vector and the corresponding label information.
  • performing model training on the information extraction model according to the model training set includes:
  • the encoding result of the encoder is input into the decoder in the information extraction model, and the encoding result is decoded according to the decoder to obtain a decoding result, wherein, by decoding the encoding result according to the decoder, it is possible to obtain a decoding result. Effectively decode the encoding result of the encoder to obtain the corresponding decoding result;
  • Loss calculation is performed according to the decoding result and the label information carried by the feature vector in the model training set to obtain a model loss value, wherein the loss calculation is performed according to the decoding result and the label information carried by the feature vector in the model training set , to calculate the computational error of the encoder and decoder;
  • model loss value is less than or equal to the loss threshold, update the parameter weights of the encoder and the decoder according to the model loss value, and continue to perform the model update according to the updated encoder.
  • FIG. 2 is an implementation flowchart of an information extraction model training method provided by another embodiment of the present application.
  • the information extraction model training method provided in this embodiment further refines step S30 in the embodiment of FIG. 1 , including:
  • Step S31 respectively extracting word vectors, word position vectors, text sequence vectors, character vectors and overlapping word vectors in the sample text.
  • FIG. 3 is a flowchart of the specific implementation steps of step S31 in FIG. 2, including:
  • Step S310 Perform vector mapping processing on the vocabulary in the sentence in the sample text to obtain the word vector.
  • the words in the sentences in the sample text can be vector-mapped according to a preset mapping algorithm to obtain word vectors corresponding to different words, and the preset mapping algorithm can be set according to requirements.
  • the preset mapping algorithm can be set as Count vector algorithm (Count Vector), TF-IDF vector algorithm (TF-IDF Vector) and Co-Occurence Vector), etc.
  • step S311 position information of the vocabulary corresponding to the sentence is obtained respectively, and position encoding processing is performed on the position information to obtain the word position vector.
  • the position encoding process is used to encode the position information into corresponding vector features.
  • a vector embedding operation is performed based on the position information of the vocabulary in the corresponding sentence to obtain the word position vector.
  • the vector embedding operation is performed on the position information of , so as to embed the word vectors corresponding to different position information according to the position encoding result of the position information, and obtain the word position vector.
  • Step S312 Acquire the sequence of paragraphs between different sentences in the sample text, and sequentially encode the sentences according to the sequence of paragraphs to obtain the text sequence vector.
  • the word vector in the vector embedding operation is performed to embed the word vector in the sentence corresponding to the different paragraph information according to the sequence encoding result of the paragraph information, and the text sequence vector is obtained.
  • Step S313 Acquire text characters in the sample text, and match the text characters with a preset character vector table to obtain the character vector.
  • the text characters include letters, punctuation, blanks or formulas and other information
  • the character vector table stores the correspondence between different text characters and corresponding character vectors. Therefore, by dividing the text characters obtained in the sample text into Match against a table of character vectors to get character vectors corresponding to text characters.
  • Step S314 Obtain the number of segmentations of the words in the sample text respectively, and obtain the vector pointed to by the number of segmentations, to obtain the overlapping word vector.
  • the number of segmentations is the number of times the corresponding vocabulary is divided into specified phrases.
  • the segmentation times of the words "China” and “United States” are 2, and the number of segmentations of other words is 2.
  • the number of segmentations is all 1, and the number of segmentations corresponding to the vocabulary is matched with the overlapping word vector look-up table to obtain overlapping word vectors of words corresponding to different segmentation times.
  • the overlapping word vector query table stores different segmentation times. The correspondence between the corresponding overlapping word vectors.
  • step S32 the extracted word vector, the word position vector, the text sequence vector, the character vector and the overlapping word vector are combined into vectors to obtain the feature vector.
  • the feature vector is obtained by summing the extracted word vector, word position vector, text order vector, character vector and overlapping word vector.
  • word vectors corresponding to different words are obtained, by separately acquiring the position information of the words in the corresponding sentences, and performing position encoding processing on the position information, so as to obtain word vectors corresponding to different words.
  • the word vector corresponding to the different position information is embedded in the vector to obtain the word position vector.
  • the sequence encoding result of the paragraph information, the word vectors in the sentences corresponding to different paragraph information are vector embedded, and the text sequence vector is obtained.
  • the embodiment of the present application also provides an information extraction method, including:
  • the information extraction model trained based on the information extraction model training method can effectively extract the word vector, word position vector, text sequence vector, character vector and overlapping word vector in the data to be extracted, and the information extraction The model converts the word vector, word position vector, text sequence vector, character vector and overlapping word vector in the data to be extracted to obtain the target information.
  • the information extraction model after convergence is obtained by performing model training on the information extraction model based on the model training set.
  • the converged information extraction model is obtained by performing model training on the information extraction model on the model training set.
  • Uploading the converged information extraction model to the blockchain ensures its security and fairness and transparency to users.
  • the user equipment can download the converged information extraction model from the blockchain, so as to verify whether the converged information extraction model has been tampered with.
  • the blockchain referred to in this example is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • FIG. 4 is a structural block diagram of an information extraction model training apparatus 100 provided by an embodiment of the present application.
  • each unit included in the information extraction model training apparatus 100 is used to execute each step in the embodiment corresponding to FIG. 1 , FIG. 2 , and FIG. 3 .
  • the information extraction model training apparatus 100 includes: a label extraction unit 10, a label setting unit 11, a label marking unit 12 and a model training unit 13, wherein:
  • the label extraction unit 10 is configured to obtain sample text, and perform label extraction on the sample text according to a preset label extraction method to obtain label information.
  • the label extraction unit 10 is further configured to: perform word segmentation on the sample text, obtain word segmentation words, and obtain a label word list corresponding to the preset label extraction method, wherein the label word list is stored in advance set label vocabulary;
  • the participle vocabulary matches any of the tag vocabulary in the tag list, the participle vocabulary is extracted to obtain the tag information.
  • the label setting unit 11 is configured to acquire a label type corresponding to the preset label extraction method, and perform label setting on the label information according to the label type.
  • the label setting unit 11 is further configured to: obtain the list identifier corresponding to the label vocabulary list, and obtain the type pointed to by the list identifier;
  • the tag information matched to the same tag vocabulary list is tagged according to the tag type.
  • the label marking unit 12 is configured to extract the feature vector of the sample text, and label the feature vector according to the label information after label setting.
  • the label marking unit 12 is also used for: extracting word vector, word position vector, text order vector, character vector and overlapping word vector in the sample text respectively;
  • the feature vector is obtained by combining the extracted word vector, the word position vector, the text sequence vector, the character vector and the overlapping word vector.
  • the label marking unit 12 is further configured to: perform vector mapping processing on the vocabulary in the sentence in the sample text to obtain the word vector, and the sample text includes at least one sentence, each of which is At least one of said words is included in the sentence;
  • the model training unit 13 is configured to construct a model training set according to the feature vector marked with the label, and perform model training on the information extraction model according to the model training set until the information extraction model converges.
  • model training unit 13 is further configured to: input the model training set into an encoder in the information extraction model, and encode the feature vector in the model training set according to the encoder;
  • model loss value is less than or equal to the loss threshold, update the parameter weights of the encoder and the decoder according to the model loss value, and continue to perform the model update according to the updated encoder.
  • FIG. 5 is a structural block diagram of a terminal device 2 provided by another embodiment of the present application.
  • 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 an information extraction model training method program of.
  • the processor 20 executes the computer program 23, it implements the steps in the various embodiments of the above-mentioned information extraction model training methods, such as S10 to S40 shown in FIG. 1 , or S31 to S32 shown in FIG. 2 , or shown in FIG. 3 . of S310 to S314.
  • the processor 20 executes the computer program 22, the functions of the units in the embodiment corresponding to FIG. 4 are implemented, for example, the functions of the units 10 to 13 shown in FIG. 4, please refer to the corresponding implementation in FIG. 5 for details. The relevant descriptions in the examples will not be repeated here.
  • the computer program 22 may be divided into one or more units, and the one or more units are stored in the memory 21 and executed by the processor 20 to complete the present application.
  • the one or more units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 22 in the terminal device 2 .
  • the computer program 22 can be divided into a label extraction unit 10, a label setting unit 11, a label labeling unit 12 and a model training unit 13, and the specific functions of each unit are as described above.
  • the terminal device may include, but is not limited to, the processor 20 and the memory 21 .
  • FIG. 5 is only an example of the terminal device 2, and does not constitute a limitation on the terminal device 2. It may include more or less components than the one shown, or combine some components, or different components
  • the terminal device may further include an input and output device, a network access device, a bus, and the like.
  • the so-called processor 20 may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processors). Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, 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 the processor may be any conventional processor or the like.
  • the memory 21 may be an internal storage unit of the terminal device 2 , such as a hard disk or a 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 equipped on the terminal device 2, a smart memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc.
  • the memory 21 may also 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 can also be used to temporarily store data that has been output or is to be output.
  • Embodiments of the present application further provide a storage medium, where a computer program is stored in the storage medium, and when the computer program is executed by a processor, implements each step of the information extraction model training method provided by any of the above solutions, and the storage medium may As a computer-readable storage medium, the computer-readable storage medium may be non-volatile or volatile.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Software Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Machine Translation (AREA)

Abstract

本申请适用于人工智能技术领域,提供了一种信息提取模型训练方法、装置、终端设备及存储介质,该方法包括:根据预设的标签提取方式对样本文本进行标签提取,得到标签信息;获取预设的标签提取方式对应的标签类型,并根据标签类型对标签信息进行标签设置;提取样本文本的特征向量,并根据标签设置后的标签信息对特征向量进行标签标记;根据标签标记后的特征向量构建模型训练集,并根据模型训练集对信息提取模型进行模型训练,直至信息提取模型收敛。本申请能根据需求有效地提取到样本文本中不同的标签信息,并能自动进行标签信息的标签设置,防止了由于人工进行标签设置所导致的标签设置准确性低下的现象。此外,本申请还涉及区块链技术。

Description

信息提取模型训练方法、装置、终端设备及存储介质
本申请要求于2021年1月29日提交中国专利局、申请号为202110125161.3,发明名称为“信息提取模型训练方法、装置、终端设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能领域,尤其涉及一种信息提取模型训练方法、装置、终端设备及存储介质。
背景技术
随着互联网的快速发展,网络上传播的数据信息越来越多。为了使人们快速从数据信息中提取到有效信息,对数据信息的结构化是必要过程,数据信息结构化是指从数据信息中提取出事件发生的时间、地点、人物、事件核心等要素的过程。
技术问题
综上,发明人意识到,现有数据信息的结构化均是基于信息提取模型的方式进行信息的提取,但现有的信息提取模型训练过程中,均是采用人工的方式进行标签设置,进而导致用户操作繁琐,且人工进行标签设置准确性低下,降低了信息提取模型的训练效果。
技术解决方案
有鉴于此,本申请实施例提供了一种信息提取模型训练方法、装置、终端设备及存储介质,以解决现有技术的信息提取模型训练过程中,由于采用人工的方式进行标签设置,导致的信息提取模型训练效果低下的问题。
本申请实施例的第一方面提供了一种信息提取模型训练方法,包括:
获取样本文本,并根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息;
获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置;
提取所述样本文本的特征向量,并根据标签设置后的所述标签信息对所述特征向量进行标签标记;
根据标签标记后的所述特征向量构建模型训练集,并根据所述模型训练集对信息提取模型进行模型训练,直至所述信息提取模型收敛。
本申请实施例的第二方面提供了一种信息提取方法,包括:
获取待提取数据,并将所述待提取数据输入采用第一方面提供的信息提取模型训练方法训练后的所述信息提取模型进行信息提取,得到目标信息。
本申请实施例的第三方面提供了一种信息提取模型训练装置,包括:
标签提取单元,用于获取样本文本,并根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息;
标签设置单元,用于获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置;
标签标记单元,用于提取所述样本文本的特征向量,并根据标签设置后的所述标签信息对所述特征向量进行标签标记;
模型训练单元,用于根据标签标记后的所述特征向量构建模型训练集,并根据所述模型训练集对信息提取模型进行模型训练,直至所述信息提取模型收敛。
本申请实施例的第四方面提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在终端设备上运行的计算机程序,所述处理器执行所述计算机程序时实现:
获取样本文本,并根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息;
获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置;
提取所述样本文本的特征向量,并根据标签设置后的所述标签信息对所述特征向量进行标签标记;
根据标签标记后的所述特征向量构建模型训练集,并根据所述模型训练集对信息提取模型进行模型训练,直至所述信息提取模型收敛。
本申请实施例的第五方面提供了一种存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时实现:
获取样本文本,并根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息;
获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置;
提取所述样本文本的特征向量,并根据标签设置后的所述标签信息对所述特征向量进行标签标记;
根据标签标记后的所述特征向量构建模型训练集,并根据所述模型训练集对信息提取模型进行模型训练,直至所述信息提取模型收敛。
有益效果
本申请实施例与现有技术相比存在的有益效果是:通过获取样本文本,并根据预设的标签提取方式对样本文本进行标签提取,能根据需求有效地提取到样本文本中不同的标签信息,通过获取预设的标签提取方式对应的标签类型,并根据标签类型对标签信息进行标签设置,能自动进行标签信息的标签设置,有效防止了由于人工进行标签设置所导致的标签设置准确性低下的现象,进而提高了信息提取模型的训练效果。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的一种信息提取模型训练方法的实现流程图;
图2是本申请另一实施例提供的一种信息提取模型训练方法的实现流程图;
图3是图2中步骤S31的具体实施步骤的流程图;
图4是本申请实施例提供的一种信息提取模型训练装置的结构框图;
图5是本申请实施例提供的一种终端设备的结构框图。
本发明的实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例所涉及的信息提取模型训练方法,可以由控制设备或终端(以下称“移动终端”)执行。
请参阅图1,图1示出了本申请实施例提供的一种信息提取模型训练方法的实现流程图,包括:
步骤S10,获取样本文本,并根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息。
其中,通过接收预先设置的事件信息,以获取该样本文本,该事件信息可以采用文字信息、语音信息或图像信息的方式进行传输,若该事件信息采用语音信息的方式进行传输时,则对该事件信息进行语音转换,以得到该事件信息对应的样本文本,若该事件信息采用图像信息的方式进行传输时,则对该事件信息进行图像文字识别,以得到该事件信息对应的样本文本。
本实施例中,至少设置有两个不同的预设的标签提取方式,该预设的标签提取方式可用于提取该样本文本中对应标签类型的标签信息,不同预设的标签提取方式对应的标签类型不相同,即,不同预设的标签提取方式提取到的标签信息不相同。
例如,本实施例中包括第一预设的标签提取方式、第二预设的标签提取方式和第三预设的标签提取方式,第一预设的标签提取方式对应的标签类型是时间,第二预设的标签提取方式对应的标签类型是地点,第三预设的标签提取方式对应的标签类型是人物,则根据第一预设的标签提取方式、第二预设的标签提取方式和第三预设的标签提取方式分别对该样本文本进行标签提取,以得到时间标签对应的标签信息a1、地点标签对应的第二标签信息和人物标签对应的标签信息a3。
具体的,该步骤中,所述根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息,包括:
对所述样本文本进行分词,得到分词词汇,并获取所述预设的标签提取方式对应的标签词汇列表;
其中,该样本文本中至少包括一条语句,每个语句至少包括一个词汇,该步骤中,通过将该样本文本中的语句分别与词汇查询表进行匹配,以得到该分词词汇,该词汇查询表中存储有预先设置的指定词汇,若该语句中的词汇与任一指定词汇相匹配时,则根据匹配到的指定词汇对该语句中的词汇进行分词,得到该分词词汇,通过对样本文本进行分词,有效的提高了对样本文本进行标签提取的准确性,进一步地,该标签词汇列表中存储有预先设置的标签词汇。
具体的,通过将该预设的标签提取方式的提取标识所指向的词汇列表设置为该预设的标签提取方式对应的标签词汇列表,以得到不同预设的标签提取方式对应的标签词汇列表,例如,本实施例中包括第一预设的标签提取方式、第二预设的标签提取方式和第三预设的标签提取方式,则根据第一预设的标签提取方式、第二预设的标签提取方式和第三预设的标签提取方式的提取标签分别进行词汇列表的查询,以得到第一标签词汇列表、第二标签词汇列表和第三标签词汇列表,需要说明的是,不同预设的标签提取方式对应的提取标签不相同。
将所述标签词汇与所述分词词汇进行匹配;
其中,若获取到的标签词汇列表包括第一标签词汇列表、第二标签词汇列表和第三标签词汇列表时,则将第一标签词汇列表、第二标签词汇列表和第三标签词汇列表分别与分词词汇进行匹配。
若所述分词词汇与所述标签列表中任一所述标签词汇相匹配,则对所述分词词汇进行提取,得到所述标签信息;
其中,若分词词汇与标签列表中任一标签词汇相匹配,则判定该分词词汇为对应样本文本的标签信息,该步骤中,基于第一标签词汇列表、第二标签词汇列表和第三标签词汇列表与分词词汇之间的匹配结果,以得到该第一预设的标签提取方式对应的标签信息a1、第二预设的标签提取方式对应的标签信息a2和第三预设的标签提取方式对应的标签信息a3。
步骤S20,获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置。
其中,该标签类型用于对该预设的标签提取方式提取到的标签信息进行标签的设置,例如,本实施例中包括第一预设的标签提取方式、第二预设的标签提取方式和第三预设的标签提取方式,第一预设的标签提取方式、第二预设的标签提取方式和第三预设的标签提取方式提取到的标签信息包括标签信息a1、标签信息a2和标签信息a3,第一预设的标签提取方式、第二预设的标签提取方式和第三预设的标签提取方式对应的标签类型为标签类型b1、标签类型b2和标签类型b3,则根据标签类型b1对该标签信息a1进行标签设置,根据标签类型b2对该标签信息a2进行标签设置,根据标签类型b3对该标签信息a3进行标签设置。
该步骤中,当该标签类型b1是时间,则将该标签信息a1设置为样本文本中的时间标签,当该标签类型b2是地点,则将该标签信息a2设置为样本文本中的地点标签,当该标签类型b3是人物,则将该标签信息a3设置为样本文本中的人物标签。
具体的,该步骤中,所述获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置,包括:
获取所述标签词汇列表对应的列表标识,并获取所述列表标识所指向的类型,其中,不同标签词汇列表之间的列表标识不相同;
将获取到的类型设置为对应所述预设的标签提取方式的所述标签类型;
根据所述标签类型对同一所述标签词汇列表相匹配到的所述标签信息进行标签设置,其中,通过根据标签类型对同一标签词汇列表相匹配到的标签信息进行标签设置,有效的提高了对标签信息进行标签设置的准确性。
步骤S30,提取所述样本文本的特征向量,并根据标签设置后的所述标签信息对所述特征向量进行标签标记。
其中,该特征向量用于表征样本文本中的文本特征,该文本特征包括词汇内容特征、词汇位置特征、文本顺序特征、字符特征和重叠词特征,该词汇内容特征用于表征样本文本中词汇的内容,该词汇位置特征用于表征对应词汇在样本文本中的位置,文本顺序特征用于表征对应语句在样本文本中的顺序,字符特征用于表征对应字符内容,重叠词特征用于表征对应词汇在样本文本中可以被切分为指定词组的次数。
具体的,该步骤中,通过根据标签设置后的标签信息对所述特征向量进行标签标记,以达到对特征向量进行样本标记的效果,该标签标记用于将标签设置后的标签信息与特征向量之间形成一一对应关系,有效的提高了后续信息提取模型训练的准确性。
步骤S40,根据标签标记后的所述特征向量构建模型训练集,并根据所述模型训练集对信息提取模型进行模型训练,直至所述信息提取模型收敛。
其中,通过将标签标记后的特征向量与对应的标签信息进行存储,以构建该模型训练集。
具体的,该步骤中,所述根据所述模型训练集对信息提取模型进行模型训练,包括:
将所述模型训练集输入所述信息提取模型中的编码器,并根据所述编码器对所述模型训练集中的所述特征向量进行编码,其中,通过根据编码器对模型训练集中的特征向量进行编码,能有效的将模型训练集中的不同特征向量编码为对应的向量信息;
将所述编码器的编码结果输入所述信息提取模型中的解码器,并根据所述解码器对所述编码结果进行解码,得到解码结果,其中,通过根据解码器对编码结果进行解码,能有效的将编码器的编码结果进行解码,得到对应的解码结果;
根据所述解码结果和所述模型训练集中的所述特征向量携带的所述标签信息进行损失计算,得到模型损失值,其中,通过解码结果和模型训练集中的特征向量携带的标签信息进行损失计算,以计算编码器和解码器的计算误差;
若所述模型损失值小于或等于损失阈值,则根据所述模型损失值对所述编码器和所述解码器进行参数权重的更新,并根据更新后的所述编码器继续执行对所述模型训练集中的所述特征向量进行编码的步骤以及后续步骤,直到损失计算得到的所述模型损失值大于所述损失阈值。
本实施例中,通过获取样本文本,并根据预设的标签提取方式对样本文本进行标签提取,能根据需求有效地提取到样本文本中不同的标签信息,通过获取预设的标签提取方式对应的标签类型,并根据标签类型对标签信息进行标签设置,能自动进行标签信息的标签设置,有效防止了由于人工进行标签设置所导致的标签设置准确性低下的现象,进而提高了信息提取模型的训练效果。
请参阅图2,图2是本申请另一实施例提供的一种信息提取模型训练方法的实现流程图。相对于图1实施例,本实施例提供的信息提取模型训练方法是对图1实施例中步骤S30作进一步细化,包括:
步骤S31,分别提取所述样本文本中的词向量、词位置向量、文本顺序向量、字符向量和重叠词向量。
具体的,请参阅图3,是图2中步骤S31的具体实施步骤的流程图,包括:
步骤S310,对所述样本文本中语句内的词汇进行向量映射处理,得到所述词向量。
其中,可以根据预设映射算法对样本文本中语句内的词汇进行向量映射,以得到不同词汇对应的词向量,该预设映射算法可以根据需求进行设置,例如,该预设映射算法可以设置为计数向量算法(Count Vector)、TF-IDF矢量算法(TF-IDF Vector)和共现向量算法(Co-Occurence Vector)等。
步骤S311,分别获取所述词汇在对应所述语句中的位置信息,并对所述位置信息进行位置编码处理,得到所述词位置向量。
其中,该位置编码处理用于将位置信息编码为对应的向量特征,该步骤中,基于词汇在对应语句中的位置信息执行向量嵌入操作,以得到该词位置向量,通过基于词汇在对应语句中的位置信息执行向量嵌入操作,以根据位置信息的位置编码结果,将不同位置信息对应的词向量进行向量嵌入,得到该词位置向量。
步骤S312,获取所述样本文本中不同所述语句之间的段落顺序,并根据所述段落顺序对所述语句进行顺序编码,得到所述文本顺序向量。
其中,通过分别获取样本文本中不同语句对应的段落信息,基于获取到的段落信息对该语句中的词向量进行向量嵌入操作,以得到该文本顺序向量,通过基于获取到的段落信息对该语句中的词向量进行向量嵌入操作,以根据段落信息的顺序编码结果,将不同段落信息对应语句中的词向量进行向量嵌入,得到该文本顺序向量。
步骤S313,获取所述样本文本中的文本字符,并将所述文本字符与预设的字符向量表进行匹配,得到所述字符向量。
其中,该文本字符包括字母、标点、空白符或公式等信息,该字符向量表中存储有不同文本字符与对应字符向量之间的对应关系,因此,通过将样本文本中获取到的文本字符分别与字符向量表进行匹配,以得到文本字符对应的字符向量。
步骤S314,分别获取所述样本文本中词汇的切分次数,并获取所述切分次数所指向的向量,得到所述重叠词向量。
其中,该切分次数为对应词汇被切分为指定词组的次数,通过分别获取样本文本中词汇的切分次数,并将切分次数所指向的向量设置为该词汇的重叠词向量,有效的方便了样本文本中词汇的歧义分析。
例如,当样本文本为“中国驻美国大使馆”时,由于词汇“中国”和“美国”可以单独被当成词组,因此,词汇“中国”和“美国”的切分次数为2,其他词汇的切分次数均为1,并将词汇对应的切分次数与重叠词向量查询表进行匹配,以得到不同切分次数对应词汇的重叠词向量,该重叠词向量查询表中存储有不同切分次数与对应重叠词向量之间的对应关系。
请继续参阅图2,步骤S32,将提取到的所述词向量、所述词位置向量、所述文本顺序向量、所述字符向量和所述重叠词向量进行向量组合,得到所述特征向量。
其中,通过将提取到的词向量、词位置向量、文本顺序向量、字符向量和重叠词向量进行矢量求和,以得到该特征向量。
本实施例中,通过对样本文本中语句内的词汇进行向量映射处理,以得到不同词汇对应的词向量,通过分别获取词汇在对应语句中的位置信息,并对位置信息进行位置编码处理,以根据位置信息的位置编码结果,将不同位置信息对应的词向量进行向量嵌入得到该词位置向量,通过获取样本文本中不同语句之间的段落顺序,并根据段落顺序对语句进行顺序编码,以根据段落信息的顺序编码结果,将不同段落信息对应语句中的词向量进行向量嵌入,得到该文本顺序向量,通过获取样本文本中的文本字符,并将文本字符与预设的字符向量表进行匹配,能有效的获取到样本文本中不同文本字符对应的字符向量,进而提高了后续信息提取模型中对文本字符特征的学习。
本申请实施例还提供一种信息提取方法,包括:
获取待提取数据,并将所述待提取数据输入采用图1或图2实施例信息提取模型训练方法训练后的所述信息提取模型进行信息提取,得到目标信息。
本实施例中,基于信息提取模型训练方法训练后的信息提取模型,能有效的提取到待提取数据中的词向量、词位置向量、文本顺序向量、字符向量和重叠词向量,并通过信息提取模型对待提取数据中的词向量、词位置向量、文本顺序向量、字符向量和重叠词向量进行文本转化,得到该目标信息。
在本申请的所有实施例中,基于模型训练集对信息提取模型进行模型训练得到收敛后的信息提取模型,具体来说,收敛后的信息提取模型由模型训练集对信息提取模型进行模型训练得到。将收敛后的信息提取模型上传至区块链可保证其安全性和对用户的公正透明性。用户设备可以从区块链中下载得到该收敛后的信息提取模型,以便查证收敛后的信息提取模型是否被篡改。本示例所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
请参阅图4,图4是本申请实施例提供的一种信息提取模型训练装置100的结构框图。本实施例中该信息提取模型训练装置100包括的各单元用于执行图1、图2、图3对应的实施例中的各步骤。具体请参阅图1、图2、图3以及图1、图2、图3所对应的实施例中的相关描述。为了便于说明,仅示出了与本实施例相关的部分。参见图4,信息提取模型训练装置100包括:标签提取单元10、标签设置单元11、标签标记单元12和模型训练单元13,其中:
标签提取单元10,用于获取样本文本,并根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息。
其中,该标签提取单元10还用于:对所述样本文本进行分词,得到分词词汇,并获取所述预设的标签提取方式对应的标签词汇列表,其中,所述标签词汇列表中存储有预先设置的标签词汇;
将所述标签词汇与所述分词词汇进行匹配;
若所述分词词汇与所述标签列表中任一所述标签词汇相匹配,则对所述分词词汇进行提取,得到所述标签信息。
标签设置单元11,用于获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置。
其中,该标签设置单元11还用于:获取所述标签词汇列表对应的列表标识,并获取所述列表标识所指向的类型;
将获取到的类型设置为对应所述预设的标签提取方式的所述标签类型;
根据所述标签类型对同一所述标签词汇列表相匹配到的所述标签信息进行标签设置。
标签标记单元12,用于提取所述样本文本的特征向量,并根据标签设置后的所述标签信息对所述特征向量进行标签标记。
其中,该标签标记单元12还用于:分别提取所述样本文本中的词向量、词位置向量、文本顺序向量、字符向量和重叠词向量;
将提取到的所述词向量、所述词位置向量、所述文本顺序向量、所述字符向量和所述重叠词向量进行向量组合,得到所述特征向量。
可选的,该标签标记单元12还用于:对所述样本文本中语句内的词汇进行向量映射处理,得到所述词向量,所述样本文本中至少包括一条所述语句,每个所述语句内至少包括一个所述词汇;
分别获取所述词汇在对应所述语句中的位置信息,并对所述位置信息进行位置编码处理,得到所述词位置向量,所述位置编码处理用于将所述位置信息编码为对应的向量特征;
获取所述样本文本中不同所述语句之间的段落顺序,并根据所述段落顺序对所述语句进行顺序编码,得到所述文本顺序向量;
获取所述样本文本中的文本字符,并将所述文本字符与预设的字符向量表进行匹配,得到所述字符向量,所述字符向量表中存储有不同所述文本字符与对应所述字符向量之间的对应关系;
分别获取所述样本文本中词汇的切分次数,并获取所述切分次数所指向的向量,得到所述重叠词向量,所述切分次数为对应所述词汇被切分为指定词组的次数。
模型训练单元13,用于根据标签标记后的所述特征向量构建模型训练集,并根据所述模型训练集对信息提取模型进行模型训练,直至所述信息提取模型收敛。
其中,该模型训练单元13还用于:将所述模型训练集输入所述信息提取模型中的编码器,并根据所述编码器对所述模型训练集中的所述特征向量进行编码;
将所述编码器的编码结果输入所述信息提取模型中的解码器,并根据所述解码器对所述编码结果进行解码,得到解码结果;
根据所述解码结果和所述模型训练集中的所述特征向量携带的所述标签信息进行损失计算,得到模型损失值;
若所述模型损失值小于或等于损失阈值,则根据所述模型损失值对所述编码器和所述解码器进行参数权重的更新,并根据更新后的所述编码器继续执行对所述模型训练集中的所述特征向量进行编码的步骤以及后续步骤,直到损失计算得到的所述模型损失值大于所述损失阈值。
本实施例中,通过获取样本文本,并根据预设的标签提取方式对样本文本进行标签提取,能根据需求有效地提取到样本文本中不同的标签信息,通过获取预设的标签提取方式对应的标签类型,并根据标签类型对标签信息进行标签设置,能自动进行标签信息的标签设置,有效防止了由于人工进行标签设置所导致的标签设置准确性低下的现象,进而提高了信息提取模型的训练效果。
图5是本申请另一实施例提供的一种终端设备2的结构框图。如图5所示,该实施例的终端设备2包括:处理器20、存储器21以及存储在所述存储器21中并可在所述处理器20上运行的计算机程序22,例如信息提取模型训练方法的程序。处理器20执行所述计算机程序23时实现上述各个信息提取模型训练方法各实施例中的步骤,例如图1所示的S10至S40,或者图2所示的S31至S32,或者图3所示的S310至S314。或者,所述处理器20执行所述计算机程序22时实现上述图4对应的实施例中各单元的功能,例如,图4所示的单元10至13的功能,具体请参阅图5对应的实施例中的相关描述,此处不赘述。
示例性的,所述计算机程序22可以被分割成一个或多个单元,所述一个或者多个单元被存储在所述存储器21中,并由所述处理器20执行,以完成本申请。所述一个或多个单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序22在所述终端设备2中的执行过程。例如,所述计算机程序22可以被分割成标签提取单元10、标签设置单元11、标签标记单元12和模型训练单元13,各单元具体功能如上所述。
所述终端设备可包括,但不仅限于,处理器20、存储器21。本领域技术人员可以理解,图5仅仅是终端设备2的示例,并不构成对终端设备2的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器20可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器21可以是所述终端设备2的内部存储单元,例如终端设备2的硬盘或内存。所述存储器21也可以是所述终端设备2的外部存储设备,例如所述终端设备2上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器21还可以既包括所述终端设备2的内部存储单元也包括外部存储设备。所述存储器21用于存储所述计算机程序以及所述终端设备所需的其他程序和数据。所述存储器21还可以用于暂时地存储已经输出或者将要输出的数据。
本申请实施例还提供了一种存储介质,所述存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述任一方案提供的信息提取模型训练方法的各步骤,该存储介质可以为计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种信息提取模型训练方法,其中,包括:
    获取样本文本,并根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息;
    获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置;
    提取所述样本文本的特征向量,并根据标签设置后的所述标签信息对所述特征向量进行标签标记;
    根据标签标记后的所述特征向量构建模型训练集,并根据所述模型训练集对信息提取模型进行模型训练,直至所述信息提取模型收敛。
  2. 根据权利要求1所述的信息提取模型训练方法,其中,所述根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息,包括:
    对所述样本文本进行分词,得到分词词汇,并获取所述预设的标签提取方式对应的标签词汇列表,其中,所述标签词汇列表中存储有预先设置的标签词汇;
    将所述标签词汇与所述分词词汇进行匹配;
    若所述分词词汇与所述标签列表中任一所述标签词汇相匹配,则对所述分词词汇进行提取,得到所述标签信息。
  3. 根据权利要求2所述的信息提取模型训练方法,其中,所述获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置标签信息,包括:
    获取所述标签词汇列表对应的列表标识,并获取所述列表标识所指向的类型;
    将获取到的类型设置为对应所述预设的标签提取方式的所述标签类型;
    根据所述标签类型对同一所述标签词汇列表相匹配到的所述标签信息进行标签设置。
  4. 根据权利要求1所述的信息提取模型训练方法,其中,所述提取所述样本文本的特征向量,包括:
    分别提取所述样本文本中的词向量、词位置向量、文本顺序向量、字符向量和重叠词向量;
    将提取到的所述词向量、所述词位置向量、所述文本顺序向量、所述字符向量和所述重叠词向量进行向量组合,得到所述特征向量。
  5. 根据权利要求4所述的信息提取模型训练方法,其中,所述分别提取所述样本文本中的词向量、词位置向量、文本顺序向量、字符向量和重叠词向量,包括:
    对所述样本文本中语句内的词汇进行向量映射处理,得到所述词向量,所述样本文本中至少包括一条所述语句,每个所述语句内至少包括一个所述词汇;
    分别获取所述词汇在对应所述语句中的位置信息,并对所述位置信息进行位置编码处理,得到所述词位置向量,所述位置编码处理用于将所述位置信息编码为对应的向量特征;
    获取所述样本文本中不同所述语句之间的段落顺序,并根据所述段落顺序对所述语句进行顺序编码,得到所述文本顺序向量;
    获取所述样本文本中的文本字符,并将所述文本字符与预设的字符向量表进行匹配,得到所述字符向量,所述字符向量表中存储有不同所述文本字符与对应所述字符向量之间的对应关系;
    分别获取所述样本文本中词汇的切分次数,并获取所述切分次数所指向的向量,得到所述重叠词向量,所述切分次数为对应所述词汇被切分为指定词组的次数。
  6. 根据权利要求1所述的信息提取模型训练方法,其中,所述根据所述模型训练集对信息提取模型进行模型训练,包括:
    将所述模型训练集输入所述信息提取模型中的编码器,并根据所述编码器对所述模型训练集中的所述特征向量进行编码;
    将所述编码器的编码结果输入所述信息提取模型中的解码器,并根据所述解码器对所述编码结果进行解码,得到解码结果;
    根据所述解码结果和所述模型训练集中的所述特征向量携带的所述标签信息进行损失计算,得到模型损失值;
    若所述模型损失值小于或等于损失阈值,则根据所述模型损失值对所述编码器和所述解码器进行参数权重的更新,并根据更新后的所述编码器继续执行对所述模型训练集中的所述特征向量进行编码的步骤以及后续步骤,直到损失计算得到的所述模型损失值大于所述损失阈值。
  7. 一种信息提取方法,其中,包括:
    获取待提取数据,并将所述待提取数据输入采用如权利要求1至6任一项所述方法训练后的所述信息提取模型进行信息提取,得到目标信息。
  8. 一种信息提取模型训练装置,其中,包括:
    标签提取单元,用于获取样本文本,并根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息;
    标签设置单元,用于获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置;
    标签标记单元,用于提取所述样本文本的特征向量,并根据标签设置后的所述标签信息对所述特征向量进行标签标记;
    模型训练单元,用于根据标签标记后的所述特征向量构建模型训练集,并根据所述模型训练集对信息提取模型进行模型训练,直至所述信息提取模型收敛。
  9. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现:
    获取样本文本,并根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息;
    获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置;
    提取所述样本文本的特征向量,并根据标签设置后的所述标签信息对所述特征向量进行标签标记;
    根据标签标记后的所述特征向量构建模型训练集,并根据所述模型训练集对信息提取模型进行模型训练,直至所述信息提取模型收敛。
  10. 根据权利要求9所述的终端设备,其中,所述根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息,包括:
    对所述样本文本进行分词,得到分词词汇,并获取所述预设的标签提取方式对应的标签词汇列表,其中,所述标签词汇列表中存储有预先设置的标签词汇;
    将所述标签词汇与所述分词词汇进行匹配;
    若所述分词词汇与所述标签列表中任一所述标签词汇相匹配,则对所述分词词汇进行提取,得到所述标签信息。
  11. 根据权利要求10所述的终端设备,其中,所述获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置标签信息,包括:
    获取所述标签词汇列表对应的列表标识,并获取所述列表标识所指向的类型;
    将获取到的类型设置为对应所述预设的标签提取方式的所述标签类型;
    根据所述标签类型对同一所述标签词汇列表相匹配到的所述标签信息进行标签设置。
  12. 根据权利要求9所述的终端设备,其中,所述提取所述样本文本的特征向量,包括:
    分别提取所述样本文本中的词向量、词位置向量、文本顺序向量、字符向量和重叠词向量;
    将提取到的所述词向量、所述词位置向量、所述文本顺序向量、所述字符向量和所述重叠词向量进行向量组合,得到所述特征向量。
  13. 根据权利要求12所述的终端设备,其中,所述分别提取所述样本文本中的词向量、词位置向量、文本顺序向量、字符向量和重叠词向量,包括:
    对所述样本文本中语句内的词汇进行向量映射处理,得到所述词向量,所述样本文本中至少包括一条所述语句,每个所述语句内至少包括一个所述词汇;
    分别获取所述词汇在对应所述语句中的位置信息,并对所述位置信息进行位置编码处理,得到所述词位置向量,所述位置编码处理用于将所述位置信息编码为对应的向量特征;
    获取所述样本文本中不同所述语句之间的段落顺序,并根据所述段落顺序对所述语句进行顺序编码,得到所述文本顺序向量;
    获取所述样本文本中的文本字符,并将所述文本字符与预设的字符向量表进行匹配,得到所述字符向量,所述字符向量表中存储有不同所述文本字符与对应所述字符向量之间的对应关系;
    分别获取所述样本文本中词汇的切分次数,并获取所述切分次数所指向的向量,得到所述重叠词向量,所述切分次数为对应所述词汇被切分为指定词组的次数。
  14. 根据权利要求9所述的终端设备,其中,所述根据所述模型训练集对信息提取模型进行模型训练,包括:
    将所述模型训练集输入所述信息提取模型中的编码器,并根据所述编码器对所述模型训练集中的所述特征向量进行编码;
    将所述编码器的编码结果输入所述信息提取模型中的解码器,并根据所述解码器对所述编码结果进行解码,得到解码结果;
    根据所述解码结果和所述模型训练集中的所述特征向量携带的所述标签信息进行损失计算,得到模型损失值;
    若所述模型损失值小于或等于损失阈值,则根据所述模型损失值对所述编码器和所述解码器进行参数权重的更新,并根据更新后的所述编码器继续执行对所述模型训练集中的所述特征向量进行编码的步骤以及后续步骤,直到损失计算得到的所述模型损失值大于所述损失阈值。
  15. 一存储介质,所述存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现:
    获取样本文本,并根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息;
    获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置;
    提取所述样本文本的特征向量,并根据标签设置后的所述标签信息对所述特征向量进行标签标记;
    根据标签标记后的所述特征向量构建模型训练集,并根据所述模型训练集对信息提取模型进行模型训练,直至所述信息提取模型收敛。
  16. 根据权利要求15所述的存储介质,其中,所述根据预设的标签提取方式对所述样本文本进行标签提取,得到标签信息,包括:
    对所述样本文本进行分词,得到分词词汇,并获取所述预设的标签提取方式对应的标签词汇列表,其中,所述标签词汇列表中存储有预先设置的标签词汇;
    将所述标签词汇与所述分词词汇进行匹配;
    若所述分词词汇与所述标签列表中任一所述标签词汇相匹配,则对所述分词词汇进行提取,得到所述标签信息。
  17. 根据权利要求16所述的存储介质,其中,所述获取所述预设的标签提取方式对应的标签类型,并根据所述标签类型对所述标签信息进行标签设置标签信息,包括:
    获取所述标签词汇列表对应的列表标识,并获取所述列表标识所指向的类型;
    将获取到的类型设置为对应所述预设的标签提取方式的所述标签类型;
    根据所述标签类型对同一所述标签词汇列表相匹配到的所述标签信息进行标签设置。
  18. 根据权利要求15所述的存储介质,其中,所述提取所述样本文本的特征向量,包括:
    分别提取所述样本文本中的词向量、词位置向量、文本顺序向量、字符向量和重叠词向量;
    将提取到的所述词向量、所述词位置向量、所述文本顺序向量、所述字符向量和所述重叠词向量进行向量组合,得到所述特征向量。
  19. 根据权利要求18所述的存储介质,其中,所述分别提取所述样本文本中的词向量、词位置向量、文本顺序向量、字符向量和重叠词向量,包括:
    对所述样本文本中语句内的词汇进行向量映射处理,得到所述词向量,所述样本文本中至少包括一条所述语句,每个所述语句内至少包括一个所述词汇;
    分别获取所述词汇在对应所述语句中的位置信息,并对所述位置信息进行位置编码处理,得到所述词位置向量,所述位置编码处理用于将所述位置信息编码为对应的向量特征;
    获取所述样本文本中不同所述语句之间的段落顺序,并根据所述段落顺序对所述语句进行顺序编码,得到所述文本顺序向量;
    获取所述样本文本中的文本字符,并将所述文本字符与预设的字符向量表进行匹配,得到所述字符向量,所述字符向量表中存储有不同所述文本字符与对应所述字符向量之间的对应关系;
    分别获取所述样本文本中词汇的切分次数,并获取所述切分次数所指向的向量,得到所述重叠词向量,所述切分次数为对应所述词汇被切分为指定词组的次数。
  20. 根据权利要求15所述的存储介质,其中,所述根据所述模型训练集对信息提取模型进行模型训练,包括:
    将所述模型训练集输入所述信息提取模型中的编码器,并根据所述编码器对所述模型训练集中的所述特征向量进行编码;
    将所述编码器的编码结果输入所述信息提取模型中的解码器,并根据所述解码器对所述编码结果进行解码,得到解码结果;
    根据所述解码结果和所述模型训练集中的所述特征向量携带的所述标签信息进行损失计算,得到模型损失值;
    若所述模型损失值小于或等于损失阈值,则根据所述模型损失值对所述编码器和所述解码器进行参数权重的更新,并根据更新后的所述编码器继续执行对所述模型训练集中的所述特征向量进行编码的步骤以及后续步骤,直到损失计算得到的所述模型损失值大于所述损失阈值。
PCT/CN2021/091081 2021-01-29 2021-04-29 信息提取模型训练方法、装置、终端设备及存储介质 Ceased WO2022160490A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110125161.3A CN112836508B (zh) 2021-01-29 2021-01-29 信息提取模型训练方法、装置、终端设备及存储介质
CN202110125161.3 2021-01-29

Publications (1)

Publication Number Publication Date
WO2022160490A1 true WO2022160490A1 (zh) 2022-08-04

Family

ID=75931077

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/091081 Ceased WO2022160490A1 (zh) 2021-01-29 2021-04-29 信息提取模型训练方法、装置、终端设备及存储介质

Country Status (2)

Country Link
CN (1) CN112836508B (zh)
WO (1) WO2022160490A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116186271A (zh) * 2023-04-19 2023-05-30 北京亚信数据有限公司 一种医疗专业名词分类模型训练方法、分类方法及装置
CN116451768A (zh) * 2023-04-11 2023-07-18 阿里巴巴(中国)有限公司 模型训练方法、文本生成方法及装置
CN116719914A (zh) * 2023-04-28 2023-09-08 科大讯飞股份有限公司 一种文本提取方法、系统及相关装置
CN117520754A (zh) * 2024-01-05 2024-02-06 北京睿企信息科技有限公司 一种模型训练数据的预处理系统
CN118643377A (zh) * 2024-08-15 2024-09-13 杭州云信智策科技有限公司 一种确定app类型的方法、装置、设备及介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113204956B (zh) * 2021-07-06 2021-10-08 深圳市北科瑞声科技股份有限公司 多模型训练方法、摘要分段方法、文本分段方法及装置
CN114067338B (zh) * 2021-09-29 2025-03-21 北京搜狗科技发展有限公司 信息提取方法、装置及介质
CN115293147A (zh) * 2022-08-01 2022-11-04 支付宝(杭州)信息技术有限公司 信息提取方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110163220A (zh) * 2019-04-26 2019-08-23 腾讯科技(深圳)有限公司 图片特征提取模型训练方法、装置和计算机设备
US20200027019A1 (en) * 2019-08-15 2020-01-23 Lg Electronics Inc. Method and apparatus for learning a model to generate poi data using federated learning
CN110728139A (zh) * 2018-06-27 2020-01-24 鼎复数据科技(北京)有限公司 关键信息提取模型及其构建方法
CN111343203A (zh) * 2020-05-18 2020-06-26 国网电子商务有限公司 一种样本识别模型训练方法、恶意样本提取方法及装置
CN111444723A (zh) * 2020-03-06 2020-07-24 深圳追一科技有限公司 信息抽取模型训练方法、装置、计算机设备和存储介质
CN112069315A (zh) * 2020-08-31 2020-12-11 深圳市卡牛科技有限公司 提取文本多维度信息方法、装置、服务器及存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109933662B (zh) * 2019-02-15 2021-03-12 北京奇艺世纪科技有限公司 模型训练方法、信息生成方法、装置、电子设备和计算机可读介质
CN110781682B (zh) * 2019-10-23 2023-04-07 腾讯科技(深圳)有限公司 命名实体识别模型训练方法、识别方法、装置及电子设备
CN111695352B (zh) * 2020-05-28 2025-05-27 平安科技(深圳)有限公司 基于语义分析的评分方法、装置、终端设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110728139A (zh) * 2018-06-27 2020-01-24 鼎复数据科技(北京)有限公司 关键信息提取模型及其构建方法
CN110163220A (zh) * 2019-04-26 2019-08-23 腾讯科技(深圳)有限公司 图片特征提取模型训练方法、装置和计算机设备
US20200027019A1 (en) * 2019-08-15 2020-01-23 Lg Electronics Inc. Method and apparatus for learning a model to generate poi data using federated learning
CN111444723A (zh) * 2020-03-06 2020-07-24 深圳追一科技有限公司 信息抽取模型训练方法、装置、计算机设备和存储介质
CN111343203A (zh) * 2020-05-18 2020-06-26 国网电子商务有限公司 一种样本识别模型训练方法、恶意样本提取方法及装置
CN112069315A (zh) * 2020-08-31 2020-12-11 深圳市卡牛科技有限公司 提取文本多维度信息方法、装置、服务器及存储介质

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116451768A (zh) * 2023-04-11 2023-07-18 阿里巴巴(中国)有限公司 模型训练方法、文本生成方法及装置
CN116186271A (zh) * 2023-04-19 2023-05-30 北京亚信数据有限公司 一种医疗专业名词分类模型训练方法、分类方法及装置
CN116186271B (zh) * 2023-04-19 2023-07-25 北京亚信数据有限公司 一种医疗专业名词分类模型训练方法、分类方法及装置
CN116719914A (zh) * 2023-04-28 2023-09-08 科大讯飞股份有限公司 一种文本提取方法、系统及相关装置
CN117520754A (zh) * 2024-01-05 2024-02-06 北京睿企信息科技有限公司 一种模型训练数据的预处理系统
CN117520754B (zh) * 2024-01-05 2024-04-12 北京睿企信息科技有限公司 一种模型训练数据的预处理系统
CN118643377A (zh) * 2024-08-15 2024-09-13 杭州云信智策科技有限公司 一种确定app类型的方法、装置、设备及介质

Also Published As

Publication number Publication date
CN112836508B (zh) 2023-04-14
CN112836508A (zh) 2021-05-25

Similar Documents

Publication Publication Date Title
WO2022160490A1 (zh) 信息提取模型训练方法、装置、终端设备及存储介质
CN109271631B (zh) 分词方法、装置、设备及存储介质
CN114972823A (zh) 数据处理方法、装置、设备及计算机介质
CN108959257B (zh) 一种自然语言解析方法、装置、服务器及存储介质
WO2021151299A1 (zh) 基于人工智能的数据增强方法、装置、电子设备及介质
CN107273356B (zh) 基于人工智能的分词方法、装置、服务器和存储介质
CN112052329A (zh) 文本摘要生成方法、装置、计算机设备及可读存储介质
CN113743101B (zh) 文本纠错方法、装置、电子设备和计算机存储介质
CN108959242A (zh) 一种基于中文字符词性特征的目标实体识别方法及装置
CN103995885B (zh) 实体名的识别方法和装置
CN115130534B (zh) 机器翻译模型训练方法、机器翻译方法、装置和计算设备
CN114639096B (zh) 文本识别方法、装置、电子设备和存储介质
CN117765132A (zh) 图像生成方法、装置、设备与存储介质
CN112214984A (zh) 内容抄袭识别方法、装置、设备及存储介质
CN113408268A (zh) 槽位填充方法、装置、设备及存储介质
WO2023092719A1 (zh) 病历数据的信息抽取方法、终端设备及可读存储介质
CN115543522A (zh) 一种多语言的界面翻译方法、装置、设备及存储介质
CN112906403B (zh) 语义分析模型训练方法、装置、终端设备及存储介质
CN114297388B (zh) 一种文本关键词提取方法
CN116644752A (zh) 关系抽取模型的训练方法、关系抽取方法及装置
CN110888940A (zh) 文本信息提取方法、装置、计算机设备及存储介质
CN110909541A (zh) 指令生成方法、系统、设备和介质
CN116486421B (zh) 一种图像翻译模型的训练方法及相关产品
CN109753976B (zh) 语料标注装置和方法
WO2019095568A1 (zh) 企业简称生成方法、装置及存储介质

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: 21922088

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21922088

Country of ref document: EP

Kind code of ref document: A1