An intelligent classification method for import and export commodities integrating knowledge graph

By constructing a dictionary and import and export commodity knowledge graph in the customs field, integrating text and entity characteristics, the problems of interpretability and data dependence in customs product classification are solved, and more efficient commodity classification and coding prediction are achieved.

CN117150006BActive Publication Date: 2025-08-22中国电子口岸数据中心杭州分中心
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310894180.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-20
Publication Date
2025-08-22
Estimated Expiration
2043-07-20

AI Technical Summary

Technical Problem

The existing customs commodity classification methods lack interpretability and dependence on labeled data, resulting in classification errors and difficulty in learning semantic information. Traditional methods cannot effectively solve the problems of unified, standardized and accurate classification of imported and exported commodities.

Method used

Introduce knowledge graphs, build customs field dictionaries and import and export commodity knowledge graphs, integrate text and entity feature vectors through word segmentation, entity recognition and knowledge graph embedding, and use classifiers to predict HS encoding.

Benefits of technology

It improves the accuracy and interpretability of product classification, solves the problems of data inconsistency and incompleteness, enhances the generalization ability of the model, and improves the accuracy of product classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117150006B_ABST
    Figure CN117150006B_ABST
Patent Text Reader

Abstract

The present invention discloses an intelligent classification method for customs import and export commodities by integrating knowledge graphs, and the steps are as follows: 1) constructing a customs domain dictionary based on customs clearance history data; 2) constructing a customs import and export commodity knowledge graph based on the customs import and export tariff manual and customs clearance history data; 3) performing word segmentation on user commodity descriptions using a word segmentation tool and the customs domain dictionary; 4) identifying customs domain entities in user commodity descriptions, linking them to the customs import and export commodity knowledge graph, and obtaining an entity set; 5) using a knowledge graph embedding method to embed the entities of the knowledge graph into a continuous vector space; 6) fusing text feature vectors and entity feature vectors to obtain a final commodity feature vector, sending the final commodity feature vector to a classifier, and obtaining a tariff code prediction result for the commodity; the present invention introduces the knowledge graph into the customs tariff code classification, fuses knowledge and language semantic information, enhances the semantic representation, and can improve the accuracy of classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of customs commodity classification, and in particular to an intelligent classification method for import and export commodities that integrates a knowledge graph. Background Art

[0002] With the rapid growth of cross-border trade, the rapid and accurate classification of goods for customs clearance is gaining increasing attention from relevant departments. However, customs and businesses possess vastly different information regarding goods, and different businesses have varying understandings of the same goods. Furthermore, the wide variety of imported and exported goods further complicates the classification process for businesses and even customs officials. Ensuring consistent, standardized, and accurate classification will facilitate customs tariff calculations, help businesses avoid shipping delays and administrative penalties resulting from misclassification, and ultimately expedite customs clearance.

[0003] The World Customs Organization has developed the International Convention on the Harmonized Commodity Description and Coding System, commonly known as the Harmonized System (HS), or HS code, which uses numerical codes to represent and identify goods traded across borders. Customs regulations require the use of six-digit codes to represent and identify cross-border goods. Commodities are classified into two-digit codes, each representing a level, from high to low, to form a complete HS code. my country's HS code consists of 10 digits and includes 21 major divisions, 97 chapters, 1,241 four-digit items, and 5,113 six-digit commodity groups. In addition to the HS code, explanatory notes are also an important component, including class notes, chapter notes, and sub-item notes. Customs HS code classification is the process of determining the most appropriate 10-digit HS code for the declared commodity based on the commodity description information in the customs declaration. The commodity description information consists of a textual series of elements that reflect the objective characteristics of the commodity. These elements are collectively referred to as declaration elements, and each element is separated by the delimiter "|".

[0004] Traditional import and export commodity classification methods primarily rely on string matching and machine learning methods based on word features. String matching uses user-described item names to match HS standard column names. Inaccurate and ambiguous user descriptions can lead to classification errors. Machine learning methods, on the other hand, require manual feature construction. Relying solely on word features ignores the contextual information and natural order structure in semantic text data, making it difficult to learn the semantic information of words. Recently, commodity coding methods based on deep learning have emerged, avoiding manual rule design. However, deep learning models rely on large amounts of labeled data to achieve high performance and suffer from poor interpretability.

