Multi-level product category generative extraction method and device based on product name

By using an encoder-decoder-based end-to-end learning model and leveraging Tree-LSTM and LSTM networks for multi-level product category extraction, the reliance on pre-constructed product category hierarchies in existing technologies is eliminated, achieving automated and highly adaptable product classification.

CN118760988BActive Publication Date: 2024-11-15BEIJING DAOKOU JINKE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411254830.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2024-11-15
Estimated Expiration
2044-09-09

AI Technical Summary

Technical Problem

Existing automated classification models require the pre-construction of a complete hierarchical structure of product categories, which involves a large amount of manual construction work. When there is a lack of prior knowledge of the hierarchical structure of product categories or when there are unknown product types in the data to be classified, the applicability is poor and the scalability is weak.

Method used

An end-to-end learning model based on the encoder-decoder concept is constructed. By obtaining the product names from invoice data, manual annotation and dependency parsing are performed. Tree-LSTM and LSTM networks are used to automatically extract multi-level product categories, reducing the dependence on the pre-constructed product category hierarchy.

Benefits of technology

It enables automatic learning of product category hierarchies without the need for pre-construction, reducing manual workload and recognizing unknown product categories, thus improving the automation and applicability of classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760988B_ABST
    Figure CN118760988B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for generative extraction of multi-level commodity categories based on commodity names, and belongs to the technical field of computer data analysis. In order to solve the problems of poor applicability and weak scalability of current automated classification models, the method of the present invention constructs an end-to-end learning model based on the encoder-decoder idea, takes the commodity name text as the input sequence, and the multi-level commodity category extraction result as the target sequence, uses a Tree-LSTM network to map the input sequence to an implicit state vector, and then generates the target sequence based on the vector using an LSTM network. The device of the present invention includes a commodity name input and dependency syntax analysis module, a distributed word vector representation module, a commodity category multi-level extraction model, and a commodity category vocabulary. The present invention does not need to pre-construct a complete commodity category hierarchy, and can automatically learn the commodity category hierarchy, thereby enhancing the applicability and scalability of multi-level commodity category recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer data analysis, relates to information automatic extraction technology, and specifically relates to a method and device for generating and extracting multi-level commodity categories based on commodity names. Background Art

[0002] The commodity name information in the purchase and sales invoice data of an enterprise includes information on the raw materials purchased and the products produced in the enterprise's production and operation activities. By analyzing the commodity names in the purchase and sales invoice data of an enterprise and intelligently classifying the commodity names, not only can the specific scope of the enterprise's production and operation be inferred, but also the position of the enterprise in the industrial chain can be further obtained on this basis. By intelligently analyzing a large amount of enterprise purchase and sales invoice data, the raw materials and output commodity categories required for each type of commodity or industry can be obtained, which helps to draw a panoramic view of the industrial chain map.

[0003] However, the amount of invoice data is huge, and the problem of classifying goods according to the product names in the invoice data often involves a huge workload. At the same time, new products emerge in an endless stream, and the type library of product classification also needs to keep up with the speed of product name updates and iterations. Using the traditional manual labeling method to classify a large amount of invoice data according to product names is not only labor-intensive, but also time-consuming and labor-intensive, and can be said to be unrealistic. Therefore, it is necessary to perform automated multi-level classification based on the product names in the invoice data. Since the product names in the invoice data are varied and rarely follow a unified standard, some product names seem to be not much different, but actually belong to different fields; some product names have information such as brand names or models that interfere with the judgment of product categories to a large extent, which leads to the problem of automatically extracting the multi-level subdivision categories to which the products belong from the product names in the invoice data, which faces huge technical challenges.

[0004] The existing technology classifies the problem of classifying products according to product names as a classification problem. The traditional method is to first construct a document-word frequency matrix to screen feature words and construct feature vectors for product texts, and then use the document-word frequency matrix after feature screening as the independent variable and the product category as the dependent variable to establish an automatic classification model. The automatic classification model is mainly constructed using the naive Bayes algorithm based on Bayes' theorem, the k-nearest neighbor algorithm based on distance metric design, the support vector machine algorithm based on kernel functions, and the decision tree algorithm based on a series of if-then rules. However, this type of method requires the tree-like hierarchical structure of product categories to be defined in advance. In the absence of prior knowledge of the product category hierarchy, or when there are unknown product types in the data to be classified, this type of method is no longer applicable. Summary of the invention

