WO2019205319A1 - Commodity information format processing method and apparatus, and computer device and storage medium - Google Patents

Commodity information format processing method and apparatus, and computer device and storage medium Download PDF

Info

Publication number
WO2019205319A1
WO2019205319A1 PCT/CN2018/097082 CN2018097082W WO2019205319A1 WO 2019205319 A1 WO2019205319 A1 WO 2019205319A1 CN 2018097082 W CN2018097082 W CN 2018097082W WO 2019205319 A1 WO2019205319 A1 WO 2019205319A1
Authority
WO
WIPO (PCT)
Prior art keywords
training
words
commodity
layer
word
Prior art date
Application number
PCT/CN2018/097082
Other languages
French (fr)
Chinese (zh)
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 WO2019205319A1 publication Critical patent/WO2019205319A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present application relates to a method, device, computer device and storage medium for processing a commodity information format.
  • Customs declaration forms involve a variety of product information. Although the declaration form specifies a uniform declaration format, different applicants fill in the order and form of the product information, resulting in a uniform format of the commodity information in the customs declaration. . A large number of customs officers interpret commodity information in different formats, which is time-consuming and laborious, and also causes more obstacles to the customs control of customs import and export business. In order to effectively and uniformly process the product information format, in the traditional way, the developer usually uses a specific template to match the key dictionary to match the key information, and unify the format of the product information. However, this approach requires developers to develop a variety of templates and collect a variety of proper noun libraries to build proprietary dictionaries, resulting in a lower efficiency in the processing of uniform commodity information formats.
  • a commodity information format processing method is provided.
  • a commodity information format processing method includes: acquiring commodity information, the commodity information including a plurality of commodity items; performing word segmentation processing on the content of the commodity item to obtain a plurality of words; and acquiring a plurality of pieces obtained by training the word vector model a weight vector corresponding to the word, generating a weight matrix by using a weight vector corresponding to the plurality of words; acquiring a code corresponding to the plurality of words of the commodity item, inputting the code of the plurality of words into the trained multi-layer cyclic neural network; The trained multi-layer cyclic neural network performs an operation based on the encoding of the plurality of words and the weight matrix, and outputs a description of a preset format corresponding to the commodity item.
  • a commodity information format processing apparatus comprising: an information acquisition module, configured to acquire commodity information, the commodity information includes a plurality of commodity items; and a word segmentation processing module, configured to perform word segmentation processing on the content of the commodity item to obtain a plurality of a weight matrix generation module, configured to acquire a weight vector corresponding to a plurality of words trained by the word vector model, and generate a weight matrix by using a weight vector corresponding to the plurality of words; and a format unification module for acquiring the commodity item Corresponding encoding of the plurality of words, inputting the encoding of the plurality of words into the trained multi-layer cyclic neural network; and encoding, by the trained multi-layer cyclic neural network, based on the encoding of the plurality of words and the weight matrix Performing an operation to output a description of a preset format corresponding to the item of the item.
  • a computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executable by the processor to cause the one or more processors to execute The following steps: obtaining commodity information, the commodity information includes a plurality of commodity items; performing word segmentation on the content of the commodity item to obtain a plurality of words; and acquiring a weight vector corresponding to the plurality of words obtained by training the word vector model, and utilizing Generating a weight matrix corresponding to the weight vector of the plurality of words; acquiring a code corresponding to the plurality of words of the commodity item, inputting the code of the plurality of words into the trained multi-layer cyclic neural network; and passing the multi-layer after the training a cyclic neural network, performing an operation based on the encoding of the plurality of words and the weight matrix, and outputting a description of a preset format corresponding to the commodity item.
  • One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of: obtaining merchandise information,
  • the commodity information includes a plurality of commodity items; performing word segmentation processing on the content of the commodity item to obtain a plurality of words; acquiring a weight vector corresponding to the plurality of words trained by the word vector model, and using a weight vector corresponding to the plurality of words Generating a weight matrix; acquiring a code corresponding to the plurality of words of the commodity item, inputting the code of the plurality of words into the trained multi-layer cyclic neural network; and using the trained multi-layer cyclic neural network, based on The encoding of the plurality of words and the weight matrix are operated to output a description of a preset format corresponding to the commodity item.
  • FIG. 1 is an application scenario diagram of a method for processing a commodity information format according to one or more embodiments
  • FIG. 2 is a schematic flow chart of a method for processing a commodity information format according to one or more embodiments
  • FIG. 3 is an expanded view of a 2-layer cyclic neural network in time in accordance with one or more embodiments
  • FIG. 4 is an expanded view of a 4-layer cyclic neural network in time in accordance with one or more embodiments
  • FIG. 5 is a developmental diagram of a 6-layer cyclic neural network in time according to one or more embodiments
  • FIG. 6 is a flow diagram showing the steps of word vector model training and multi-layer cyclic neural network training in accordance with one or more embodiments
  • FIG. 7 is a block diagram of a commodity information format processing apparatus in accordance with one or more embodiments.
  • FIG. 8 is a block diagram of a computer device in accordance with one or more embodiments.
  • the commodity information format processing method provided by the present application can be applied to an application environment as shown in FIG. 1.
  • the terminal 102 communicates with the server 104 via a network.
  • the terminal 102 can be, but is not limited to, computer equipment such as various personal computers, notebook computers, smart phones, and tablet computers.
  • the server 104 can be implemented by a separate server or a server cluster composed of multiple servers.
  • the product file uploaded by the terminal 102 to the server 104.
  • a plurality of product information is recorded in the product file, and the product information includes a plurality of product items.
  • the server 104 performs word segmentation processing on the detailed description of each item of merchandise.
  • the trained word vector model and the trained multi-layer cyclic neural network are pre-stored in the server 104.
  • the server 104 acquires a weight vector corresponding to a plurality of words trained by the word vector model, and generates a weight matrix by using weight vectors corresponding to the plurality of words.
  • the server 104 acquires a code corresponding to a plurality of words of the item of the item, and inputs the code of the plurality of words to the trained multi-layer loop neural network.
  • the operation is performed based on the encoding of the plurality of words and the weight matrix, and the description of the preset format corresponding to the commodity item is output. This allows a variety of different formats of original product information to be converted into a uniform format description.
  • a method for processing a commodity information format is provided.
  • the method is applied to the server in FIG. 1 as an example, and includes the following steps:
  • Step 202 Acquire item information, where the item information includes a plurality of item items.
  • Step 204 Perform word segmentation on the content of the commodity item to obtain a plurality of words.
  • the server receives the product files uploaded by multiple terminals.
  • a variety of product information is recorded in the product file.
  • the product information includes a plurality of product items, and each product item includes a specific content, that is, a detailed information description.
  • the specific content of the same product item may be different.
  • the server performs word segmentation on the detailed description of each item of merchandise. For example, the server divides one of the detailed descriptions of the item "hard disk” into “hard disk”, “capacity”, “128”, “GB”, “cache”, “capacity”, “32”, “MB”. , get multiple words.
  • Step 206 Acquire a weight vector corresponding to a plurality of words trained by the word vector model, and generate a weight matrix by using a weight vector corresponding to the plurality of words.
  • the hidden layer includes a forward estimation layer and a backward estimation layer, which may also be referred to as an implicit layer that is a two-way estimation.
  • the hidden layer of the first layer includes a first forward estimation layer and a first backward estimation layer
  • the hidden layer of the second layer includes a second forward estimation layer and a second backward estimation layer
  • the third layer implies The layer includes a third forward estimation layer and a third backward estimation layer, and so on.
  • a corresponding weight matrix is set between the input layer and the hidden layer of the first layer, that is, a corresponding weight matrix is respectively set between the input layer and the first forward estimation layer and the input layer and the first backward estimation layer.
  • the weight matrix corresponding to the first forward estimation layer and the first backward estimation layer are initialized to a random vector, but this may result in poor convergence of the multilayer cyclic neural network, and the output result cannot be fulfil requirements.
  • the server uses the weight matrix corresponding to the plurality of words in the commodity item as the weight matrix between the input layer and the first hidden layer in the multi-layer cyclic neural network.
  • the weight matrix is obtained by training the word vector model.
  • the weight vector can reflect the vector of each word in the commodity item, effectively improve the convergence efficiency of the multi-layer cyclic neural network, thereby improving the accuracy of the output effect.
  • the weight matrix corresponding to each of the first forward estimation layer and the first backward estimation layer is different from each other.
  • the server can obtain the weight vector corresponding to each word according to the description order of the multiple words in the commodity item, and the weight vector corresponding to each word can be a vector array.
  • the server uses the weight vector corresponding to the plurality of words to generate a forward weighted weight matrix corresponding to the plurality of words.
  • the server may obtain the weight vector of each word according to the reverse description order of the plurality of words in the commodity item, thereby generating a backward weighted weight matrix corresponding to the plurality of words.
  • the forward weighted weight matrix is the weight matrix between the input layer and the first forward estimation layer in the multi-layer cyclic neural network.
  • the weight matrix calculated backwards is the weight matrix between the input layer and the first backward estimation layer in the multi-layer cyclic neural network.
  • the server can generate forward in the order of “hard disk”, “capacity”, “128”, “GB”, “cache”, “capacity”, “32”, “MB”.
  • the weight matrix of the calculation may also generate a backward weight matrix in the order of "MB", "32”, “capacity”, “cache”, “GB”, “128”, “capacity”, and "hard disk”.
  • Step 208 Acquire a code corresponding to a plurality of words of the commodity item, and input the code of the plurality of words into the trained multi-layer cyclic neural network.
  • Step 210 Perform a calculation based on the multi-word cyclic neural network after training, based on the encoding of the plurality of words and the weight matrix, and output a description of the preset format corresponding to the commodity item.
  • the multilayer hidden layer in the multilayer cyclic neural network may be 2 layers, 4 layers or 6 layers.
  • Each layer of the hidden layer includes a forward estimation layer and a backward estimation layer.
  • Relu represents the activation function
  • Lstm represents the long and short time memory unit
  • Softmax represents the classification function
  • w* indicates a positive integer
  • each layer of the forward estimation layer and each layer of the backward estimation layer are set with corresponding initial weight matrix. For example, w2, w5 in FIG. 3, w3, w5, w6, w8 in FIG. 4, and w3, w5, w7, w8, w10, w12 in FIG.
  • Multi-layered cyclic neural networks can be pre-trained.
  • the multi-layer cyclic neural network can be trained by using the mapping file corresponding to the commodity information, and the mapping file records the original description of the plurality of training words in the commodity item and the description of the preset format. Thereby, the original description of the plurality of words in the item can be output in a preset format.
  • the server Since the multi-layered cyclic neural network only accepts numerical inputs, the server also generates a corresponding training vocabulary based on the training words during training.
  • the training vocabulary contains the code corresponding to each training word. After the server performs word segmentation on the commodity item, the training vocabulary can be used to query the code corresponding to the word of each commodity item.
  • the server invokes the trained multi-layered cyclic neural network to input the codes of the multiple words of the commodity item to the input layer of the multi-layer cyclic neural network.
  • the input layer activates the weight matrix of the first forward estimation layer by an activation function, and activates the weight matrix of the first backward estimation layer, combined with the initial weight matrix of the first forward estimation layer and the initial weight matrix of the first backward estimation layer Start the operation. There is no information flow between the forward estimation layer and the backward estimation layer.
  • the 4-layer cyclic neural network after training is described as an example.
  • the multiple words entered in the input layer may be "hard disk”, “capacity”, “128”, “GB”, “cache”, “capacity”, “32”, “MB”.
  • w1 is a weight matrix of the first forward estimation layer
  • w3 is an initial weight matrix of the first forward estimation layer.
  • the forward weighted weight matrix w3 is outputted respectively (w3 at this time) This is different from the initial w3, here the same mark is used for the sake of brevity) and the weight matrix w4 corresponding to the second forward estimation layer.
  • W2 is the weight matrix of the first backward estimation layer
  • w6 is the initial weight matrix of the first backward estimation layer.
  • the weight matrix w6 calculated backward is output respectively (w6 at this time is different from the initial w6)
  • the same is used for the sake of brevity and the weight matrix w7 corresponding to the second backward estimation layer. This is done by looping until the output layer outputs a description of the preset format of each word in turn by the classification function.
  • the item is "hard disk” and the original information is "Seagate/ST500LT012
  • the server may perform word segmentation on the content in the commodity item to obtain a plurality of words corresponding to the commodity item.
  • the server may acquire a corresponding weight vector according to a plurality of words of the commodity item, and then generate a weight matrix corresponding to the plurality of words. Since the weight vector of each word is trained by the word vector model, it can accurately reflect the vector of each word, effectively improve the convergence effect of the multi-layer cyclic neural network, and thus improve the accuracy of the output effect.
  • the server inputs the code of the plurality of words of the commodity item into the multi-layer cyclic neural network after training, and uses the multi-cycle neural network after training to perform calculation by using the coding of multiple words and the weight matrix, and outputs the preset format corresponding to the commodity item. description of. Since the multi-layered cyclic neural network is trained, each word in the commodity item can be output as a description of the preset format. The whole process does not need to develop a variety of templates and build a proprietary dictionary. Various types of product information can output the required uniform format, and the uniform efficiency of the product information format is improved.
  • the method further comprises: a word vector model training and a step of multi-layer cyclic neural network training. As shown in Figure 6, the following are included:
  • Step 602 Acquire a training set corresponding to the commodity information, where the training set includes a plurality of commodity items and a plurality of training words corresponding to the commodity items.
  • step 604 the number of words of the training words in the plurality of commodity items is counted, and the maximum number of words is marked as the longest input parameter.
  • step 606 the word vector model is trained by using the longest input parameter and the training word, and the weight vector corresponding to the training word is obtained.
  • step 608 the multi-layer cyclic neural network is trained by using the longest input parameter and the weight vector corresponding to the training word, and the trained multi-layer cyclic neural network is obtained.
  • a large number of sample files are stored in the database.
  • the corresponding product information is recorded in the sample file.
  • the item information recorded in the server sample file is marked as training data in a specific scale.
  • Word vector models and multi-layered cyclic neural networks can be trained in advance through training data.
  • Training data can be derived from existing product information.
  • Product data and detailed descriptions are included in the training data.
  • the server performs word segmentation on the detailed description of each commodity item to obtain multiple words.
  • the server performs preprocessing such as data cleaning of multiple words and unification of output formats. For example, the server cleans the wrong data and cleans "128GD" to "128".
  • the server unifies the capitalization of the English description and unifies "SEAGATE", "Seagate”, and "SEagate” into “SEAGATE”.
  • the server uses the pre-processed word as a training word, and generates a training set by using a plurality of commodity items and training words corresponding to the commodity items.
  • the number of words in the training words of different commodity items is different.
  • the trained word vector model and the trained multi-layered cyclic neural network are universal.
  • the longest input parameter and the longest output parameter are set for both the word vector model and the multi-layer cyclic neural network.
  • the longest input parameter has the same value as the longest output parameter.
  • the server may count the number of words of the training words in the plurality of item items, and mark the maximum number of words in the number of words of the training words in the item items as the longest input parameter.
  • the server may add a corresponding number of preset characters according to the vocabulary quantity of the commodity item and the longest input parameter.
  • the preset characters may be characters that do not conflict with the product information, such as null characters.
  • the initial input parameter is 100
  • the corresponding longest output parameter is also 100. If the vocabulary quantity of a commodity item is 30, the server adds 70 preset characters to the item.
  • the server trains the word vector model using the training words and the preset characters supplemented by the longest input parameters, thereby obtaining a weight vector corresponding to each training word and the preset character.
  • the word vector model can adopt the Skip-Gram model, that is, the model can adopt a neural network structure, including an input vector, an implicit layer, and an output layer.
  • the final result is output through the output layer of the model, and the final result is a probability distribution.
  • This probability distribution does not apply to multilayer cyclic neural networks. Therefore, in this embodiment, only the input vector of the model and the structure of the hidden layer are used, and the weight vector of the plurality of words is output through the hidden layer, and the operation is not continued through the output layer.
  • the server Since the word vector model and the multi-layered cyclic neural network only accept numerical inputs, the server also generates a corresponding training vocabulary based on the training words during training. Some of the preset characters are also recorded in the training vocabulary, taking into account the longest input parameters.
  • the training vocabulary contains the code corresponding to each training word.
  • the server generates an input vector of the word vector model according to the code corresponding to the training word, and performs an operation through the hidden layer to output a corresponding training weight matrix.
  • the training weight matrix includes a plurality of training words and a weight vector corresponding to the preset characters.
  • the server calls the multi-layer cyclic neural network, and obtains a plurality of training words and codes corresponding to the preset characters according to the longest input parameter, and inputs them into the multi-layer cyclic neural network for training.
  • each training word weight vector obtained by the word vector model training is used, the vector state of each training word can be more accurately reflected, and the convergence effect of the multi-layer cyclic neural network can be effectively improved, thereby enabling Improve the accuracy of multi-layer cyclic neural network training.
  • the vocabulary corresponding to each commodity item reaches the same number as the longest data parameter, that is, the vocabulary corresponding to each commodity item is the same, thereby making the trained word vector model and Multi-layered cyclic neural networks after training are versatile. There is no need to train multiple models, which effectively reduces the workload of developers.
  • the word vector model is trained by using the longest input parameter and the training word, and the weight vector corresponding to the training word is obtained by: obtaining a corpus corresponding to the product information, and the corpus includes a plurality of corpora; the corpus includes Partial preset characters; using the corpus to train the word vector model to obtain the corpus weight matrix; the corpus weight matrix includes multiple corpus weight vectors; using the preset characters to increase the vocabulary number of the training words of the plurality of commodity items to the longest Enter the same number of parameters; according to the product item after increasing the vocabulary quantity, select the training word and the corpus weight vector corresponding to one or more preset characters in the corpus weight matrix, and mark the input vector corresponding to the training word; A plurality of input vectors are loaded, and a training weight matrix is obtained by training the hidden layer of the word vector model.
  • the training weight matrix includes a plurality of training words and a weight vector corresponding to the preset characters.
  • the server can also optimize the training process of the word vector model.
  • the server may crawl multiple corpus articles corresponding to the product information on multiple websites, and perform pre-processing on the corpus articles, including word segmentation, cleaning, and unified description formats.
  • the server uses the pre-processed corpus to build a corpus.
  • the corpus may also include some preset characters in consideration of the setting of the longest input parameter.
  • the server encodes each corpus and preset characters in the corpus to obtain a corresponding corpus input vector.
  • the server inputs multiple corpus input vectors into the input layer of the word vector model, and trains through the hidden layer to obtain a corpus weight matrix.
  • the corpus weight matrix includes multiple corpus weight vectors.
  • the server increases the number of words per item item to the longest data parameter.
  • the server selects the training word and the corpus weight vector corresponding to one or more preset characters in the corpus weight matrix, and marks the input vector corresponding to the training word.
  • the word vector model loads a plurality of input vectors, and is trained by the hidden layer of the word vector model to obtain a plurality of training words and a training weight matrix corresponding to the preset characters.
  • a mapping file corresponding to the commodity information is pre-stored in the server, and a description of the original description and the preset format of the plurality of training words in the commodity item is recorded in the mapping file. For example, if the item is "hard disk” and the original information is "Seagate/ST500LT012
  • the server increases the number of words of the training words of the plurality of commodity items to the same number as the longest input parameter by using the preset characters, so that the number of words in each commodity item is the same.
  • the server separately obtains a plurality of training words in each commodity item and a weight vector corresponding to the preset characters, and then generates a training weight matrix corresponding to each commodity item.
  • the server may generate a forward weighted training weight matrix corresponding to each commodity item and a backward weighted training weight matrix with reference to the above embodiment.
  • the server acquires a plurality of words in each commodity item and a code corresponding to the preset character, inputs the corresponding code to the input layer of the multi-layer cyclic neural network, and sets the training weight matrix calculated in advance to the first
  • a weight matrix of the forward estimation layer is set, and the backward weighted training weight matrix is set as the weight matrix of the first backward estimation layer.
  • the initial weight matrix of each layer in the hidden layer is initialized, and the initial weight matrix of each layer in the hidden layer is estimated.
  • the server trains the multi-layer cyclic neural network to output a description of the preset format of multiple training words in the commodity item.
  • the weight matrix of the first forward estimation layer in the multi-layer cyclic network may be set to 100, and the weight matrix of the first backward estimation layer in the multi-layer cyclic neural network may be set to 100. That is, each training word and preset character in the commodity item are configured with corresponding weight matrix in the loop training.
  • the multi-layer circular network also outputs 100 results, which are described in terms of the preset format of the training words. For the output of the preset character, it can also be a preset character. There will be no impact on the training results.
  • the trained multi-layered cyclic neural network After training the multi-layered cyclic neural network with the longest input parameters, the trained multi-layered cyclic neural network can be adapted to use diversified commodity information.
  • a corresponding output format is set for each training word through a mapping table, and the original description of each item in the commodity item has a one-to-one correspondence with the output description. If the item items are the same and the original information is different, the output format of the two item items cannot be unified.
  • the training is performed through the multi-layer cyclic network, so that the original description in each commodity item is not one-to-one correspondence with the output description, but it is ensured that each commodity item is output according to a preset unified format.
  • the multi-layered cyclic neural network includes a plurality of hidden layers; a training word, a preset character, and a corresponding weight vector matrix in the commodity item after the vocabulary quantity is increased, through the multilayer cyclic neural network
  • the training includes: assigning a random vector to each hidden layer as an initial weight matrix of the hidden layer; and training corresponding to the commodity item after the input layer and the first hidden layer are set to increase the vocabulary quantity according to the longest input parameter; Weight matrix; the code corresponding to the training word of the commodity item after increasing the vocabulary quantity and the code corresponding to the preset character are input to the input layer of the multi-layer cyclic neural network; the multi-layer hidden layer is trained by using the initial weight matrix and the training weight matrix
  • the output layer outputs a description of a preset format of the plurality of training words in the product item.
  • each layer of hidden layers needs to be initialized.
  • Each layer of hidden layers may include a forward estimation layer and a backward estimation layer.
  • the forward estimation layer and the backward estimation layer of each hidden layer need to be initialized.
  • the initial weighting matrix corresponding to each layer of the hidden layer and the initial weighting matrix corresponding to the backward estimating layer are initialized to 0, but the generalized ability of the multi-layered cyclic neural network trained in this way is limited. If there are more different types of product information in the future, it may be necessary to retrain.
  • the server assigns a random vector to the forward estimation layer and the backward estimation layer of each layer of the hidden layer as the initial weight matrix.
  • the random vector may be an array of preset lengths, for example, 200 or 300 dimensions.
  • the server sets the training weight matrix corresponding to the commodity item after increasing the vocabulary quantity in the input layer and the first layer hidden layer, and increases the encoding and preset corresponding to the training word of the commodity item after the vocabulary quantity.
  • the code corresponding to the character is input to the input layer of the multi-layer cyclic neural network.
  • the method may be used to perform the training by using the initial weight matrix and the training weight matrix through the multi-layer hidden layer, and output the description of the preset format of the plurality of training words in the commodity item through the output layer.
  • each layer of the hidden layer configures a random vector as the initial weight matrix at the time of initialization
  • the generalization capability of the multi-layer cyclic neural network can be effectively improved, and it can be applied to more diverse product information in the future.
  • the vocabulary corresponding to each commodity item is the same, thereby making the trained word vector model and the trained multi-layer cyclic neural network have versatility. There is no need to train multiple models, which effectively reduces the workload of developers.
  • the method further includes: acquiring a number of sample files corresponding to the plurality of training sets; acquiring a verification set, the verification set includes words of the plurality of commodity items; and using the verification set to output the plurality of training sets after passing the training
  • the preset format of the commodity item is verified; when the accuracy of the verification reaches the threshold, the number of sample files corresponding to the threshold value for the first time is marked as the number of sample files of the maximum batch training.
  • Multi-layered cyclic neural networks can perform batch training on training words in multiple samples. If the number of sample files for batch training is too small, the multi-layered cyclic neural network cannot learn the diversity of commodity information existing in the sample files. If the number of sample files for batch training is too large, multi-layered cyclic neural networks cannot accurately memorize diversified product information, and performance will be affected. Therefore, when training in a multi-layered cyclic neural network, it is necessary to determine the number of sample files for maximum batch training.
  • the server may separately acquire a plurality of sample files to generate a training set.
  • the training is performed by the word vector model and the multi-layer cyclic neural network, and the output corresponding to the number of each sample file is obtained.
  • the server can also use the commodity information in other sample files to generate a verification set in advance.
  • the verification set includes words corresponding to multiple item items.
  • the server compares the output result corresponding to the number of sample files with the words in the verification set, thereby obtaining the accuracy corresponding to the number of sample files.
  • the server can mark the number of sample files when the threshold is reached for the first time as the number of sample files for the maximum batch training. Further, the server can also draw a corresponding curve by using different sample file numbers and their corresponding accuracy. There may be fluctuations in the curve.
  • the ratio of the difference between the number of sample files corresponding to the threshold is calculated to be less than or equal to the preset ratio. If yes, the number of sample files that are initially less than or equal to the preset ratio is marked as the number of sample files for the maximum batch training.
  • the number of sample files whose accuracy reaches the threshold includes S1, S2, S3, S4, where S1 ⁇ S2 ⁇ S3 ⁇ S4.
  • steps in the flowcharts of FIGS. 2 and 6 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in FIG. 2 and FIG. 6 may include a plurality of sub-steps or stages, which are not necessarily performed at the same time, but may be executed at different times, or The order of execution of the stages is also not necessarily sequential, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
  • a commodity information format processing apparatus including: an information acquisition module 702, configured to acquire commodity information, the commodity information includes a plurality of commodity items; and a word segmentation processing module 704, configured to Performing word segmentation on the content of the commodity item to obtain a plurality of words; the weight matrix generating module 706 is configured to acquire a weight vector corresponding to the plurality of words trained by the word vector model, and generate a weight matrix by using the weight vector corresponding to the plurality of words; And a format unification module 708, configured to obtain a code corresponding to a plurality of words of the commodity item, input the code of the plurality of words into the trained multi-layer cyclic neural network; and pass the trained multi-layer cyclic neural network, based on the plurality of The coding of the word and the weight matrix are operated to output a description of the preset format corresponding to the commodity item.
  • the apparatus further includes: a first training module 710, configured to acquire a training set corresponding to the commodity information, where the training set includes a plurality of commodity items and a plurality of training words corresponding to the commodity items; and counting a plurality of commodity items The number of vocabulary of the training words, marking the maximum vocabulary quantity as the longest input parameter; training the word vector model with the longest input parameter and the training word to obtain the weight vector corresponding to the training word; and the second training module 712 for The multi-layer cyclic neural network is trained by using the longest input parameters and the weight vector corresponding to the training words, and the trained multi-layer cyclic neural network is obtained.
  • a first training module 710 configured to acquire a training set corresponding to the commodity information, where the training set includes a plurality of commodity items and a plurality of training words corresponding to the commodity items; and counting a plurality of commodity items The number of vocabulary of the training words, marking the maximum vocabulary quantity as the longest input parameter; training the word vector model with the longest input parameter and the training word to obtain
  • the first training module 710 is further configured to obtain a corpus corresponding to the product information, where the corpus includes a plurality of corpus words; the corpus includes some preset characters; and the corpus is used to train the word vector model to obtain The corpus weight matrix; the corpus weight matrix includes a plurality of corpus weight vectors; the vocabulary number of the training words of the plurality of commodity items is increased to the same number as the longest input parameter by using the preset character; according to the commodity item after increasing the vocabulary quantity, The corpus weight matrix selects the training word and the corpus weight vector corresponding to one or more preset characters, which is marked as the input vector corresponding to the training word; loads multiple input vectors through the word vector model, and trains through the hidden layer of the word vector model A training weight matrix is obtained, and the training weight matrix includes a plurality of training words and a weight vector corresponding to the preset characters.
  • the second training module 712 is further configured to obtain a mapping file corresponding to the commodity information, where the original description of the plurality of training words in the commodity item and a description of the preset format are recorded in the mapping file;
  • the number of vocabulary of the training words of the commodity items is increased to the same number as the longest input parameter;
  • the training weights corresponding to the training words and the preset characters are generated by the training weight matrix corresponding to the commodity items; and the commodity items after the vocabulary quantity is increased
  • the training words, the preset characters and the corresponding weight vector matrix are trained by the multi-layer cyclic neural network to output a description of the preset format of the plurality of training words in the commodity item.
  • the second training module 712 is further configured to allocate a random vector to each layer of the hidden layer as an initial weight matrix of the hidden layer; and set the input layer and the first layer hidden layer according to the longest input parameter.
  • a training weight matrix corresponding to the commodity item after increasing the vocabulary quantity; the code corresponding to the training word of the commodity item after increasing the vocabulary quantity and the code corresponding to the preset character are input to the input layer of the multi-layer cyclic neural network;
  • the hidden layer is trained by using the initial weight matrix and the training weight matrix, so that the output layer outputs a description of the preset format of the plurality of training words in the commodity item.
  • the second training module 712 is further configured to acquire a number of sample files corresponding to the plurality of training sets; acquire a verification set, the verification set includes words of the plurality of commodity items; and use the verification set to train the plurality of training sets
  • the preset format of the commodity item to be output is verified; when the accuracy of the verification reaches the threshold, the number of sample files corresponding to the threshold value for the first time is marked as the number of sample files of the maximum batch training.
  • each of the above-described commodity information format processing apparatuses may be implemented in whole or in part by software, hardware, and a combination thereof.
  • Each of the above modules may be embedded in or independent of the processor in the computer device, or may be stored in a memory in the computer device in a software form, so that the processor invokes the operations corresponding to the above modules.
  • a computer device which may be a server, and its internal structure diagram may be as shown in FIG.
  • the computer device includes a processor, memory, network interface, and database connected by a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, an internal memory.
  • the non-volatile storage medium stores an operating system, computer readable instructions, and a database.
  • the internal memory provides an environment for operation of an operating system and computer readable instructions in a non-volatile storage medium.
  • the non-volatile storage medium can be a computer-readable non-volatile storage medium.
  • the database of the computer device is used to store commodity files as well as sample files and the like.
  • the network interface of the computer device is used to communicate with an external server via a network connection.
  • the computer readable instructions are executed by the processor to implement a commodity information format processing method.
  • FIG. 8 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the solution of the present application is applied.
  • the specific computer device may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.