[0005] Compared to deep learning, knowledge graphs are more interpretable and contain concepts and the connections between them. Knowledge graphs describe concepts, entities, and their relationships in a structured organizational form, and are used to describe concepts and their relationships in the physical world in a symbolic form. RDF (Resource Description Framework) is a standard data model for describing entities / relationships. RDF is formally represented as SPO triples (Subject-Predicate-Object), and entities are connected to each other through relationships to form a network-like knowledge structure. The nodes in the knowledge graph represent entities in the physical world, while the various semantic relationships between entities constitute the edges in the network. The introduction of knowledge graphs can provide additional knowledge information for the model and improve the generalization ability of the model. Summary of the Invention

[0006] In order to overcome the lack of interpretability and dependence on labeled data in the existing technology, the present invention introduces knowledge graphs into tariff code classification, integrates knowledge and language semantic information, and enhances the semantic representation.

[0007] In order to solve the problem involved in the present invention, the following technical solution is adopted:

[0008] A method for intelligently classifying import and export commodities by integrating knowledge graphs includes the following steps:

[0009] Step 1: Build a customs domain dictionary based on historical customs clearance data;

[0010] Step 2: Build a customs import and export commodity knowledge graph based on the customs import and export tariff manual and historical customs clearance data;

[0011] Step 3: Use the word segmentation tool and the customs domain dictionary built in step 1 to segment the user's product description, and use the word embedding method to obtain the text feature vector;

[0012] Step 4: Identify the customs domain entities in the user's product description, and link the identified customs domain entities to the customs import and export commodity knowledge graph constructed in step 2 to obtain an entity set;

[0013] Step 5: Use the knowledge graph embedding method to embed the entities in the knowledge graph into a continuous vector space, extract the vector representation of the entity set identified in step 4, and then use the average pooling method to aggregate the entity set vector representation into a vector to obtain the entity feature vector;

[0014] Step 6: Fuse the text feature vector and the entity feature vector to obtain the final feature vector of the product, and send the final feature vector of the product to the classifier to obtain the tariff code prediction result of the product.

[0015] As a further optimization of the present invention, step 1 constructs a customs domain dictionary based on historical customs clearance data, and the specific steps are as follows:

[0016] 1.1) Customs commodity names can represent a single word with complete semantic information, but may be broken down into different words using common word segmentation tools. Therefore, historical customs clearance data is used as the input source for the construction of the customs domain dictionary.

[0017] 1.2) Extract words from declaration elements of customs historical data by using the separator “|”;

[0018] 1.3) Discard words longer than 10 Chinese characters;

[0019] 1.4) Count the occurrence frequencies of the extracted words. For each word with a frequency greater than 5000, manually split it into two new words, and then re-count the occurrence frequencies of the new words to improve the accuracy of word segmentation;

[0020] 1.5) Build a domain dictionary for customs clearance data. The dictionary contains domain keywords and the frequency of keyword occurrence. Import the dictionary as an expanded vocabulary into the word segmentation tool so that it can be pre-loaded during the subsequent word segmentation process, resulting in more accurate word segmentation.

[0021] As a further optimization of the present invention, step 2 constructs a customs import and export commodity knowledge graph based on the customs import and export tariff manual and historical customs clearance data, and the specific steps are:

[0022] 2.1) Build a knowledge graph based on the Customs Tariff Manual

[0023] 2.1.1) The Customs HS Catalogue has a hierarchical structure, from which a five-layer HS code ontology structure can be constructed, corresponding to the class, chapter, item, sub-item and extension code respectively. The relationship between HS codes is that of inclusion and inclusion.

[0024] 2.1.2) For each item (4 digits), sub-item (8 digits) and HS code (10 digits), there is a corresponding product name. In other words, the HS code can uniquely identify a product name, so a corresponding name relationship is established between the HS code and the product name;