[0005] The technical problem to be solved by the present invention is that the automatic classification model of the prior art needs to pre-construct a complete commodity category hierarchy when automatically classifying commodities according to commodity names, and the workload of manual construction is huge. When there is a lack of prior knowledge of the commodity category hierarchy, or there are unknown commodity types in the data to be classified, the automatic classification model will not be applicable or has poor applicability, and there is a problem of weak scalability. In order to solve these problems, the present invention proposes a method and device for generative extraction of multi-level commodity categories based on commodity names, constructs an end-to-end learning model based on the encoder-decoder concept, and achieves the purpose of extracting multi-level commodity categories from commodity names without relying on pre-constructing a complete commodity category hierarchy.

[0006] The present invention provides a method for generating and extracting multi-level commodity categories based on commodity names, comprising the following steps:

[0007] Step 1: Get the product names in the invoice data and build a product name dataset;

[0008] Step 2: Manually label the product name dataset and mark the multi-level product categories corresponding to the product names;

[0009] The multi-level commodity categories are represented as: <First-level category limitation> <tab><Secondary category limitation> <tab><Tertiary category limit> <end>;in <tab>is the separator, <end>is the end character;

[0010] Step 3: Obtain a public Chinese pre-trained corpus and merge it with the annotated data set to obtain a pre-trained corpus with product information added; perform Chinese word segmentation on the pre-trained corpus with product information added;

[0011] Step 4: Input the segmented corpus into the pre-trained model to obtain the distributed word vector representation of all words in the corpus;

[0012] Step 5: Construct a candidate string set and a vocabulary, and represent the multi-level product categories as digital sequence labels based on the vocabulary. The digital sequence labels are formed by sequentially combining the IDs of each word in the vocabulary in the multi-level product categories.

[0013] The candidate string set includes a multi-level product category label set and a terminator <end>, separator <tab>;

[0014] The structure of the word list is <word id, word name term, word vector vector>, and the separator and the terminator are stored in the word list as a single word, and the word list also contains at least known multi-level commodity category words;

[0015] Step 6: Perform dependency syntactic analysis on the product name to obtain the corresponding syntactic dependency tree structure;

[0016] Step 7: Establish a multi-level extraction model for product categories. The input of the model is the syntactic dependency tree of the product name, and the output is the digital sequence label of the multi-level product category.

[0017] The multi-level extraction model of commodity categories is composed of an encoder and a decoder; in the encoder, a tree-like long short-term memory Tree-LSTM network is applied to the syntactic dependency tree of the commodity name, and the word vector of the word segmentation corresponding to the node in the tree is input into the Tree-LSTM unit of the node, and after being encoded by the Tree-LSTM network, the memory cell state and hidden state obtained by encoding the Tree-LSTM unit of the root node of the syntactic dependency tree are used as the output of the encoder; in the decoder, the output of the encoder is sequentially decoded using the long short-term memory LSTM network to output the digital sequence labels of the multi-level commodity categories;

[0018] Step 8: Use the training data set to train the product category multi-level extraction model;

[0019] Each product name and the labeled multi-level product category are combined into a piece of training data, and the corresponding training sample includes the syntactic dependency tree of the product name and the digital sequence label of the labeled multi-level product category;

[0020] Step 9: Use the trained multi-level product category extraction model to automatically generate multi-level product categories for the currently input product name;

[0021] Perform dependency syntactic analysis on the currently input product name to obtain the syntactic dependency tree of the product name, and input the trained multi-level extraction model of product categories. The model outputs a prediction sequence of the product name. Each element in the sequence corresponds to an n-dimensional vector, where n is the number of words in the vocabulary, and dimension k represents the predicted probability that the word corresponding to the element belongs to the kth word in the vocabulary; for each element in the sequence, the word with the largest prediction probability is taken as the final prediction word, and the final product category prediction result is output.

