Commodity tax rule code identification method and device
By using large language models and tariff knowledge graphs to automatically identify commodity tariff codes, the problem of time-consuming and labor-intensive manual identification has been solved, achieving efficient and accurate tariff code identification and improving trade compliance and customs clearance efficiency.
Patent Information
- Application Number
- CN202410775326.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-24
AI Technical Summary
In the existing technology, the identification of commodity tariff codes relies on manual interpretation, which is time-consuming, labor-intensive, and prone to misjudgment, leading to errors in tariff calculation and trade compliance risks, making it difficult to meet the high-efficiency and accurate requirements of modern trade.
By employing a pre-trained Large Language Model (LLM) and a tariff knowledge graph, the system automatically identifies commodity attribute information and determines the target tariff code from the tariff knowledge graph. Automated tariff code recognition is achieved through logical reasoning and graph matching.
This significantly reduces labor costs, shortens processing time, improves the accuracy of tariff code identification, reduces tariff errors, and enhances customs clearance efficiency and trade compliance.
Smart Images

Figure CN118691371A
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of data processing technology, and in particular, to a method and device for identifying commodity tariff codes. Background Art
[0002] In the globalized trade market, cross-border transactions of goods place extremely high demands on the accurate identification of commodity classification and tariff codes. This is not only related to the accurate calculation of tariffs, but also affects the efficiency and compliance of trade. In related technologies, the tariff codes of goods rely on professional customs personnel to manually interpret commodity information, including its name, ingredients, uses, etc., and classify them according to the customs tariff manual. This process not only consumes a lot of time and energy, but is also limited by personal knowledge and experience, and is prone to misjudgment and omission, resulting in tariff calculation errors or trade compliance risks. Summary of the invention
[0003] In view of this, one or more embodiments of this specification provide the following technical solutions:
[0004] According to a first aspect of one or more embodiments of this specification, a method for identifying a commodity tariff code is proposed, comprising:
[0005] Acquire product information of a target product, and determine a target product type to which the target product belongs from a preset product classification list based on the product information;
[0006] Acquire an attribute list corresponding to the target product type, and use the attribute list as a knowledge base by the LLM model to perform logical reasoning on the product information, so as to identify attribute information corresponding to the target product from the product information; wherein the attribute list includes attributes of products belonging to the product type;
[0007] Obtaining a tariff knowledge graph related to the tariff code, and determining a subgraph matching the attribute information from the tariff knowledge graph; wherein the tariff knowledge graph includes a node for representing at least one coded value in the tariff code and an edge for representing a combination relationship between coded values;
[0008] The coding values represented by each node contained in the subgraph are obtained, and based on the coding values of each node contained in the subgraph, the coding values represented by the nodes are spliced according to the combination relationship represented by each edge contained in the subgraph to obtain the target tariff code corresponding to the target commodity.
[0009] According to a second aspect of one or more embodiments of this specification, a device for identifying a commodity tariff code is provided, comprising:
[0010] A commodity classification module, used to obtain commodity information of a target commodity, and determine a target commodity type to which the target commodity belongs from a preset commodity classification list based on the commodity information;
[0011] An attribute extraction module, used to obtain an attribute list corresponding to the target product type, and use the attribute list as a knowledge base by the LLM model to perform logical reasoning on the product information, so as to identify attribute information corresponding to the target product from the product information; wherein the attribute list includes attributes possessed by products belonging to the product type;
[0012] A graph matching module, used to obtain a tariff knowledge graph related to the tariff code, and determine a subgraph matching the attribute information from the tariff knowledge graph; wherein the tariff knowledge graph includes a node for representing at least one coded value in the tariff code and an edge for representing a combination relationship between coded values;
[0013] The coding output module is used to obtain the coding values represented by each node contained in the subgraph, and based on the coding values of each node contained in the subgraph, the coding values represented by the nodes are spliced according to the combination relationship represented by each edge contained in the subgraph to obtain the target tariff code corresponding to the target commodity.
[0014] According to a third aspect of one or more embodiments of this specification, an electronic device is proposed, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the steps of the method described in the first aspect by running the executable instructions.
[0015] According to a fourth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
[0016] According to a fifth aspect of one or more embodiments of the present specification, a computer program product is proposed, comprising a computer program / instruction, which implements the steps of the method described in the first aspect when executed by a processor.
[0017] It can be seen from the above embodiments that this specification uses a pre-trained LLM model related to the tariff code to identify attribute information from the commodity information, and then obtains the tariff code of the target commodity from the pre-acquired tariff knowledge graph related to the tariff code based on the identified attribute information. This can not only greatly reduce the manpower cost required to identify the commodity tariff code and greatly shorten the processing time, but also improve the recognition accuracy of the tariff code, reduce tariff problems caused by recognition errors, and improve customs clearance efficiency, trade compliance and market response speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a schematic diagram of the architecture of a commodity tariff code identification service system provided by an exemplary embodiment.
[0019] Figure 2 The present invention is a flowchart of a method for identifying a commodity tariff code provided by an exemplary embodiment.
[0020] Figure 3 The present invention is a flowchart of another method for identifying commodity tariff codes provided by an exemplary embodiment.
[0021] Figure 4 It is a structural schematic diagram of a device provided by an exemplary embodiment.
[0022] Figure 5 The present invention is a block diagram of a device for identifying commodity tariff codes provided by an exemplary embodiment. DETAILED DESCRIPTION
[0023] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0024] In the globalized trade market, cross-border transactions of goods place extremely high demands on the classification of goods and the accurate identification of tariff codes, which can also be called Harmonised System Codes (HSC). This is not only related to the accurate calculation of tariffs, but also affects the efficiency and compliance of trade. Traditionally, determining the tariff codes of goods relies on professional customs officers to manually interpret the product information, including its name, ingredients, uses, etc., and classify them according to the customs tariff manual. This process not only consumes a lot of time and energy, but is also limited by personal knowledge and experience, and is prone to misjudgment and omission, resulting in tariff calculation errors or trade compliance risks.
[0025] In the implementation of global trade, customs tariff codes are usually very complex, containing thousands of tax numbers, each of which corresponds to different commodity categories and tariff rates. With the increasing variety of commodities and the acceleration of their replacement, the efficiency and accuracy of manual classification are far from meeting the needs of modern trade. In addition, due to the differences in tariffs between different countries and regions, international companies must take into account the specific regulations of the target market when classifying commodities, which makes the process even more complicated and cumbersome.
[0026] In view of this, this specification proposes a method for identifying commodity tariff codes. Advanced artificial intelligence technology and machine learning models are used to automate the commodity tariff code identification process, and a large language model (LLM) related to the tariff code and a tariff knowledge graph related to the tariff code are pre-trained. The LLM model identifies the attribute information of the target commodity from the commodity information; then a subgraph matching the attribute information is determined from the tariff knowledge graph, so as to determine the target tariff code corresponding to the target commodity based on the nodes and edges contained in the subgraph.
[0027] During implementation, the commodity information of the target commodity is obtained, and based on the commodity information, the commodity type corresponding to the target commodity is determined from a preset commodity classification list; an attribute list corresponding to the commodity type is obtained, and the LLM model uses the attribute list as a knowledge base to perform logical reasoning on the commodity information, so as to identify the attribute information corresponding to the target commodity from the commodity information; wherein the attribute list includes the attributes of commodities belonging to the commodity type; a tariff knowledge graph related to the tariff code is obtained, and a subgraph matching the attribute information is determined from the tariff knowledge graph; wherein the nodes of the tariff knowledge graph are used to represent at least one coded value in the tariff code, and the edges of the tariff knowledge graph are used to represent the combination relationship between the coded values; the coded values represented by each node contained in the subgraph are obtained, and based on the coded values of each node contained in the subgraph, the coded values represented by the nodes are spliced according to the combination relationship represented by each edge contained in the subgraph, so as to obtain the target tariff code corresponding to the target commodity.
[0028] In the above technical solution, by using a pre-trained LLM model related to the tariff code to identify attribute information from the commodity information, and then obtaining the tariff code of the target commodity from the pre-acquired tariff knowledge graph related to the tariff code based on the identified attribute information, it can not only greatly reduce the manpower cost required to identify the commodity tariff code and greatly shorten the processing time, but also improve the recognition accuracy of the tariff code, reduce tariff problems caused by recognition errors, and improve customs clearance efficiency, trade compliance and market response speed.
[0029] Figure 1 FIG. 1 is a schematic diagram of the architecture of a commodity tariff code identification service system provided by an exemplary embodiment. Figure 1 As shown, the system may include a server 11, a network 12, and several electronic devices, such as a PC (Personal Computer) 13, a mobile phone 14, and the like.
[0030] The server 11 may be a physical server including an independent host, or the server 11 may be a virtual server carried by a host cluster. During operation, the server 11 may run a server-side program of a certain application to implement the relevant functions of the application. For example, when the server 11 runs a program for the identification service of commodity tariff codes, it may be implemented as a corresponding commodity tariff code identification service platform.
[0031] PC13 and mobile phone 14 are only some types of electronic devices that users can use. In fact, users can obviously also use electronic devices such as the following types: tablet devices, laptops, PDAs (Personal Digital Assistants), wearable devices (such as smart glasses, smart watches, etc.), etc., and one or more embodiments of this specification do not limit this. During operation, the electronic device can run a program on the client side of a certain application to implement the relevant functions of the application. For example, when the electronic device runs a program for the identification service of the commodity tariff code, it can be implemented as a client of the identification service of the commodity tariff code. Among them, the application program of the client of the identification service of the above-mentioned commodity tariff code can be started and run on the electronic device. The program on the client side can be a native application installed on the electronic device, or the program on the client side can be a small program, a quick application or other similar forms. Of course, when using web page technologies such as HTML5 or similar, the relevant functions can be implemented through the page displayed by the browser. The browser here can be an independent browser application or a browser module embedded in certain applications.
[0032] As for the network 12 for interaction between electronic devices such as PC 13 and mobile phone 14 and server 11, it is possible to select a wired or wireless network to achieve communication based on the communication mode supported by the corresponding electronic device, and this specification does not limit this. For example, PC 13 can support both wired and wireless communication, so it can use a wired or wireless network to achieve communication as needed, while mobile phone 14 usually only supports wireless communication, so it can use a wireless network to achieve communication.
[0033] Please see Figure 2 , Figure 2 FIG. 1 is a flowchart of a method for identifying a commodity tariff code provided by an exemplary embodiment. Figure 2 As shown, the method for identifying commodity tariff codes may include the following steps.
[0034] In step S201, the commodity information of the target commodity is obtained, and based on the commodity information, the target commodity type to which the target commodity belongs is determined from a preset commodity classification list.
[0035] Obtain product information of the target product to be identified, where the product information may include at least one of the following: information used to indicate the physical characteristics of the product, such as material, size, weight, shape, etc.; information used to indicate the function and use of the product, such as the design, efficacy, use, etc. of the product; information used to indicate the ingredients and materials contained in the product; information used to indicate the manufacturing process and technology of the product; and other information that may affect the identification of the tariff code, such as information provided based on the requirements of international conventions and agreements.
[0036] Based on the commodity information of the target commodity, the target commodity can be preliminarily classified, and the target commodity type to which the target commodity belongs can be determined from the preset commodity classification list. The commodity classification list may include several commodity types, which may include major categories of commodities, such as: animal and plant products, food and beverages; mineral products; chemicals and related products; plastic and rubber products; leather and products; wood and wood products; textiles and textile products, etc. The commodity type may also include subcategories that subdivide the above major categories.
[0037] In step S202, an attribute list corresponding to the target product type is obtained, and the LLM model uses the attribute list as a knowledge base to perform logical reasoning on the product information to identify attribute information corresponding to the target product from the product information; wherein the attribute list includes attributes of products belonging to the product type.
[0038] An attribute list corresponding to each commodity type in the commodity classification list can be pre-built, and the attribute list can include various attributes that the commodity belonging to the commodity type should have or may have, such as product name and number; components or variants; quantity, which can include the quantity of each component or variant; description, which can include description of each component or variant, such as function, feature, specification and other information; supplier information, which can include supplier information corresponding to each component or variant; cost information, which can include cost information of each component or variant, such as raw material cost, processing cost, etc.; importance level, which can include the importance level of each component or variant; and other remarks. The attribute list can also be called a property value (PV) disassembly list.
[0039] After determining the target commodity type to which the target commodity belongs, an attribute list corresponding to the target commodity type may be obtained, and then the attribute information corresponding to at least some of the attributes in the attribute list may be identified from the commodity information of the target commodity using the LLM model. For example, in one embodiment, the LLM model may use the attribute list corresponding to the target commodity type as a knowledge base to perform logical reasoning on the commodity information of the target commodity, and identify the attribute information corresponding to the target commodity from the commodity information of the target commodity. The attribute information may include one or a combination of information selected from the following: the product name, unique identifier, component or variant, quantity, commodity description information, supplier information, cost information, importance level, and other notes of the target commodity.
[0040] In step S203, a tariff knowledge graph related to the tariff code is obtained, and a subgraph matching the attribute information is determined from the tariff knowledge graph; wherein the tariff knowledge graph includes a node for representing at least one coded value in the tariff code and an edge for representing a combination relationship between coded values.
[0041] In step S204, the coding values represented by the nodes contained in the subgraph are obtained, and based on the coding values of the nodes contained in the subgraph, the coding values represented by the nodes are concatenated according to the combination relationship represented by the edges contained in the subgraph to obtain the target tariff code corresponding to the target commodity.
[0042] A tariff knowledge graph related to tariff codes can be pre-constructed to store and process knowledge related to tariff codes, which may include: the code values of each position that constitutes the tariff code, the attribute information corresponding to each code value, the combination relationship between each code value, the association relationship between each attribute information, and the weight of each relationship.
[0043] The tariff code can be composed of multiple digits, such as 6, 8 or 10 digits. For example, taking the 10-digit tariff code as an example, the first two digits can indicate the major category of the commodity, the 3rd to 5th digits can be used to indicate a more refined commodity type for the commodity type corresponding to the previous digit, the 6th digit is used to distinguish specific commodity details, such as brand or specification, and the 7th to 10th digits are used to more finely distinguish the characteristics, materials, size, etc. of the commodity.
[0044] In one embodiment, when constructing a tariff knowledge graph, at least one code value in the tariff code can be used as a node based on the combination of tariff codes, and the attribute corresponding to the code value represented can be saved in the node; based on the relevant knowledge of the tariff code, the combination relationship between the code values is determined, and the edges between the nodes corresponding to the code values are determined based on the combination relationship. The combination relationship may include the attribute relationship, type relationship, and relationship weight between adjacent code values; wherein the attribute relationship may include the relationship between the attributes corresponding to adjacent code values; the type relationship may include the affiliation between adjacent code values; and the relationship weight may include the weight of the relationship between the attributes corresponding to adjacent code values.
[0045] In one embodiment, when constructing a tariff knowledge graph, each attribute corresponding to at least one coded value in the tariff code may be used as a node, and the combination relationship between the attributes corresponding to each coded value may be determined to determine the edge between each node based on the combination relationship.
[0046] In one embodiment, when constructing a tariff knowledge graph, the nodes in the tariff knowledge graph may include nodes for representing at least one coded value in the tariff code and nodes corresponding to each attribute, and the edges in the tariff knowledge graph may include edges for representing a combination relationship between coded values, edges for representing a corresponding relationship between coded values and attributes, and edges for an association relationship between attributes.
[0047] In one embodiment, the constructed tariff knowledge graph can be saved in a graph database. After the LLM model identifies the attribute information corresponding to the target product from the product information of the target product, the tariff knowledge graph can be obtained from the graph database, and based on the attribute information corresponding to the target product, combined with a machine learning method, the matching degree between the tariff code composed of different nodes in the tariff knowledge graph and the target product can be evaluated, and the target tariff code corresponding to the target product can be determined based on the matching degree.
[0048] In one embodiment, a preset graph matching algorithm can be used to search for a subgraph that matches the attribute information corresponding to the target product from the tariff knowledge graph, and based on the coding values represented by each node contained in the subgraph, the coding values represented by the nodes are spliced according to the combination relationship represented by each edge contained in the subgraph to obtain the target tariff code corresponding to the target product.
[0049] Among them, the graph matching algorithm can be set according to actual needs, for example, using a pre-trained graph neural network (GNN) to search for a subgraph that matches the attribute information corresponding to the target product from the tariff knowledge graph.
[0050] In one embodiment, a preset graph matching algorithm can be used to search for at least one candidate subgraph that matches the attribute information corresponding to the target product from the tariff knowledge graph, and the matching degree of each candidate subgraph with the target product is calculated based on the weights of the attributes corresponding to the nodes contained in each candidate subgraph and the weights of the relationships between the nodes. The coding values represented by the nodes in the candidate subgraph with the highest matching degree are spliced according to the combination relationship represented by each edge, so that the spliced tariff code is used as the target tariff code corresponding to the target product.
[0051] In one embodiment, a tariff knowledge graph corresponding to each commodity type may be constructed and saved in a graph database. The tariff knowledge graph may include a node corresponding to at least one coded value in the tariff code belonging to the commodity type, and an edge for representing a combination relationship between the coded values.
[0052] Based on the commodity information of the target commodity, the target commodity type to which the target commodity belongs is determined from the preset commodity classification list, and then the LLM model uses the attribute list corresponding to the target commodity type as the knowledge base to perform logical reasoning on the commodity information of the target commodity. After the attribute information corresponding to the target commodity is identified from the commodity information, the tariff knowledge graph corresponding to the target commodity type can be extracted from the graph database. Based on the attribute information corresponding to the target commodity, a subgraph matching the attribute information corresponding to the target commodity is determined from the acquired tariff knowledge graph, and based on the coding values corresponding to each node contained in the subgraph, the coding values are spliced according to the combination relationship represented by each edge contained in the subgraph to obtain the target tariff code corresponding to the target commodity.
[0053] In the above technical solution, by using a pre-trained LLM model related to the tariff code to identify attribute information from the commodity information, and then obtaining the tariff code of the target commodity from the pre-acquired tariff knowledge graph related to the tariff code based on the identified attribute information, it can not only greatly reduce the labor cost required to determine the commodity tariff code and greatly shorten the processing time, but also improve the classification accuracy of the tariff code, reduce tariff problems caused by classification errors, and improve customs clearance efficiency, trade compliance and market response speed.
[0054] In one embodiment, in the above step S202, the LLM model identifies the attribute information corresponding to the target product from the product information, which may include: using the PV group (Property: Value) format, the LLM model extracts the attribute information corresponding to the target product from the product information of the target product.
[0055] In one embodiment, the extracted attribute information corresponding to the target product can be subjected to preset standardization processing, and the standardization processing can include data cleaning and normalization processing to convert the PV group contained in the attribute information into a standard JSON format. For example, a rule engine can be established or a script can be used to standardize the attribute information; regular expressions and string operation methods can be used to standardize the attribute information. By standardizing the attribute information, the consistency of data types and accurate mapping of fields can be guaranteed to facilitate subsequent processing.
[0056] In one implementation, in order to ensure the accuracy and robustness of the standardization process, a preset unit measurement may be used to detect the standardization process.
[0057] In the above step S201, there are various ways to perform preliminary product classification processing on the target product. For example, in one embodiment, a keyword list corresponding to each product type can be pre-constructed, and the target keyword can be found from the product information of the target product based on the keyword list, and the product type corresponding to the target keyword can be determined as the target product type corresponding to the target product.
[0058] For example, in one embodiment, a product classification model for preliminary product classification processing can be pre-trained. After the product information of the target product to be identified is obtained, the product information can be input into the product classification model for classification processing, and the target product type output by the product classification model to which the target product belongs can be obtained.
[0059] The output mode of the commodity classification model can be set according to actual needs, and can be an identifier of the target commodity type. For example, in one embodiment, the commodity information can be input into a pre-trained commodity classification model for classification processing, and a plurality of digits of coding values used to represent the target commodity type to which the target commodity belongs can be output. For example, taking the 10-digit tariff code as an example, if the target commodity type is a major category column of commodities, the commodity classification model can output the first 2 digits of coding values used to represent the target major category to which the target commodity belongs; if the target commodity type is a next-level commodity type that subdivides the major category column, the commodity classification model can output the first 3 digits of coding values used to represent the target commodity type; and so on.
[0060] The construction method of the commodity classification model can be set according to actual needs, for example, it can be a neural network model. In one embodiment, the commodity classification model is a classification model constructed based on a preset natural language processing model. A pre-trained natural language processing model is used as a basis for text feature extraction, and a classification layer, such as a softmax layer, is added to obtain the probability distribution of outputting a plurality of bit encoding values to construct a commodity classification model.
[0061] In one embodiment, the natural language processing model is a pre-trained BERT model, or a suitable BERT variant, such as BERT-base, BERT-large.
[0062] It should be noted that a suitable natural language processing model can be selected based on different regions and languages.
[0063] Training data for training the constructed commodity classification model can be collected from the historical tariff code recognition results. In one embodiment, since there is less training data for some unpopular commodity types in the historical tariff code recognition results, and more training data for popular commodity types, it is easy to cause imbalance in training. Therefore, the training data can be processed by data augmentation method, which may include but not limited to the following methods:
[0064] Resampling technology: oversampling unpopular product categories and undersampling popular product categories;
[0065] Generative methods: Use generative models to synthesize training data for unpopular product types, such as generative adversarial networks (GANs).
[0066] Data augmentation: Perform operations such as synonym replacement and back translation on the text in the training data.
[0067] A weighted loss function, such as weighted cross entropy, can be used during model training to balance the impact between different categories.
[0068] In one implementation, the collected training data may be preprocessed, including word segmentation, encoding, serialization, etc., to adapt to the selected natural language processing model.
[0069] In one implementation, when training the product classification model based on the training data, a suitable optimizer, such as AdamW, and a learning rate scheduling strategy, such as linear warm-up and decay, may be used.
[0070] In one embodiment, the trained product classification model can be tested. For example, the classification results can be analyzed using tools such as confusion matrix, using the F1 score and overall accuracy rate used to represent the precision and recall of the model.
[0071] In the above embodiment, preliminary commodity classification processing is performed on the target commodity by using a commodity classification model constructed based on a natural language processing model, so that the target commodity type to which the target commodity belongs can be accurately obtained, which helps the LLM model to accurately identify the attribute information of the target commodity from the commodity information based on the target commodity type, and further accurately identify the target tariff code of the target commodity.
[0072] In one embodiment, after determining the target commodity type corresponding to the target commodity and obtaining the attribute list corresponding to the target commodity type, the attribute feature information related to the target commodity type can be obtained, and the attribute feature information includes feature information of the attributes of commodities belonging to the commodity type, such as the association between the attributes, the constraint conditions when identifying the attribute information from the commodity information, etc. When using the LLM model to identify the commodity information, the prompt word engine (prompt engineering) of the LLM model can be used to construct prompt words based on the attribute feature information and the commodity information; the prompt words are input into the LLM model, so that the LLM model uses the attribute list corresponding to the target commodity type as a knowledge base, performs logical reasoning on the commodity information based on the prompt words, and identifies the attribute information corresponding to the target commodity from the commodity information.
[0073] In one embodiment, the transfer learning and few-shot learning capabilities of the LLM model can be utilized. The LLM model can be a LLM service model obtained by fine-tuning a pre-trained LLM basic model based on data related to tariff codes, so that the fine-tuned LLM model can adapt to the task of extracting attribute information from product information.
[0074] In the above embodiment, by acquiring attribute feature information related to the target product type and accurately constructing prompt words based on the attribute feature information, the LLM model can perform logical reasoning on the product information based on the prompt words and accurately identify the attribute information corresponding to the target product from the product information.
[0075] In one embodiment, the accuracy of the target tariff code of each target commodity obtained by the commodity tariff code recognition method of this specification can be regularly evaluated to ensure that the preset accuracy can be achieved. For example, cross-validation can be used to evaluate the accuracy, and ensemble learning can be used to improve the various models and algorithms in the above embodiments to improve accuracy and generalization ability. The performance of the model and algorithm can be regularly evaluated by collecting sufficient test data, and the model and algorithm can be fine-tuned according to the evaluation results, which may include hyperparameter adjustment, model structure adjustment, etc.
[0076] In one embodiment, in order to improve the generalization of the commodity tariff code identification method of this specification, an index database can be constructed, in which the corresponding relationship between the commodity information of the index commodity and the tariff code of the index commodity can be maintained. After determining the target tariff code corresponding to the target commodity based on the method of the above embodiment, the target commodity can be used as the index commodity, and the corresponding relationship between the commodity information of the target commodity and the target tariff code is added to the index database.
[0077] In one embodiment, after obtaining the product information of the target product, the product information of the target product can be matched with the product information of the index product maintained in the index database to determine whether there is a target index product matching the target product in the index database. If so, the tariff code corresponding to the target index product is used as the target tariff code corresponding to the target product; if not, the commodity tariff code identification method of the above embodiment is further executed to determine the target tariff code corresponding to the target product.
[0078] In one embodiment, after obtaining the product information of the target product, the semantic similarity between the product information of the target product and the product information of the index product maintained in the index database can be calculated based on a pre-trained semantic similarity model; based on the semantic similarity, it is determined whether there is a target index product matching the target product in the index database; if so, the tariff code corresponding to the target index product is used as the target tariff code corresponding to the target product; if not, the commodity tariff code recognition method of the above embodiment is further executed to determine the target tariff code corresponding to the target product.
[0079] In one embodiment, after determining the semantic similarity between the product information of the target product and the product information of the index product, the product similarity between the target product and each index product can be calculated based on a preset similarity retrieval algorithm, and based on the product similarity, it can be determined whether there is a target index product matching the target product in the index database. For example, the index product with a product similarity higher than a preset threshold can be determined as the target index product matching the target product; if there is more than one index product with a product similarity higher than the preset threshold, the index product with the highest product similarity can be determined as the target index product matching the target product.
[0080] There are many similarity retrieval algorithms, such as Approximate Nearest Neighbors (ANN).
[0081] In one implementation, the semantic similarity model can be constructed according to actual needs, for example, a deep structured semantic model, a BERT model, an InferSent model, etc. can be used.
[0082] In one implementation, the index database may also maintain attribute information of the indexed commodities.
[0083] In one embodiment, the index database may maintain a correspondence between the attribute information of the indexed commodity and the tariff code of the indexed commodity. After obtaining the commodity information of the target commodity, the target commodity type to which the target commodity belongs may be determined from the preset commodity classification list based on the commodity information; then, based on the attribute list corresponding to the target commodity type, the attribute information of the target commodity may be identified from the commodity information of the target commodity by the LLM model; then, the attribute information of the target commodity may be matched with the attribute information of the indexed commodity maintained in the index database, for example, the similarity between the attribute information of the target commodity and the attribute information of the indexed commodity may be calculated to determine whether there is a target indexed commodity matching the target commodity in the index database, and if so, the tariff code corresponding to the target indexed commodity is used as the target tariff code corresponding to the target commodity; if not, the subsequent steps of the commodity tariff code identification method of the above embodiment are further performed to determine the target tariff code corresponding to the target commodity.
[0084] In one embodiment, index databases corresponding to each commodity type may be constructed respectively. After obtaining the commodity information of the target commodity, the target commodity type to which the target commodity belongs is first determined from a preset commodity classification list based on the commodity information, and a target index database corresponding to the target commodity type is obtained; the commodity information of the target commodity is then matched with the commodity information of the index commodity maintained in the target index database to determine whether there is a target index commodity matching the target commodity in the target index database; or, after the attribute information of the target commodity is identified from the commodity information of the target commodity by the LLM model, the attribute information of the target commodity is matched with the attribute information of the index commodity maintained in the target index database to determine whether there is a target index commodity matching the target commodity in the target index database.
[0085] In one embodiment, the indexed commodities in the index database may be cleaned or updated regularly. For example, a survival timer may be set for each indexed commodity or each commodity type. When the survival timer corresponding to the indexed commodity reaches the survival time, the indexed commodity is deleted from the index database. Alternatively, when the survival timer corresponding to the indexed commodity reaches the survival time, the indexed commodity may be used as a new target commodity to be identified, and the commodity tariff code identification method of the above embodiment may be executed again to determine the tariff code of the indexed commodity, so as to update the relevant information of the indexed commodity in the index database.
[0086] In the above embodiment, by constructing an index database, the indexed commodities in the index database can be generalized to all similar commodities, the generalization ability of the commodity tariff code recognition method can be improved, and the cost of using models such as LLM can be greatly saved.
[0087] Please see Figure 3 , Figure 3 FIG. 1 is a flowchart of another method for identifying a commodity tariff code provided by an exemplary embodiment. Figure 3 As shown, the method includes the following steps.
[0088] S301. Input the product information of the target product into the product classification model for classification processing, and output a two-digit code value for indicating the target product type to which the target product belongs; wherein the product classification model uses a pre-trained BERT model as a base for text feature extraction, and adds a softmax layer on the top layer of the BERT model to output the product classification result.
[0089] S302: Based on the PV breakdown list corresponding to the target product type, use the LLM model to extract PV of the product information of the target product to obtain the product information of the target product.
[0090] S303: Perform preset data cleaning and regularization processing on the attribute information extracted by the LLM model, and convert the attribute information into a standard JSON format to ensure the consistency of data types and accurate mapping of fields. Regular expressions and string operation methods can be used to clean and standardize data.
[0091] S304. Determine the target tariff code corresponding to the target commodity using the pre-built tariff knowledge graph. The tariff knowledge graph can be used to store the attributes, code values, and the relationships and weights between the commodities. A graph neural network or other graph algorithms can be used to calculate the strength of the relationship between nodes (i.e., attributes). Implement an inference algorithm to predict the most likely tariff code as the target tariff code.
[0092] S305. Regularly evaluate the accuracy of tariff codes. Regular evaluation can be used to adjust the model to ensure that the set accuracy target is achieved. Cross-validation and ensemble technology can be used to improve the accuracy and generalization ability of the model.
[0093] S306, write the target product as an index product into the index database. When a new product to be identified is obtained, the target index product matching the product to be identified can be determined from the index database based on the semantic similarity model, so that the tariff code of the target index product can be used as the tariff code of the product to be identified. DSSM or other semantic similarity models can be used to calculate the similarity between the product to be identified and the index product, and the generalization of tariff information can be achieved by retrieving all products (such as hundreds of thousands) similar to the index product (such as hundreds of thousands).
[0094] In one embodiment, when implementing the method of this specification, it is necessary to continuously approach the performance of each model and regularly optimize and iterate it. Here, considering the changes in tax law rules, the tax knowledge graph, index database and each model can be regularly updated.
[0095] Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 4 At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and may also include hardware required for other functions. One or more embodiments of this specification may be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0096] Please refer to Figure 5 The identification device of commodity tariff code can be applied to Figure 4 The device shown in the figure is used to implement the technical solution of this specification. The commodity tariff code recognition device may include: a commodity classification module 501, an attribute extraction module 502, a graph matching module 503 and a coding output module 504.
[0097] The commodity classification module 501 is used to obtain commodity information of a target commodity, and determine the target commodity type to which the target commodity belongs from a preset commodity classification list based on the commodity information; the attribute extraction module 502 is used to obtain an attribute list corresponding to the target commodity type, and the LLM model uses the attribute list as a knowledge base to perform logical reasoning on the commodity information, so as to identify the attribute information corresponding to the target commodity from the commodity information; wherein the attribute list includes the attributes of commodities belonging to the commodity type; the graph matching module 503 is used to obtain a tariff knowledge graph related to the tariff code, and determine a subgraph matching the attribute information from the tariff knowledge graph; wherein the tariff knowledge graph includes nodes for representing at least one coded value in the tariff code and edges for representing a combination relationship between coded values; the coding output module 504 is used to obtain the coded values represented by each node contained in the subgraph, and based on the coded values of each node contained in the subgraph, splice the coded values represented by the nodes according to the combination relationship represented by each edge contained in the subgraph, so as to obtain the target tariff code corresponding to the target commodity.
[0098] In one implementation, the commodity classification module 501 is used to input the commodity information into a pre-trained commodity classification model for classification processing, and obtain the target commodity type to which the target commodity belongs output by the commodity classification model.
[0099] In one implementation, the commodity classification module 501 is used to input the commodity information into a pre-trained commodity classification model for classification processing, and output a multi-bit code value for indicating the target commodity type to which the target commodity belongs.
[0100] In one embodiment, the product classification model is a classification model constructed based on a preset natural language processing model.
[0101] In one embodiment, the natural language processing model is a BERT model.
[0102] In one embodiment, the attribute extraction module 502 is used to obtain attribute feature information related to the target product type, and construct prompt words based on the attribute feature information and the product information; wherein the attribute feature information includes feature information of the attributes of products belonging to the product type; the prompt words are input into the LLM model, so that the LLM uses the attribute list as a knowledge base, performs logical reasoning on the product information based on the prompt words, and identifies the attribute information corresponding to the target product from the product information.
[0103] In one embodiment, the coding output module 504 is also used to calculate the semantic similarity between the product information of the target product and the product information of the index product maintained in the index database based on a pre-trained semantic similarity model; wherein the index database maintains the product information of the index product and the tariff code corresponding to the index product; based on the semantic similarity, determine whether there is a target index product matching the target product in the index database; if so, use the tariff code corresponding to the target index product as the target tariff code of the target product.
[0104] In one embodiment, the LLM model is an LLM service model obtained by fine-tuning a pre-trained LLM basic model based on data related to tariff codes.
[0105] Based on the same concept as the above method, this specification also provides an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method described in any of the above embodiments by running the executable instructions.
[0106] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.
[0107] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.
Claims
1. A method for identifying commodity tariff codes, characterized in that: include: Acquire product information of a target product, and determine a target product type to which the target product belongs from a preset product classification list based on the product information; Acquire an attribute list corresponding to the target product type, and use the attribute list as a knowledge base by the LLM model to perform logical reasoning on the product information, so as to identify attribute information corresponding to the target product from the product information; wherein the attribute list includes attributes of products belonging to the product type; Obtaining a tariff knowledge graph related to the tariff code, and determining a subgraph matching the attribute information from the tariff knowledge graph; wherein the tariff knowledge graph includes a node for representing at least one coded value in the tariff code and an edge for representing a combination relationship between coded values; The coding values represented by each node contained in the subgraph are obtained, and based on the coding values of each node contained in the subgraph, the coding values represented by the nodes are spliced according to the combination relationship represented by each edge contained in the subgraph to obtain the target tariff code corresponding to the target commodity.
2. The method according to claim 1, characterized in that The step of determining the target commodity type to which the target commodity belongs from a preset commodity classification list based on the commodity information includes: The commodity information is input into a pre-trained commodity classification model for classification processing, and a target commodity type to which the target commodity belongs output by the commodity classification model is obtained.
3. The method according to claim 2, characterized in that Inputting the commodity information into a pre-trained commodity classification model for classification processing, and obtaining the target commodity type output by the commodity classification model to which the target commodity belongs, including: The commodity information is input into a pre-trained commodity classification model for classification processing, and a multi-bit code value for indicating the target commodity type to which the target commodity belongs is output.
4. The method according to claim 2, characterized in that: The commodity classification model is a classification model constructed based on a preset natural language processing model.
5. The method according to claim 4, characterized in that The natural language processing model is a BERT model.
6. The method according to claim 1, characterized in that The LLM model uses the attribute list as a knowledge base to perform logical reasoning on the product information to identify attribute information corresponding to the target product from the product information, including: Acquire attribute feature information related to the target commodity type, and construct a prompt word based on the attribute feature information and the commodity information; wherein the attribute feature information includes feature information of the attributes of the commodity belonging to the commodity type; The prompt words are input into the LLM model, so that the LLM uses the attribute list as a knowledge base, performs logical reasoning on the product information based on the prompt words, and identifies attribute information corresponding to the target product from the product information.
7. The method according to claim 1, characterized in that After obtaining the commodity information of the target commodity, the method further includes: Based on a pre-trained semantic similarity model, calculating the semantic similarity between the commodity information of the target commodity and the commodity information of the index commodity maintained in an index database; wherein the index database maintains the commodity information of the index commodity and the tariff code corresponding to the index commodity; Based on the semantic similarity, it is determined whether there is a target index commodity matching the target commodity in the index database; if so, the tariff code corresponding to the target index commodity is used as the target tariff code of the target commodity.
8. The method according to claim 1, characterized in that The LLM model is an LLM service model obtained by fine-tuning the pre-trained LLM basic model based on data related to tariff codes.
9. A device for identifying commodity tariff codes, characterized in that: include: A commodity classification module, used to obtain commodity information of a target commodity, and determine a target commodity type to which the target commodity belongs from a preset commodity classification list based on the commodity information; An attribute extraction module, used to obtain an attribute list corresponding to the target product type, and use the attribute list as a knowledge base by the LLM model to perform logical reasoning on the product information, so as to identify attribute information corresponding to the target product from the product information; wherein the attribute list includes attributes possessed by products belonging to the product type; A graph matching module, used to obtain a tariff knowledge graph related to the tariff code, and determine a subgraph matching the attribute information from the tariff knowledge graph; wherein the tariff knowledge graph includes a node for representing at least one coded value in the tariff code and an edge for representing a combination relationship between coded values; The coding output module is used to obtain the coding values represented by each node contained in the subgraph, and based on the coding values of each node contained in the subgraph, the coding values represented by the nodes are spliced according to the combination relationship represented by each edge contained in the subgraph to obtain the target tariff code corresponding to the target commodity.
10. An electronic device, characterized in that: include: processor; A memory for storing processor-executable instructions; wherein the processor implements the steps of the method according to any one of claims 1 to 8 by executing the executable instructions.
11. A computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and when the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Cited By
Global invoice data standardization method based on multilayer conversion
CN122779940A