Abstract

A commodity information format processing method, comprising: obtaining commodity information, the commodity information comprising a plurality of commodity items; performing word segmentation on the content of the commodity items to obtain a plurality of words; obtaining weight vectors which are obtained by training of a word vector model and correspond to the plurality of words, and utilizing the weight vectors corresponding to the plurality of words to generate a weight matrix; obtaining codes corresponding to the plurality of words of the commodity items, and inputting the codes of the plurality of words into a trained multi-layer cyclic neural network; and performing operation by means of the trained multi-layer cyclic neural network based on the codes of the plurality of words and the weight matrix, and outputting the description of a preset format corresponding to the commodity items.

Description

商品信息格式处理方法、装置、计算机设备和存储介质Commodity information format processing method, device, computer device and storage medium
本申请要求于2018年4月25日提交中国专利局,申请号为2018103807519,申请名称为“商品信息格式处理方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application is filed on April 25, 2018, the Chinese Patent Office, the application number is 2018103807519, and the priority of the Chinese patent application entitled "Commodity Information Format Processing Method, Apparatus, Computer Equipment and Storage Medium" is applied. The citations are incorporated herein by reference.
技术领域Technical field
本申请涉及一种商品信息格式处理方法、装置、计算机设备和存储介质。The present application relates to a method, device, computer device and storage medium for processing a commodity information format.
背景技术Background technique
海关报关单中涉及到各种各样的商品信息,虽然报关单中规定了统一的申报格式,但是不同的申报人填写商品信息的顺序和形式不同,导致报关单中的商品信息格式并不统一。大量的海关人员对不同格式的商品信息进行解读,费时费力,而且对海关进出口业务风控管理也造成了较多阻碍。为了对商品信息格式进行有效的统一化处理,在传统的方式中,开发人员通常采特定的模板配合专有词典对关键信息进行匹配,将商品信息的格式进行统一。然而这种方式需要开发人员开发多种模板以及收集多种专有名词库构建专有词典,导致统一商品信息格式的处理效率较低。Customs declaration forms involve a variety of product information. Although the declaration form specifies a uniform declaration format, different applicants fill in the order and form of the product information, resulting in a uniform format of the commodity information in the customs declaration. . A large number of customs officers interpret commodity information in different formats, which is time-consuming and laborious, and also causes more obstacles to the customs control of customs import and export business. In order to effectively and uniformly process the product information format, in the traditional way, the developer usually uses a specific template to match the key dictionary to match the key information, and unify the format of the product information. However, this approach requires developers to develop a variety of templates and collect a variety of proper noun libraries to build proprietary dictionaries, resulting in a lower efficiency in the processing of uniform commodity information formats.
发明内容Summary of the invention
根据本申请公开的各种实施例,提供一种商品信息格式处理方法、装置、计算机设备和存储介质。According to various embodiments disclosed herein, a commodity information format processing method, apparatus, computer apparatus, and storage medium are provided.
一种商品信息格式处理方法,包括:获取商品信息,所述商品信息包括多个商品项;对所述商品项的内容进行分词处理,得到多个词;获取通过词向量模型训练得到的多个词对应的权重向量,利用多个词对应的权重向量生成权重矩阵;获取所述商品项的多个词对应的编码,将多个词的编码输入至训练后的多层循环神经网络;及通过所述训练后的多层循环神经网络,基于所述多个词的编码以及所述权重矩阵进行运算,输出所述商品项对应的预设格式的描述。A commodity information format processing method includes: acquiring commodity information, the commodity information including a plurality of commodity items; performing word segmentation processing on the content of the commodity item to obtain a plurality of words; and acquiring a plurality of pieces obtained by training the word vector model a weight vector corresponding to the word, generating a weight matrix by using a weight vector corresponding to the plurality of words; acquiring a code corresponding to the plurality of words of the commodity item, inputting the code of the plurality of words into the trained multi-layer cyclic neural network; The trained multi-layer cyclic neural network performs an operation based on the encoding of the plurality of words and the weight matrix, and outputs a description of a preset format corresponding to the commodity item.
一种商品信息格式处理装置,包括:信息获取模块,用于获取商品信息,所述商品信息包括多个商品项;分词处理模块,用于对所述商品项的内容进行分词处理,得到多个词;权重矩阵生成模块,用于获取通过词向量模型训练得到的多个词对应的权重向量,利用多个词对应的权重向量生成权重矩阵;及格式统一化模块,用于获取所述商品项的多个词对应的编码,将多个词的编码输入至训练后的多层循环神经网络;通过所述训练后的多层循环神经网络,基于所述多个词的编码以及所述权重矩阵进行 运算,输出所述商品项对应的预设格式的描述。A commodity information format processing apparatus, comprising: an information acquisition module, configured to acquire commodity information, the commodity information includes a plurality of commodity items; and a word segmentation processing module, configured to perform word segmentation processing on the content of the commodity item to obtain a plurality of a weight matrix generation module, configured to acquire a weight vector corresponding to a plurality of words trained by the word vector model, and generate a weight matrix by using a weight vector corresponding to the plurality of words; and a format unification module for acquiring the commodity item Corresponding encoding of the plurality of words, inputting the encoding of the plurality of words into the trained multi-layer cyclic neural network; and encoding, by the trained multi-layer cyclic neural network, based on the encoding of the plurality of words and the weight matrix Performing an operation to output a description of a preset format corresponding to the item of the item.
一种计算机设备,包括存储器和一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述处理器执行时,使得所述一个或多个处理器执行以下步骤:获取商品信息,所述商品信息包括多个商品项;对所述商品项的内容进行分词处理,得到多个词;获取通过词向量模型训练得到的多个词对应的权重向量,利用多个词对应的权重向量生成权重矩阵;获取所述商品项的多个词对应的编码,将多个词的编码输入至训练后的多层循环神经网络;及通过所述训练后的多层循环神经网络,基于所述多个词的编码以及所述权重矩阵进行运算,输出所述商品项对应的预设格式的描述。A computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executable by the processor to cause the one or more processors to execute The following steps: obtaining commodity information, the commodity information includes a plurality of commodity items; performing word segmentation on the content of the commodity item to obtain a plurality of words; and acquiring a weight vector corresponding to the plurality of words obtained by training the word vector model, and utilizing Generating a weight matrix corresponding to the weight vector of the plurality of words; acquiring a code corresponding to the plurality of words of the commodity item, inputting the code of the plurality of words into the trained multi-layer cyclic neural network; and passing the multi-layer after the training a cyclic neural network, performing an operation based on the encoding of the plurality of words and the weight matrix, and outputting a description of a preset format corresponding to the commodity item.
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:获取商品信息,所述商品信息包括多个商品项;对所述商品项的内容进行分词处理,得到多个词;获取通过词向量模型训练得到的多个词对应的权重向量,利用多个词对应的权重向量生成权重矩阵;获取所述商品项的多个词对应的编码,将多个词的编码输入至训练后的多层循环神经网络;及通过所述训练后的多层循环神经网络,基于所述多个词的编码以及所述权重矩阵进行运算,输出所述商品项对应的预设格式的描述。One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of: obtaining merchandise information, The commodity information includes a plurality of commodity items; performing word segmentation processing on the content of the commodity item to obtain a plurality of words; acquiring a weight vector corresponding to the plurality of words trained by the word vector model, and using a weight vector corresponding to the plurality of words Generating a weight matrix; acquiring a code corresponding to the plurality of words of the commodity item, inputting the code of the plurality of words into the trained multi-layer cyclic neural network; and using the trained multi-layer cyclic neural network, based on The encoding of the plurality of words and the weight matrix are operated to output a description of a preset format corresponding to the commodity item.
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。Details of one or more embodiments of the present application are set forth in the accompanying drawings and description below. Other features and advantages of the present invention will be apparent from the description, drawings and claims.
附图说明DRAWINGS
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings to be used in the embodiments will be briefly described below. Obviously, the drawings in the following description are only some embodiments of the present application, Those skilled in the art can also obtain other drawings based on these drawings without any creative work.
图1为根据一个或多个实施例中商品信息格式处理方法的应用场景图;1 is an application scenario diagram of a method for processing a commodity information format according to one or more embodiments;
图2为根据一个或多个实施例中商品信息格式处理方法的流程示意图;2 is a schematic flow chart of a method for processing a commodity information format according to one or more embodiments;
图3为根据一个或多个实施例中2层循环神经网络在时间上的展开图;3 is an expanded view of a 2-layer cyclic neural network in time in accordance with one or more embodiments;
图4为根据一个或多个实施例中4层循环神经网络在时间上的展开图;4 is an expanded view of a 4-layer cyclic neural network in time in accordance with one or more embodiments;
图5为根据一个或多个实施例中6层循环神经网络在时间上的展开图;5 is a developmental diagram of a 6-layer cyclic neural network in time according to one or more embodiments;
图6为根据一个或多个实施例中词向量模型训练以及多层循环神经网络训练的步骤的流程示意图;6 is a flow diagram showing the steps of word vector model training and multi-layer cyclic neural network training in accordance with one or more embodiments;
图7为根据一个或多个实施例中商品信息格式处理装置的框图;7 is a block diagram of a commodity information format processing apparatus in accordance with one or more embodiments;
图8为根据一个或多个实施例中计算机设备的框图。FIG. 8 is a block diagram of a computer device in accordance with one or more embodiments.
具体实施方式detailed description
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the application and are not intended to be limiting.
本申请提供的商品信息格式处理方法,可以应用于如图1所示的应用环境中。其中,终端102通过网络与服务器104进行通信。其中,终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机以及平板电脑等计算机设备,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。终端102向服务器104上传的商品文件。商品文件中记录了多种商品信息,商品信息包括多个商品项。服务器104对每个商品项的详细信息描述进行分词处理。服务器104中预先存储了训练后的词向量模型以及训练后的多层循环神经网络。服务器104获取通过词向量模型训练得到的多个词对应的权重向量,利用多个词对应的权重向量生成权重矩阵。服务器104获取所述商品项的多个词对应的编码,将多个词的编码输入至训练后的多层循环神经网络。通过训练后的多层循环神经网络,基于多个词的编码以及权重矩阵进行运算,输出商品项对应的预设格式的描述。由此可以将多种不同格式的原始商品信息转换为统一格式的描述。The commodity information format processing method provided by the present application can be applied to an application environment as shown in FIG. 1. The terminal 102 communicates with the server 104 via a network. The terminal 102 can be, but is not limited to, computer equipment such as various personal computers, notebook computers, smart phones, and tablet computers. The server 104 can be implemented by a separate server or a server cluster composed of multiple servers. The product file uploaded by the terminal 102 to the server 104. A plurality of product information is recorded in the product file, and the product information includes a plurality of product items. The server 104 performs word segmentation processing on the detailed description of each item of merchandise. The trained word vector model and the trained multi-layer cyclic neural network are pre-stored in the server 104. The server 104 acquires a weight vector corresponding to a plurality of words trained by the word vector model, and generates a weight matrix by using weight vectors corresponding to the plurality of words. The server 104 acquires a code corresponding to a plurality of words of the item of the item, and inputs the code of the plurality of words to the trained multi-layer loop neural network. Through the trained multi-layer cyclic neural network, the operation is performed based on the encoding of the plurality of words and the weight matrix, and the description of the preset format corresponding to the commodity item is output. This allows a variety of different formats of original product information to be converted into a uniform format description.
在一个实施例中,如图2所示,提供了一种商品信息格式处理方法,以该方法应用于图1中的服务器为例进行说明,包括以下步骤:In an embodiment, as shown in FIG. 2, a method for processing a commodity information format is provided. The method is applied to the server in FIG. 1 as an example, and includes the following steps:
步骤202,获取商品信息,商品信息包括多个商品项。Step 202: Acquire item information, where the item information includes a plurality of item items.
步骤204,对商品项的内容进行分词处理,得到多个词。Step 204: Perform word segmentation on the content of the commodity item to obtain a plurality of words.
服务器接收多个终端上传的商品文件。商品文件中记录了多种商品信息。商品信息中包括了多个商品项,每个商品项中又包括了具体的内容,即详细信息描述。当商品文件来源于不同的用户时,同一商品项的具体内容可以不同。例如商品项为“硬盘”时,对应的内容可能被描述为“硬盘容量128GB缓存容量32MB”,也可能被描述为“128GB 32MB”。服务器对每个商品项的详细信息描述进行分词处理。例如,服务器将商品项“硬盘”的其中一种详细信息描述切分为“硬盘”、“容量”、“128”、“GB”、“缓存”、“容量”、“32”、“MB”,得到多个词。The server receives the product files uploaded by multiple terminals. A variety of product information is recorded in the product file. The product information includes a plurality of product items, and each product item includes a specific content, that is, a detailed information description. When the product file is from a different user, the specific content of the same product item may be different. For example, when the item is "hard disk", the corresponding content may be described as "hard disk capacity 128 GB cache capacity 32 MB", or may be described as "128 GB 32 MB". The server performs word segmentation on the detailed description of each item of merchandise. For example, the server divides one of the detailed descriptions of the item "hard disk" into "hard disk", "capacity", "128", "GB", "cache", "capacity", "32", "MB". , get multiple words.
步骤206,获取通过词向量模型训练得到的多个词对应的权重向量,利用多个词对应的权重向量生成权重矩阵。Step 206: Acquire a weight vector corresponding to a plurality of words trained by the word vector model, and generate a weight matrix by using a weight vector corresponding to the plurality of words.
在多层循环神经网络中可以包含多层隐含层。隐含层包括向前推算层以及向后推算层,这也可以称为是双向推算的隐含层。第一层的隐含层包括第一向前推算层和第一向后推算层,第二层的隐含层包括第二向前推算层和第二向后推算层,第三层的隐含层包括第三向前推算层和第三向后推算层,以此类推。输入层与第一层的隐含层之间设置了相应的权重矩阵,即输入层与第一向前推算层以及输入层与第一向后推算层 之间分别设置了相应的权重矩阵。在传统的方式中,第一向前推算层和第一向后推算层所对应的权重矩阵均被初始化为随机向量,但这可能会导致多层循环神经网络的收敛效果较差,输出结果无法满足要求。Multiple layers of hidden layers can be included in a multilayer cyclic neural network. The hidden layer includes a forward estimation layer and a backward estimation layer, which may also be referred to as an implicit layer that is a two-way estimation. The hidden layer of the first layer includes a first forward estimation layer and a first backward estimation layer, and the hidden layer of the second layer includes a second forward estimation layer and a second backward estimation layer, and the third layer implies The layer includes a third forward estimation layer and a third backward estimation layer, and so on. A corresponding weight matrix is set between the input layer and the hidden layer of the first layer, that is, a corresponding weight matrix is respectively set between the input layer and the first forward estimation layer and the input layer and the first backward estimation layer. In the conventional manner, the weight matrix corresponding to the first forward estimation layer and the first backward estimation layer are initialized to a random vector, but this may result in poor convergence of the multilayer cyclic neural network, and the output result cannot be fulfil requirements.
在本实施例中,服务器采用商品项中多个词对应的权重矩阵作为多层循环神经网络中输入层与第一隐含层之间的权重矩阵。该权重矩阵是通过对词向量模型训练得到的。该权重向量能够反映商品项中每个词的矢量,有效提高多层循环神经网络的收敛效率,从而能够提高输出效果的准确性。In this embodiment, the server uses the weight matrix corresponding to the plurality of words in the commodity item as the weight matrix between the input layer and the first hidden layer in the multi-layer cyclic neural network. The weight matrix is obtained by training the word vector model. The weight vector can reflect the vector of each word in the commodity item, effectively improve the convergence efficiency of the multi-layer cyclic neural network, thereby improving the accuracy of the output effect.
其中,第一向前推算层和第一向后推算层各自对应的权重矩阵互不相同。服务器按照商品项中多个词的描述顺序可以获取每个词对应的权重向量,每个词对应的权重向量可以是一个向量数组。服务器利用多个词对应的权重向量,生成多个词对应的向前推算的权重矩阵。服务器按照商品项中多个词相反的描述顺序可以获取相应每个词的权重向量,进而生成多个词对应的向后推算的权重矩阵。向前推算的权重矩阵即为多层循环神经网络中输入层与第一向前推算层之间的权重矩阵。向后推算的权重矩阵即为多层循环神经网络中输入层与第一向后推算层之间的权重矩阵。The weight matrix corresponding to each of the first forward estimation layer and the first backward estimation layer is different from each other. The server can obtain the weight vector corresponding to each word according to the description order of the multiple words in the commodity item, and the weight vector corresponding to each word can be a vector array. The server uses the weight vector corresponding to the plurality of words to generate a forward weighted weight matrix corresponding to the plurality of words. The server may obtain the weight vector of each word according to the reverse description order of the plurality of words in the commodity item, thereby generating a backward weighted weight matrix corresponding to the plurality of words. The forward weighted weight matrix is the weight matrix between the input layer and the first forward estimation layer in the multi-layer cyclic neural network. The weight matrix calculated backwards is the weight matrix between the input layer and the first backward estimation layer in the multi-layer cyclic neural network.
继续以上述商品项“硬盘”为例,服务器可以按照“硬盘”、“容量”、“128”、“GB”、“缓存”、“容量”、“32”、“MB”的顺序生成向前推算的权重矩阵。服务器也可以按照“MB”、“32”、“容量”、“缓存”、“GB”、“128”、“容量”、“硬盘”的顺序生成向后推算的权重矩阵。Continuing with the above product item "hard disk" as an example, the server can generate forward in the order of "hard disk", "capacity", "128", "GB", "cache", "capacity", "32", "MB". The weight matrix of the calculation. The server may also generate a backward weight matrix in the order of "MB", "32", "capacity", "cache", "GB", "128", "capacity", and "hard disk".
步骤208,获取商品项的多个词对应的编码,将多个词的编码输入至训练后的多层循环神经网络。Step 208: Acquire a code corresponding to a plurality of words of the commodity item, and input the code of the plurality of words into the trained multi-layer cyclic neural network.
步骤210,通过训练后的多层循环神经网络,基于多个词的编码以及权重矩阵进行运算,输出商品项对应的预设格式的描述。Step 210: Perform a calculation based on the multi-word cyclic neural network after training, based on the encoding of the plurality of words and the weight matrix, and output a description of the preset format corresponding to the commodity item.
多层循环神经网络中的多层隐含层可以是2层、4层或者6层等。其中,每一层隐含层都包括向前推算层以及向后推算层。如图3至图5所示,分别为2层、4层、6层循环神经网络在时间上的展开图。其中,Relu表示激活函数,Lstm表示长短时记忆单元,Softmax表示分类函数。w*(*表示正整数)表示权重矩阵。由展开图上可以看出,每一层向前推算层以及每一层向后推算层都设置了对应的初始权重矩阵。例如,图3中的w2、w5,图4中的w3、w5、w6、w8,以及图5中的w3、w5、w7、w8、w10、w12。The multilayer hidden layer in the multilayer cyclic neural network may be 2 layers, 4 layers or 6 layers. Each layer of the hidden layer includes a forward estimation layer and a backward estimation layer. As shown in FIG. 3 to FIG. 5, the time-expansion diagrams of the two-layer, four-layer, and six-layer cyclic neural networks, respectively. Among them, Relu represents the activation function, Lstm represents the long and short time memory unit, and Softmax represents the classification function. w* (* indicates a positive integer) indicates a weight matrix. As can be seen from the expanded view, each layer of the forward estimation layer and each layer of the backward estimation layer are set with corresponding initial weight matrix. For example, w2, w5 in FIG. 3, w3, w5, w6, w8 in FIG. 4, and w3, w5, w7, w8, w10, w12 in FIG.
多层循环神经网络可以是预先训练好的。多层循环神经网络在训练时,可以利用商品信息对应的映射文件进行训练,映射文件中记录了商品项中多个训练词的原始描述与预设格式的描述。由此可以使得商品项中多个词的原始描述按照预设格式输出。由于多层循环神经网络只接受数值输入,因此在训练时,服务器还会根据训练词生成相应的训练词汇表。训练词汇表中包含每个训练词对应的编码。当服务器对商品项进行分词处理后,可以通过 该训练词汇表查询每个商品项的词所对应的编码。Multi-layered cyclic neural networks can be pre-trained. When training, the multi-layer cyclic neural network can be trained by using the mapping file corresponding to the commodity information, and the mapping file records the original description of the plurality of training words in the commodity item and the description of the preset format. Thereby, the original description of the plurality of words in the item can be output in a preset format. Since the multi-layered cyclic neural network only accepts numerical inputs, the server also generates a corresponding training vocabulary based on the training words during training. The training vocabulary contains the code corresponding to each training word. After the server performs word segmentation on the commodity item, the training vocabulary can be used to query the code corresponding to the word of each commodity item.
服务器调用训练后的多层循环神经网络,将商品项的多个词的编码输入至多层循环神经网络的输入层。输入层通过激活函数激活第一向前推算层的权重矩阵,以及激活第一向后推算层的权重矩阵,结合第一向前推算层的初始权重矩阵以及第一向后推算层的初始权重矩阵开始进行运算。其中,向前推算层与向后推算层之间没有信息流。The server invokes the trained multi-layered cyclic neural network to input the codes of the multiple words of the commodity item to the input layer of the multi-layer cyclic neural network. The input layer activates the weight matrix of the first forward estimation layer by an activation function, and activates the weight matrix of the first backward estimation layer, combined with the initial weight matrix of the first forward estimation layer and the initial weight matrix of the first backward estimation layer Start the operation. There is no information flow between the forward estimation layer and the backward estimation layer.
以训练后的多层循环神经网络为4层循环神经网络为例进行说明。输入层中输入的多个词可以是“硬盘”、“容量”、“128”、“GB”、“缓存”、“容量”、“32”、“MB”。如图4所示,w1为第一向前推算层的权重矩阵,w3为第一向前推算层的初始权重矩阵,经过Lstm运算之后,分别输出向前推算的权重矩阵w3(此时的w3与初始的w3已不同,这里是为了简洁描述采用了相同的标记)以及第二向前推算层所对应的权重矩阵w4。w2为第一向后推算层的权重矩阵,w6为第一向后推算层的初始权重矩阵,经过Lstm运算之后,分别输出向后推算的权重矩阵w6(此时的w6与初始的w6已不同,同样是为了简洁描述采用了相同的标记)以及第二向后推算层所对应的权重矩阵w7。以此类推进行循环,直至输出层通过分类函数依次输出每个词预设格式的描述。The 4-layer cyclic neural network after training is described as an example. The multiple words entered in the input layer may be "hard disk", "capacity", "128", "GB", "cache", "capacity", "32", "MB". As shown in FIG. 4, w1 is a weight matrix of the first forward estimation layer, and w3 is an initial weight matrix of the first forward estimation layer. After the Lstm operation, the forward weighted weight matrix w3 is outputted respectively (w3 at this time) This is different from the initial w3, here the same mark is used for the sake of brevity) and the weight matrix w4 corresponding to the second forward estimation layer. W2 is the weight matrix of the first backward estimation layer, and w6 is the initial weight matrix of the first backward estimation layer. After the Lstm operation, the weight matrix w6 calculated backward is output respectively (w6 at this time is different from the initial w6) The same is used for the sake of brevity and the weight matrix w7 corresponding to the second backward estimation layer. This is done by looping until the output layer outputs a description of the preset format of each word in turn by the classification function.
例如,商品项为“硬盘”,原始信息为“Seagate/ST500LT012|003SDM1”,经过多层循环神经网络运算之后,可以输出为如下统一的格式:For example, if the item is "hard disk" and the original information is "Seagate/ST500LT012|003SDM1", after multi-layer cyclic neural network operation, it can be output as the following unified format:
“BRAND:SEAGATE,TYPE:HDD,SIZE:500,CACHE:NaN,PRODUCT_NO:ST500LT012,RPM:NAN”。由于商品项中每个词都采用了预设格式的描述,由此可以将多种不同格式的原始商品信息转换为统一格式的描述。服务器中部署了数据库,服务器对商品文件处理进行格式处理之后,将统一格式描述的商品文件存储在数据库中。"BRAND: SEAGATE, TYPE: HDD, SIZE: 500, CACHE: NaN, PRODUCT_NO: ST500LT012, RPM: NAN". Since each word in the item is described in a preset format, the original item information in a variety of different formats can be converted into a uniform format description. A database is deployed in the server, and after the server processes the format of the commodity file processing, the commodity file described in the unified format is stored in the database.
本实施例中,当需要对商品信息中原始描述进行格式统一时,服务器可以对商品项中的内容进行分词处理,得到商品项对应的多个词。服务器可以根据商品项的多个词获取相应的权重向量,继而生成多个词对应的权重矩阵。由于每个词的权重向量均是通过词向量模型训练得到的,由此能够准确反映每个词的矢量,有效提高多层循环神经网络的收敛效果,从而能够提高输出效果的准确性。服务器将商品项的多个词的编码输入至训练后的多层循环神经网络,通过训练后的多层循环神经网络利用多个词的编码以及权重矩阵进行运算,输出商品项对应的预设格式的描述。由于多层循环神经网络是经过训练的,可以使得商品项中每个词都能输出为预设格式的描述。整个过程无需开发多种模板以及构建专有词典,多种类型的商品信息均可输出所需的统一格式,实现了商品信息格式统一效率的提高。In this embodiment, when it is necessary to format the original description in the product information, the server may perform word segmentation on the content in the commodity item to obtain a plurality of words corresponding to the commodity item. The server may acquire a corresponding weight vector according to a plurality of words of the commodity item, and then generate a weight matrix corresponding to the plurality of words. Since the weight vector of each word is trained by the word vector model, it can accurately reflect the vector of each word, effectively improve the convergence effect of the multi-layer cyclic neural network, and thus improve the accuracy of the output effect. The server inputs the code of the plurality of words of the commodity item into the multi-layer cyclic neural network after training, and uses the multi-cycle neural network after training to perform calculation by using the coding of multiple words and the weight matrix, and outputs the preset format corresponding to the commodity item. description of. Since the multi-layered cyclic neural network is trained, each word in the commodity item can be output as a description of the preset format. The whole process does not need to develop a variety of templates and build a proprietary dictionary. Various types of product information can output the required uniform format, and the uniform efficiency of the product information format is improved.
在一个实施例中,该方法还包括:词向量模型训练以及多层循环神经网络训练的步骤。如图6所示,包括以下:In one embodiment, the method further comprises: a word vector model training and a step of multi-layer cyclic neural network training. As shown in Figure 6, the following are included:
步骤602,获取与商品信息对应的训练集,训练集中包括多个商品项以及商品项对应的多个训练词。Step 602: Acquire a training set corresponding to the commodity information, where the training set includes a plurality of commodity items and a plurality of training words corresponding to the commodity items.
步骤604,统计多个商品项中训练词的词汇数量,将最大词汇数量标记为最长输入参数。In step 604, the number of words of the training words in the plurality of commodity items is counted, and the maximum number of words is marked as the longest input parameter.
步骤606,利用最长输入参数以及训练词,对词向量模型进行训练,得到训练词对应的权重向量。In step 606, the word vector model is trained by using the longest input parameter and the training word, and the weight vector corresponding to the training word is obtained.
步骤608,利用最长输入参数以及训练词对应的权重向量对多层循环神经网络进行训练,得到训练后的多层循环神经网络。In step 608, the multi-layer cyclic neural network is trained by using the longest input parameter and the weight vector corresponding to the training word, and the trained multi-layer cyclic neural network is obtained.
数据库中存储了大量的样本文件。样本文件中记录了相应的商品信息。服务器样本文件中记录的商品信息按特定比例标记为训练数据。词向量模型与多层循环神经网络可以通过训练数据预先进行训练。训练数据可以来源于已有的商品信息。训练数据中包括了商品项以及详细信息描述。服务器对每个商品项的详细信息描述进行分词处理,得到多个词。服务器对多个词进行数据清洗、输出格式统一化等预处理。例如,服务器对错误数据进行清洗,将“128GD”清洗为“128”。服务器对英文的大小写描述进行格式统一,将“SEAGATE”、“Seagate”、“SEagate”统一为“SEAGATE”。服务器将预处理后的词作为训练词,利用多个商品项以及商品项对应的训练词生成训练集。A large number of sample files are stored in the database. The corresponding product information is recorded in the sample file. The item information recorded in the server sample file is marked as training data in a specific scale. Word vector models and multi-layered cyclic neural networks can be trained in advance through training data. Training data can be derived from existing product information. Product data and detailed descriptions are included in the training data. The server performs word segmentation on the detailed description of each commodity item to obtain multiple words. The server performs preprocessing such as data cleaning of multiple words and unification of output formats. For example, the server cleans the wrong data and cleans "128GD" to "128". The server unifies the capitalization of the English description and unifies "SEAGATE", "Seagate", and "SEagate" into "SEAGATE". The server uses the pre-processed word as a training word, and generates a training set by using a plurality of commodity items and training words corresponding to the commodity items.
由于不同的商品项的训练词的词汇数量不同。为了固定词向量模型与多层循环神经网络的模型结构,使得训练后的词向量模型以及训练后的多层循环神经网络具有通用性。本实施例中对词向量模型与多层循环神经网络均设置了最长输入参数以及最长输出参数。最长输入参数与最长输出参数的值相同。服务器可以统计多个商品项中训练词的词汇数量,将商品项中训练词的词汇数量中的最大词汇数量标记为最长输入参数。对于词汇数量小于最长输入参数的商品项,服务器可以根据该商品项的词汇数量与最长输入参数增加相应数量的预设字符。预设字符可以是与商品信息不冲突的字符,如空字符等。例如,最初输入参数为100,相应的最长输出参数也为100,假设某个商品项的词汇数量为30,则服务器为该商品项增加70个预设字符。The number of words in the training words of different commodity items is different. In order to fix the word vector model and the model structure of the multi-layered cyclic neural network, the trained word vector model and the trained multi-layered cyclic neural network are universal. In this embodiment, the longest input parameter and the longest output parameter are set for both the word vector model and the multi-layer cyclic neural network. The longest input parameter has the same value as the longest output parameter. The server may count the number of words of the training words in the plurality of item items, and mark the maximum number of words in the number of words of the training words in the item items as the longest input parameter. For a commodity item whose vocabulary quantity is less than the longest input parameter, the server may add a corresponding number of preset characters according to the vocabulary quantity of the commodity item and the longest input parameter. The preset characters may be characters that do not conflict with the product information, such as null characters. For example, the initial input parameter is 100, and the corresponding longest output parameter is also 100. If the vocabulary quantity of a commodity item is 30, the server adds 70 preset characters to the item.
服务器利用训练词以及最长输入参数补入的预设字符对词向量模型进行训练,由此得到每个训练词以及预设字符对应的权重向量。词向量模型可以采用Skip-Gram模型,即该模型可以采用神经网络结构,包括输入向量、隐含层以及输出层。在传统的方式中,是通过该模型的输出层输出最终结果,而最终结果是一个概率分布。这种概率分布并不适用于多层循环神经网络。因此,本实施例中,仅采用该模型的输入向量与隐含层的结构,通过隐含层输出多个词的权重向量即可,不再继续通过输出层进行运算。The server trains the word vector model using the training words and the preset characters supplemented by the longest input parameters, thereby obtaining a weight vector corresponding to each training word and the preset character. The word vector model can adopt the Skip-Gram model, that is, the model can adopt a neural network structure, including an input vector, an implicit layer, and an output layer. In the traditional way, the final result is output through the output layer of the model, and the final result is a probability distribution. This probability distribution does not apply to multilayer cyclic neural networks. Therefore, in this embodiment, only the input vector of the model and the structure of the hidden layer are used, and the weight vector of the plurality of words is output through the hidden layer, and the operation is not continued through the output layer.
由于词向量模型以及多层循环神经网络只接受数值输入,因此在训练时,服务器还会根据训练词生成相应的训练词汇表。考虑到最长输入参数,训练词汇表中还会记录部分预 设字符。训练词汇表中包含每个训练词对应的编码。服务器根据训练词对应的编码生成词向量模型的输入向量,通过隐含层进行运算,输出对应的训练权重矩阵。训练权重矩阵中包括多个训练词以及预设字符对应的权重向量。服务器调用多层循环神经网络,根据最长输入参数获取多个训练词以及预设字符所对应的编码,将其输入至多层循环神经网络进行训练。Since the word vector model and the multi-layered cyclic neural network only accept numerical inputs, the server also generates a corresponding training vocabulary based on the training words during training. Some of the preset characters are also recorded in the training vocabulary, taking into account the longest input parameters. The training vocabulary contains the code corresponding to each training word. The server generates an input vector of the word vector model according to the code corresponding to the training word, and performs an operation through the hidden layer to output a corresponding training weight matrix. The training weight matrix includes a plurality of training words and a weight vector corresponding to the preset characters. The server calls the multi-layer cyclic neural network, and obtains a plurality of training words and codes corresponding to the preset characters according to the longest input parameter, and inputs them into the multi-layer cyclic neural network for training.
在训练的过程中,由于采用了词向量模型训练得到的每个训练词权重向量,由此能够更加准确的反映每个训练词的矢量状况,有效提高多层循环神经网络的收敛效果,从而能够提高多层循环神经网络训练的准确性。通过设置最长输入参数,使得每个商品项对应的词汇量均达到与最长数据参数相同的数量,即使得每个商品项对应的词汇量均相同,由此使得训练后的词向量模型以及训练后的多层循环神经网络具有通用性。无需训练多种模型,有效减少了开发人员的工作量。In the process of training, because each training word weight vector obtained by the word vector model training is used, the vector state of each training word can be more accurately reflected, and the convergence effect of the multi-layer cyclic neural network can be effectively improved, thereby enabling Improve the accuracy of multi-layer cyclic neural network training. By setting the longest input parameter, the vocabulary corresponding to each commodity item reaches the same number as the longest data parameter, that is, the vocabulary corresponding to each commodity item is the same, thereby making the trained word vector model and Multi-layered cyclic neural networks after training are versatile. There is no need to train multiple models, which effectively reduces the workload of developers.
在一个实施例中,利用最长输入参数以及训练词对词向量模型进行训练,得到训练词对应的权重向量包括:获取与商品信息对应的语料库,语料库中包括多个语料词;语料词中包括部分预设字符;利用语料词对词向量模型进行训练,得到语料权重矩阵;语料权重矩阵包括多个语料权重向量;利用预设字符将多个商品项的训练词的词汇数量增加至与最长输入参数相同的数量;根据增加词汇数量后的商品项,在语料权重矩阵中选择训练词以及一个或多个预设字符对应的语料权重向量,标记为训练词对应的输入向量;通过词向量模型加载多个输入向量,通过词向量模型的隐含层进行训练得到训练权重矩阵,训练权重矩阵包括多个训练词以及预设字符对应的权重向量。In one embodiment, the word vector model is trained by using the longest input parameter and the training word, and the weight vector corresponding to the training word is obtained by: obtaining a corpus corresponding to the product information, and the corpus includes a plurality of corpora; the corpus includes Partial preset characters; using the corpus to train the word vector model to obtain the corpus weight matrix; the corpus weight matrix includes multiple corpus weight vectors; using the preset characters to increase the vocabulary number of the training words of the plurality of commodity items to the longest Enter the same number of parameters; according to the product item after increasing the vocabulary quantity, select the training word and the corpus weight vector corresponding to one or more preset characters in the corpus weight matrix, and mark the input vector corresponding to the training word; A plurality of input vectors are loaded, and a training weight matrix is obtained by training the hidden layer of the word vector model. The training weight matrix includes a plurality of training words and a weight vector corresponding to the preset characters.
为了进一步提高多层循环神经网络的收敛效果,从而能够提高多层循环神经网络训练的准确性,服务器还可以对词向量模型的训练过程进行优化。具体的,服务器可以在多个网站爬取与商品信息对应的多种语料文章,通过对语料文章进行预处理,包括分词、清洗、统一描述格式等。服务器利用预处理后的语料词建立语料库。其中考虑到最长输入参数的设置,语料库中也可以包括部分预设字符。服务器对语料库中的每个语料词以及预设字符进行编码,得到对应的语料输入向量。服务器将多个语料输入向量输入词向量模型的输入层,通过隐含层进行训练,得到语料权重矩阵。语料权重矩阵包括了多个语料权重向量。In order to further improve the convergence effect of the multi-layer cyclic neural network, and thus improve the accuracy of multi-layer cyclic neural network training, the server can also optimize the training process of the word vector model. Specifically, the server may crawl multiple corpus articles corresponding to the product information on multiple websites, and perform pre-processing on the corpus articles, including word segmentation, cleaning, and unified description formats. The server uses the pre-processed corpus to build a corpus. The corpus may also include some preset characters in consideration of the setting of the longest input parameter. The server encodes each corpus and preset characters in the corpus to obtain a corresponding corpus input vector. The server inputs multiple corpus input vectors into the input layer of the word vector model, and trains through the hidden layer to obtain a corpus weight matrix. The corpus weight matrix includes multiple corpus weight vectors.
服务器将每个商品项的词汇数量增加到最长数据参数。服务器在语料权重矩阵中选择训练词以及一个或多个预设字符对应的语料权重向量,标记为训练词对应的输入向量。词向量模型加载多个输入向量,通过词向量模型的隐含层进行训练得到多个训练词以及预设字符对应的训练权重矩阵。The server increases the number of words per item item to the longest data parameter. The server selects the training word and the corpus weight vector corresponding to one or more preset characters in the corpus weight matrix, and marks the input vector corresponding to the training word. The word vector model loads a plurality of input vectors, and is trained by the hidden layer of the word vector model to obtain a plurality of training words and a training weight matrix corresponding to the preset characters.
在一个实施例中,利用最长输入参数、训练词以及训练词对应的权重向量对多层循环神经网络进行训练,得到训练后的多层循环神经网络包括:获取商品信息对应的 映射文件,映射文件中记录了商品项中多个训练词的原始描述与预设格式的描述;利用预设字符将多个商品项的训练词的词汇数量增加至与最长输入参数相同的数量;将训练词以及预设字符对应的权重向量生成与商品项对应的训练权重矩阵;将增加词汇数量后的商品项中的训练词、预设字符以及对应的权重向量矩阵,通过多层循环神经网络进行训练,输出商品项中多个训练词预设格式的描述。In one embodiment, the multi-layer cyclic neural network is trained by using the longest input parameter, the training word, and the weight vector corresponding to the training word, and the trained multi-layer cyclic neural network includes: obtaining a mapping file corresponding to the commodity information, and mapping The document records the original description of the plurality of training words in the commodity item and the description of the preset format; uses the preset character to increase the number of vocabulary of the training words of the plurality of commodity items to the same number as the longest input parameter; And the weight vector corresponding to the preset character generates a training weight matrix corresponding to the commodity item; the training word, the preset character and the corresponding weight vector matrix in the commodity item after the vocabulary quantity is increased, and the training is performed through the multi-layer cyclic neural network, Outputs a description of the preset format of multiple training words in the item.
服务器中预先存储了商品信息对应的映射文件,映射文件中记录了商品项中多个训练词的原始描述与预设格式的描述。例如,商品项为“硬盘”,原始信息为“Seagate/ST500LT012|003SDM1”,经过多层循环神经网络运算之后,可以输出为如下统一的格式:A mapping file corresponding to the commodity information is pre-stored in the server, and a description of the original description and the preset format of the plurality of training words in the commodity item is recorded in the mapping file. For example, if the item is "hard disk" and the original information is "Seagate/ST500LT012|003SDM1", after multi-layer cyclic neural network operation, it can be output as the following unified format:
“BRAND:SEAGATE,TYPE:HDD,SIZE:500,CACHE:NaN,PRODUCT_NO:ST500LT012,RPM:NAN”。由于商品项中每个词都采用了预设格式的描述,由此可以将多张不同格式的原始商品信息转换为统一格式的描述。"BRAND: SEAGATE, TYPE: HDD, SIZE: 500, CACHE: NaN, PRODUCT_NO: ST500LT012, RPM: NAN". Since each word in the product item is described in a preset format, it is possible to convert a plurality of original product information in different formats into a uniform format description.
可以参照上述实施例中的方式,服务器利用预设字符将多个商品项的训练词的词汇数量增加至与最长输入参数相同的数量,使得每个商品项中的词汇数量相同。利用上述实施例中通过词向量模型得到的训练权重矩阵,服务器分别获取每个商品项中多个训练词以及预设字符对应的权重向量,继而生成每个商品项对应的训练权重矩阵。其中,服务器可以参照上述实施例生成每个商品项对应的向前推算的训练权重矩阵,以及向后推算的训练权重矩阵。Referring to the manner in the above embodiment, the server increases the number of words of the training words of the plurality of commodity items to the same number as the longest input parameter by using the preset characters, so that the number of words in each commodity item is the same. Using the training weight matrix obtained by the word vector model in the above embodiment, the server separately obtains a plurality of training words in each commodity item and a weight vector corresponding to the preset characters, and then generates a training weight matrix corresponding to each commodity item. The server may generate a forward weighted training weight matrix corresponding to each commodity item and a backward weighted training weight matrix with reference to the above embodiment.
参照上述实施例中的方式,服务器获取每个商品项中多个词以及预设字符对应的编码,将相应编码输入至多层循环神经网络的输入层,将向前推算的训练权重矩阵设置为第一向前推算层的权重矩阵,将向后推算的训练权重矩阵设置为第一向后推算层的权重矩阵。对隐含层中各层向前推算层的初始权重矩阵进行初始化,以及对隐含层中各层向后推算层的初始权重矩阵进行初始化。在初始化之后,服务器对多层循环神经网络进行训练,输出商品项中多个训练词预设格式的描述。Referring to the manner in the foregoing embodiment, the server acquires a plurality of words in each commodity item and a code corresponding to the preset character, inputs the corresponding code to the input layer of the multi-layer cyclic neural network, and sets the training weight matrix calculated in advance to the first A weight matrix of the forward estimation layer is set, and the backward weighted training weight matrix is set as the weight matrix of the first backward estimation layer. The initial weight matrix of each layer in the hidden layer is initialized, and the initial weight matrix of each layer in the hidden layer is estimated. After initialization, the server trains the multi-layer cyclic neural network to output a description of the preset format of multiple training words in the commodity item.
例如,最长输入参数为100,则多层循环网络中的第一向前推算层的权重矩阵可以设置100个,多层循环神经网络中的第一向后推算层的权重矩阵可以设置100个,即商品项中每个训练词以及预设字符在循环训练时都被配置了相应的权重矩阵。多层循环网络同样会输出100个结果,即按照训练词预设格式的描述。对于预设字符的输出,还可以是预设字符。对训练结果不会造成影响。利用最长输入参数对多层循环神经网络进行训练后,可以使得训练后的多层循环神经网络可以适应用多样化的商品信息。For example, if the longest input parameter is 100, the weight matrix of the first forward estimation layer in the multi-layer cyclic network may be set to 100, and the weight matrix of the first backward estimation layer in the multi-layer cyclic neural network may be set to 100. That is, each training word and preset character in the commodity item are configured with corresponding weight matrix in the loop training. The multi-layer circular network also outputs 100 results, which are described in terms of the preset format of the training words. For the output of the preset character, it can also be a preset character. There will be no impact on the training results. After training the multi-layered cyclic neural network with the longest input parameters, the trained multi-layered cyclic neural network can be adapted to use diversified commodity information.
在采用传统模板匹配的方式中,通过映射表为每个训练词设置了对应的输出格式,商品项中每个的原始描述与输出描述是一一对应的。如果商品项相同,而原始信息不同时,两个商品项的输出格式还是不能统一。而本实施例中,通过多层循环网络进行训练,可以 使得每个商品项中的原始描述与输出描述不是一一对应,而是确保了每个商品项都按照预设的统一格式输出。In the traditional template matching manner, a corresponding output format is set for each training word through a mapping table, and the original description of each item in the commodity item has a one-to-one correspondence with the output description. If the item items are the same and the original information is different, the output format of the two item items cannot be unified. In this embodiment, the training is performed through the multi-layer cyclic network, so that the original description in each commodity item is not one-to-one correspondence with the output description, but it is ensured that each commodity item is output according to a preset unified format.
在其中一个实施例中,多层循环神经网络包括多个隐含层;将增加词汇数量后的商品项中的训练词、预设字符以及对应的权重向量矩阵,通过所述多层循环神经网络进行训练包括:向每层隐含层分配随机向量作为隐含层的初始权重矩阵;根据最长输入参数在输入层与第一层隐含层设置与增加词汇数量后的商品项相对应的训练权重矩阵;将增加词汇数量后的商品项的训练词所对应的编码以及预设字符对应的编码输入至多层循环神经网络的输入层;多层隐含层利用初始权重矩阵以及训练权重矩阵进行训练,通过输出层输出商品项中多个训练词预设格式的描述。In one embodiment, the multi-layered cyclic neural network includes a plurality of hidden layers; a training word, a preset character, and a corresponding weight vector matrix in the commodity item after the vocabulary quantity is increased, through the multilayer cyclic neural network The training includes: assigning a random vector to each hidden layer as an initial weight matrix of the hidden layer; and training corresponding to the commodity item after the input layer and the first hidden layer are set to increase the vocabulary quantity according to the longest input parameter; Weight matrix; the code corresponding to the training word of the commodity item after increasing the vocabulary quantity and the code corresponding to the preset character are input to the input layer of the multi-layer cyclic neural network; the multi-layer hidden layer is trained by using the initial weight matrix and the training weight matrix The output layer outputs a description of a preset format of the plurality of training words in the product item.
服务器通过训练词对多层循环神经网络进行训练时,需要对每层隐含层进行初始化。每层隐含层都可以包括向前推算层和向后推算层。每层隐含层的向前推算层和向后推算层都需要进行初始化。在传统的方式中,每层隐含层的向前推算层和向后推算层对应的初始权重矩阵均被初始化为0,但是这种方式训练得到的多层循环神经网络的泛化能力受限,如果将来有更多不同格式的商品信息时,有可能需要重新训练。When the server trains the multi-layer cyclic neural network through training words, each layer of hidden layers needs to be initialized. Each layer of hidden layers may include a forward estimation layer and a backward estimation layer. The forward estimation layer and the backward estimation layer of each hidden layer need to be initialized. In the traditional way, the initial weighting matrix corresponding to each layer of the hidden layer and the initial weighting matrix corresponding to the backward estimating layer are initialized to 0, but the generalized ability of the multi-layered cyclic neural network trained in this way is limited. If there are more different types of product information in the future, it may be necessary to retrain.
本实施例中,在初始化时,服务器向每层隐含层的向前推算层和向后推算层分配随机向量作为初始权重矩阵。随机向量可以是预设长度的数组,例如,可以是200维或300维。在初始化完成之后,服务器在输入层与第一层隐含层设置与增加词汇数量后的商品项相对应的训练权重矩阵,将增加词汇数量后的商品项的训练词所对应的编码以及预设字符对应的编码输入至多层循环神经网络的输入层。可以参数上述实施例中提供的方式,通过多层隐含层利用初始权重矩阵以及训练权重矩阵进行训练,通过输出层输出商品项中多个训练词预设格式的描述。In this embodiment, at the time of initialization, the server assigns a random vector to the forward estimation layer and the backward estimation layer of each layer of the hidden layer as the initial weight matrix. The random vector may be an array of preset lengths, for example, 200 or 300 dimensions. After the initialization is completed, the server sets the training weight matrix corresponding to the commodity item after increasing the vocabulary quantity in the input layer and the first layer hidden layer, and increases the encoding and preset corresponding to the training word of the commodity item after the vocabulary quantity. The code corresponding to the character is input to the input layer of the multi-layer cyclic neural network. The method may be used to perform the training by using the initial weight matrix and the training weight matrix through the multi-layer hidden layer, and output the description of the preset format of the plurality of training words in the commodity item through the output layer.
由于每层隐含层在初始化时配置随机向量作为初始权重矩阵,由此能够有效提高多层循环神经网络的泛化能力,能够在将来适用于更加多样化的商品信息。而且通过设置最长输入参数,使得每个商品项对应的词汇量相同,由此使得训练后的词向量模型以及训练后的多层循环神经网络具有通用性。无需训练多种模型,有效减少了开发人员的工作量。Since each layer of the hidden layer configures a random vector as the initial weight matrix at the time of initialization, the generalization capability of the multi-layer cyclic neural network can be effectively improved, and it can be applied to more diverse product information in the future. Moreover, by setting the longest input parameter, the vocabulary corresponding to each commodity item is the same, thereby making the trained word vector model and the trained multi-layer cyclic neural network have versatility. There is no need to train multiple models, which effectively reduces the workload of developers.
在一个实施例中,该方法还包括:获取多个训练集对应的样本文件数量;获取验证集,验证集中包括多个商品项的词;利用验证集对多个训练集在通过训练后输出的商品项的预设格式进行验证;当验证的准确度达到阈值时,将初次达到阈值对应的样本文件数量标记为最大批量训练的样本文件数量。In an embodiment, the method further includes: acquiring a number of sample files corresponding to the plurality of training sets; acquiring a verification set, the verification set includes words of the plurality of commodity items; and using the verification set to output the plurality of training sets after passing the training The preset format of the commodity item is verified; when the accuracy of the verification reaches the threshold, the number of sample files corresponding to the threshold value for the first time is marked as the number of sample files of the maximum batch training.
多层循环神经网络可以对多个样本中的训练词进行批量训练。如果批量训练的样本文件数量过少,则多层循环神经网络无法学习到样本文件中存在的商品信息的多样性。如果批量训练的样本文件数量过多,则多层循环神经网络无法准确记忆到多样化 的商品信息,而且性能也会受到影响。因此,在多层循环神经网络进行训练时,需要确定最大批量训练的样本文件数量。Multi-layered cyclic neural networks can perform batch training on training words in multiple samples. If the number of sample files for batch training is too small, the multi-layered cyclic neural network cannot learn the diversity of commodity information existing in the sample files. If the number of sample files for batch training is too large, multi-layered cyclic neural networks cannot accurately memorize diversified product information, and performance will be affected. Therefore, when training in a multi-layered cyclic neural network, it is necessary to determine the number of sample files for maximum batch training.
本实施例中,服务器可以分别获取不同数量的多个样本文件生成训练集。通过词向量模型以及多层循环神经网络进行训练,得到每个样本文件数量对应的输出结果。服务器中还可以预先利用其他样本文件中的商品信息生成验证集。验证集中包括了多个商品项对应的词。服务器将每个样本文件数量对应的输出结果与验证集中的词进行比对,由此得到样本文件数量对应的准确度。In this embodiment, the server may separately acquire a plurality of sample files to generate a training set. The training is performed by the word vector model and the multi-layer cyclic neural network, and the output corresponding to the number of each sample file is obtained. The server can also use the commodity information in other sample files to generate a verification set in advance. The verification set includes words corresponding to multiple item items. The server compares the output result corresponding to the number of sample files with the words in the verification set, thereby obtaining the accuracy corresponding to the number of sample files.
当准确度达到阈值时,服务器可以将初次达到阈值时的样本文件数量标记为最大批量训练的样本文件数量。进一步的,服务器还可以利用不同样本文件数量与其对应的准确度绘制相应的曲线。曲线可能存在波动。当曲线对应的准确对达到阈值时,计算阈值对应的多个样本文件数量之间的差值比例是否小于或等于预设比例。若是,则将初次小于或等于预设比例的样本文件数量标记为最大批量训练的样本文件数量。例如,准确度达到阈值的样本文件数量包括S1、S2、S3、S4,其中S1<S2<S3<S4。预设比例假设为2%,如果(S2-S1)/S1≦2%,(S3-S1)/S1≦2%,(S4-S1)/S1≦2%,则将S1标记为最大批量训练的样本文件数量。由此通过最大批量训练的样本文件数量使得多层循环神经网络进行批量训练时,能够有效学习商品信息的多样化,从而提供了多层循环神经网络的泛化能力。When the accuracy reaches the threshold, the server can mark the number of sample files when the threshold is reached for the first time as the number of sample files for the maximum batch training. Further, the server can also draw a corresponding curve by using different sample file numbers and their corresponding accuracy. There may be fluctuations in the curve. When the exact pair corresponding to the curve reaches the threshold, the ratio of the difference between the number of sample files corresponding to the threshold is calculated to be less than or equal to the preset ratio. If yes, the number of sample files that are initially less than or equal to the preset ratio is marked as the number of sample files for the maximum batch training. For example, the number of sample files whose accuracy reaches the threshold includes S1, S2, S3, S4, where S1 < S2 < S3 < S4. The preset ratio is assumed to be 2%. If (S2-S1)/S1≦2%, (S3-S1)/S1≦2%, (S4-S1)/S1≦2%, then S1 is marked as the maximum batch training. The number of sample files. Therefore, when the number of sample files in the maximum batch training enables the multi-layer cyclic neural network to perform batch training, it can effectively learn the diversification of commodity information, thereby providing the generalization ability of the multi-layer cyclic neural network.
应该理解的是,虽然图2与图6的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2与图6中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flowcharts of FIGS. 2 and 6 are sequentially displayed as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these steps is not strictly limited, and the steps may be performed in other orders. Moreover, at least some of the steps in FIG. 2 and FIG. 6 may include a plurality of sub-steps or stages, which are not necessarily performed at the same time, but may be executed at different times, or The order of execution of the stages is also not necessarily sequential, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
在一个实施例中,如图7所示,提供了一种商品信息格式处理装置,包括:信息获取模块702,用于获取商品信息,商品信息包括多个商品项;分词处理模块704,用于对商品项的内容进行分词处理,得到多个词;权重矩阵生成模块706,用于获取通过词向量模型训练得到的多个词对应的权重向量,利用多个词对应的权重向量生成权重矩阵;及格式统一化模块708,用于获取商品项的多个词对应的编码,将多个词的编码输入至训练后的多层循环神经网络;通过训练后的多层循环神经网络,基于多个词的编码以及所述权重矩阵进行运算,输出商品项对应的预设格式的描述。In an embodiment, as shown in FIG. 7, a commodity information format processing apparatus is provided, including: an information acquisition module 702, configured to acquire commodity information, the commodity information includes a plurality of commodity items; and a word segmentation processing module 704, configured to Performing word segmentation on the content of the commodity item to obtain a plurality of words; the weight matrix generating module 706 is configured to acquire a weight vector corresponding to the plurality of words trained by the word vector model, and generate a weight matrix by using the weight vector corresponding to the plurality of words; And a format unification module 708, configured to obtain a code corresponding to a plurality of words of the commodity item, input the code of the plurality of words into the trained multi-layer cyclic neural network; and pass the trained multi-layer cyclic neural network, based on the plurality of The coding of the word and the weight matrix are operated to output a description of the preset format corresponding to the commodity item.
在一个实施例中,该装置还包括:第一训练模块710,用于获取与商品信息对应的训练集,训练集中包括多个商品项以及商品项对应的多个训练词;统计多个商品项中训练词 的词汇数量,将最大词汇数量标记为最长输入参数;利用最长输入参数以及训练词对词向量模型进行训练,得到训练词对应的权重向量;及第二训练模块712,用于利用最长输入参数以及训练词对应的权重向量对多层循环神经网络进行训练,得到训练后的多层循环神经网络。In an embodiment, the apparatus further includes: a first training module 710, configured to acquire a training set corresponding to the commodity information, where the training set includes a plurality of commodity items and a plurality of training words corresponding to the commodity items; and counting a plurality of commodity items The number of vocabulary of the training words, marking the maximum vocabulary quantity as the longest input parameter; training the word vector model with the longest input parameter and the training word to obtain the weight vector corresponding to the training word; and the second training module 712 for The multi-layer cyclic neural network is trained by using the longest input parameters and the weight vector corresponding to the training words, and the trained multi-layer cyclic neural network is obtained.
在一个实施例中,第一训练模块710还用于获取与商品信息对应的语料库,语料库中包括多个语料词;语料词中包括部分预设字符;利用语料词对词向量模型进行训练,得到语料权重矩阵;语料权重矩阵包括多个语料权重向量;利用预设字符将多个商品项的训练词的词汇数量增加至与最长输入参数相同的数量;根据增加词汇数量后的商品项,在语料权重矩阵中选择训练词以及一个或多个预设字符对应的语料权重向量,标记为训练词对应的输入向量;通过词向量模型加载多个输入向量,通过词向量模型的隐含层进行训练得到训练权重矩阵,训练权重矩阵包括多个训练词以及预设字符对应的权重向量。In one embodiment, the first training module 710 is further configured to obtain a corpus corresponding to the product information, where the corpus includes a plurality of corpus words; the corpus includes some preset characters; and the corpus is used to train the word vector model to obtain The corpus weight matrix; the corpus weight matrix includes a plurality of corpus weight vectors; the vocabulary number of the training words of the plurality of commodity items is increased to the same number as the longest input parameter by using the preset character; according to the commodity item after increasing the vocabulary quantity, The corpus weight matrix selects the training word and the corpus weight vector corresponding to one or more preset characters, which is marked as the input vector corresponding to the training word; loads multiple input vectors through the word vector model, and trains through the hidden layer of the word vector model A training weight matrix is obtained, and the training weight matrix includes a plurality of training words and a weight vector corresponding to the preset characters.
在一个实施例中,第二训练模块712还用于获取商品信息对应的映射文件,映射文件中记录了商品项中多个训练词的原始描述与预设格式的描述;利用预设字符将多个商品项的训练词的词汇数量增加至与最长输入参数相同的数量;将训练词以及预设字符对应的权重向量生成与商品项对应的训练权重矩阵;将增加词汇数量后的商品项中的训练词、预设字符以及对应的权重向量矩阵,通过多层循环神经网络进行训练,输出商品项中多个训练词预设格式的描述。In an embodiment, the second training module 712 is further configured to obtain a mapping file corresponding to the commodity information, where the original description of the plurality of training words in the commodity item and a description of the preset format are recorded in the mapping file; The number of vocabulary of the training words of the commodity items is increased to the same number as the longest input parameter; the training weights corresponding to the training words and the preset characters are generated by the training weight matrix corresponding to the commodity items; and the commodity items after the vocabulary quantity is increased The training words, the preset characters and the corresponding weight vector matrix are trained by the multi-layer cyclic neural network to output a description of the preset format of the plurality of training words in the commodity item.
在一个实施例中,第二训练模块712还用于向每层隐含层分配随机向量作为隐含层的初始权重矩阵;根据所述最长输入参数在输入层与第一层隐含层设置与增加词汇数量后的商品项相对应的训练权重矩阵;将增加词汇数量后的商品项的训练词所对应的编码以及预设字符对应的编码输入至多层循环神经网络的输入层;通过多层隐含层利用初始权重矩阵以及训练权重矩阵进行训练,使得输出层输出商品项中多个训练词预设格式的描述。In an embodiment, the second training module 712 is further configured to allocate a random vector to each layer of the hidden layer as an initial weight matrix of the hidden layer; and set the input layer and the first layer hidden layer according to the longest input parameter. a training weight matrix corresponding to the commodity item after increasing the vocabulary quantity; the code corresponding to the training word of the commodity item after increasing the vocabulary quantity and the code corresponding to the preset character are input to the input layer of the multi-layer cyclic neural network; The hidden layer is trained by using the initial weight matrix and the training weight matrix, so that the output layer outputs a description of the preset format of the plurality of training words in the commodity item.
在一个实施例中,第二训练模块712还用于获取多个训练集对应的样本文件数量;获取验证集,验证集中包括多个商品项的词;利用验证集对多个训练集在通过训练后输出的商品项的预设格式进行验证;当验证的准确度达到阈值时,将初次达到阈值对应的样本文件数量标记为最大批量训练的样本文件数量。In an embodiment, the second training module 712 is further configured to acquire a number of sample files corresponding to the plurality of training sets; acquire a verification set, the verification set includes words of the plurality of commodity items; and use the verification set to train the plurality of training sets The preset format of the commodity item to be output is verified; when the accuracy of the verification reaches the threshold, the number of sample files corresponding to the threshold value for the first time is marked as the number of sample files of the maximum batch training.
关于商品信息格式处理装置的具体限定可以参见上文中对于商品信息格式处理方法的限定,在此不再赘述。上述商品信息格式处理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific definition of the commodity information format processing device, reference may be made to the above definition of the commodity information format processing method, and details are not described herein again. Each of the above-described commodity information format processing apparatuses may be implemented in whole or in part by software, hardware, and a combination thereof. Each of the above modules may be embedded in or independent of the processor in the computer device, or may be stored in a memory in the computer device in a software form, so that the processor invokes the operations corresponding to the above modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图8所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。非易失性存储介质可以是计算机可读非易失性存储介质。该计算机设备的数据库用于存储商品文件以及样本文件等。该计算机设备的网络接口用于与外部的服务器通过网络连接通信。该计算机可读指令被处理器执行时以实现一种商品信息格式处理方法。本领域技术人员可以理解,图8中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in FIG. The computer device includes a processor, memory, network interface, and database connected by a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium, an internal memory. The non-volatile storage medium stores an operating system, computer readable instructions, and a database. The internal memory provides an environment for operation of an operating system and computer readable instructions in a non-volatile storage medium. The non-volatile storage medium can be a computer-readable non-volatile storage medium. The database of the computer device is used to store commodity files as well as sample files and the like. The network interface of the computer device is used to communicate with an external server via a network connection. The computer readable instructions are executed by the processor to implement a commodity information format processing method. It will be understood by those skilled in the art that the structure shown in FIG. 8 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation of the computer device to which the solution of the present application is applied. The specific computer device may It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。One of ordinary skill in the art can understand that all or part of the process of implementing the above embodiments can be completed by computer readable instructions, which can be stored in a non-volatile computer. The readable storage medium, which when executed, may include the flow of an embodiment of the methods as described above. Any reference to a memory, storage, database or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. For the sake of brevity of description, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, It is considered to be the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments are merely illustrative of several embodiments of the present application, and the description thereof is more specific and detailed, but is not to be construed as limiting the scope of the invention. It should be noted that a number of variations and modifications may be made by those skilled in the art without departing from the spirit and scope of the present application. Therefore, the scope of the invention should be determined by the appended claims.

