WO2019105134A1 - 词向量处理方法、装置以及设备 - Google Patents

词向量处理方法、装置以及设备 Download PDF

Info

Publication number
WO2019105134A1
WO2019105134A1 PCT/CN2018/110055 CN2018110055W WO2019105134A1 WO 2019105134 A1 WO2019105134 A1 WO 2019105134A1 CN 2018110055 W CN2018110055 W CN 2018110055W WO 2019105134 A1 WO2019105134 A1 WO 2019105134A1
Authority
WO
WIPO (PCT)
Prior art keywords
word
vector
words
neural network
convolutional neural
Prior art date
Application number
PCT/CN2018/110055
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 WO2019105134A1 publication Critical patent/WO2019105134A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Definitions

  • the present specification relates to the field of computer software technology, and in particular, to a word vector processing method, apparatus and device.
  • a word vector is a vector that maps a word to a fixed dimension that represents the semantic information of the word.
  • common algorithms for generating word vectors include, for example, Google's word vector algorithm, Microsoft's deep neural network algorithm, and the like.
  • the embodiments of the present specification provide a word vector processing method, apparatus, and device to solve the following technical problem: a more accurate word vector scheme is needed.
  • Convolving neural networks are trained according to word vectors of the words and word vectors of context words of the words in the corpus;
  • the training result of the word vector of each word is obtained according to the word vector of each word and the convolutional neural network after training.
  • the training module trains the convolutional neural network according to the word vector of each word and the word vector of the context word of each word in the corpus;
  • the processing module acquires the training result of the word vector of each word according to the word vector of each word and the convolutional neural network after training.
  • Step 1 establishing a vocabulary composed of words obtained by corpus segmentation, the words do not include words appearing in the corpus less than a set number of times; jump step 2;
  • Step 2 determining the total number of words, the same word is counted only once; jump to step 3;
  • Step 3 establishing a different 1-hot word vector whose dimensions are the number for each word; jumping to step 4;
  • Step 4 traversing the corpus after the word segmentation, performing step 5 on the current word traversed, and performing step 6 if the traversal is completed, otherwise continuing the traversal;
  • Step 5 Centering on the current word, sliding to more than k words on both sides to create a window, using words other than the current word in the window as context words, and inputting the word vectors of all context words into the convolutional neural network convolution
  • the layer performs convolution calculation, and the convolution calculation result is input into the pooling layer of the convolutional neural network to perform a pooling calculation to obtain a first vector; the current word and the word vector of the negative sample word selected in the corpus are input.
  • Computing the fully connected layer of the convolutional neural network to obtain a second vector and a third vector respectively; updating the location according to the first vector, the second vector, the third vector, and a specified loss function
  • the parameters of the convolutional neural network are:
  • the convolution calculation is performed as follows:
  • the pooling calculation is performed according to the following formula:
  • the loss function includes:
  • x i represents the word vector of the i-th context word
  • x i:i+ ⁇ -1 represents a vector obtained by splicing the word vectors of the i-i+i+ ⁇ -1 context words
  • y i represents passing the volume
  • the i-th element of the vector obtained by the product ⁇ represents the weight parameter of the convolutional layer
  • represents the offset parameter of the convolutional layer
  • represents the excitation function
  • max represents the maximum function
  • average represents the averaging function
  • c (j) representing the computing pool obtained after the j-th element of the first vector
  • t represents the number of context words
  • c denotes the first vector
  • w denotes the second vector
  • w 'm m represents The third vector corresponding to the negative sample word
  • represents the weight parameter of the convolution layer
  • represents the offset parameter of the convolution layer
  • represents the offset parameter of the fully connected layer
  • step 6 the word vectors of the words are respectively input into the fully connected layer of the trained convolutional neural network to calculate, and the corresponding word vector training result is obtained.
  • At least one processor and,
  • the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
  • Convolving neural networks are trained according to word vectors of the words and word vectors of context words of the words in the corpus;
  • the training result of the word vector of each word is obtained according to the word vector of each word and the convolutional neural network after training.
  • the convolutional neural network can describe the overall semantic information of the word context by convolution calculation and pooling calculation, and extract more context semantic information, and then More accurate word vector training results can be obtained, and therefore, the above technical problems can be partially or completely solved.
  • FIG. 1 is a schematic diagram of an overall architecture involved in an implementation scenario of the present specification
  • FIG. 2 is a schematic flow chart of a word vector processing method according to an embodiment of the present disclosure
  • FIG. 3 is a schematic structural diagram of a convolutional neural network in an actual application scenario provided by an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart diagram of another word vector processing method according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic structural diagram of a word vector processing apparatus corresponding to FIG. 2 according to an embodiment of the present disclosure.
  • the embodiments of the present specification provide a word vector processing method, apparatus, and device.
  • FIG. 1 is a schematic diagram of an overall architecture involved in an implementation scenario of the present specification.
  • the overall structure mainly involves four parts: the word in the corpus, the word vector of the word and the word vector of the context word of the word in the corpus, and the convolutional neural network training server.
  • the actions involved in the first three parts may be performed by corresponding software and/or hardware function modules, for example, may also be performed by a convolutional neural network training server.
  • the word vector of the word and its context word is used to train the convolutional neural network, and then the word vector is inferred by the trained convolutional neural network.
  • the word vector training and the inference result are realized through the network training process and the word vector inference process. That is the result of the word vector training.
  • the scheme of this specification applies to the word vector of English words, and also applies to word vectors in any language such as Chinese, Japanese, and German.
  • word vectors in any language such as Chinese, Japanese, and German.
  • the following embodiments are mainly directed to the scenario of an English word, and the scheme of the present specification is explained.
  • FIG. 2 is a schematic flowchart diagram of a word vector processing method according to an embodiment of the present disclosure.
  • the execution body of the process includes at least one of the following devices: a personal computer, a large and medium-sized computer, a computer cluster, a mobile phone, a tablet computer, a smart wearable device, a car machine, and the like.
  • the process in Figure 2 can include the following steps:
  • the words may specifically be: at least part of the words that appear at least once in the corpus.
  • the words can be saved in the vocabulary, and the words can be read from the vocabulary when needed.
  • the word can be screened out so that Not included in the words.
  • the words are specifically: part of the words that appear at least once in the corpus.
  • the established word vector may be an initialized word vector, which needs to be trained to better reflect the meaning of the word.
  • the word vector it is generally not the same word vector for different words; for example, the values of elements in a word vector are generally not all 0;
  • a word vector for example, establishing a 1-hot word vector, or randomly establishing a word vector.
  • the word vectors corresponding to some words have been trained based on other corpora before, the word vectors of these words are further trained based on the corpus in FIG. 2, and the word vectors of these words may not be re-established, but based on The corpus in Figure 2 and the previous training results can be trained.
  • S206 Train the convolutional neural network according to the word vector of each word and the word vector of the context word of each word in the corpus.
  • the convolutional layer of the convolutional neural network is used to extract information of local neurons
  • the pooling layer of the convolutional neural network is used to synthesize the local information of the convolutional layer to obtain global information.
  • local information may refer to the overall semantics of partial context words
  • global information may refer to the overall semantics of all context words.
  • S208 Acquire a training result of the word vector of each word according to the word vector of each word and the convolutional neural network after training.
  • the parameters include, for example, weight parameters and offset parameters.
  • the word vector training result can be obtained by inferring the word vector using the fully connected layer of the trained convolutional neural network.
  • the convolutional neural network can describe the overall semantic information of the word context by convolution calculation and pooling calculation, extract more contextual semantic information, and then obtain more accurate word vector training results.
  • the embodiments of the present specification further provide some specific implementations of the method, and an extended solution, which will be described below.
  • a 1-hot word vector is established as an example.
  • the establishing the word vector of each word may specifically include:
  • the words are numbered one by one, the numbering starts from 0, and is incremented by one. Assuming that the total number of words is N c , the last word is numbered N c -1 .
  • a 1-hot word vector of dimension N c is created for each word. Specifically, assuming that the number of a word is 256, the 256th element in the word vector established for it can be 1, and the remaining elements are 0.
  • the goal when training the convolutional neural network, the goal is to make the similarity of the current word and the word vector of the context word relatively higher after being inferred by the trained convolutional neural network.
  • the context word is regarded as a positive example word.
  • one or more negative sample words of the current word can also be selected according to a certain rule to participate in the training, which is beneficial to the training to quickly converge and obtain more accurate Training results.
  • the target may further include that the similarity can be relatively low after the word vector of the current word and the negative sample word is inferred by the trained convolutional neural network. Negative sample words can be randomly selected in the corpus, or selected in non-context words, and so on. This specification does not limit the specific way of calculating the similarity. For example, the similarity can be calculated based on the angle cosine operation of the vector, the similarity can be calculated based on the square sum operation of the vector, and the like.
  • the convolutional neural network is trained according to the word vector of the words and the word vector of the context words of the words in the corpus. Specifically, it may include:
  • the convolutional neural network is trained according to the word vector of each word, and the word vector of the word in the corpus and the word vector of the negative sample word.
  • the training process of the convolutional neural network may be iterative, and a relatively simple method is to traverse the corpus after the word segmentation, and perform an iteration every time one word in the above words is traversed. Until the traversal is completed, it can be considered that the convolutional neural network has been trained using the corpus.
  • the training of the convolutional neural network according to the word vector of the words and the word vector of the words in the corpus and the word vector of the negative sample words may include:
  • FIG. 3 is a schematic structural diagram of a convolutional neural network in an actual application scenario provided by an embodiment of the present disclosure.
  • the convolutional neural network of Figure 3 mainly includes a convolutional layer, a pooled layer, a fully connected layer, and a Softmax layer.
  • the vector of context words is processed by the convolutional layer and the pooling layer to extract the meaning information of the context word as a whole, and the word vector of the current word and its negative example words can be fully
  • the connection layer is processed. The details are explained below.
  • a sliding window is used to determine a context word.
  • the center of the sliding window is the current word traversed, and the words other than the current word in the sliding window are context words.
  • the word vector of all context words is input into the convolution layer, and then the convolution calculation can be performed according to the following formula:
  • x i represents the word vector of the i-th context word (here, x i is a column vector), and x i:i+ ⁇ -1 represents the splicing of the word vectors of the i-i+i+ ⁇ -1 context words.
  • the vector, y i represents the i-th element of the vector (convolution calculation result) calculated by the convolution, ⁇ represents the weight parameter of the convolutional layer, ⁇ represents the offset parameter of the convolutional layer, and ⁇ represents the excitation function, For example, the Sigmoid function, then
  • the pooling layer may be input for the pooling calculation, and the specific pooling calculation or the average pooling calculation may be used.
  • max represents the maximum function
  • average represents the averaging function
  • c(j) represents the jth element of the first vector obtained after the pooling calculation
  • t represents the number of context words.
  • its word vector can be input into the fully connected layer, for example, according to the following formula:
  • w represents the second vector output by the fully connected layer after processing the word vector of the current word.
  • q represents the word vector of the current word
  • represents the offset parameter of the fully connected layer.
  • the word vector can be input into the fully connected layer, and processed according to the current word, to obtain the third vector, and the third corresponding to the m negative sample word.
  • the vector is represented as w' m .
  • updating the parameters of the convolutional neural network according to the first vector, the second vector, the third vector, and the specified loss function may include, for example, calculating the second vector a first similarity with the first vector, and a second similarity of the third vector to the first vector; according to the first similarity, the second similarity, and a specified loss function Updating the parameters of the convolutional neural network.
  • the loss function can be, for example:
  • c denotes the first vector
  • w denotes the second vector
  • w 'm denotes the m-th word corresponding third negative sample vector
  • represents the weight of the convolution layer weight parameters
  • represents the convolution Layer offset parameter
  • represents the offset parameter of the fully connected layer
  • represents the hyperparameter
  • s represents the similarity calculation function
  • represents the number of negative sample words.
  • the loss function that is used may correspondingly remove the term that calculates the similarity between the first vector and the third vector.
  • the word vector after the convolutional neural network training, the word vector can be reasoned to obtain the word vector training result.
  • the acquiring the training result of the word vector of each word according to the word vector of the words and the convolutional neural network after the training may specifically include:
  • the word vectors of the words are respectively input into the fully connected layer of the trained convolutional neural network for calculation, and the calculated output vector is obtained as a corresponding word vector training result.
  • FIG. 4 is a schematic flow chart of the other word vector processing method.
  • the process in Figure 4 can include the following steps:
  • Step 1 establishing a vocabulary composed of words obtained by corpus segmentation, the words do not include words appearing in the corpus less than a set number of times; jump step 2;
  • Step 2 determining the total number of words, the same word is counted only once; jump to step 3;
  • Step 3 establishing a different 1-hot word vector whose dimensions are the number for each word; jumping to step 4;
  • Step 4 traversing the corpus after the word segmentation, performing step 5 on the current word traversed, and performing step 6 if the traversal is completed, otherwise continuing the traversal;
  • Step 5 Centering on the current word, sliding to more than k words on both sides to create a window, using words other than the current word in the window as context words, and inputting the word vectors of all context words into the convolutional neural network convolution a layer, performing a convolution calculation, and inputting a convolution calculation result into a pooling layer of the convolutional neural network for pooling calculation to obtain a first vector; and a word vector of the current word and the negative sample word selected in the corpus Inputting the fully connected layer of the convolutional neural network to calculate, respectively obtaining a second vector and a third vector; updating according to the first vector, the second vector, the third vector, and a specified loss function The parameters of the convolutional neural network;
  • the convolution calculation is performed as follows:
  • the pooling calculation is performed according to the following formula:
  • the loss function includes:
  • x i represents the word vector of the i-th context word
  • x i:i+ ⁇ -1 represents a vector obtained by splicing the word vectors of the i-i+i+ ⁇ -1 context words
  • y i represents passing the volume
  • the i-th element of the vector obtained by the product ⁇ represents the weight parameter of the convolutional layer
  • represents the offset parameter of the convolutional layer
  • represents the excitation function
  • max represents the maximum function
  • average represents the averaging function
  • c (j) representing the computing pool obtained after the j-th element of the first vector
  • t represents the number of context words
  • c denotes the first vector
  • w denotes the second vector
  • w 'm m represents The third vector corresponding to the negative sample word
  • represents the weight parameter of the convolution layer
  • represents the offset parameter of the convolution layer
  • represents the offset parameter of the fully connected layer
  • step 6 the word vectors of the words are respectively input into the fully connected layer of the trained convolutional neural network to calculate, and the corresponding word vector training result is obtained.
  • the embodiment of the present specification further provides a corresponding device, as shown in FIG. 5 .
  • FIG. 5 is a schematic structural diagram of a word vector processing apparatus corresponding to FIG. 2 according to an embodiment of the present disclosure.
  • the apparatus may be located in an execution body of the process in FIG. 2, and includes:
  • the obtaining module 501 is configured to obtain each word obtained by the corpus segmentation
  • the training module 503 trains the convolutional neural network according to the word vector of each word and the word vector of the context word of each word in the corpus;
  • the processing module 504 acquires the training result of the word vector of each word according to the word vector of each word and the trained convolutional neural network.
  • the establishing module 502 establishes a word vector of each word, and specifically includes:
  • the establishing module 502 determines a total number of the words
  • a word vector whose dimensions are the total number are respectively formed for the words, wherein the word vectors of the words are different from each other, and one element of the word vector is 1 and the remaining elements are 0.
  • the training module 503 trains the convolutional neural network according to the word vector of each word and the word vector of the context word of each word in the corpus, and specifically includes:
  • the training module 503 trains the convolutional neural network according to the word vector of each word and the word vector of the words in the corpus and the word vector of the negative sample word.
  • the training module 503 trains the convolutional neural network according to the word vector of each word, and the word vector of the words in the corpus and the word vector of the negative sample word, specifically including :
  • the training module 503 traverses the corpus after the word segmentation, and executes the traversed current word:
  • Updating parameters of the convolutional neural network based on the first vector, the second vector, the third vector, and a specified loss function.
  • the training module 503 performs convolution calculation, and specifically includes:
  • the training module 503 performs convolution calculation according to the following formula:
  • x i represents the word vector of the i-th context word
  • x i:i+ ⁇ -1 represents a vector obtained by splicing the word vectors of the i-i+i+ ⁇ -1 context words
  • y i represents passing the volume
  • represents the weight parameter of the convolutional layer
  • represents the offset parameter of the convolutional layer
  • represents the excitation function.
  • the training module 503 performs a pooling calculation, and specifically includes:
  • the training module 503 performs a maximized pooling calculation or an average pooling calculation.
  • the training module 503 updates the parameters of the convolutional neural network according to the first vector, the second vector, the third vector, and the specified loss function, and specifically includes:
  • the training module 503 calculates a first similarity between the second vector and the first vector, and a second similarity between the third vector and the first vector;
  • the parameters of the convolutional neural network are updated based on the first similarity, the second similarity, and a specified loss function.
  • the loss function specifically includes:
  • c denotes the first vector
  • w denotes the second vector
  • w 'm denotes the m-th word corresponding third negative sample vector
  • represents the weight of the convolution layer weight parameters
  • represents the convolution Layer offset parameter
  • represents the offset parameter of the fully connected layer
  • represents the hyperparameter
  • s represents the similarity calculation function
  • represents the number of negative sample words.
  • the processing module 504 obtains the training result of the word vector of each word according to the word vector of each word and the trained convolutional neural network, and specifically includes:
  • the processing module 504 inputs the word vectors of the words into the fully connected layer of the trained convolutional neural network for calculation, and obtains the calculated output vector as the corresponding word vector training result.
  • the embodiment of the present specification further provides a corresponding word vector processing device, including:
  • At least one processor and,
  • the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
  • Convolving neural networks are trained according to word vectors of the words and word vectors of context words of the words in the corpus;
  • the training result of the word vector of each word is obtained according to the word vector of each word and the convolutional neural network after training.
  • the embodiment of the present specification further provides a corresponding non-volatile computer storage medium, where computer executable instructions are stored, and the computer executable instructions are set as:
  • Convolving neural networks are trained according to word vectors of the words and word vectors of context words of the words in the corpus;
  • the training result of the word vector of each word is obtained according to the word vector of each word and the convolutional neural network after training.
  • the device, the device, the non-volatile computer storage medium and the method provided by the embodiments of the present specification are corresponding, and therefore, the device, the device, and the non-volatile computer storage medium also have similar beneficial technical effects as the corresponding method, since The beneficial technical effects of the method are described in detail, and therefore, the beneficial technical effects of the corresponding device, device, and non-volatile computer storage medium are not described herein.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller can be implemented in any suitable manner, for example, the controller can take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor.
  • computer readable program code eg, software or firmware
  • examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, The Microchip PIC18F26K20 and the Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller can be logically programmed by means of logic gates, switches, ASICs, programmable logic controllers, and embedding.
  • Such a controller can therefore be considered a hardware component, and the means for implementing various functions included therein can also be considered as a structure within the hardware component.
  • a device for implementing various functions can be considered as a software module that can be both a method of implementation and a structure within a hardware component.
  • the system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
  • a typical implementation device is a computer.
  • the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or A combination of any of these devices.
  • embodiments of the specification can be provided as a method, system, or computer program product.
  • embodiments of the present specification can take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware.
  • embodiments of the present specification can take the form of a computer program product embodied on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory. (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include temporary storage of computer readable media, such as modulated data signals and carrier waves.
  • embodiments of the present description can be provided as a method, system, or computer program product. Accordingly, the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware. Moreover, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types.
  • the present specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network.
  • program modules can be located in both local and remote computer storage media including storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Machine Translation (AREA)

Abstract

本说明书实施例公开了词向量处理方法、装置以及设备。所述方法包括:获取对语料分词得到的各词,建立各词的词向量,根据各词的词向量,以及各词在语料中的上下文词的词向量,对卷积神经网络进行训练,根据各词的词向量和训练后的卷积神经网络,获取各词的词向量的训练结果。

Description

词向量处理方法、装置以及设备 技术领域
本说明书涉及计算机软件技术领域,尤其涉及词向量处理方法、装置以及设备。
背景技术
如今的自然语言处理的解决方案,大都采用基于神经网络的架构,而在这种架构下一个重要的基础技术就是词向量。词向量是将词映射到一个固定维度的向量,该向量表征了该词的语义信息。
在现有技术中,常见的用于生成词向量的算法比如包括:谷歌公司的词向量算法、微软公司的深度神经网络算法等。
基于现有技术,需要一种更准确的词向量方案。
发明内容
本说明书实施例提供词向量处理方法、装置以及设备,用以解决如下技术问题:需要一种更准确的词向量方案。
为解决上述技术问题,本说明书实施例是这样实现的:
本说明书实施例提供的一种词向量处理方法,包括:
获取对语料分词得到的各词;
建立所述各词的词向量;
根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练;
根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果。
本说明书实施例提供的一种词向量处理装置,包括:
获取模块,获取对语料分词得到的各词;
建立模块,建立所述各词的词向量;
训练模块,根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练;
处理模块,根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果。
本说明书实施例提供的另一种词向量处理方法,包括:
步骤1,建立通过对语料分词得到的各词构成的词汇表,所述各词不包括在所述语料中出现次数少于设定次数的词;跳转步骤2;
步骤2,确定各词的总数量,相同的词只计一次;跳转步骤3;
步骤3,为各词分别建立维度为所述数量的一个不同的1-hot词向量;跳转步骤4;
步骤4,遍历分词后的所述语料,对遍历到的当前词执行步骤5,若遍历完成则执行步骤6,否则继续遍历;
步骤5,以当前词为中心,向两侧分别滑动至多k个词建立窗口,将窗口中除当前词以外的词作为上下文词,并将所有上下文词的词向量输入卷积神经网络的卷积层进行卷积计算,卷积计算结果输入所述卷积神经网络的池化层进行池化计算,得到第一向量;将当前词以及在所述语料中选择的负样例词的词向量输入所述卷积神经网络的全连接层进行计算,分别得到第二向量和第三向量;根据所述第一向量、所述第二向量、所述第三向量,以及指定的损失函数,更新所述卷积神经网络的参数;
所述卷积计算按照如下公式进行:
Figure PCTCN2018110055-appb-000001
Figure PCTCN2018110055-appb-000002
所述池化计算按照如下公式进行:
Figure PCTCN2018110055-appb-000003
或者
Figure PCTCN2018110055-appb-000004
所述损失函数包括:
Figure PCTCN2018110055-appb-000005
其中,x i表示第i个上下文词的词向量,x i:i+θ-1表示将第i~i+θ-1个上下文词的词向量拼接得到的向量,y i表示通过所述卷积计算得到的向量的第i个元素,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,σ表示激励函数,max表示求最大值函数,average表示求平均值函数,c(j)表示池化计算后得到的所述第一向量的第j个元素,t表示上下文词的数量,c表示所述第一向量,w表示所述第二向量,w' m表示第m个负样例词对应的所述第三向量,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,
Figure PCTCN2018110055-appb-000006
表示全连接层的权重参数,τ表示全连接层的偏置参数,γ表示超参数,s表示相似度计算函数,λ表示负样例词的数量;
步骤6,将所述各词的词向量分别输入训练后的所述卷积神经网络的全连接层进行计算,得到对应的词向量训练结果。
本说明书实施例提供的一种词向量处理设备,包括:
至少一个处理器;以及,
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
对语料分词得到各词;
建立所述各词的词向量;
根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练;
根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果。
本说明书实施例采用的上述至少一个技术方案能够达到以下有益效果:卷积神经网络可以通过卷积计算和池化计算,对词的上下文整体语义信息 进行刻画,提取更多的上下文语义信息,进而能够得到更为准确的词向量训练结果,因此,可以部分或者全部地解决上述技术问题。
附图说明
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本说明书的方案在一种实际应用场景下涉及的一种整体架构示意图;
图2为本说明书实施例提供的一种词向量处理方法的流程示意图;
图3为本说明书实施例提供的实际应用场景下,一种卷积神经网络的结构示意图;
图4为本说明书实施例提供的另一种词向量处理方法的流程示意图;
图5为本说明书实施例提供的对应于图2的一种词向量处理装置的结构示意图。
具体实施方式
本说明书实施例提供词向量处理方法、装置以及设备。
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本说明书实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
图1为本说明书的方案在一种实际应用场景下涉及的一种整体架构示意图。该整体架构中,主要涉及四部分:语料中的词、词的词向量及词在 语料中的上下文词的词向量、卷积神经网络训练服务器。前三部分涉及的动作可以由相应的软件和/或硬件功能模块执行,比如,可以也由卷积神经网络训练服务器执行。
词及其上下文词的词向量用于训练卷积神经网络,进而用训练后的卷积神经网络再对词向量进行推理,通过网络训练过程和词向量推理过程,实现了词向量训练,推理结果即为词向量训练结果。
本说明书的方案适用于英文词的词向量,也适用于中文、日文和德文等任意语言的词向量。为了便于描述,以下各实施例主要针对英文词的场景,对本说明书的方案进行说明。
图2为本说明书实施例提供的一种词向量处理方法的流程示意图。从设备角度而言,该流程的执行主体比如包括以下至少一种设备:个人计算机、大中型计算机、计算机集群、手机、平板电脑、智能可穿戴设备、车机等。
图2中的流程可以包括以下步骤:
S202:获取对语料分词得到的各词。
在本说明书实施例中,所述各词具体可以是:语料中至少出现过一次的词中的至少部分词。为了便于后续处理,可以将各词保存在词汇表中,需要使用时从词汇表中读取词即可。
需要说明的是,考虑到若某词在语料中出现的次数太少,则后续处理时相应的迭代次数也少,训练结果可信度相对低,因此,可以将这种词筛除,使其不包含在所述各词中。在这种情况下,所述各词具体是:语料中至少出现过一次的词中的部分词。
S204:建立所述各词的词向量。
在本说明书实施例中,所建立的词向量可以是初始化的词向量,需要通过训练后才能够较好地反映词义。
为了保证方案的效果,在建立词向量时,可能会有一些限制条件。比如,一般不为不同词的建立相同的词向量;又比如,词向量中的元素取值 一般不能全为0;等等。
在本说明书实施例中,建立词向量的方式有多种,比如,建立独热(1-hot)词向量、或者随机建立词向量等。
另外,若之前已经基于其他语料,训练过某些词对应的词向量,则在进一步地基于图2中的语料训练这些词的词向量,可以不再重新建立这些词的词向量,而是基于图2中的语料和之前的训练结果,再进行训练即可。
S206:根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练。
在本说明书实施例中,卷积神经网络的卷积层用于提取局部神经元的信息,卷积神经网络的池化层用于综合卷积层各个局部信息进而得到全局信息。具体到本说明书的场景,局部信息可以指部分上下文词的整体语义,全局信息可以指全部上下文词的整体语义。
S208:根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果。
通过训练卷积神经网络,能够为卷积神经网络确定合理的参数,使得卷积神经网络能够较为准确地刻画上下文词的整体语义,以及对应的当前词的语义。所述参数比如包括权重参数和偏置参数等。
利用训练后的卷积神经网络的全连接层对词向量进行推理,可以获得词向量训练结果。
通过图2的方法,卷积神经网络可以通过卷积计算和池化计算,对词的上下文整体语义信息进行刻画,提取更多的上下文语义信息,进而能够得到更为准确的词向量训练结果。
基于图2的方法,本说明书实施例还提供了该方法的一些具体实施方案,以及扩展方案,下面进行说明。
在本说明书实施例中,以建立1-hot词向量为例。对于步骤S204,所述建立所述各词的词向量,具体可以包括:
确定所述各词的总数量(相同的词只计一次);分别为所述各词建立维 度为所述总数量的词向量,其中,所述各词的词向量互不相同,所述词向量中有一个元素为1,其余元素为0。
例如,对各词逐一进行编号,编号从0开始,依次加一,假定各词的总数量为N c,则最后一个词的编号为N c-1。分别为各词建立一个维度为N c的1-hot词向量,具体地,假定某词的编号为256,为其建立的词向量中第256个元素可以为1,则其余元素为0。
在本说明书实施例中,在对卷积神经网络进行训练时,目标是使得当前词与上下文词的词向量在经过训练后的卷积神经网络推理后,相似度能够相对变高。
进一步地,将上下文词视为正样例词,作为对照,还可以按照一定的规则选择当前词的一个或者多个负样例词也参与训练,如此有利于训练快速收敛以及获得更为准确的训练结果。这种情况下,所述目标还可以包括使得当前词与负样例词的词向量在经过训练后的卷积神经网络推理后,相似度能够相对变低。负样例词比如可以在语料中随机选择得到,或者在非上下文词中选择得到,等等。本说明书对计算相似度的具体方式并不做限定,比如,可以基于向量的夹角余弦运算计算相似度,可以基于向量的平方和运算计算相似度,等等。
根据上一段的分析,对于步骤S206,所述根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练。具体可以包括:
根据所述各词的词向量,以及所述各词在所述语料中的上下文词和负样例词的词向量,对卷积神经网络进行训练。
在本说明书实施例中,卷积神经网络的训练过程可以是迭代进行的,比较简单的一种方式是对分词后的语料进行遍历,每遍历到上述各词中的一个词即进行一次迭代,直到遍历完毕,可以视为已经利用该语料训练过卷积神经网络了。
具体地,所述根据所述各词的词向量,以及所述各词在所述语料中的 上下文词和负样例词的词向量,对卷积神经网络进行训练,可以包括:
对分词后的所述语料进行遍历,对遍历到的当前词执行(执行内容即为一次迭代过程):
确定当前词在分词后的所述语料中的一个或多个上下文词以及负样例词;将当前词的上下文词的词向量输入卷积神经网络的卷积层进行卷积计算;将卷积计算结果输入所述卷积神经网络的池化层进行池化计算,得到第一向量;将当前词的词向量输入所述卷积神经网络的全连接层进行计算,得到第二向量,以及将当前词的负样例词的词向量输入所述卷积神经网络的全连接层进行计算,得到第三向量;根据所述第一向量、所述第二向量、所述第三向量,以及指定的损失函数,更新所述卷积神经网络的参数。
更直观地,结合图3进行说明。图3为本说明书实施例提供的实际应用场景下,一种卷积神经网络的结构示意图。
图3的卷积神经网络主要包括卷积层、池化层、全连接层,以及Softmax层。在训练卷积神经网络的过程中,上下文词的向量由卷积层和池化层进行处理,以提取上下文词整体的词义信息,而当前词及其负样例词的词向量则可以由全连接层进行处理。下面分别详细说明。
在本说明书实施例中,假定采用滑动窗口来确定上下文词,滑动窗口的中心为遍历到的当前词,滑动窗口中除当前词以外的其他词为上下文词。将全部上下文词的词向量输入卷积层,进而可以按照如下公式,进行卷积计算:
Figure PCTCN2018110055-appb-000007
Figure PCTCN2018110055-appb-000008
其中,x i表示第i个上下文词的词向量(这里假定x i是列向量),x i:i+θ-1表示将第i~i+θ-1个上下文词的词向量拼接得到的向量,y i表示通过所述卷积计算得到的向量(卷积计算结果)的第i个元素,ω表示卷积层的权重参数, ζ表示卷积层的偏置参数,σ表示激励函数,比如,Sigmoid函数,则
Figure PCTCN2018110055-appb-000009
进一步地,得到卷积计算结果后,可以输入池化层进行池化计算,具体可以采用最大化池化计算或者平均池化计算等。
若采用最大化池化计算,比如采用以下公式:
Figure PCTCN2018110055-appb-000010
若采用平均池化计算,比如采用以下公式:
Figure PCTCN2018110055-appb-000011
其中,max表示求最大值函数,average表示求平均值函数,c(j)表示池化计算后得到的所述第一向量的第j个元素,t表示上下文词的数量。
图3还示例性地示出了某语料中的某个当前词“liquid”、该当前词在该语料中的6个上下文词“as”、“the”、“vegan”、“gelatin”、“substitute”、“absorbs”,以及该当前词在该语料中的两个负样例词“year”、“make”。图3中假定所建立的1-hot词向量均为N c维,θ=3,表示卷积窗口的长度,则卷积计算时拼接得到的向量的维度为θ·N c=3·N c维。
对于当前词,其词向量可以输入全连接层,比如按照以下公式进行计算:
Figure PCTCN2018110055-appb-000012
其中,w表示全连接层对当前词的词向量处理后输出的所述第二向量,
Figure PCTCN2018110055-appb-000013
表示全连接层的权重参数,q表示当前词的词向量,τ表示全连接层的偏置参数。
类似地,对于每个负样例词,其词向量可以分别输入全连接层,参照当前词的方式进行处理,得到所述第三向量,将第m个负样例词对应的所述第三向量表示为w' m
进一步地,所述根据所述第一向量、所述第二向量、所述第三向量,以及指定的损失函数,更新所述卷积神经网络的参数,比如可以包括:计 算所述第二向量与所述第一向量的第一相似度,以及所述第三向量与所述第一向量的第二相似度;根据所述第一相似度、所述第二相似度,以及指定的损失函数,更新所述卷积神经网络的参数。
列举一种损失函数作为示例。所述损失函数比如可以是:
Figure PCTCN2018110055-appb-000014
其中,c表示所述第一向量,w表示所述第二向量,w' m表示第m个负样例词对应的所述第三向量,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,
Figure PCTCN2018110055-appb-000015
表示全连接层的权重参数,τ表示全连接层的偏置参数,γ表示超参数,s表示相似度计算函数,λ表示负样例词的数量。
在实际应用中,若为采用负样例词,则采用的损失函数中可以相应地去掉计算第一向量与第三向量的相似度的项。
在本说明书实施例中,在卷积神经网络训练后,可以对词向量进行推理,获得词向量训练结果。具体地,对于步骤S208,所述根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果,具体可以包括:
将所述各词的词向量分别输入训练后的所述卷积神经网络的全连接层进行计算,获得计算后输出的向量,作为对应的词向量训练结果。
基于同样的思路,本说明书实施例提供了另一种词向量处理方法,其为图2中的词向量处理方法示例性的一种具体实施方案。图4为该另一种词向量处理方法的流程示意图。
图4中的流程可以包括以下步骤:
步骤1,建立通过对语料分词得到的各词构成的词汇表,所述各词不包括在所述语料中出现次数少于设定次数的词;跳转步骤2;
步骤2,确定各词的总数量,相同的词只计一次;跳转步骤3;
步骤3,为各词分别建立维度为所述数量的一个不同的1-hot词向量;跳转步骤4;
步骤4,遍历分词后的所述语料,对遍历到的当前词执行步骤5,若遍历完成则执行步骤6,否则继续遍历;
步骤5,以当前词为中心,向两侧分别滑动至多k个词建立窗口,将窗口中除当前词以外的词作为上下文词,并将所有上下文词的词向量输入卷积神经网络的卷积层,进行卷积计算,卷积计算结果输入所述卷积神经网络的池化层进行池化计算,得到第一向量;将当前词以及在所述语料中选择的负样例词的词向量输入所述卷积神经网络的全连接层进行计算,分别得到第二向量和第三向量;根据所述第一向量、所述第二向量、所述第三向量,以及指定的损失函数,更新所述卷积神经网络的参数;
所述卷积计算按照如下公式进行:
Figure PCTCN2018110055-appb-000016
Figure PCTCN2018110055-appb-000017
所述池化计算按照如下公式进行:
Figure PCTCN2018110055-appb-000018
或者
Figure PCTCN2018110055-appb-000019
所述损失函数包括:
Figure PCTCN2018110055-appb-000020
其中,x i表示第i个上下文词的词向量,x i:i+θ-1表示将第i~i+θ-1个上下文词的词向量拼接得到的向量,y i表示通过所述卷积计算得到的向量的第i个元素,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,σ表示激励函数,max表示求最大值函数,average表示求平均值函数,c(j)表示池化计算后得到的所述第一向量的第j个元素,t表示上下文词的数量,c表示所述第一向量,w表示所述第二向量,w' m表示第m个负样例词对应的所述第三向量,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,
Figure PCTCN2018110055-appb-000021
表示全连接 层的权重参数,τ表示全连接层的偏置参数,γ表示超参数,s表示相似度计算函数,λ表示负样例词的数量;
步骤6,将所述各词的词向量分别输入训练后的所述卷积神经网络的全连接层进行计算,得到对应的词向量训练结果。
该另一种词向量处理方法中各步骤可以由相同或者不同的模块执行,本说明书对此并不做具体限定。
上面为本说明书实施例提供的词向量处理方法,基于同样的思路,本说明书实施例还提供了对应的装置,如图5所示。
图5为本说明书实施例提供的对应于图2的一种词向量处理装置的结构示意图,该装置可以位于图2中流程的执行主体,包括:
获取模块501,获取对语料分词得到的各词;
建立模块502,建立所述各词的词向量;
训练模块503,根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练;
处理模块504,根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果。
可选地,所述建立模块502建立所述各词的词向量,具体包括:
所述建立模块502确定所述各词的总数量;
分别为所述各词建立维度为所述总数量的词向量,其中,所述各词的词向量互不相同,所述词向量中有一个元素为1,其余元素为0。
可选地,所述训练模块503根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练,具体包括:
所述训练模块503根据所述各词的词向量,以及所述各词在所述语料中的上下文词和负样例词的词向量,对卷积神经网络进行训练。
可选地,所述训练模块503根据所述各词的词向量,以及所述各词在所述语料中的上下文词和负样例词的词向量,对卷积神经网络进行训练,具体包括:
所述训练模块503对分词后的所述语料进行遍历,对遍历到的当前词执行:
确定当前词在分词后的所述语料中的一个或多个上下文词以及负样例词;
将当前词的上下文词的词向量输入卷积神经网络的卷积层进行卷积计算;
将卷积计算结果输入所述卷积神经网络的池化层进行池化计算,得到第一向量;
将当前词的词向量输入所述卷积神经网络的全连接层进行计算,得到第二向量,以及将当前词的负样例词的词向量输入所述卷积神经网络的全连接层进行计算,得到第三向量;
根据所述第一向量、所述第二向量、所述第三向量,以及指定的损失函数,更新所述卷积神经网络的参数。
可选地,所述训练模块503进行卷积计算,具体包括:
所述训练模块503按照如下公式,进行卷积计算:
Figure PCTCN2018110055-appb-000022
Figure PCTCN2018110055-appb-000023
其中,x i表示第i个上下文词的词向量,x i:i+θ-1表示将第i~i+θ-1个上下文词的词向量拼接得到的向量,y i表示通过所述卷积计算得到的向量的第i个元素,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,σ表示激励函数。
可选地,所述训练模块503进行池化计算,具体包括:
所述训练模块503进行最大化池化计算或者平均池化计算。
可选地,所述训练模块503根据所述第一向量、所述第二向量、所述第三向量,以及指定的损失函数,更新所述卷积神经网络的参数,具体包括:
所述训练模块503计算所述第二向量与所述第一向量的第一相似度,以及所述第三向量与所述第一向量的第二相似度;
根据所述第一相似度、所述第二相似度,以及指定的损失函数,更新所述卷积神经网络的参数。
可选地,所述损失函数具体包括:
Figure PCTCN2018110055-appb-000024
其中,c表示所述第一向量,w表示所述第二向量,w' m表示第m个负样例词对应的所述第三向量,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,
Figure PCTCN2018110055-appb-000025
表示全连接层的权重参数,τ表示全连接层的偏置参数,γ表示超参数,s表示相似度计算函数,λ表示负样例词的数量。
可选地,所述处理模块504根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果,具体包括:
所述处理模块504将所述各词的词向量分别输入训练后的所述卷积神经网络的全连接层进行计算,获得计算后输出的向量,作为对应的词向量训练结果。
基于同样的思路,本说明书实施例还提供了对应的一种词向量处理设备,包括:
至少一个处理器;以及,
与所述至少一个处理器通信连接的存储器;其中,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
获取对语料分词得到的各词;
建立所述各词的词向量;
根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练;
根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词 的词向量的训练结果。
基于同样的思路,本说明书实施例还提供了对应的一种非易失性计算机存储介质,存储有计算机可执行指令,所述计算机可执行指令设置为:
获取对语料分词得到的各词;
建立所述各词的词向量;
根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练;
根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、设备、非易失性计算机存储介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本说明书实施例提供的装置、设备、非易失性计算机存储介质与方法是对应的,因此,装置、设备、非易失性计算机存储介质也具有与对应方法类似的有益技术效果,由于上面已经对方法的有益技术效果进行了详细说明,因此,这里不再赘述对应装置、设备、非易失性计算机存储介质的有益技术效果。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上 的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可 以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机。具体的,计算机例如可以为个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本说明书时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
本领域内的技术人员应明白,本说明书实施例可提供为方法、系统、或计算机程序产品。因此,本说明书实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本说明书实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本说明书是参照根据本说明书实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一 个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
本领域技术人员应明白,本说明书实施例可提供为方法、系统或计算机程序产品。因此,本说明书可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本说明书可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本说明书,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本说明书实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。

Claims (20)

  1. 一种词向量处理方法,包括:
    获取对语料分词得到的各词;
    建立所述各词的词向量;
    根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练;
    根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果。
  2. 如权利要求1所述的方法,所述建立所述各词的词向量,具体包括:
    确定所述各词的总数量;
    分别为所述各词建立维度为所述总数量的词向量,其中,所述各词的词向量互不相同,所述词向量中有一个元素为1,其余元素为0。
  3. 如权利要求1所述的方法,所述根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练,具体包括:
    根据所述各词的词向量,以及所述各词在所述语料中的上下文词和负样例词的词向量,对卷积神经网络进行训练。
  4. 如权利要求3所述的方法,所述根据所述各词的词向量,以及所述各词在所述语料中的上下文词和负样例词的词向量,对卷积神经网络进行训练,具体包括:
    对分词后的所述语料进行遍历,对遍历到的当前词执行:
    确定当前词在分词后的所述语料中的一个或多个上下文词以及负样例词;
    将当前词的上下文词的词向量输入卷积神经网络的卷积层进行卷积计算;
    将卷积计算结果输入所述卷积神经网络的池化层进行池化计算, 得到第一向量;
    将当前词的词向量输入所述卷积神经网络的全连接层进行计算,得到第二向量,以及将当前词的负样例词的词向量输入所述卷积神经网络的全连接层进行计算,得到第三向量;
    根据所述第一向量、所述第二向量、所述第三向量,以及指定的损失函数,更新所述卷积神经网络的参数。
  5. 如权利要求4所述的方法,所述进行卷积计算,具体包括:
    按照如下公式,进行卷积计算:
    Figure PCTCN2018110055-appb-100001
    Figure PCTCN2018110055-appb-100002
    其中,x i表示第i个上下文词的词向量,x i:i+θ-1表示将第i~i+θ-1个上下文词的词向量拼接得到的向量,y i表示通过所述卷积计算得到的向量的第i个元素,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,σ表示激励函数。
  6. 如权利要求4所述的方法,所述进行池化计算,具体包括:
    进行最大化池化计算或者平均池化计算。
  7. 如权利要求4所述的方法,所述根据所述第一向量、所述第二向量、所述第三向量,以及指定的损失函数,更新所述卷积神经网络的参数,具体包括:
    计算所述第二向量与所述第一向量的第一相似度,以及所述第三向量与所述第一向量的第二相似度;
    根据所述第一相似度、所述第二相似度,以及指定的损失函数,更新所述卷积神经网络的参数。
  8. 如权利要求4所述的方法,所述损失函数具体包括:
    Figure PCTCN2018110055-appb-100003
    其中,c表示所述第一向量,w表示所述第二向量,w' m表示第m个负样例词对应的所述第三向量,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,
    Figure PCTCN2018110055-appb-100004
    表示全连接层的权重参数,τ表示全连接层的偏置参数,γ表示超参数,s表示相似度计算函数,λ表示负样例词的数量。
  9. 如权利要求1所述的方法,所述根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果,具体包括:
    将所述各词的词向量分别输入训练后的所述卷积神经网络的全连接层进行计算,获得计算后输出的向量,作为对应的词向量训练结果。
  10. 一种词向量处理装置,包括:
    获取模块,获取对语料分词得到的各词;
    建立模块,建立所述各词的词向量;
    训练模块,根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练;
    处理模块,根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果。
  11. 如权利要求10所述的装置,所述建立模块建立所述各词的词向量,具体包括:
    所述建立模块确定所述各词的总数量;
    分别为所述各词建立维度为所述总数量的词向量,其中,所述各词的词向量互不相同,所述词向量中有一个元素为1,其余元素为0。
  12. 如权利要求10所述的装置,所述训练模块根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练,具体包括:
    所述训练模块根据所述各词的词向量,以及所述各词在所述语料中的上下文词和负样例词的词向量,对卷积神经网络进行训练。
  13. 如权利要求12所述的装置,所述训练模块根据所述各词的词向量, 以及所述各词在所述语料中的上下文词和负样例词的词向量,对卷积神经网络进行训练,具体包括:
    所述训练模块对分词后的所述语料进行遍历,对遍历到的当前词执行:
    确定当前词在分词后的所述语料中的一个或多个上下文词以及负样例词;
    将当前词的上下文词的词向量输入卷积神经网络的卷积层进行卷积计算;
    将卷积计算结果输入所述卷积神经网络的池化层进行池化计算,得到第一向量;
    将当前词的词向量输入所述卷积神经网络的全连接层进行计算,得到第二向量,以及将当前词的负样例词的词向量输入所述卷积神经网络的全连接层进行计算,得到第三向量;
    根据所述第一向量、所述第二向量、所述第三向量,以及指定的损失函数,更新所述卷积神经网络的参数。
  14. 如权利要求13所述的装置,所述训练模块进行卷积计算,具体包括:
    所述训练模块按照如下公式,进行卷积计算:
    Figure PCTCN2018110055-appb-100005
    Figure PCTCN2018110055-appb-100006
    其中,x i表示第i个上下文词的词向量,x i:i+θ-1表示将第i~i+θ-1个上下文词的词向量拼接得到的向量,y i表示通过所述卷积计算得到的向量的第i个元素,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,σ表示激励函数。
  15. 如权利要求13所述的装置,所述训练模块进行池化计算,具体包括:
    所述训练模块进行最大化池化计算或者平均池化计算。
  16. 如权利要求13所述的装置,所述训练模块根据所述第一向量、所述第二向量、所述第三向量,以及指定的损失函数,更新所述卷积神经网络的参数,具体包括:
    所述训练模块计算所述第二向量与所述第一向量的第一相似度,以及所述第三向量与所述第一向量的第二相似度;
    根据所述第一相似度、所述第二相似度,以及指定的损失函数,更新所述卷积神经网络的参数。
  17. 如权利要求13所述的装置,所述损失函数具体包括:
    Figure PCTCN2018110055-appb-100007
    其中,c表示所述第一向量,w表示所述第二向量,w' m表示第m个负样例词对应的所述第三向量,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,
    Figure PCTCN2018110055-appb-100008
    表示全连接层的权重参数,τ表示全连接层的偏置参数,γ表示超参数,s表示相似度计算函数,λ表示负样例词的数量。
  18. 如权利要求10所述的装置,所述处理模块根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果,具体包括:
    所述处理模块将所述各词的词向量分别输入训练后的所述卷积神经网络的全连接层进行计算,获得计算后输出的向量,作为对应的词向量训练结果。
  19. 一种词向量处理方法,包括:
    步骤1,建立通过对语料分词得到的各词构成的词汇表,所述各词不包括在所述语料中出现次数少于设定次数的词;跳转步骤2;
    步骤2,确定各词的总数量,相同的词只计一次;跳转步骤3;
    步骤3,为各词分别建立维度为所述数量的一个不同的1-hot词向量;跳转步骤4;
    步骤4,遍历分词后的所述语料,对遍历到的当前词执行步骤5,若遍历完成则执行步骤6,否则继续遍历;
    步骤5,以当前词为中心,向两侧分别滑动至多k个词建立窗口,将窗口中除当前词以外的词作为上下文词,并将所有上下文词的词向量输入卷积神经网络的卷积层进行卷积计算,卷积计算结果输入所述卷积神经网络的池化层进行池化计算,得到第一向量;将当前词以及在所述语料中选择的负样例词的词向量输入所述卷积神经网络的全连接层进行计算,分别得到第二向量和第三向量;根据所述第一向量、所述第二向量、所述第三向量,以及指定的损失函数,更新所述卷积神经网络的参数;
    所述卷积计算按照如下公式进行:
    Figure PCTCN2018110055-appb-100009
    Figure PCTCN2018110055-appb-100010
    所述池化计算按照如下公式进行:
    Figure PCTCN2018110055-appb-100011
    或者
    Figure PCTCN2018110055-appb-100012
    所述损失函数包括:
    Figure PCTCN2018110055-appb-100013
    其中,x i表示第i个上下文词的词向量,x i:i+θ-1表示将第i~i+θ-1个上下文词的词向量拼接得到的向量,y i表示通过所述卷积计算得到的向量的第i个元素,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,σ表示激励函数,max表示求最大值函数,average表示求平均值函数,c(j)表示池化计算后得到的所述第一向量的第j个元素,t表示上下文词的数量,c表示所述第一向量,w表示所述第二向量,w' m表示第m个负样例词对应的所述第三向量,ω表示卷积层的权重参数,ζ表示卷积层的偏置参数,
    Figure PCTCN2018110055-appb-100014
    表示全连接 层的权重参数,τ表示全连接层的偏置参数,γ表示超参数,s表示相似度计算函数,λ表示负样例词的数量;
    步骤6,将所述各词的词向量分别输入训练后的所述卷积神经网络的全连接层进行计算,得到对应的词向量训练结果。
  20. 一种词向量处理设备,包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够:
    对语料分词得到各词;
    建立所述各词的词向量;
    根据所述各词的词向量,以及所述各词在所述语料中的上下文词的词向量,对卷积神经网络进行训练;
    根据所述各词的词向量和训练后的所述卷积神经网络,获取所述各词的词向量的训练结果。
PCT/CN2018/110055 2017-11-30 2018-10-12 词向量处理方法、装置以及设备 WO2019105134A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711235849.7 2017-11-30
CN201711235849.7A CN108170667B (zh) 2017-11-30 2017-11-30 词向量处理方法、装置以及设备

Publications (1)

Publication Number Publication Date
WO2019105134A1 true WO2019105134A1 (zh) 2019-06-06

Family

ID=62524251

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/110055 WO2019105134A1 (zh) 2017-11-30 2018-10-12 词向量处理方法、装置以及设备

Country Status (3)

Country Link
CN (1) CN108170667B (zh)
TW (1) TWI701588B (zh)
WO (1) WO2019105134A1 (zh)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442857A (zh) * 2019-06-18 2019-11-12 平安科技(深圳)有限公司 情感智能判断方法、装置及计算机可读存储介质
CN110705280A (zh) * 2019-08-23 2020-01-17 上海市研发公共服务平台管理中心 技术合同认定模型创建方法、装置、设备和存储介质
CN111241819A (zh) * 2020-01-07 2020-06-05 北京百度网讯科技有限公司 词向量生成方法、装置及电子设备
CN111539228A (zh) * 2020-04-29 2020-08-14 支付宝(杭州)信息技术有限公司 向量模型训练方法及装置、相似度确定方法及装置
CN111737995A (zh) * 2020-05-29 2020-10-02 北京百度网讯科技有限公司 基于多种词向量训练语言模型的方法、装置、设备及介质
CN111782811A (zh) * 2020-07-03 2020-10-16 湖南大学 一种基于卷积神经网络和支持向量机的电子政务敏感文本检测方法
CN112749275A (zh) * 2020-05-22 2021-05-04 腾讯科技(深圳)有限公司 一种数据处理方法以及设备
CN112988921A (zh) * 2019-12-13 2021-06-18 北京四维图新科技股份有限公司 地图信息变化的识别方法和装置
CN113961664A (zh) * 2020-07-15 2022-01-21 上海乐言信息科技有限公司 基于深度学习的数值词处理方法、系统、终端及介质
CN115017915A (zh) * 2022-05-30 2022-09-06 北京三快在线科技有限公司 一种模型训练、任务执行的方法及装置
CN116384515A (zh) * 2023-06-06 2023-07-04 之江实验室 一种模型训练的方法、装置、存储介质及电子设备
CN117522669A (zh) * 2024-01-08 2024-02-06 之江实验室 一种图形处理器内存优化方法、装置、介质及设备
CN117573815A (zh) * 2024-01-17 2024-02-20 之江实验室 一种基于向量相似度匹配优化的检索增强生成方法

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108170667B (zh) * 2017-11-30 2020-06-23 阿里巴巴集团控股有限公司 词向量处理方法、装置以及设备
CN110162770B (zh) * 2018-10-22 2023-07-21 腾讯科技(深圳)有限公司 一种词扩展方法、装置、设备及介质
CN112395412B (zh) * 2019-08-12 2024-05-03 北京国双科技有限公司 文本分类的方法、装置以及计算机可读介质
CN110502614B (zh) * 2019-08-16 2023-05-09 创新先进技术有限公司 文本拦截方法、装置、系统以及设备
CN110852063B (zh) * 2019-10-30 2023-05-05 语联网(武汉)信息技术有限公司 基于双向lstm神经网络的词向量生成方法及装置
CN112016295B (zh) * 2020-09-04 2024-02-23 平安科技(深圳)有限公司 症状数据处理方法、装置、计算机设备及存储介质
CN114697096A (zh) * 2022-03-23 2022-07-01 重庆邮电大学 基于空时特征和注意力机制的入侵检测方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105786782A (zh) * 2016-03-25 2016-07-20 北京搜狗科技发展有限公司 一种词向量的训练方法和装置
JP2016161968A (ja) * 2015-02-26 2016-09-05 日本電信電話株式会社 単語ベクトル学習装置、自然言語処理装置、方法、及びプログラム
CN106295796A (zh) * 2016-07-22 2017-01-04 浙江大学 基于深度学习的实体链接方法
CN108170667A (zh) * 2017-11-30 2018-06-15 阿里巴巴集团控股有限公司 词向量处理方法、装置以及设备

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10289957B2 (en) * 2014-12-30 2019-05-14 Excalibur Ip, Llc Method and system for entity linking

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016161968A (ja) * 2015-02-26 2016-09-05 日本電信電話株式会社 単語ベクトル学習装置、自然言語処理装置、方法、及びプログラム
CN105786782A (zh) * 2016-03-25 2016-07-20 北京搜狗科技发展有限公司 一种词向量的训练方法和装置
CN106295796A (zh) * 2016-07-22 2017-01-04 浙江大学 基于深度学习的实体链接方法
CN108170667A (zh) * 2017-11-30 2018-06-15 阿里巴巴集团控股有限公司 词向量处理方法、装置以及设备

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110442857B (zh) * 2019-06-18 2024-05-10 平安科技(深圳)有限公司 情感智能判断方法、装置及计算机可读存储介质
CN110442857A (zh) * 2019-06-18 2019-11-12 平安科技(深圳)有限公司 情感智能判断方法、装置及计算机可读存储介质
CN110705280A (zh) * 2019-08-23 2020-01-17 上海市研发公共服务平台管理中心 技术合同认定模型创建方法、装置、设备和存储介质
CN112988921A (zh) * 2019-12-13 2021-06-18 北京四维图新科技股份有限公司 地图信息变化的识别方法和装置
CN111241819A (zh) * 2020-01-07 2020-06-05 北京百度网讯科技有限公司 词向量生成方法、装置及电子设备
CN111539228A (zh) * 2020-04-29 2020-08-14 支付宝(杭州)信息技术有限公司 向量模型训练方法及装置、相似度确定方法及装置
CN111539228B (zh) * 2020-04-29 2023-08-08 支付宝(杭州)信息技术有限公司 向量模型训练方法及装置、相似度确定方法及装置
CN112749275A (zh) * 2020-05-22 2021-05-04 腾讯科技(深圳)有限公司 一种数据处理方法以及设备
CN112749275B (zh) * 2020-05-22 2024-05-14 腾讯科技(深圳)有限公司 一种数据处理方法以及设备
CN111737995B (zh) * 2020-05-29 2024-04-05 北京百度网讯科技有限公司 基于多种词向量训练语言模型的方法、装置、设备及介质
CN111737995A (zh) * 2020-05-29 2020-10-02 北京百度网讯科技有限公司 基于多种词向量训练语言模型的方法、装置、设备及介质
CN111782811A (zh) * 2020-07-03 2020-10-16 湖南大学 一种基于卷积神经网络和支持向量机的电子政务敏感文本检测方法
CN113961664A (zh) * 2020-07-15 2022-01-21 上海乐言信息科技有限公司 基于深度学习的数值词处理方法、系统、终端及介质
CN115017915B (zh) * 2022-05-30 2023-05-30 北京三快在线科技有限公司 一种模型训练、任务执行的方法及装置
CN115017915A (zh) * 2022-05-30 2022-09-06 北京三快在线科技有限公司 一种模型训练、任务执行的方法及装置
CN116384515B (zh) * 2023-06-06 2023-09-01 之江实验室 一种模型训练的方法、装置、存储介质及电子设备
CN116384515A (zh) * 2023-06-06 2023-07-04 之江实验室 一种模型训练的方法、装置、存储介质及电子设备
CN117522669A (zh) * 2024-01-08 2024-02-06 之江实验室 一种图形处理器内存优化方法、装置、介质及设备
CN117522669B (zh) * 2024-01-08 2024-03-26 之江实验室 一种图形处理器内存优化方法、装置、介质及设备
CN117573815A (zh) * 2024-01-17 2024-02-20 之江实验室 一种基于向量相似度匹配优化的检索增强生成方法
CN117573815B (zh) * 2024-01-17 2024-04-30 之江实验室 一种基于向量相似度匹配优化的检索增强生成方法

Also Published As

Publication number Publication date
TW201926078A (zh) 2019-07-01
CN108170667B (zh) 2020-06-23
CN108170667A (zh) 2018-06-15
TWI701588B (zh) 2020-08-11

Similar Documents

Publication Publication Date Title
WO2019105134A1 (zh) 词向量处理方法、装置以及设备
WO2019149135A1 (zh) 词向量生成方法、装置以及设备
TWI685761B (zh) 詞向量處理方法及裝置
WO2019149076A1 (zh) 词向量生成方法、装置以及设备
WO2022007823A1 (zh) 一种文本数据处理方法及装置
CN107957989B9 (zh) 基于集群的词向量处理方法、装置以及设备
US11238306B2 (en) Generating vector representations of code capturing semantic similarity
WO2018223992A1 (zh) 一种对话生成方法、装置以及电子设备
CN108874765B (zh) 词向量处理方法及装置
CN112580369B (zh) 语句复述方法、训练语句复述模型的方法及其装置
US10846483B2 (en) Method, device, and apparatus for word vector processing based on clusters
WO2019174392A1 (zh) 针对rpc信息的向量处理
CN107562715B (zh) 词向量处理方法、装置以及电子设备
CN107577658B (zh) 词向量处理方法、装置以及电子设备
CN116109449A (zh) 一种数据处理方法及相关设备
WO2021233389A1 (zh) 增强深度学习模型鲁棒性的方法及装置
CN107844472B (zh) 词向量处理方法、装置以及电子设备
CN111967365A (zh) 影像连接点的提取方法和装置
CN114358003A (zh) 目标句子识别方法、装置、设备、存储介质和程序产品
CN115309873A (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: 18884530

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

Country of ref document: EP

Kind code of ref document: A1