[0025] 2.1.3) If there is a subdirectory named "Other" in the parent directory, this subdirectory should include all the nouns and attributes described in the parent directory that do not appear in any subdirectory other than this one;

[0026] 2.1.4) If the words "or," "and," or "regardless" appear in keywords or attributes in the catalog, the two preceding and following product name keywords or attribute words are split into two parts, and a "include" or "belong to" relationship is established with the product name;

[0027] 2.1.5) When there is a negative description such as "no" or "not" in the product name, an exclusion relationship is constructed between the product name and the noun following "no" or "not".

[0028] 2.1.6) If a numerical range appears in the product name, a restrictive relationship is constructed between the product name and the upper / lower limits.

[0029] 2.2) Construct a knowledge graph based on historical customs clearance data

[0030] 2.2.1) The historical customs clearance data of the product includes the product name, declaration elements, and product code. For the declaration elements, declaration element separation and declaration element alignment are performed. Declaration element separation means separating each declaration element in the original data according to the separator "|". After separating the declaration elements, it is necessary to align them one by one with the specified declaration elements in accordance with the "Catalogue of Standard Declaration of Import and Export Goods of the People's Republic of China Customs" to obtain each declaration element and the corresponding value of the declaration element;

[0031] 2.2.2) After completing the tasks of declaration element separation and alignment, the aligned declaration specifications can be used as the relationship between the product and the declaration elements, and the triple <product, declaration element specification, declaration element> can be extracted.

[0032] As a further optimization of the present invention, in step 3, a word segmentation tool and the customs domain dictionary constructed in step 1 are used to segment the user's product description, and a text feature vector is obtained using the word embedding method. The specific steps are as follows:

[0033] 3.1) Obtain the product description information input by the user;

[0034] 3.2) Use a word segmentation tool (such as jieba) to perform Chinese word segmentation on the product description information, and introduce the customs domain dictionary library constructed in step 1 to identify the词性 and semantic features of each word;

[0035] 3.3) Use BERT to perform self-supervised pre-training on a super-large unlabeled corpus, and then continue training on the labeled customs data of the downstream task. BERT can represent word vectors from two aspects: the word level and the sentence structure level. After concatenating the generated word vectors, the text sequence feature vector T can be obtained.

[0036] As a further optimization of the present invention, in step 4, the customs domain entities in the user's product description are identified, and the identified customs domain entities are linked to the customs import and export product knowledge graph constructed in step 2 to obtain an entity set. The specific steps are as follows:

[0037] 4.1) Based on the above word segmentation, we use the BIO (begin-inside-outside) annotation method and the BiLSTM-CRF (Bidirectional Long Short-Term Memory Conditional Random Field) model to perform named entity recognition on user description texts to obtain named entity mentions in product description texts;

[0038] 4.2) Using Baidu Encyclopedia’s entity pages and redirected pages, build a name dictionary for each named entity in the knowledge graph. The name dictionary is a <key, value> mapping, where the key column is the named entity and the value contains various name information of the named entity, including the entity’s name variants, abbreviations, confusing names, and nicknames.

[0039] 4.3) Perform string matching on the user entity mentions and the constructed name dictionary. If there is a name in the name dictionary that contains the user entity mention, all values ​​of the name are added to the candidate entity set, thereby obtaining multiple candidate entities in the customs import and export commodity knowledge graph for the entity mentions;

[0040] 4.4) Calculate the semantic similarity between the entity mention and each candidate entity, and take the candidate entity with the highest similarity as the entity to be finally linked by the entity mention.

[0041] As a further optimization of the present invention, step 5 uses the knowledge graph embedding method to embed the entities of the knowledge graph into a continuous vector space, extracts the vector representation of the entity set identified in step 4, and then uses the average pooling method to aggregate the entity set vector representation into a vector, thereby obtaining the entity feature vector. The specific steps are as follows:

[0042] 5.1) Use the knowledge graph embedding method to obtain the vector representation of all entities in the knowledge graph, and extract the entity set vector representation X in the product description text.

[0043] 5.2) Use the global average pooling method to aggregate the entity vector representation of the product description text into a vector to obtain the entity feature representation E.