Claims (20)

  1. 一种商品信息格式处理方法,包括:A method for processing a commodity information format, comprising:
    获取商品信息,所述商品信息包括多个商品项;Obtaining commodity information, the commodity information including a plurality of commodity items;
    对所述商品项的内容进行分词处理,得到多个词;Performing word segmentation on the content of the commodity item to obtain a plurality of words;
    获取通过词向量模型训练得到的多个词对应的权重向量,利用多个词对应的权重向量生成权重矩阵;Obtaining a weight vector corresponding to the plurality of words trained by the word vector model, and generating a weight matrix by using a weight vector corresponding to the plurality of words;
    获取所述商品项的多个词对应的编码,将多个词的编码输入至训练后的多层循环神经网络;及Obtaining a code corresponding to the plurality of words of the product item, and inputting the code of the plurality of words into the trained multi-layer circulating neural network; and
    通过所述训练后的多层循环神经网络,基于所述多个词的编码以及所述权重矩阵进行运算,输出所述商品项对应的预设格式的描述。And performing, by the trained multi-layer cyclic neural network, an operation based on the encoding of the plurality of words and the weight matrix, and outputting a description of a preset format corresponding to the commodity item.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    获取与商品信息对应的训练集,所述训练集中包括多个商品项以及商品项对应的多个训练词;Obtaining a training set corresponding to the commodity information, where the training set includes a plurality of commodity items and a plurality of training words corresponding to the commodity items;
    统计多个商品项中训练词的词汇数量,将最大词汇数量标记为最长输入参数;Counting the number of vocabulary of training words in multiple commodity items, marking the maximum vocabulary quantity as the longest input parameter;
    利用所述最长输入参数以及所述训练词,对词向量模型进行训练,得到所述训练词对应的权重向量;及Using the longest input parameter and the training word, training the word vector model to obtain a weight vector corresponding to the training word; and
    利用所述最长输入参数以及所述训练词对应的权重向量对多层循环神经网络进行训练,得到训练后的多层循环神经网络。The multi-layer cyclic neural network is trained by using the longest input parameter and the weight vector corresponding to the training word to obtain a trained multi-layer cyclic neural network.
  3. 根据权利要求2所述的方法,其特征在于,所述利用所述最长输入参数以及所述训练词,对词向量模型进行训练,得到所述训练词对应的权重向量包括:The method according to claim 2, wherein the training the word vector model by using the longest input parameter and the training word, and obtaining the weight vector corresponding to the training word comprises:
    获取与商品信息对应的语料库,所述语料库中包括多个语料词;所述语料词中包括部分预设字符;Obtaining a corpus corresponding to the commodity information, where the corpus includes a plurality of corpus words; the corpus includes some preset characters;
    利用所述语料词对词向量模型进行训练,得到语料权重矩阵;所述语料权重矩阵包括多个语料权重向量;Using the corpus to train the word vector model to obtain a corpus weight matrix; the corpus weight matrix includes a plurality of corpus weight vectors;
    利用预设字符将多个商品项的训练词的词汇数量增加至与所述最长输入参数相同的数量;Increasing the number of words of the training words of the plurality of commodity items to the same number as the longest input parameter by using a preset character;
    根据增加词汇数量后的商品项,在所述语料权重矩阵中选择训练词以及一个或多个预设字符对应的语料权重向量,标记为训练词对应的输入向量;及Selecting a training word and a corpus weight vector corresponding to one or more preset characters in the corpus weight matrix according to the product item after increasing the vocabulary quantity, and marking the input vector corresponding to the training word;
    通过所述词向量模型加载多个输入向量,通过所述词向量模型的隐含层进行训练得到训练权重矩阵,所述训练权重矩阵包括多个训练词以及预设字符对应的权重向量。A plurality of input vectors are loaded by the word vector model, and trained by the hidden layer of the word vector model to obtain a training weight matrix, where the training weight matrix includes a plurality of training words and a weight vector corresponding to the preset characters.
  4. 根据权利要求2所述的方法,其特征在于,所述利用所述最长输入参数、所述训练词以及所述训练词对应的权重向量对多层循环神经网络进行训练,得到训练后 的多层循环神经网络包括:The method according to claim 2, wherein the multi-layer cyclic neural network is trained by using the longest input parameter, the training word, and the weight vector corresponding to the training word, and the training is performed after the training. The layer loop neural network includes:
    获取所述商品信息对应的映射文件,所述映射文件中记录了商品项中多个训练词的原始描述与预设格式的描述;Obtaining a mapping file corresponding to the commodity information, where the mapping file records a description of the original description and a preset format of the plurality of training words in the commodity item;
    利用预设字符将多个商品项的训练词的词汇数量增加至与所述最长输入参数相同的数量;Increasing the number of words of the training words of the plurality of commodity items to the same number as the longest input parameter by using a preset character;
    将所述训练词以及预设字符对应的权重向量生成与商品项对应的训练权重矩阵;及Generating, by the training word and the weight vector corresponding to the preset character, a training weight matrix corresponding to the commodity item; and
    将增加词汇数量后的商品项中的训练词、预设字符以及对应的权重向量矩阵,通过所述多层循环神经网络进行训练,输出商品项中多个训练词预设格式的描述。The training words, the preset characters, and the corresponding weight vector matrix in the commodity item after the vocabulary quantity are increased, and the multi-cycle neural network is trained to output a description of the preset format of the plurality of training words in the commodity item.
  5. 根据权利要求4所述的方法,其特征在于,所述多层循环神经网络神经包括多个隐含层;所述将增加词汇数量后的商品项中的训练词、预设字符以及对应的权重向量矩阵,通过所述多层循环神经网络进行训练包括:The method according to claim 4, wherein said multi-layered cyclic neural network nerve comprises a plurality of hidden layers; said training words, preset characters and corresponding weights in the item of goods after increasing the number of words A vector matrix, trained by the multilayer cyclic neural network, includes:
    向每层隐含层分配随机向量作为隐含层的初始权重矩阵;Assigning a random vector to each hidden layer as the initial weight matrix of the hidden layer;
    根据所述最长输入参数在所述输入层与第一层隐含层设置与增加词汇数量后的商品项相对应的训练权重矩阵;And setting, according to the longest input parameter, a training weight matrix corresponding to the commodity item after increasing the vocabulary quantity in the input layer and the first layer hidden layer;
    将增加词汇数量后的商品项的训练词所对应的编码以及预设字符对应的编码输入至所述多层循环神经网络的输入层;及Transmitting the code corresponding to the training word of the commodity item after increasing the vocabulary quantity and the code corresponding to the preset character to the input layer of the multi-layer cyclic neural network; and
    通过多层隐含层利用所述初始权重矩阵以及训练权重矩阵进行训练,使得输出层输出商品项中多个训练词预设格式的描述。The initial weight matrix and the training weight matrix are trained by the multi-layer hidden layer, so that the output layer outputs a description of the preset format of the plurality of training words in the commodity item.
  6. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method of claim 2, wherein the method further comprises:
    获取多个训练集对应的样本文件数量;Obtain the number of sample files corresponding to multiple training sets;
    获取验证集,所述验证集中包括多个商品项的词;Obtaining a verification set, the verification set including words of a plurality of commodity items;
    利用验证集对多个训练集在通过训练后输出的商品项的预设格式进行验证;及Using a verification set to verify a preset format of a plurality of training sets that are output after training; and
    当验证的准确度达到阈值时,将初次达到所述阈值对应的样本文件数量标记为最大批量训练的样本文件数量。When the accuracy of the verification reaches the threshold, the number of sample files corresponding to the threshold for the first time is marked as the number of sample files of the maximum batch training.
  7. 一种商品信息格式处理装置,包括:A commodity information format processing device includes:
    信息获取模块,用于获取商品信息,所述商品信息包括多个商品项;An information obtaining module, configured to acquire commodity information, where the commodity information includes a plurality of commodity items;
    分词处理模块,用于对所述商品项的内容进行分词处理,得到多个词;a word segmentation processing module, configured to perform word segmentation on the content of the commodity item to obtain a plurality of words;
    权重矩阵生成模块,用于获取通过词向量模型训练得到的多个词对应的权重向量,利用多个词对应的权重向量生成权重矩阵;及a weight matrix generating module, configured to acquire a weight vector corresponding to a plurality of words trained by the word vector model, and generate a weight matrix by using a weight vector corresponding to the plurality of words; and
    格式统一化模块,用于获取所述商品项的多个词对应的编码,将多个词的编码输入至训练后的多层循环神经网络;通过所述训练后的多层循环神经网络,基于所述多个词的编码以及所述权重矩阵进行运算,输出所述商品项对应的预设格式的描述。a format unification module, configured to acquire a code corresponding to a plurality of words of the commodity item, input a code of the plurality of words into the trained multi-layer cyclic neural network; and pass the trained multi-layer cyclic neural network, based on The encoding of the plurality of words and the weight matrix are operated to output a description of a preset format corresponding to the commodity item.
  8. 根据权利要求7所述的装置,其特征在于,所述装置还包括:The device according to claim 7, wherein the device further comprises:
    第一训练模块,用于获取与商品信息对应的训练集,所述训练集中包括多个商品项以及商品项对应的多个训练词;统计多个商品项中训练词的词汇数量,将最大词汇数量标记为最长输入参数;利用所述最长输入参数以及所述训练词对词向量模型进行训练,得到所述训练词对应的权重向量;及a first training module, configured to acquire a training set corresponding to the commodity information, where the training set includes a plurality of commodity items and a plurality of training words corresponding to the commodity items; and counting the number of vocabulary of the training words in the plurality of commodity items, and the maximum vocabulary The quantity is marked as the longest input parameter; the word vector model is trained by using the longest input parameter and the training word to obtain a weight vector corresponding to the training word;
    第二训练模块,用于利用所述最长输入参数以及所述训练词对应的权重向量对多层循环神经网络进行训练,得到训练后的多层循环神经网络。The second training module is configured to train the multi-layer cyclic neural network by using the longest input parameter and the weight vector corresponding to the training word to obtain a trained multi-layer cyclic neural network.
  9. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:A computer device comprising a memory and one or more processors having stored therein computer readable instructions, the computer readable instructions being executed by the one or more processors to cause the one or more The processors perform the following steps:
    获取商品信息,所述商品信息包括多个商品项;Obtaining commodity information, the commodity information including a plurality of commodity items;
    对所述商品项的内容进行分词处理,得到多个词;Performing word segmentation on the content of the commodity item to obtain a plurality of words;
    获取通过词向量模型训练得到的多个词对应的权重向量,利用多个词对应的权重向量生成权重矩阵;Obtaining a weight vector corresponding to the plurality of words trained by the word vector model, and generating a weight matrix by using a weight vector corresponding to the plurality of words;
    获取所述商品项的多个词对应的编码,将多个词的编码输入至训练后的多层循环神经网络;及Obtaining a code corresponding to the plurality of words of the product item, and inputting the code of the plurality of words into the trained multi-layer circulating neural network; and
    通过所述训练后的多层循环神经网络,基于所述多个词的编码以及所述权重矩阵进行运算,输出所述商品项对应的预设格式的描述。And performing, by the trained multi-layer cyclic neural network, an operation based on the encoding of the plurality of words and the weight matrix, and outputting a description of a preset format corresponding to the commodity item.
  10. 根据权利要求9所述的计算机设备,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:The computer apparatus according to claim 9, wherein said computer readable instructions are executed by said one or more processors such that said one or more processors further perform the following steps:
    获取与商品信息对应的训练集,所述训练集中包括多个商品项以及商品项对应的多个训练词;Obtaining a training set corresponding to the commodity information, where the training set includes a plurality of commodity items and a plurality of training words corresponding to the commodity items;
    统计多个商品项中训练词的词汇数量,将最大词汇数量标记为最长输入参数;Counting the number of vocabulary of training words in multiple commodity items, marking the maximum vocabulary quantity as the longest input parameter;
    利用所述最长输入参数以及所述训练词,对词向量模型进行训练,得到所述训练词对应的权重向量;及Using the longest input parameter and the training word, training the word vector model to obtain a weight vector corresponding to the training word; and
    利用所述最长输入参数以及所述训练词对应的权重向量对多层循环神经网络进行训练,得到训练后的多层循环神经网络。The multi-layer cyclic neural network is trained by using the longest input parameter and the weight vector corresponding to the training word to obtain a trained multi-layer cyclic neural network.
  11. 根据权利要求10所述的计算机设备,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:The computer apparatus according to claim 10, wherein said computer readable instructions are executed by said one or more processors such that said one or more processors further perform the following steps:
    获取与商品信息对应的语料库,所述语料库中包括多个语料词;所述语料词中包括部分预设字符;Obtaining a corpus corresponding to the commodity information, where the corpus includes a plurality of corpus words; the corpus includes some preset characters;
    利用所述语料词对词向量模型进行训练,得到语料权重矩阵;所述语料权重矩阵包括多个语料权重向量;Using the corpus to train the word vector model to obtain a corpus weight matrix; the corpus weight matrix includes a plurality of corpus weight vectors;
    利用预设字符将多个商品项的训练词的词汇数量增加至与所述最长输入参数相 同的数量;Increasing the number of words of the training words of the plurality of item items to the same number as the longest input parameter by using a preset character;
    根据增加词汇数量后的商品项,在所述语料权重矩阵中选择训练词以及一个或多个预设字符对应的语料权重向量,标记为训练词对应的输入向量;及Selecting a training word and a corpus weight vector corresponding to one or more preset characters in the corpus weight matrix according to the product item after increasing the vocabulary quantity, and marking the input vector corresponding to the training word;
    通过所述词向量模型加载多个输入向量,通过所述词向量模型的隐含层进行训练得到训练权重矩阵,所述训练权重矩阵包括多个训练词以及预设字符对应的权重向量。A plurality of input vectors are loaded by the word vector model, and trained by the hidden layer of the word vector model to obtain a training weight matrix, where the training weight matrix includes a plurality of training words and a weight vector corresponding to the preset characters.
  12. 根据权利要求10所述的计算机设备,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:The computer apparatus according to claim 10, wherein said computer readable instructions are executed by said one or more processors such that said one or more processors further perform the following steps:
    获取所述商品信息对应的映射文件,所述映射文件中记录了商品项中多个训练词的原始描述与预设格式的描述;Obtaining a mapping file corresponding to the commodity information, where the mapping file records a description of the original description and a preset format of the plurality of training words in the commodity item;
    利用预设字符将多个商品项的训练词的词汇数量增加至与所述最长输入参数相同的数量;Increasing the number of words of the training words of the plurality of commodity items to the same number as the longest input parameter by using a preset character;
    将所述训练词以及预设字符对应的权重向量生成与商品项对应的训练权重矩阵;及Generating, by the training word and the weight vector corresponding to the preset character, a training weight matrix corresponding to the commodity item; and
    将增加词汇数量后的商品项中的训练词、预设字符以及对应的权重向量矩阵,通过所述多层循环神经网络进行训练,输出商品项中多个训练词预设格式的描述。The training words, the preset characters, and the corresponding weight vector matrix in the commodity item after the vocabulary quantity are increased, and the multi-cycle neural network is trained to output a description of the preset format of the plurality of training words in the commodity item.
  13. 根据权利要求12所述的计算机设备,其特征在于,所述多层循环神经网络神经包括多个隐含层;所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:The computer apparatus according to claim 12, wherein said multi-layered cyclic neural network neural comprises a plurality of hidden layers; said computer readable instructions being executed by said one or more processors such that said One or more processors also perform the following steps:
    向每层隐含层分配随机向量作为隐含层的初始权重矩阵;Assigning a random vector to each hidden layer as the initial weight matrix of the hidden layer;
    根据所述最长输入参数在所述输入层与第一层隐含层设置与增加词汇数量后的商品项相对应的训练权重矩阵;And setting, according to the longest input parameter, a training weight matrix corresponding to the commodity item after increasing the vocabulary quantity in the input layer and the first layer hidden layer;
    将增加词汇数量后的商品项的训练词所对应的编码以及预设字符对应的编码输入至所述多层循环神经网络的输入层;及Transmitting the code corresponding to the training word of the commodity item after increasing the vocabulary quantity and the code corresponding to the preset character to the input layer of the multi-layer cyclic neural network; and
    通过多层隐含层利用所述初始权重矩阵以及训练权重矩阵进行训练,使得输出层输出商品项中多个训练词预设格式的描述。The initial weight matrix and the training weight matrix are trained by the multi-layer hidden layer, so that the output layer outputs a description of the preset format of the plurality of training words in the commodity item.
  14. 根据权利要求10所述的计算机设备,其特征在于,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:The computer apparatus according to claim 10, wherein said computer readable instructions are executed by said one or more processors such that said one or more processors further perform the following steps:
    获取多个训练集对应的样本文件数量;Obtain the number of sample files corresponding to multiple training sets;
    获取验证集,所述验证集中包括多个商品项的词;Obtaining a verification set, the verification set including words of a plurality of commodity items;
    利用验证集对多个训练集在通过训练后输出的商品项的预设格式进行验证;及Using a verification set to verify a preset format of a plurality of training sets that are output after training; and
    当验证的准确度达到阈值时,将初次达到所述阈值对应的样本文件数量标记为最大批量训练的样本文件数量。When the accuracy of the verification reaches the threshold, the number of sample files corresponding to the threshold for the first time is marked as the number of sample files of the maximum batch training.
  15. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause the one or more processors to perform the following steps:
    获取商品信息,所述商品信息包括多个商品项;Obtaining commodity information, the commodity information including a plurality of commodity items;
    对所述商品项的内容进行分词处理,得到多个词;Performing word segmentation on the content of the commodity item to obtain a plurality of words;
    获取通过词向量模型训练得到的多个词对应的权重向量,利用多个词对应的权重向量生成权重矩阵;Obtaining a weight vector corresponding to the plurality of words trained by the word vector model, and generating a weight matrix by using a weight vector corresponding to the plurality of words;
    获取所述商品项的多个词对应的编码,将多个词的编码输入至训练后的多层循环神经网络;及Obtaining a code corresponding to the plurality of words of the product item, and inputting the code of the plurality of words into the trained multi-layer circulating neural network; and
    通过所述训练后的多层循环神经网络,基于所述多个词的编码以及所述权重矩阵进行运算,输出所述商品项对应的预设格式的描述。And performing, by the trained multi-layer cyclic neural network, an operation based on the encoding of the plurality of words and the weight matrix, and outputting a description of a preset format corresponding to the commodity item.
  16. 根据权利要求15所述的存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:The storage medium of claim 15 wherein said computer readable instructions are executed by one or more processors such that said one or more processors further perform the steps of:
    获取与商品信息对应的训练集,所述训练集中包括多个商品项以及商品项对应的多个训练词;Obtaining a training set corresponding to the commodity information, where the training set includes a plurality of commodity items and a plurality of training words corresponding to the commodity items;
    统计多个商品项中训练词的词汇数量,将最大词汇数量标记为最长输入参数;Counting the number of vocabulary of training words in multiple commodity items, marking the maximum vocabulary quantity as the longest input parameter;
    利用所述最长输入参数以及所述训练词,对词向量模型进行训练,得到所述训练词对应的权重向量;及Using the longest input parameter and the training word, training the word vector model to obtain a weight vector corresponding to the training word; and
    利用所述最长输入参数以及所述训练词对应的权重向量对多层循环神经网络进行训练,得到训练后的多层循环神经网络。The multi-layer cyclic neural network is trained by using the longest input parameter and the weight vector corresponding to the training word to obtain a trained multi-layer cyclic neural network.
  17. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:The storage medium of claim 16 wherein said computer readable instructions are executed by one or more processors such that said one or more processors further perform the steps of:
    获取与商品信息对应的语料库,所述语料库中包括多个语料词;所述语料词中包括部分预设字符;Obtaining a corpus corresponding to the commodity information, where the corpus includes a plurality of corpus words; the corpus includes some preset characters;
    利用所述语料词对词向量模型进行训练,得到语料权重矩阵;所述语料权重矩阵包括多个语料权重向量;Using the corpus to train the word vector model to obtain a corpus weight matrix; the corpus weight matrix includes a plurality of corpus weight vectors;
    利用预设字符将多个商品项的训练词的词汇数量增加至与所述最长输入参数相同的数量;Increasing the number of words of the training words of the plurality of commodity items to the same number as the longest input parameter by using a preset character;
    根据增加词汇数量后的商品项,在所述语料权重矩阵中选择训练词以及一个或多个预设字符对应的语料权重向量,标记为训练词对应的输入向量;及Selecting a training word and a corpus weight vector corresponding to one or more preset characters in the corpus weight matrix according to the product item after increasing the vocabulary quantity, and marking the input vector corresponding to the training word;
    通过所述词向量模型加载多个输入向量,通过所述词向量模型的隐含层进行训练得到训练权重矩阵,所述训练权重矩阵包括多个训练词以及预设字符对应的权重向量。A plurality of input vectors are loaded by the word vector model, and trained by the hidden layer of the word vector model to obtain a training weight matrix, where the training weight matrix includes a plurality of training words and a weight vector corresponding to the preset characters.
  18. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:The storage medium of claim 16 wherein said computer readable instructions are executed by one or more processors such that said one or more processors further perform the steps of:
    获取所述商品信息对应的映射文件,所述映射文件中记录了商品项中多个训练词 的原始描述与预设格式的描述;Obtaining a mapping file corresponding to the commodity information, where the mapping file records a description of a original description and a preset format of a plurality of training words in the commodity item;
    利用预设字符将多个商品项的训练词的词汇数量增加至与所述最长输入参数相同的数量;Increasing the number of words of the training words of the plurality of commodity items to the same number as the longest input parameter by using a preset character;
    将所述训练词以及预设字符对应的权重向量生成与商品项对应的训练权重矩阵;及Generating, by the training word and the weight vector corresponding to the preset character, a training weight matrix corresponding to the commodity item; and
    将增加词汇数量后的商品项中的训练词、预设字符以及对应的权重向量矩阵,通过所述多层循环神经网络进行训练,输出商品项中多个训练词预设格式的描述。The training words, the preset characters, and the corresponding weight vector matrix in the commodity item after the vocabulary quantity are increased, and the multi-cycle neural network is trained to output a description of the preset format of the plurality of training words in the commodity item.
  19. 根据权利要求18所述的存储介质,其特征在于,所述多层循环神经网络神经包括多个隐含层所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:A storage medium according to claim 18, wherein said multi-layered cyclic neural network neural comprises a plurality of hidden layers, said computer readable instructions being executed by one or more processors such that said one or more The processors also perform the following steps:
    向每层隐含层分配随机向量作为隐含层的初始权重矩阵;Assigning a random vector to each hidden layer as the initial weight matrix of the hidden layer;
    根据所述最长输入参数在所述输入层与第一层隐含层设置与增加词汇数量后的商品项相对应的训练权重矩阵;And setting, according to the longest input parameter, a training weight matrix corresponding to the commodity item after increasing the vocabulary quantity in the input layer and the first layer hidden layer;
    将增加词汇数量后的商品项的训练词所对应的编码以及预设字符对应的编码输入至所述多层循环神经网络的输入层;及Transmitting the code corresponding to the training word of the commodity item after increasing the vocabulary quantity and the code corresponding to the preset character to the input layer of the multi-layer cyclic neural network; and
    通过多层隐含层利用所述初始权重矩阵以及训练权重矩阵进行训练,使得输出层输出商品项中多个训练词预设格式的描述。The initial weight matrix and the training weight matrix are trained by the multi-layer hidden layer, so that the output layer outputs a description of the preset format of the plurality of training words in the commodity item.
  20. 根据权利要求16所述的存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行以下步骤:The storage medium of claim 16 wherein said computer readable instructions are executed by one or more processors such that said one or more processors further perform the steps of:
    获取多个训练集对应的样本文件数量;Obtain the number of sample files corresponding to multiple training sets;
    获取验证集,所述验证集中包括多个商品项的词;Obtaining a verification set, the verification set including words of a plurality of commodity items;
    利用验证集对多个训练集在通过训练后输出的商品项的预设格式进行验证;及Using a verification set to verify a preset format of a plurality of training sets that are output after training; and
    当验证的准确度达到阈值时,将初次达到所述阈值对应的样本文件数量标记为最大批量训练的样本文件数量。When the accuracy of the verification reaches the threshold, the number of sample files corresponding to the threshold for the first time is marked as the number of sample files of the maximum batch training.
