A method and system for automatic retrieval and classification of HS codes
Product description information is automatically processed through the graph attention network and Textrank algorithm, which solves the problem of difficult classification of HS codes, achieves efficient and accurate automatic retrieval of HS codes, and reduces trade link costs and manual intervention.
Patent Information
- Application Number
- CN202110264452.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-11
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-03-11
AI Technical Summary
Existing technology is difficult to efficiently and accurately realize the automatic retrieval and classification of HS codes, resulting in import and export enterprises and cross-border e-commerce companies requiring a large amount of manual intervention when filling in inspection and customs declaration information, which increases the cost and work burden of trade links.
The graph attention network and Textrank algorithm are used to obtain the product description information to be determined for Chinese word segmentation, identify part-of-speech and semantic features, establish keyword associations, calculate keyword weights, and filter and match through the corpus text graph to automatically determine Relevant HS code.
It achieves automatic understanding and accurate classification of HS codes, reduces manual intervention, improves work efficiency, and reduces trade link costs.
Smart Images

Figure CN112765308B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of import and export goods management in international trade, and in particular to a method and system for automatic retrieval and classification of HS codes. Background Art
[0002] With the rapid growth of cross-border trade, the rapid and accurate classification of customs clearance goods has received more and more attention from relevant departments. The World Customs Organization has developed the Harmonized System (HS) code, which represents and identifies cross-border trade goods in the form of digital codes. Customs commodity HS code classification is the process of finding the most accurate 10-digit HS category code for the commodity to be classified based on the commodity description information. If HS code classification can be achieved efficiently and accurately, it will help import and export companies, cross-border e-commerce companies, etc. to realize automatic retrieval and classification of HS codes when filling in the inspection and customs declaration information of import and export goods, parcels, etc., and reduce the impact of human factors. Summary of the invention
[0003] The present invention aims to provide a method and system for automatic retrieval and classification of HS codes, which is used to realize automatic retrieval and classification of HS codes when filling in inspection and customs declaration information of import and export goods, parcels, etc. for import and export enterprises, cross-border e-commerce, etc., reduce the influence of human factors, and improve the efficiency of HS code classification.
[0004] The embodiment of the present invention is achieved through the following technical solution: a method for automatic retrieval and classification of HS codes, characterized in that it includes the following steps:
[0005] Step 1: Obtain the description information of the product to be determined;
[0006] Step 2: Segment the product description information into Chinese words to identify the part of speech and semantic features of each word;
[0007] Step 3: Perform a cleaning operation on the product description information based on the part of speech and semantic features to obtain keywords;
[0008] Step 4: Use a graph attention network to model the association between the keywords in the product description information;
[0009] Step 5: According to the position, part of speech, semantic features and association relationship of the keyword, combined with the preset weight setting, obtain the first weight of the keyword in the product description information;
[0010] Step 6: construct a corpus text graph of the product description information through the Textrank algorithm, and calculate the second weight of the keyword according to the corpus text graph and the first weight;
[0011] Step 7: Sort the keywords according to the second weights of the keywords to generate a keyword sequence;
[0012] Step 8: Filter the original corpus based on the keyword sequence to obtain domain corpus data related to the product description information;
[0013] Step nine: obtaining one or more preliminary matching texts in the domain corpus data based on the aforementioned association relationship;
[0014] Step 10: Based on the second weight obtained above, calculate the relevance between the preliminary matching text and the keyword sequence;
[0015] Step 11: Based on the calculated relevance, determine the commodity HS code from the HS codes corresponding to the original corpus.
[0016] According to a preferred implementation, the step 4 specifically includes:
[0017] Step 4.1: Calculate the attention score between keywords. The specific formula is:
[0018]
[0019] In the formula, For keyword v i and v j The attention score, a is the weight vector, and The keywords are v i and v j The linear transformation result of ;
[0020] Step 4.2: Use Softmax to normalize the attention score and get:
[0021]
[0022] In the formula, For keyword v i and v j The degree of correlation, For all keywords, keyword v i A set of neighbor keywords, where v i , v j ∈V n , V n is a collection of keywords;
[0023] Step 4.3: loop through steps 4.1 and 4.2 to determine the associations between all the keywords in the product description information.
[0024] According to a preferred implementation, the step five is specifically as follows:
[0025] Step 5.1, according to the priority relationship Q1>Q2>Q3>Q4, the weight ratio of each weight determination index and the adjacent index is obtained, wherein the weight determination index includes: association relationship index Q1, position index Q2, part of speech index Q3 and semantic feature index Q4;
[0026] Step 5.2: According to the weight ratio obtained in step 5.1, score the importance of each keyword, and sort the keywords according to the score to determine the first weight of each keyword. The formula is:
[0027]
[0028] In the formula, w(v i ) is the keyword v i The first weight of For keyword v i The weight determines the score of indicator Q1. For keyword v i The weight determines the score of indicator Q2. For keyword v i The weight determines the score of indicator Q3. For keyword v i The weight determines the score of indicator Q4.
[0029] According to a preferred implementation, the step six specifically includes:
[0030] Step 6.1: Calculate the weight of the keywords in the product description information using the Textrank algorithm. The formula is:
[0031]
[0032] Where d is the damping coefficient, In(v i ) is the keyword v in the corpus text graph i The set of all keywords, Out(v j ) is the keyword v in the corpus text graph j Points to the set of all keywords, W ji For keyword v j To keyword v i The weight of the edge;
[0033] Step 6.2: Calculate the second weight of the keyword according to the corpus text graph and the first weight according to the following formula, which is expressed as:
[0034]
[0035] According to a preferred embodiment, the filtering operation in step eight is implemented using a classifier.
[0036] According to a preferred embodiment, the step ten specifically includes:
[0037] Step 10.1, calculate the relevance of each keyword, the formula is:
[0038] S vi =M vi / N vi (6)
[0039] Where M vi For keyword v i The total number of times the keyword appears in the sequence, N vi For keyword v i the total number of retrieved in the said preliminary matching text;
[0040] Step 10.2: Calculate the correlation between the preliminary matching text and the keyword sequence. The formula is:
[0041]
[0042] In the formula, it is assumed that there are N keywords in total, and the relevance of each keyword is S1, S2, S3, S vi ,S vj ,S n ,The second weight of each keyword corresponds to W1(1), W1(2), W1(3), W1(vi), W1(vj), W1(n), where S m and W1(m) respectively represent the relevance and the second weight of the mth keyword in the keyword sequence.
[0043] According to a preferred embodiment, the step ten further comprises:
[0044] Step 10.3: To ensure that the relevance S0 between the preliminary matching text and the keyword sequence is limited to the interval [0,1], the formula is expressed as:
[0045]
[0046] Wherein, max(W1(m)) represents the maximum value of the second weight of the keyword in the keyword series.
[0047] The present invention also provides a system for automatic retrieval and classification of HS codes using the method for automatic retrieval and classification of HS codes as described above, comprising: an application server and a database server, wherein the application server comprises:
[0048] A data collection module is used to obtain the description information of the product to be determined;
[0049] A word segmentation and part-of-speech recognition module, connected to the data acquisition module, for receiving the product description information, performing Chinese word segmentation on the product description information, and identifying the part of speech and semantic features of each word;
[0050] A preprocessing module connected to the word segmentation and part-of-speech recognition module, configured to receive the parts-of-speech and semantic features output by the word segmentation and part-of-speech recognition module, and perform a cleaning operation on the product description information based on the parts-of-speech and semantic features to obtain keywords;
[0051] A graph attention network module, connected to the preprocessing module, for receiving the keywords output by the preprocessing module, and using a graph attention network to model the association relationship between the keywords in the product description information;
[0052] A first weight calculation module is connected to the word segmentation and part-of-speech recognition module and the graph attention network module respectively, and is used to receive the position, part-of-speech and semantic features of the keywords output by the word segmentation and part-of-speech recognition module, and receive the association relationship between the keywords output by the graph attention network module, and obtain the first weight of the keywords in the product description information according to the position, part-of-speech, semantic features and association relationship of the keywords in combination with the preset weight setting;
[0053] a second weight calculation module, connected to the first weight calculation module, for constructing a corpus text graph of the product description information through a Textrank algorithm, and calculating a second weight of the keyword according to the corpus text graph and the first weight of the keyword output by the first weight calculation module;
[0054] a first sorting module, connected to the second weight calculation module, for receiving the second weight output by the second weight calculation module, sorting the keywords according to the second weights of the keywords, and generating a keyword sequence;
[0055] A filtering module, connected to the original corpus and the first sorting module in the database server respectively, for performing a filtering operation on the original corpus according to the keyword sequence output by the first sorting module to obtain domain corpus data in a domain related to the product description information;
[0056] A query module, connected to the graph attention network module and the filtering module respectively, for receiving the association relationship of the keywords output by the graph attention network module and the domain corpus data output by the filtering module, and querying and obtaining one or more preliminary matching texts in the domain corpus data;
[0057] a relevance calculation module, connected to the second weight calculation module and the query module respectively, for receiving the preliminary matching text output by the second weight estimation query module and output by the second weight calculation module, and calculating the relevance between the preliminary matching text and the keyword sequence;
[0058] The matching module is connected to the original corpus and the relevance calculation module respectively, and is used to match the commodity HS code in the original corpus according to the relevance calculation result between the preliminary matching text output by the relevance calculation module and the keyword sequence.
[0059] According to a preferred embodiment, the filtering module adopts a classifier.
[0060] According to a preferred embodiment, the first weight calculation module includes:
[0061] A weight ratio calculation module is used to obtain the weight ratio of each weight determination index and adjacent index according to the priority order relationship;
[0062] Parameter definition module, used to customize weight determination indicators and priority relationships;
[0063] A scoring module, connected to the weight ratio calculation module, receives the weight ratio output by the weight ratio calculation module, and scores the importance of each of the keywords;
[0064] The second sorting module is connected to the scoring module, and is used to receive the scores output by the scoring module, sort the keywords according to the scores, and determine the first weight of each keyword.
[0065] The technical solution of the embodiment of the present invention has at least the following advantages and beneficial effects: (1) Through the graph attention network, the system, device, etc. can automatically understand the commodity description information, and then determine the HS code with the highest relevance, which solves the problem of difficult HS code classification for current import and export companies, cross-border e-commerce, etc., reduces the cost of trade links, and improves work efficiency; (2) The Textrank algorithm technology is used to analyze and refine the effective information in the commodity description information, which solves the problem of manual entry of commodity declaration elements. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 A flowchart of the steps of the method for automatic retrieval and classification of HS codes provided in Example 1 of the present invention;
[0067] Figure 2 This is a structural block diagram of a system for automatic retrieval and classification of HS codes provided in Example 2 of the present invention. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0069] Example 1
[0070] See also Figure 1 As shown, this embodiment provides a method for automatically retrieving and classifying HS codes, comprising the following steps:
[0071] Step 1. Obtain the description information of the product to be determined; for example, the description information of the product provided by the customer is as follows: a gearbox oil cooler specially used for brand cars with more than 4 gears, which is a non-universal component without a number or brand, and is not a complete set of loose parts; its working principle is to cool the oil in the gearbox through the circulating water in the water tank; the torque is 250NM, and the specific model is 216WC50X0AS216WC50X0A.
[0072] Based on the product description information obtained above, we can roughly know that the product is related to cars and transmission oil coolers. However, if we search for transmission oil coolers on the HS code search website: https: / / cn-hsc ode.com / , the number of hits totals more than 100,000. Manual query is extremely labor-intensive and the accuracy is low. Therefore, it is necessary to further refine the product description information.
[0073] Step 2: Perform Chinese word segmentation on the product description information to identify the part of speech and semantic features of each word; by performing Chinese word segmentation on the above product description information, the results are as follows: a transmission oil cooler | dedicated to | brand cars with more than 4 gears |, is | an unnumbered |, unbranded | non-universal component |, and | not a complete set of parts |; its | working principle is to cool the oil in the transmission through the circulating water in the water tank |; the torque is | 250NM |, and the specific model is | 216WC50X0AS216WC50X0A.
[0074] Furthermore, the part of speech and semantic features of each word are identified, for example, the part of speech is noun, verb, adjective, etc.; the semantic features are automobile parts, working principles, etc., which will not be repeated here.
[0075] Step 3: Perform a cleaning operation on the product description information based on the part of speech and semantic features to obtain keywords;
[0076] Useless words in the product description will interfere with the HS code query, so it is necessary to clean the useless information in the product description. The keywords of the product description that are finally retained are, 4 gears or more | dedicated to brand cars | transmission oil cooler | no number | no brand | non-universal parts | not a complete set of parts | water tank | circulating water | transmission | oil cooling | 250NM | 216WC50X0AS 216WC50X0A.
[0077] It is understandable that the remaining keywords after the cleaning operation of the product description information will affect the final HS code query results. However, since the declaration elements of the HS code have a sequential relationship stipulated by the field rules, and according to the declaration elements displayed on the HS code query website, the first word is the brand type, and the sequence relationship of the keywords extracted from the product description information is obviously different from the sequence relationship of the declaration elements. If the sequence relationship of the HS code declaration elements is not matched with the correct sequence relationship, it will undoubtedly increase the difficulty of matching the HS code; therefore, it is necessary to link these keywords and capture their association relationship in order to correctly classify them.
[0078] Step 4: Use a graph attention network to model the association between the keywords in the product description information;
[0079] Specifically, it includes step 4.1, calculating the attention score between keywords, and the specific formula is expressed as:
[0080]
[0081] In formula (1), For keyword v i and v j The attention score, a is the weight vector, and The keywords are v i and v j The linear transformation result of ;
[0082] Step 4.2: Use Softmax to normalize the attention score and get:
[0083]
[0084] In formula (2), For keyword v i and v j The degree of correlation, For all keywords, keyword v i A set of neighbor keywords, where v i , v j ∈V n , V n is a set of keywords, namely V n For: [4 gears or more|Special for brand cars|Transmission oil cooler|No number|No brand|Non-universal parts|Not a complete set of parts|Water tank|Circulating water|Transmission|Oil cooling|250NM|216WC50X0AS216WC50X0A];
[0085] Step 4.3: loop through steps 4.1 and 4.2 to determine the associations between all the keywords in the product description information.
[0086] This embodiment changes the commonly used statistical method and instead takes advantage of the graph attention network mechanism to adaptively learn the degree of association between keywords as edge weights, and then aggregates the neighbor keywords of the keywords, so that the extracted scattered keywords are associated with each other, providing a basis for the next step.
[0087] Step 5: According to the position, part of speech, semantic features and association relationship of the keyword, combined with the preset weight setting, obtain the first weight of the keyword in the product description information;
[0088] Specifically, it includes step 5.1, according to the priority relationship Q1>Q2>Q3>Q4, the weight ratio of each weight determination index and the adjacent index is obtained, wherein the weight determination index includes: the association relationship index Q1, the position index Q2, the part of speech index Q3 and the semantic feature index Q4, for example, Q1 is recorded as 4 points, Q2 is recorded as 3 points, Q3 is recorded as 2 points, and Q4 is recorded as 1 point; thus, the weight ratio is 4:3:2:1;
[0089] Step 5.2: According to the weight ratio obtained in step 5.1, score the importance of each keyword, and sort the keywords according to the score to determine the first weight of each keyword. The formula is:
[0090]
[0091] In formula (3), w(v i ) is the keyword v i The first weight of For keyword v i The weight determines the score of indicator Q1. For keyword v i The weight determines the score of indicator Q2. For keyword v i The weight determines the score of indicator Q3. For keyword v i The weight determines the score of indicator Q4.
[0092] Here, the gearbox oil cooler is taken as an example. The neighbor keywords of the gearbox oil cooler include [sedan|gearbox|oil cooler|250NM], so the association index Q1 scores [3, 4]; the gearbox oil cooler is in the third place, so the position index Q2 scores [2, 3]; the part of speech is a noun, so the part of speech index Q3 scores 2; the semantic feature indicates that it is related to gearbox parts, and the other keywords all meet this feature, so the semantic feature index Q4 scores 1; the total score is compromised to 9 points; according to the above algorithm logic, the first weight of the remaining keywords is calculated.
[0093] Step 6: construct a corpus text graph of the product description information through the Textrank algorithm, and calculate the second weight of the keyword according to the corpus text graph and the first weight;
[0094] Specifically, step 6.1 is to calculate the weight of the keywords in the product description information by using the Textrank algorithm, and the formula is expressed as:
[0095]
[0096] In formula (4), d is the damping coefficient, In(v i ) is the keyword v in the corpus text graph i The set of all keywords, Out(v j ) is the keyword v in the corpus text graph j Points to the set of all keywords, W ji For keyword v j To keyword v i The weight of the edge;
[0097] Step 6.2: Calculate the second weight of the keyword according to the corpus text graph and the first weight according to the following formula, which is expressed as:
[0098]
[0099] Step 7: Sort the keywords according to the second weights of the keywords to generate a keyword sequence;
[0100] Finally, the keyword set V is re-ranked according to the second weight n For: [Transmission oil cooler|Specially for branded cars|Cools the oil in the transmission through the circulating water in the water tank|More than 4 gears|Not a complete set of parts|Not a universal part|No number|No brand|250NM|216WC50X0AS216WC50X0A].
[0101] Step 8: Filter the original corpus based on the keyword sequence to obtain domain corpus data related to the product description information. In this embodiment, the original corpus is filtered based on the keyword "gearbox parts" obtained above, and the details are not repeated here.
[0102] Step nine: based on the aforementioned association relationship, obtain one or more preliminary matching texts in the domain corpus data.
[0103] Step 10: Based on the second weight obtained above, calculate the relevance between the preliminary matching text and the keyword sequence;
[0104] Specifically, step 10.1 is to calculate the relevance of each keyword, and the formula is expressed as:
[0105] S vi =M vi / N vi (6)
[0106] Where M vi For keyword v i The total number of times the keyword appears in the sequence, N vi For keyword v i The total number of matches found in the initial text.
[0107] Step 10.2: Calculate the correlation between the preliminary matching text and the keyword sequence. The formula is:
[0108]
[0109] In formula (7), it is assumed that there are N keywords in total, and the relevance of each keyword is S1, S2, S3, S vi ,S vj ,S n ,The second weight of each keyword corresponds to W1(1), W1(2), W1(3), W1(vi), W1(vj), W1(n), where S m and W1(m) respectively represent the relevance and the second weight of the mth keyword in the keyword sequence.
[0110] Further including:
[0111] Step 10.3: To ensure that the relevance S0 between the preliminary matching text and the keyword sequence is limited to the interval [0,1], the formula is expressed as:
[0112]
[0113] In formula (8), max(W1(m)) represents the maximum value of the second weight of the keyword in the keyword series.
[0114] Step 11: Based on the calculated relevance, determine the HS code of the product from the HS code corresponding to the original corpus, and finally obtain the HS code classification result of 8708408199, corresponding to the description: parts of automatic transmissions for other passenger cars.
[0115] In summary, compared with the prior art, the method for automatic retrieval and classification of HS codes provided in this embodiment has at least the following beneficial effects: (1) Through the graph attention network, the system, device, etc. can automatically understand the commodity description information, and then determine the HS code with the highest relevance, which solves the current problem of HS code classification difficulties for import and export companies, cross-border e-commerce, etc., reduces the cost of trade links, and improves work efficiency; (2) The Textrank algorithm technology is used to analyze and refine the effective information in the commodity description information, which solves the problem of manual entry of commodity declaration elements.
[0116] Example 2
[0117] See also Figure 2 As shown, different from Example 1, this embodiment further provides a system for automatic retrieval and classification of HS codes, including: an application server and a database server, and the application server includes:
[0118] A data collection module is used to obtain the description information of the product to be determined;
[0119] A word segmentation and part-of-speech recognition module, connected to the data acquisition module, for receiving the product description information, performing Chinese word segmentation on the product description information, and identifying the part of speech and semantic features of each word;
[0120] A preprocessing module connected to the word segmentation and part-of-speech recognition module, configured to receive the parts-of-speech and semantic features output by the word segmentation and part-of-speech recognition module, and perform a cleaning operation on the product description information based on the parts-of-speech and semantic features to obtain keywords;
[0121] A graph attention network module, connected to the preprocessing module, for receiving the keywords output by the preprocessing module, and using a graph attention network to model the association relationship between the keywords in the product description information;
[0122] A first weight calculation module is connected to the word segmentation and part-of-speech recognition module and the graph attention network module respectively, and is used to receive the position, part-of-speech and semantic features of the keywords output by the word segmentation and part-of-speech recognition module, and receive the association relationship between the keywords output by the graph attention network module, and obtain the first weight of the keywords in the product description information according to the position, part-of-speech, semantic features and association relationship of the keywords in combination with the preset weight setting;
[0123] a second weight calculation module, connected to the first weight calculation module, for constructing a corpus text graph of the product description information through a Textrank algorithm, and calculating a second weight of the keyword according to the corpus text graph and the first weight of the keyword output by the first weight calculation module;
[0124] a first sorting module, connected to the second weight calculation module, for receiving the second weight output by the second weight calculation module, sorting the keywords according to the second weights of the keywords, and generating a keyword sequence;
[0125] a filtering module, connected to the original corpus and the first sorting module respectively, for performing a filtering operation on the original corpus according to the keyword sequence output by the first sorting module, and obtaining domain corpus data in a domain related to the product description information;
[0126] A query module, connected to the graph attention network module and the filtering module respectively, for receiving the association relationship of the keywords output by the graph attention network module and the domain corpus data output by the filtering module, and querying and obtaining one or more preliminary matching texts in the domain corpus data;
[0127] a relevance calculation module, connected to the second weight calculation module and the query module respectively, for receiving the preliminary matching text output by the second weight estimation query module and output by the second weight calculation module, and calculating the relevance between the preliminary matching text and the keyword sequence;
[0128] A matching module, connected to the original corpus and the relevance calculation module respectively, for matching the commodity HS codes in the original corpus according to the relevance calculation result between the preliminary matching text output by the relevance calculation module and the keyword sequence;
[0129] Central processing unit, used to control the working status of each module;
[0130] A storage module is used to store data generated during the operation of each module;
[0131] The communication module is used for communication between the central processing unit and the database server.
[0132] Furthermore, the database server includes the original corpus and the HS code library.
[0133] Furthermore, in this embodiment, the filtering module adopts a classifier.
[0134] Furthermore, in this embodiment, the first weight calculation module includes:
[0135] A weight ratio calculation module is used to obtain the weight ratio of each weight determination index and adjacent index according to the priority order relationship;
[0136] Parameter definition module, used to customize weight determination indicators and priority relationships;
[0137] A scoring module, connected to the weight ratio calculation module, receives the weight ratio output by the weight ratio calculation module, and scores the importance of each of the keywords;
[0138] The second sorting module is connected to the scoring module, and is used to receive the scores output by the scoring module, sort the keywords according to the scores, and determine the first weight of each keyword.
[0139] Furthermore, the application server also includes a data display module connected to the central processor, and the data display module is used to receive data sent by the central processor and display it on a display screen.
[0140] Furthermore, the application server also includes a print output module connected to the central processor, and the print output module is used to connect to a printer to output corresponding data that needs to be printed.
[0141] In summary, compared with the prior art, the system for automatic retrieval and classification of HS codes provided in this embodiment has at least the following beneficial effects: (1) Through the graph attention network, the system, device, etc. can automatically understand the commodity description information, and then determine the HS code with the highest relevance, which solves the current problem of HS code classification difficulties for import and export companies, cross-border e-commerce, etc., reduces the cost of trade links, and improves work efficiency; (2) The Textrank algorithm technology is used to analyze and refine the effective information in the commodity description information, which solves the problem of manual entry of commodity declaration elements.
[0142] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for automatic retrieval and classification of HS codes, characterized in that: The steps include: Step 1: Obtain the description information of the product to be determined; Step 2: Segment the product description information into Chinese words to identify the part of speech and semantic features of each word; Step 3: Perform a cleaning operation on the product description information based on the part of speech and semantic features to obtain keywords; Step 4: Use a graph attention network to model the association between the keywords in the product description information; Step 5: According to the position, part of speech, semantic features and association relationship of the keyword, combined with the preset weight setting, obtain the first weight of the keyword in the product description information; Step 6: construct a corpus text graph of the product description information through the Textrank algorithm, and calculate the second weight of the keyword according to the corpus text graph and the first weight; Step 7: Sort the keywords according to the second weights of the keywords to generate a keyword sequence; Step 8: Filter the original corpus based on the keyword sequence to obtain domain corpus data related to the product description information; Step nine: obtaining one or more preliminary matching texts in the domain corpus data based on the aforementioned association relationship; Step 10: Based on the second weight obtained above, calculate the relevance between the preliminary matching text and the keyword sequence; Step 11: Based on the calculated relevance, determine the HS code of the product from the HS code corresponding to the original corpus; The step 4 specifically includes: Step 4.1: Calculate the attention score between keywords. The specific formula is: In the formula, For keyword v i and v j The attention score, a is the weight vector, and The keywords are v i and v j The linear transformation result of ; Step 4.2: Use Softmax to normalize the attention score and get: In the formula, For keyword v i and v j The degree of correlation, For all keywords, keyword v i The set of neighbor keywords, where υ i , j ∈V n , V n is a collection of keywords; Step 4.3, looping through steps 4.1 and 4.2, determining the association relationship between all the keywords in the product description information; The step five is specifically as follows: Step 5.1, according to the priority relationship Q1>Q2>Q3>Q4, the weight ratio of each weight determination index and the adjacent index is obtained, wherein the weight determination index includes: association relationship index Q1, position index Q2, part of speech index Q3 and semantic feature index Q4; Step 5.2: According to the weight ratio obtained in step 5.1, score the importance of each keyword, and sort the keywords according to the score to determine the first weight of each keyword. The formula is: In the formula, w(υ i ) is the keyword v i The first weight of For keyword v i The weight determines the score of indicator Q1. For keyword v i The weight determines the score of indicator Q2. For keyword v i The weight determines the score of indicator Q3. For keyword v i The weight determines the score of indicator Q4; The step six specifically includes: Step 6.1: Calculate the weight of the keywords in the product description information using the Textrank algorithm. The formula is: Where d is the damping coefficient, In(v i ) is the keyword v in the corpus text graph i The set of all keywords, Out(v j ) is the keyword v in the corpus text graph j Points to the set of all keywords, W ji For keyword v j To keyword v i The weight of the edge; Step 6.2: Calculate the second weight of the keyword according to the corpus text graph and the first weight according to the following formula, which is expressed as:
2. The method for automatic retrieval and classification of HS codes according to claim 1, characterized in that: The filtering operation in step eight is implemented using a classifier.
3. The method for automatic retrieval and classification of HS codes according to claim 2, characterized in that: The step ten specifically includes: Step 10.1, calculate the relevance of each keyword, the formula is: S υi =M υi / N υi (6) Where M vi For keyword v i The total number of times the keyword appears in the sequence, N vi For keyword v i the total number of retrieved in the said preliminary matching text; Step 10.2: Calculate the correlation between the preliminary matching text and the keyword sequence. The formula is: In the formula, it is assumed that there are N keywords in total, and the relevance of each keyword is S1, S2, S3, S vi ,S vj ,S n ,The second weight of each keyword corresponds to W1(1), W1(2), W1(3), W1(vi), W1(vj), W1(n), where S m and W1(m) respectively represent the relevance and the second weight of the mth keyword in the keyword sequence.
4. The method for automatic retrieval and classification of HS codes according to claim 3, characterized in that: The step ten further comprises: Step 10.3: To ensure that the relevance S0 between the preliminary matching text and the keyword sequence is limited to the interval [0,1], the formula is expressed as: Wherein, max(W1(m)) represents the maximum value of the second weight of the keyword in the keyword series.
5. A system for automatic retrieval and classification of HS codes using the method for automatic retrieval and classification of HS codes as described in any one of claims 1 to 4, characterized in that: include: Application server and database server, where the application server includes: A data collection module is used to obtain the description information of the product to be determined; A word segmentation and part-of-speech recognition module, connected to the data acquisition module, for receiving the product description information, performing Chinese word segmentation on the product description information, and identifying the part of speech and semantic features of each word; A preprocessing module connected to the word segmentation and part-of-speech recognition module, configured to receive the parts-of-speech and semantic features output by the word segmentation and part-of-speech recognition module, and perform a cleaning operation on the product description information based on the parts-of-speech and semantic features to obtain keywords; A graph attention network module, connected to the preprocessing module, for receiving the keywords output by the preprocessing module, and using a graph attention network to model the association relationship between the keywords in the product description information; A first weight calculation module is connected to the word segmentation and part-of-speech recognition module and the graph attention network module respectively, and is used to receive the position, part-of-speech and semantic features of the keywords output by the word segmentation and part-of-speech recognition module, and receive the association relationship between the keywords output by the graph attention network module, and obtain the first weight of the keywords in the product description information according to the position, part-of-speech, semantic features and association relationship of the keywords in combination with the preset weight setting; a second weight calculation module, connected to the first weight calculation module, for constructing a corpus text graph of the product description information through a Textrank algorithm, and calculating a second weight of the keyword according to the corpus text graph and the first weight of the keyword output by the first weight calculation module; a first sorting module, connected to the second weight calculation module, for receiving the second weight output by the second weight calculation module, sorting the keywords according to the second weights of the keywords, and generating a keyword sequence; a filtering module, connected to the original corpus in the database server and the first sorting module respectively, for performing a filtering operation on the original corpus according to the keyword sequence output by the first sorting module to obtain domain corpus data in a domain related to the product description information; A query module, connected to the graph attention network module and the filtering module respectively, for receiving the association relationship of the keywords output by the graph attention network module and the domain corpus data output by the filtering module, and querying and obtaining one or more preliminary matching texts in the domain corpus data; a relevance calculation module, connected to the second weight calculation module and the query module respectively, for receiving the preliminary matching text output by the second weight estimation query module and output by the second weight calculation module, and calculating the relevance between the preliminary matching text and the keyword sequence; The matching module is connected to the original corpus and the relevance calculation module respectively, and is used to match the commodity HS code in the original corpus according to the relevance calculation result between the preliminary matching text output by the relevance calculation module and the keyword sequence.
6. The system for automatic retrieval and classification of HS codes according to claim 5, characterized in that: The filtering module adopts a classifier.
7. The system for automatic retrieval and classification of HS codes according to claim 6, characterized in that: The first weight calculation module includes: A weight ratio calculation module is used to obtain the weight ratio of each weight determination index and adjacent index according to the priority order relationship; Parameter definition module, used to customize weight determination indicators and priority relationships; A scoring module, connected to the weight ratio calculation module, receives the weight ratio output by the weight ratio calculation module, and scores the importance of each of the keywords; The second sorting module is connected to the scoring module, and is used to receive the scores output by the scoring module, sort the keywords according to the scores, and determine the first weight of each keyword.