[0044] As a further optimization of the present invention, step 6 fuses the text feature vector and the entity feature vector to obtain the final feature vector of the product, and the final feature vector of the product is sent to the classifier to obtain the tariff code prediction result of the product. The specific steps are as follows:

[0045] 6.1) After obtaining the text feature representation T and entity feature representation E, we use the attention mechanism to fuse these two features to obtain the final feature representation of the customs commodity description text, denoted as C.

[0046] 6.2) The final feature representation C of the product description text is fed into a two-layer fully connected neural network;

[0047] 6.3) Use the softmax classifier to obtain the probability prediction results of the product on the HS label;

[0048] 6.4) Use the cross entropy loss function to optimize the entire model.

[0049] The beneficial effects of the present invention are as follows:

[0050] 1) In view of the fact that there is no domain dictionary and knowledge graph in the customs field, a method of constructing a customs domain dictionary and a customs import and export commodity knowledge graph is proposed.

[0051] 2) Based on the structure and content of the HS code catalog and historical customs clearance data, this paper designs the ontology of the import and export knowledge graph and the association relationship between ontologies, which can effectively solve problems such as inconsistent and incomplete data in import and export data sources.

[0052] 3) This paper leverages both textual and entity information modalities to propose an intelligent import and export commodity classification method that integrates textual information with knowledge graph entity information. By integrating both textual and entity information, better feature representations can be learned, improving the accuracy of commodity classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is the structure diagram of the customs HS code in the present invention;

[0054] Figure 2 This is an activity diagram of an intelligent classification method for import and export commodities that integrates knowledge graphs in the present invention. DETAILED DESCRIPTION

[0055] The following is a detailed description of a method for intelligently classifying import and export commodities by integrating knowledge graphs according to the present invention, with reference to the accompanying drawings. The method comprises the following steps:

[0056] Step 1: Build a customs domain dictionary based on historical customs clearance data. The specific steps are as follows:

[0057] 1.1) A customs commodity name can represent a complete semantic word, but it may be broken down into different words using common word segmentation tools. Therefore, historical customs clearance data is used as the input source for the construction of the customs domain dictionary.

[0058] 1.2) Split the declaration elements of the customs historical data using the separator “|” to extract the words.

[0059] 1.3) Discard words longer than 10 Chinese characters.

[0060] 1.4) Count the frequencies of the extracted words, sort them by frequency, and for each word with a frequency greater than 5000, manually split it into two new words. Then re-count the frequencies of the new words to improve the accuracy of word segmentation.

[0061] 1.5) Build a domain dictionary for customs clearance data, containing domain keywords and their frequency. Import the dictionary as an expanded vocabulary into the word segmentation tool so that it can be preloaded during subsequent word segmentation, resulting in more accurate word segmentation.

[0062] Step 2: Build a customs import and export commodity knowledge graph based on the customs import and export tariff manual and historical customs clearance data. The specific steps are as follows:

[0063] 2.1) Build a knowledge graph based on the Customs Tariff Manual

[0064] 2.1.1) The Customs HS catalogue has a hierarchical structure, from which a five-layer HS code ontology structure can be constructed, corresponding to the class, chapter, item, sub-item and extension code respectively. The codes are in a containment relationship. For example, the parent category of code 3305.1000 "Shampoo (Shampoo)" is code 3305 "Hair care products", so the triples of (hair care products, including shampoo) and (3305, including 3305.1000) are constructed.

[0065] 2.1.2) Each item (4-digit), sub-item (8-digit), and HS code (10-digit) has a corresponding product name. That is, the HS code uniquely identifies a product name. Therefore, a corresponding name relationship is established between the HS code and the product name. For example, the relationship (3304.1000, corresponding name, lip cosmetics) is established.