[0022] In step 7, the input of the first LSTM unit of the decoder is the output of the encoder and <start>The word vector of the output hidden state is used as the word vector of a predicted word; the input of the other LSTM units of the decoder except the first one is the hidden state of the previous LSTM unit and the word vector of the output predicted word, a word vector of a predicted word; when the maximum target sequence length is reached or the LSTM unit outputs the end symbol <end>When , the prediction stops; the hidden state output by the decoder at each time step is input into the Softmax classifier, and the predicted word at each time step is output as the confidence of each candidate string; finally, the multi-level product category digital sequence label of the product name is output based on the confidence and the vocabulary.

[0023] Based on the above method, the present invention also provides a multi-level product category generative extraction device based on product names, including: a product name input and dependency syntax analysis module, a distributed word vector representation module, a product category multi-level extraction model, and a product category vocabulary.

[0024] The product name input and dependency syntax analysis module is used to obtain the product name, perform dependency syntax analysis on the product name, output the syntax dependency tree of the product name, and then input it into the product category multi-level extraction model;

[0025] The distributed word vector representation module is used to output word vectors;

[0026] After receiving the syntactic dependency tree of the product name, the multi-level extraction model of product categories obtains the word vector of each word corresponding to each node in the tree by the distributed word vector representation module, and then uses the Tree-LSTM network encoding in the encoder to output the memory cell state and hidden state obtained by the Tree-LSTM unit encoding of the root node of the syntactic dependency tree to the decoder. The decoder uses the start symbol <start>The word vector and the output of the encoder are used as input, and a prediction sequence is output after decoding. Each element in the sequence is an n-dimensional vector of the corresponding product category vocabulary, where n is the number of words in the vocabulary, and dimension k represents the predicted probability that the word corresponding to the element belongs to the kth word in the vocabulary; for each element in the sequence, the word with the largest prediction probability is taken as the final prediction word, and finally the predicted multi-level product category is obtained;

[0027] The product category vocabulary contains all multi-level product category words and separators <tab>and end character <end>.

[0028] Compared with the prior art, the advantages and beneficial effects of the present invention are as follows: the method and device of the present invention propose an end-to-end learning model based on the encoder-decoder concept to perform multi-level commodity category extraction, without the need to pre-construct a complete commodity category hierarchy, and can automatically learn the commodity category hierarchy, reducing the huge workload of manually constructing and maintaining the commodity category hierarchy. In addition, the multi-level commodity category extraction model obtained by training can intelligently identify unknown commodity categories according to the commodity names in the case of unknown commodity categories. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a flow chart of a method for generating and extracting multi-level commodity categories according to an embodiment of the present invention;

[0030] Figure 2 is an example diagram of extracting a syntactic dependency tree structure of a product name according to an embodiment of the present invention;

[0031] Figure 3 is a schematic diagram of the structure of the multi-level commodity category extraction model Goodsche constructed in an embodiment of the present invention;

[0032] Figure 4 It is a schematic diagram of a multi-level commodity category generation and extraction device constructed according to an embodiment of the present invention. DETAILED DESCRIPTION

[0033] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments.

[0034] The present invention provides a method and device for generative extraction of multi-level commodity categories based on commodity names, which converts the multi-level category extraction problem into an end-to-end sequence conversion problem, takes the original commodity name text to be extracted as the input sequence, and the multi-level commodity category extraction result as the target sequence, uses a neural network to map the input sequence to a vector in an implicit semantic space, and based on the vector, uses a neural network to generate the target sequence.

[0035] like Figure 1 As shown, the multi-level product category generative extraction method based on product names in an embodiment of the present invention includes the following 11 steps.

[0036] Step 1: Get the product names in the invoice data and build a product name dataset.

[0037] Collect invoice data, obtain product name text from it, and store it in the product name dataset.

[0038] Step 2: Manually label the product names obtained in step 1, and label the corresponding multi-level product categories of the product names. The labeling format is: <First-level category limitation> <tab><Secondary category limit> <tab><Tertiary category limit> <end>. Mark up to 3 levels of product categories, and use <tab>Division; <tab>is the hierarchical category separator, <end>It is the end mark of the current multi-level product category sequence.

[0039] A commodity classification system is determined in advance as the classification basis, and the commodity names are manually labeled according to the system. For example, for the commodity name "Programmable Control System", the labeling format is: <Manufacturing> <tab><Industrial><Automatic Control><Instrumentation><System> <tab><Industrial><Automatic Control><System> <end>For the product name "Subtitle animation movie camera", the notation format is: <Manufacturing> <tab><Movie><Machine> <tab><Movie><Camera> <end>.