PCT/CN2018/097082 2018-04-25 2018-07-25 Commodity information format processing method and apparatus, and computer device and storage medium WO2019205319A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810380751.9 2018-04-25
CN201810380751.9A CN108563782B (en) 2018-04-25 2018-04-25 Commodity information format processing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2019205319A1 true WO2019205319A1 (en) 2019-10-31

Family

ID=63536706

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/097082 WO2019205319A1 (en) 2018-04-25 2018-07-25 Commodity information format processing method and apparatus, and computer device and storage medium

Country Status (2)

Country Link
CN (1) CN108563782B (en)
WO (1) WO2019205319A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111710386A (en) * 2020-04-30 2020-09-25 上海数创医疗科技有限公司 Quality control system for electrocardiogram diagnosis report
CN113076755A (en) * 2021-04-14 2021-07-06 京东数字科技控股股份有限公司 Keyword extraction method, device, equipment and storage medium
CN113592512A (en) * 2021-07-22 2021-11-02 上海普洛斯普新数字科技有限公司 Online commodity identity uniqueness identification and confirmation system
CN113762998A (en) * 2020-07-31 2021-12-07 北京沃东天骏信息技术有限公司 Category analysis method, device, equipment and storage medium

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109493931A (en) * 2018-10-25 2019-03-19 平安科技(深圳)有限公司 A kind of coding method of patient file, server and computer readable storage medium
CN109767326A (en) * 2018-12-20 2019-05-17 平安科技(深圳)有限公司 Suspicious transaction reporting generation method, device, computer equipment and storage medium
CN111858838A (en) * 2019-04-04 2020-10-30 拉扎斯网络科技(上海)有限公司 Menu calibration method and device, electronic equipment and nonvolatile storage medium
CN110135463A (en) * 2019-04-18 2019-08-16 微梦创科网络科技(中国)有限公司 A kind of commodity method for pushing and device
CN110245557B (en) * 2019-05-07 2023-12-22 平安科技(深圳)有限公司 Picture processing method, device, computer equipment and storage medium
CN110458638B (en) * 2019-06-26 2023-08-15 平安科技(深圳)有限公司 Commodity recommendation method and device
CN112001768A (en) * 2020-07-10 2020-11-27 苏宁云计算有限公司 E-commerce platform shop opening method and device based on robot process automation
CN112966681B (en) * 2021-04-12 2022-05-10 深圳市秦丝科技有限公司 Method, equipment and storage medium for intelligent recognition, filing and retrieval of commodity photographing
CN113570427A (en) * 2021-07-22 2021-10-29 上海普洛斯普新数字科技有限公司 System for extracting and identifying on-line or system commodity characteristic information

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103294798A (en) * 2013-05-27 2013-09-11 北京尚友通达信息技术有限公司 Automatic merchandise classifying method on the basis of binary word segmentation and support vector machine
US8892488B2 (en) * 2011-06-01 2014-11-18 Nec Laboratories America, Inc. Document classification with weighted supervised n-gram embedding
CN106294568A (en) * 2016-07-27 2017-01-04 北京明朝万达科技股份有限公司 A kind of Chinese Text Categorization rule generating method based on BP network and system
CN106326346A (en) * 2016-08-06 2017-01-11 上海高欣计算机系统有限公司 Text classification method and terminal device
CN106569998A (en) * 2016-10-27 2017-04-19 浙江大学 Text named entity recognition method based on Bi-LSTM, CNN and CRF

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201611380D0 (en) * 2016-06-30 2016-08-17 Microsoft Technology Licensing Llc Artificial neural network with side input for language modelling and prediction
CN106682220A (en) * 2017-01-04 2017-05-17 华南理工大学 Online traditional Chinese medicine text named entity identifying method based on deep learning
CN107832326B (en) * 2017-09-18 2021-06-08 北京大学 Natural language question-answering method based on deep convolutional neural network
CN107818080A (en) * 2017-09-22 2018-03-20 新译信息科技(北京)有限公司 Term recognition methods and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8892488B2 (en) * 2011-06-01 2014-11-18 Nec Laboratories America, Inc. Document classification with weighted supervised n-gram embedding
CN103294798A (en) * 2013-05-27 2013-09-11 北京尚友通达信息技术有限公司 Automatic merchandise classifying method on the basis of binary word segmentation and support vector machine
CN106294568A (en) * 2016-07-27 2017-01-04 北京明朝万达科技股份有限公司 A kind of Chinese Text Categorization rule generating method based on BP network and system
CN106326346A (en) * 2016-08-06 2017-01-11 上海高欣计算机系统有限公司 Text classification method and terminal device
CN106569998A (en) * 2016-10-27 2017-04-19 浙江大学 Text named entity recognition method based on Bi-LSTM, CNN and CRF

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111710386A (en) * 2020-04-30 2020-09-25 上海数创医疗科技有限公司 Quality control system for electrocardiogram diagnosis report
CN113762998A (en) * 2020-07-31 2021-12-07 北京沃东天骏信息技术有限公司 Category analysis method, device, equipment and storage medium
CN113076755A (en) * 2021-04-14 2021-07-06 京东数字科技控股股份有限公司 Keyword extraction method, device, equipment and storage medium
CN113076755B (en) * 2021-04-14 2024-04-09 京东科技控股股份有限公司 Keyword extraction method, keyword extraction device, keyword extraction equipment and storage medium
CN113592512A (en) * 2021-07-22 2021-11-02 上海普洛斯普新数字科技有限公司 Online commodity identity uniqueness identification and confirmation system