[0066] 2.1.3) If a subcategory named "Other" exists within a parent category, this subcategory should include all terms and attributes described in the parent category that do not appear in any other subcategory. For example, 0405 has three first-level subcategories: 0405.1000, 0405.2000, and 0405.9000. 0405.9000 "Other" should include all terms and attributes described in the parent category 0405, excluding butter (subcategory 0405.1000) and spreads (subcategory 0405.2000). Therefore, in contrast to the description of 0405, "Butter and other fats and oils extracted from milk; spreads," 0405.9000 should include "Other fats and oils extracted from milk." Therefore, a triplet is constructed for HS code 0405.9000 (0405.9000, corresponding name, other fats and oils extracted from milk).

[0067] 2.1.4) If "or", "and", or "regardless of" appears in the keyword or attribute, then divide the two commodity name keywords or attribute words before and after into parts, and construct an inclusion or being-included relationship with the commodity name. For example, the commodity name corresponding to code 3304 is "cosmetics or makeup and skin care products"; then insert the triples (cosmetics or makeup and skin care products, include, cosmetics), (cosmetics or makeup and skin care products, include, makeup), (cosmetics or makeup and skin care products, include, skin care products).

[0068] 2.1.5) If there is a negative description such as "not" or "no" in the commodity name, then construct a non-inclusion relationship between the commodity name and the noun after "not" or "no". For example, the commodity description of 2202 is "water flavored, sweetened or with other sweet substances, including mineral water and soda water, other non-alcoholic beverages, but not including fruit juices, nut juices or vegetable juices of heading 2009"; then construct the triples ("water flavored, sweetened or with other sweet substances", not include, "fruit juices"), ("water flavored, sweetened or with other sweet substances", not include, "nut juices"), ("water flavored, sweetened or with other sweet substances", not include, "vegetable juices").

[0069] 2.1.6) If a numerical range appears in the commodity description, then construct a restrictive relationship between the commodity name and the upper / lower limits, and construct a triple (commodity name, restrictive relationship, limit value). For example, for code 2002.9011 (canned tomato paste), the numerical range limit is "not exceeding 5 kg in weight". Then use this as the restrictive relationship attribute word to construct the triple (canned tomato paste, weight, less than or equal to 5 kg).

[0070] 2.2) Construct a knowledge graph based on historical customs clearance data

[0071] 2.2.1) Historical commodity customs clearance data includes commodity name (G_NAME), declaration elements (G_MODEL), and commodity code (CODE_TS), as shown in Tables 1 and 2. Declaration elements are separated by a "|" symbol. Each commodity has a corresponding declaration element specification, as shown in Table 3. Each declaration element in the original data is separated using the "|" separator. After separation, each declaration element is aligned one-to-one with the declaration elements specified in the "Standardized Declaration Catalogue for Import and Export Commodities of the Customs of the People's Republic of China" to obtain each declaration element and its corresponding value. For example, the code in Table 2 is 6112410000, and the product name is "Swimsuit". The corresponding declaration element value is "4|2|Knitted|Swimming suit|Women's|82% Nylon + 18% Spandex|Tempt Me|No item number|One-piece suit". From Table 3, we can find that the declaration elements of this HS are "0. Brand type 1. Export preferential status 2. Weaving method (knitted or crocheted) 3. Type (sports suit, sportswear, ski suit, swimming suit) 4. Category (men's, women's) 5. Ingredient content 6. Brand (Chinese or foreign name) 7. Item number 8. Set composition and quantity 9. GTIN 10. CAS 11. Others". Thus, the one-to-one corresponding attributes and attribute values ​​can be obtained (GTIN, CAS and others are optional).

[0072] 2.2.2) After completing the declaration element segmentation and alignment tasks, the aligned declaration specifications can be used as the relationship between the product and the declaration element to extract the <product, declaration element specification, declaration element> triple. For example, in step 3.1, the triple can be constructed: (6112410000, product name, swimsuit), (swimsuit, brand type, 4), (swimsuit, export preferential treatment, 2), (swimsuit, weaving method, knitted), (swimsuit, type, swimwear), (swimsuit, category, women's), (swimsuit, composition, 82% nylon + 18% spandex), (swimsuit, brand (Chinese or foreign name), Tempt Me), (swimsuit, item number, no item number), (swimsuit, set composition and quantity, one-piece set).

[0073] Table 1 Historical data composition fields

[0074]

[0075] Table 2 Historical data example

[0076]

[0077] Table 3 Examples of commodity declaration elements

[0078]

[0079]

[0080] Step 3: Use the word segmentation tool and the customs domain dictionary built in step 1 to segment the user's product description, and use the word embedding method to obtain the text feature vector. The specific steps are as follows:

[0081] 3.1) Obtain product description information entered by the user;