[0040] Each product name and the corresponding labeled multi-level product category are combined into a piece of training data. A batch of product names and their labeled data are obtained through manual labeling to form a training data set.

[0041] Step 3: Obtain a large-scale pre-training corpus of Chinese.

[0042] For example, the embodiment of the present invention obtains Sogou News corpus.

[0043] Step 4: Merge the training data set obtained in step 2 with the pre-training corpus obtained in step 4 to obtain a pre-training corpus with product information added.

[0044] Step 5: Perform Chinese word segmentation on the pre-trained corpus with product information obtained in step 4. Jieba word segmentation tool or other Chinese word segmentation tools can be used.

[0045] Step 6: Input the segmented corpus obtained in step 5 into the pre-trained model to obtain the distributed word vector representation of all corpus words and build a distributed word vector table.

[0046] The pre-trained model is a word vector model or a Bert model. The word vector model can select the current mainstream word vector model, such as Word2Vec, Glove, FastText, ELMo, Bert, XLNet, etc. The embodiment of the present invention adopts the word2vec module in the Gensim library to obtain word vectors. The training data set of the present invention involves a large number of commodity names and categories. Combined with the large-scale pre-trained corpus of Chinese, the distribution of pre-trained model parameters can be more biased towards the commodity classification field applied by the present invention. The extracted distributed word vector is more suitable for the application field of the present invention, which is conducive to improving the accuracy of multi-level category extraction of commodities.

[0047] Step 7: Construct a candidate string set and vocabulary, and represent the multi-level product categories as digital sequence labels. The digital sequence labels are formed by sequentially combining the IDs of each word in the vocabulary in the multi-level product categories.

[0048] The candidate string set C is defined as follows:

[0049] (1) C1 is a set of multi-level product category labels;

[0050] (2) C = C1 { <end> , <tab>}.

[0051] Construct a vocabulary with the structure of <word id, word name term, word vector vector>. <tab>and end character <end>Each of them is stored as a word in the word list, and the word list at least contains the known multi-level commodity category words. That is, the word list at least contains the words of the candidate character string set C.

[0052] For example, part of the vocabulary constructed based on partially annotated multi-level product categories is as follows:

[0053] 0 <tab> < / tab> 0010001110000000011000000111110010011011001111100111011011100001 1 <end> < / end> 0010001110000000011000000111110010011011001111100111011011100000 2 manufacturing 0011111110011100011000000100010010011011001111100000011011100111 3 Movie 1100111110011100011000000100010010011011001111100000011000000000 4 mechanical 1100111110011100011000000100010010011011001111100000011000000111 5 camera 1100100000100101110001110101110010001001101111100000011000000111 6 industry 0011111110011100011000000100010010011011001111100000011011100100 7 subtitle 1100110010011101011101100100010010011111001111101110011001100101 8 Animation 1100111110011100011001100100010010011111001111100000011000000101

[0054] Each row corresponds to the three-dimensional information of a word: word id, word name term, and word vector vector.

[0055] For example, the multi-level commodity category "<Manufacturing> <tab><Movie><Machine> <tab><Movie><Camera> <end>”, whose numeric sequence label is 20340351.

[0056] The multi-level product category of each training data obtained in step 2 is represented as a digital sequence label. In this way, each labeled training data is converted into data containing a product name and a digital sequence label of multi-level product categories.

[0057] Step 8: Perform dependency syntactic analysis on the product name as a short sentence to obtain the syntactic dependency tree structure of the short sentence.

[0058] The dependency parsing of the embodiment of the present invention can use Baidu's DDParser tool or HanLP tool or the dependency parsing API of the iFlytek open platform. Figure 2 As shown, the syntactic dependency tree structure is obtained by analyzing the input product name "electronic floor scale remote control system", where "system" is the root node, and its child nodes include "control" and "floor scale", "remote" is the child node of "control", and "electronic" is the child node of "floor scale".

[0059] Step 9: Establish a goods category hierarchical extraction model (goods category hierarchical extractor, Goodsche).

[0060] According to the above steps, the training sample set of the model will be obtained. Each sample contains a syntactic dependency tree of a product name and a digital sequence label of a multi-level product category. The syntactic dependency tree of the product name is input into the multi-level extraction model of product category, and the digital sequence label of the multi-level product category is output for model training.