Also Published As

Publication number Publication date
CN108563782B (en) 2023-04-18
CN108563782A (en) 2018-09-21

Similar Documents

Publication Publication Date Title
WO2019205319A1 (en) Commodity information format processing method and apparatus, and computer device and storage medium
WO2019205318A1 (en) Public opinion information classification method and apparatus, computer device, and storage medium
US11755885B2 (en) Joint learning of local and global features for entity linking via neural networks
US11030997B2 (en) Slim embedding layers for recurrent neural language models
CN111353076B (en) Method for training cross-modal retrieval model, cross-modal retrieval method and related device
US20210216577A1 (en) Reader-retriever approach for question answering
WO2021179570A1 (en) Sequence labeling method and apparatus, and computer device and storage medium
CN110019793A (en) A kind of text semantic coding method and device
CN108604311B (en) Enhanced neural network with hierarchical external memory
US11586838B2 (en) End-to-end fuzzy entity matching
CN109299479A (en) Translation memory is incorporated to the method for neural machine translation by door control mechanism
CN112699215B (en) Grading prediction method and system based on capsule network and interactive attention mechanism
US20230281390A1 (en) Systems and methods for enhanced review comprehension using domain-specific knowledgebases
CN112949758A (en) Response model training method, response method, device, equipment and storage medium
CN111667069A (en) Pre-training model compression method and device and electronic equipment
CN108268629A (en) Image Description Methods and device, equipment, medium, program based on keyword
CN113761188A (en) Text label determination method and device, computer equipment and storage medium
US11520762B2 (en) Performing fine-grained question type classification
WO2023061107A1 (en) Language translation method and apparatus based on layer prediction, and device and medium
EP4064038B1 (en) Automated generation and integration of an optimized regular expression
US20230042327A1 (en) Self-supervised learning with model augmentation
US20230196067A1 (en) Optimal knowledge distillation scheme
CN114692012A (en) Electronic government affair recommendation method based on Bert neural collaborative filtering
CN113837216A (en) Data classification method, training method, device, medium and electronic equipment
CN114065771A (en) Pre-training language processing method and device

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205N DATED 16/12/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18916721

Country of ref document: EP

Kind code of ref document: A1