[0082] 3.2) Use a word segmentation tool (such as Jieba) to segment the product description information into Chinese words, and introduce the customs domain dictionary built in step 1 to identify the part of speech and semantic features of each word;

[0083] 3.3) Use the BERT pre-trained model to generate word vectors for the corresponding text. BERT uses the Transformer model to extract features and performs self-supervised pre-training on an unlabeled corpus. It then continues training on labeled customs data for downstream tasks. BERT can represent word vectors at both the word level and sentence structure level. By concatenating the word vector, position vector, and segment vector, we can obtain the text feature vector T. The formula is as follows:

[0084] T=T Word +T Position +T Segment #(1)

[0085] Where T Word Represents word vector, T Position Represents the position vector, that is, the position encoding introduced when representing the word vector, T Segment Represents segment vectors, which are used to distinguish different sentences.

[0086] Step 4: Identify the customs domain entities in the user's product description, link the identified customs domain entities to the customs import and export commodity knowledge graph constructed in step 2, and obtain the entity set. The specific steps are as follows:

[0087] 4.1) Use the BiLSTM-CRF (Bidirectional Long Short-Term Memory Conditional Random Field) model to perform named entity recognition on user description text, using the BIO (begin-inside-outside) annotation method, where the B label represents the first character of the entity, the I label represents the non-first character of the entity, and the O label represents the non-entity word. The BiLSTM in the model is responsible for learning the rules for corresponding each word and symbol in the text to the entity reference item label, and the CRF (Conditional Random Field) learns the transfer rules between adjacent entity reference item labels. The user's product description text is input into the BiLSTM encoding layer, and the embedding vector of each character is mapped to a label set through the CRF layer and the fully connected layer. Then, Softmax (a normalized exponential function) is used to predict the label of each character. Based on the label, the entity mentions in the text can be extracted.

[0088] 4.2) Use Baidu Encyclopedia's entity pages and redirect pages to build a name dictionary for each named entity in the knowledge graph. The name dictionary is a <key, value> mapping, where the key column is the named entity and the value contains various name information of the named entity, including the entity's name variants, abbreviations, confusing names, and nicknames. Specifically, each entity page in Baidu Encyclopedia describes the relevant information focused on the entity. Usually, the title of each page is the most common name of the entity described in the page. Add the title in the entity interface to the key of the naming dictionary, and add the description of the entity to the value. Each alias will have a redirect page, which can point to an entity that exists in Baidu Encyclopedia. The redirect page will point out synonyms, abbreviations, and variants of the referred entity. Add the title of the redirect page to the key and the referred entity to the value.

[0089] 4.3) Perform string matching on the user entity mentions and the constructed name dictionary. If a name in the name dictionary contains an entity mention, all values ​​of that name are added to the candidate entity set, thereby obtaining multiple candidate entities in the customs import and export commodity knowledge graph for the entity mentions;

[0090] 4.4) Calculate the semantic similarity between the entity mention and each candidate entity, and take the candidate entity with the highest similarity as the entity to be finally linked by the entity mention.

[0091] Step 5: Use the knowledge graph embedding method to embed the entities in the knowledge graph into a continuous vector space, extract the vector representation of the entity set identified in step 4, and then use the average pooling method to aggregate the entity set vector representation into a vector to obtain the entity feature vector. The specific steps are as follows:

[0092] 5.1) Use the BERT model to initialize the node representation in the graph to fully represent its semantic information.

[0093] 5.2) Use a graph convolutional network (GCN) to update the vector representation of each node. GCNs use aggregation and composition operations. Aggregation aggregates a node's neighboring nodes, while composition combines the aggregated representation with the node's original representation. The node representation is updated using the aggregated information of its neighbors and the original node information. Through this operation, each node contains both its neighboring node information and the original node information, resulting in an updated vector representation for each node.