[0061] The structure of the Goodsche multi-level extraction model of commodity categories constructed by the present invention is as follows: Figure 3 As shown in the figure, Goodsche consists of two parts: encoder and decoder. The encoder applies the Tree-LSTM (tree-like long short-term memory) network to the syntactic dependency tree of the input product name short sentence to obtain the high-level semantic encoding of the input short sentence. The decoder uses the LSTM (long short-term memory) network to decode and output the multi-level product category extraction results in sequence. The specific steps are as follows, where steps 9.1 and 9.2 correspond to the encoder part, and step 9.3 corresponds to the decoder part.

[0062] Step 9.1: Query the distributed word vector table obtained in step 6 to obtain the word vector corresponding to each word in the input short sentence , n represents the number of word segments of the input product name.

[0063] Step 9.2: Apply Tree-LSTM to the syntactic dependency tree of the input short sentence. The input of each Tree-LSTM unit in Tree-LSTM is the word vector in step 9.1.

[0064] Assume that nodes 2 and 3 are child nodes of node 1 in the syntactic dependency tree. is the input of node 1, , , are the memory cell states of the Tree-LSTM units corresponding to nodes 1, 2, and 3, respectively. , , The hidden states of the Tree-LSTM units corresponding to nodes 1, 2, and 3, respectively, and the outputs of the Tree-LSTM units of nodes 2 and 3 , as well as , For node 1, in the Tree-LSTM unit of node 1, the input of node 1 Combination , Get new input ,Will , , After the input gate and the forget gate, the memory cell state is obtained , After passing through the output gate, the hidden state is obtained .

[0065] like Figure 3 As shown, the embodiment of the present invention obtains the syntactic dependency tree of "electronic floor scale remote control system", each node in the tree corresponds to a word segment, and a Tree-LSTM unit is used at each node for encoding processing. The word vector of the word segment corresponding to the node is input into the Tree-LSTM unit of this node, and the memory cell state and hidden state are output to the parent node. The Tree-LSTM unit of the parent node collects the input of the child node and the word vector of the word segment corresponding to this node, and continues to output the memory cell state and hidden state to the parent node of the previous layer. Until the root node of the syntactic dependency tree outputs the memory cell state and hidden state, such as the root node output as well as , as the output of the encoder.

[0066] Step 9.3: The hidden state vector and memory cell state vector of the entire input product name phrase obtained by Tree-LSTM in step 9.2 are passed into the decoder as initial data. The decoder is composed of a long short-term memory neural network (LSTM) and the start symbol of the string marker is <start>The corresponding distributed word vectors are passed as initial input to the decoder to generate the predicted output sequence. <start>It is also set in the vocabulary, and the corresponding distributed word vector encoding can be obtained by querying the vocabulary.

[0067] like Figure 3 As shown, the initial time step of the decoder, i.e. the first LSTM unit, has as input the output of the encoder and <start>The decoder receives the hidden state of the previous LSTM unit and the predicted word vector output by the previous LSTM unit. The LSTM unit at each time step maps the output hidden state to a predicted word vector, which is then input to the next LSTM unit. When the maximum target sequence length (maximum time step) is reached or the output <end>When the word vector is marked, the prediction phase stops. Then, the hidden state vector output by the long short-term memory neural network at each time step is input into the Softmax classifier to predict the word vector output at each time step as the confidence of each candidate string. Finally, the confidence and the word list are combined to output the multi-level product category digital sequence label of the current input product name.

[0068] Step 10: Train the multi-level extraction model for product categories.

[0069] The constructed product category multi-level extraction model is trained using the labeled training data. During the training, the following steps are included:

[0070] Step 10.1: Use the cross entropy loss function to train the model. The cross entropy loss function used is as follows:

[0071] =-

[0072] in, are all the trainable parameters of the model, represents the current input sample i, N is the number of samples in the training data set, represents the true label of sample i, Indicates that the true label is obtained by inputting sample i under the current model parameters probability.

[0073] Step 10.2: Use Adam optimizer to minimize the loss function to train the model until convergence.

[0074] Step 11: Use the multi-level product category extraction model trained in step 10 to automatically label any given product name with multi-level product categories. The specific steps for automatically obtaining multi-level product category labels by using a product name as the input data of the model are as follows:

[0075] Step 11.1: Perform dependency syntactic analysis on the input data to obtain the syntactic dependency tree structure of the short sentence. Obtain the word vector for each word in each input data.

[0076] Step 11.2: Apply the multi-level product category extraction model trained in step 10 to the syntactic dependency tree of the input short sentence obtained in step 11.1, and use the multi-level product category extraction model to predict and output the multi-level product category label of the currently input product name. The label is a sequence, each element in the sequence is an n-dimensional vector, and any dimension k in the n-dimensional vector represents the predicted probability that the output word corresponding to the element is the kth candidate word in the candidate string set, and n is the number of candidate words in the candidate string set, that is, the number of words in the vocabulary. For each element in the sequence, the corresponding word with the largest prediction probability is taken as the final prediction word to obtain the product category prediction result.

[0077] Based on the above method, the multi-level product category generation extraction device based on product name is implemented in the embodiment of the present invention, such as Figure 4 As shown, it includes: a product name input and dependency syntactic analysis module, a distributed word vector representation module, a product category multi-level extraction model, and a product category vocabulary. The product name input and dependency syntactic analysis module is used to obtain the product name, perform dependency syntactic analysis on the product name, output the syntactic dependency tree of the product name, and then input it into the product category multi-level extraction model. The distributed word vector representation module stores the distributed word vector table constructed in the above step 6, which is used to look up the table and output the corresponding word vector. The product category multi-level extraction model is a trained model of the present invention. After receiving the syntactic dependency tree of the product name, the distributed word vector representation module obtains the word vector of the word corresponding to each node in the tree, and then uses Tree-LSTM network coding in the encoder to output the memory cell state and hidden state obtained by encoding the Tree-LSTM unit of the root node of the syntactic dependency tree to the decoder. The start symbol is used in the decoder. <start>The word vector and the output of the encoder are decoded to output a prediction sequence. Each element in the prediction sequence corresponds to an n-dimensional vector, which corresponds to the product category vocabulary. n is the number of words in the vocabulary, where dimension k represents the predicted probability that the word corresponding to the element belongs to the kth word in the vocabulary. For each element in the sequence, the word with the largest prediction probability is taken as the final prediction word, and finally the predicted multi-level product category is obtained. The product category vocabulary contains all multi-level product category words and separators. <tab>and end character <end>.

[0078] Except for the technical features described in the specification, all of them are known technologies to those skilled in the art. The present invention omits the description of known components and known technologies to avoid redundancy and unnecessary limitation of the present invention. The implementation methods described in the above embodiments do not represent all implementation methods consistent with the present application. On the basis of the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative labor are still within the protection scope of the present invention.< / end> < / tab> < / start> < / end> < / start> < / start> < / start> < / end> < / tab> < / tab> < / end> < / tab> < / tab> < / end> < / end> < / tab> < / tab> < / end> < / tab> < / tab> < / end> < / tab> < / tab> < / end> < / tab> < / tab> < / end> < / tab> < / start> < / end> < / start> < / tab> < / end> < / end> < / tab> < / end> < / tab> < / tab>

Claims

1. A method for generating and extracting multi-level commodity categories based on commodity names, characterized in that: The steps include: Step 1: Get the product names in the invoice data and build a product name dataset; Step 2: Manually label the product name dataset and mark the multi-level product categories corresponding to the product names; The multi-level commodity categories are represented as: <First-level category limitation> <tab><Secondary category limit> <tab><Tertiary category limit> <end>;in <tab>is the separator, <end> is the end character;< / end> < / tab> < / end> < / tab> < / tab> Step 3: Obtain a public Chinese pre-trained corpus and merge it with the annotated data set to obtain a pre-trained corpus with product information added; perform Chinese word segmentation on the pre-trained corpus with product information added; Step 4: Input the segmented corpus into the pre-trained model to obtain the distributed word vector representation of all words in the corpus; Step 5: Construct a candidate string set and a vocabulary, and represent the multi-level product categories as digital sequence labels based on the vocabulary. The digital sequence labels are formed by sequentially combining the IDs of each word in the vocabulary in the multi-level product categories. The candidate string set includes a multi-level product category label set and a terminator <end>, separator <tab> ;< / tab> < / end> The structure of the word list is <word id, word name term, word vector vector>, and the separator and the terminator are stored in the word list as a single word, and the word list also contains at least known multi-level commodity category words; Step 6: Perform dependency syntactic analysis on the product name to obtain the corresponding syntactic dependency tree structure; Step 7: Establish a multi-level extraction model for product categories. The input of the model is the syntactic dependency tree of the product name, and the output is the digital sequence label of the multi-level product category. The multi-level extraction model of commodity categories is composed of an encoder and a decoder; in the encoder, a tree-like long short-term memory Tree-LSTM network is applied to the syntactic dependency tree of the commodity name, and the word vector of the word segmentation corresponding to the node in the tree is input into the Tree-LSTM unit of the node, and after being encoded by the Tree-LSTM network, the memory cell state and hidden state obtained by encoding the Tree-LSTM unit of the root node of the syntactic dependency tree are used as the output of the encoder; in the decoder, the output of the encoder is sequentially decoded using the long short-term memory LSTM network to output the digital sequence labels of the multi-level commodity categories; Step 8: Use the training data set to train the product category multi-level extraction model; Each product name and the labeled multi-level product category are combined into a piece of training data, and the corresponding training sample includes the syntactic dependency tree of the product name and the digital sequence label of the labeled multi-level product category; Step 9: Use the trained multi-level product category extraction model to automatically generate multi-level product categories for the currently input product name; Perform dependency syntactic analysis on the currently input product name to obtain the syntactic dependency tree of the product name, and input the trained multi-level extraction model of product categories. The model outputs a prediction sequence of the product name. Each element in the sequence corresponds to an n-dimensional vector, where n is the number of words in the vocabulary, and dimension k represents the predicted probability that the word corresponding to the element belongs to the kth word in the vocabulary; for each element in the sequence, the word with the largest prediction probability is taken as the final prediction word, and the final product category prediction result is output.

2. The method according to claim 1, characterized in that: In step 7, the input of the first LSTM unit of the decoder is the output of the encoder and the start symbol <start>The word vector of the output hidden state is used as the word vector of a predicted word; the input of the other LSTM units of the decoder except the first one is the hidden state of the previous LSTM unit and the word vector of the output predicted word, a word vector of a predicted word; when the maximum target sequence length is reached or the LSTM unit outputs the end symbol <end>When , the prediction stops; the hidden state output by the decoder at each time step is input into the Softmax classifier, and the predicted word at each time step is output as the confidence of each candidate string; finally, the multi-level product category digital sequence label of the product name is output based on the confidence and the vocabulary.< / end> < / start> 3. The method according to claim 1, characterized in that In step 4, the pre-trained model uses a word vector model or a Bert model.

4. The method according to claim 1, characterized in that: In step 8, a cross entropy loss function is used to train the multi-level extraction model of product categories, and the cross entropy loss function is minimized until the model converges.

5. A multi-level commodity category generation extraction device implemented according to the method of claim 1, 2 or 3, characterized in that: include: Product name input and dependency syntax analysis module, distributed word vector representation module, product category multi-level extraction model, and product category vocabulary; among them, The product name input and dependency syntax analysis module is used to obtain the product name, perform dependency syntax analysis on the product name, output the syntax dependency tree of the product name, and then input it into the product category multi-level extraction model; The distributed word vector representation module is used to output word vectors; After receiving the syntactic dependency tree of the product name, the multi-level extraction model of product categories obtains the word vector of each word corresponding to each node in the tree by the distributed word vector representation module, and then uses the Tree-LSTM network encoding in the encoder to output the memory cell state and hidden state obtained by the Tree-LSTM unit encoding of the root node of the syntactic dependency tree to the decoder. The decoder uses the start symbol <start> The word vector and the output of the encoder are used as input, and a prediction sequence is output after decoding. Each element in the sequence is an n-dimensional vector of the corresponding product category vocabulary, where n is the number of words in the vocabulary, and dimension k represents the predicted probability that the word corresponding to the element belongs to the kth word in the vocabulary; for each element in the sequence, the word with the largest prediction probability is taken as the final prediction word, and finally the predicted multi-level product category is obtained;< / start> The product category vocabulary contains all multi-level product category words and separators <tab>and end character <end> 。< / end> < / tab>