[0094] 5.3) Obtain the entity set in the knowledge graph corresponding to the product description text, and extract the vector representation of the entity set identified in step 4.

[0095] 5.4) Then use the average pooling method to aggregate all entity feature vectors into an entity feature representation vector E.

[0096] Step 6: Fuse the text feature vector and the entity feature vector to obtain the final feature vector of the product. Send the final feature vector of the product to the classifier to obtain the predicted result of the tariff code of the product. The specific steps are as follows:

[0097] 6.1) After obtaining the text feature representation T and entity feature representation E, we use the attention mechanism to weight the text feature vector and entity feature vector with the attention vector. The weights are then multiplied and added together. The resulting vector C is the final feature representation of the product description text. The specific calculation formula is as follows:

[0098]

[0099] Where α represents the attention vector and exp() represents the exponential function.

[0100] 6.2) The final feature c of the product description text n It means that a two-layer fully connected neural network is fed into the HS label y of product n using a softmax (a normalized exponential function) classifier. (i) The probability prediction result is as follows:

[0101] c′ n =ELU(W1c n +b1)#(3)

[0102] p(y (i) |D)=softmax(W2c' n +b2)#(4)

[0103] Where ELU is the exponential linear unit, W1∈R d'×d' and W2∈R C×d' is a learnable parameter matrix, b1∈R d' and b2∈R d' is the bias vector. p(y (i) |D) means that for product n, given its product description D, the classification model is on the label y (i) The predicted probability of .

[0104] 6.3) Then use the cross entropy loss function to optimize the entire model:

[0105]

[0106] Among them, N is the number of samples to be classified, q(y (i) ) indicates that the sample has label y (i) The true probability on , which obeys the 0-1 distribution, that is, when the true label of the sample is y (i) When q(y (i) ) is 1, otherwise q(y (i)) is 0.

[0107] Finally, it should be noted that the contents described in the above embodiments are merely an enumeration of the implementation forms of the inventive concept, and the scope of protection of the present invention should not be regarded as limited to the specific forms described in the embodiments, wherein each step may be varied, and any equivalent transformations and improvements based on the technical solution of the present invention should not be excluded from the scope of protection of the present invention.

Claims

1. A method for intelligent classification of import and export commodities integrating knowledge graph, characterized in that: It includes the following steps: Step 1) Construct a customs domain dictionary based on historical customs clearance data; Step 1) The specific steps are as follows: Use the historical customs clearance data as the input source of the domain dictionary. Cut and extract words from the declaration elements of the historical customs clearance data through delimiters, discard words with a length greater than 10 Chinese characters, then count the occurrence frequencies of the above-extracted words, sort the vocabulary according to the frequency size. For each vocabulary with a frequency greater than 5000, manually split it into 2 new vocabularies, and then re-count the occurrence frequencies of the new vocabularies. Thus, a customs clearance data domain dictionary is constructed. The dictionary contains domain keywords and the frequencies of keyword occurrences. Import the dictionary as an extended vocabulary into the word segmentation tool; Step 2) Construct a customs import and export commodity knowledge graph based on the import and export tariff manual and historical customs clearance data; Step 2) The specific steps are as follows: Step 2.1) Construct a knowledge graph according to the customs tariff manual, which specifically includes the following steps: Step 2.1.1) The customs HS code directory has a hierarchical structure. Construct a five-layer HS code ontology structure, corresponding to class, chapter, heading, subheading, and extended code respectively. The HS codes have an inclusion and being-included relationship; Step 2.1.2) For each heading, subheading, and HS code, there is a corresponding commodity name, that is, the HS code uniquely determines a commodity name. Thus, a corresponding name relationship is constructed between the HS code and the commodity name; Step 2.1.3) For the case where there is a subdirectory with the name [Others] in the parent directory, this subdirectory should include all nouns and attributes described in the parent directory and not appearing in other subdirectories outside this item; Step 2.1.4) If [or], [and], [regardless of] appear in the keywords or attributes in the directory, then divide the previous and subsequent commodity name keywords or attribute words into two parts, and construct an inclusion and being-included relationship with the commodity name; Step 2.1.5) If there is a negative description such as [not] or [no] in the commodity name, then construct a non-inclusion relationship between the commodity name and the noun after [not] or [no]; Step 2.1.6) If a numerical range appears in the commodity description, then construct a restrictive relationship between the commodity name and the upper / lower limits; Step 2.2) Construct a knowledge graph according to the historical customs clearance data, which specifically includes the following steps: Step 2.2.1) The commodity historical customs clearance data includes commodity name, declaration elements, and commodity code; for the declaration elements, perform declaration element separation and declaration element alignment to obtain each declaration element and the value corresponding to the declaration element; Step 2.2.2) After completing the declaration element segmentation and alignment tasks, take the aligned declaration specification as the relationship between the commodity and the declaration element, and extract the <commodity, declaration element specification, declaration element> triple; Step 3) Use the word segmentation tool and the customs domain dictionary constructed in Step 1) to segment the user's commodity description, and obtain the text feature vector using the word embedding method; Step 4) Identify the customs domain entities in the user's commodity description, and link the identified customs domain entities to the customs import and export commodity knowledge graph constructed in Step 2) to obtain the entity set; Step 5) Use the knowledge graph embedding method to embed the entities in the knowledge graph into a continuous vector space, extract the vector representation of the entity set identified in step 4), and then use the average pooling method to aggregate the entity set vector representation into a single vector to obtain the entity feature vector; Step 6) Fuse the text feature vector and the entity feature vector to obtain the final feature vector of the product, and send the final feature vector of the product to the classifier to obtain the tariff code prediction result of the product.

2. The method for intelligently classifying imported and exported goods by integrating a knowledge graph as claimed in claim 1, characterized in that: Step 3) The specific steps are: Obtain the product description information input by the user, perform Chinese word segmentation on the product description information, and introduce the customs domain dictionary library constructed in step 1) to identify the part of speech and semantic features of each word; perform a cleaning operation on the product description information based on the part of speech and semantic features; use BERT to perform self-supervised pre-training on an unlabeled corpus, and then continue training on labeled customs data for downstream tasks; BERT can represent word vectors at both the word level and the sentence structure level. After splicing the generated word vectors, a text feature vector T is obtained.

3. The method for intelligently classifying imported and exported goods by integrating a knowledge graph as claimed in claim 1, characterized in that: Step 4) The specific steps are: Named entity recognition is performed on user description texts using the BIO sequence labeling method, where the B label represents the first word of the entity, the I label represents the non-first word of the entity, and the O label represents the non-entity word. The bidirectional long short-term memory conditional random field model BiLSTM-CRF is used to generate a predicted label sequence for the text, and the entity set in the user description text is extracted based on the label sequence; then, based on the string matching technology, multiple candidate entities of each entity in the customs import and export commodity knowledge graph are searched; the semantic similarity between the entity and each candidate entity is calculated, and the candidate entity with the highest similarity is taken as the final linked entity.

4. The method for intelligently classifying imported and exported goods by integrating a knowledge graph according to claim 1, characterized in that: Step 5) The specific steps are: Use the BERT model to initialize the node representation in the knowledge graph, then use the graph convolutional network (GCN) to update the vector representation of each node, extract the vector representation of the entity set identified in step 5), and then use the global average pooling method to average all entity node information into a vector to obtain the entity feature E.

5. The method for intelligently classifying imported and exported goods by integrating a knowledge graph as claimed in claim 1, characterized in that: Step 6) The specific steps are: Using the attention mechanism, the text features T and entity features E are fused to obtain the final features C of the customs commodity description text. The final features C are fed into a two-layer fully connected neural network, and a softmax classifier is used to obtain the probability prediction results of the commodity on the HS label. Finally, the cross-entropy loss function is used to optimize the entire model.

Citation Information

Patent Citations

  • Abnormal information text classification method based on knowledge graph

    CN108595708A

  • Recommendation method and system based on commodity knowledge graph feature learning

    CN111369318A