Cargo code classification method and device, equipment and medium
By using a large language model to extract category information in the goods declaration text and automatically find target category codes, the problem of low efficiency in the existing technology of customs coding determination is solved, and an efficient and accurate customs declaration process is achieved, and the level of logistics services is improved.
Patent Information
- Application Number
- CN202411427300.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-02-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to quickly and accurately determine the customs code of goods, resulting in low import customs declaration efficiency and seriously affecting logistics timeliness.
Use the preset large language model to extract category information from the declaration text of the goods, and automatically find the target category encoding based on the first correspondence relationship to realize automatic encoding of the goods.
It improves the efficiency and accuracy of customs code determination of goods, reduces manual intervention, improves customs declaration efficiency, shortens logistics timeliness, and reduces the risk of cargo seizure.
Smart Images

Figure CN119537583A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of cross-border logistics technology, and in particular to methods, devices, equipment and media for coding and classifying goods. Background Art
[0002] In order to ensure the security of global trade, the determination of the customs codes of goods during the export and import process has become an indispensable part of the global trade process. For large and scattered goods in the logistics process, it is even more necessary to determine the customs codes of each product at the customs of the destination country for import declaration.
[0003] However, at present, the determination of the customs codes of corresponding goods often requires a large number of customs declaration personnel to manually identify and fill in a large number of scattered goods based on the declaration texts (for example, text descriptions) of the goods. It is difficult to quickly and accurately determine the customs codes of the goods, which seriously affects the efficiency of import customs declaration and delays logistics timeliness.
[0004] Therefore, how to improve the efficiency and accuracy of determining the customs codes of goods passing through customs, thereby improving the efficiency of goods declaration, has become a technical problem that urgently needs to be solved. Summary of the invention
[0005] The embodiments of the present application provide a method, device, equipment and medium for coding and classifying goods, which can solve the problem of how to improve the efficiency and accuracy of determining the customs codes of goods passing through customs, thereby improving the efficiency of goods declaration.
[0006] In a first aspect, an embodiment of the present application provides a method for coding and classifying goods, comprising:
[0007] Get the declaration text of the goods to be compiled;
[0008] Use the preset large language model to extract the category information of the goods to be compiled from the declaration text;
[0009] The target category code corresponding to the category information of the goods to be compiled is searched from the first corresponding relationship, and the target category code is used as the category code of the goods to be compiled. The first corresponding relationship includes different category codes corresponding to different category information.
[0010] In some embodiments, in the first corresponding relationship, one category information corresponds to at least one category code, and there is a corresponding weight between one category information and one category code; searching the target category code corresponding to the category information of the goods to be coded from the first corresponding relationship includes:
[0011] Determine, from the first corresponding relationship, target category information that matches the category information of the goods to be compiled;
[0012] From the first corresponding relationship, obtaining at least one candidate category code corresponding to the target category information and a corresponding weight of each candidate category code;
[0013] According to the corresponding weight of each candidate category code and a preset threshold, a target category code is determined from at least one candidate category code.
[0014] In some embodiments, determining target category information that matches the category information from the first corresponding relationship includes:
[0015] Determine the similarity between each category information in the first corresponding relationship and the category information of the goods to be compiled;
[0016] The category information corresponding to the similarity with the highest value among the similarities is determined as the target category information.
[0017] In some embodiments, determining a target category code from at least one candidate category code includes:
[0018] In the case where the target category information corresponds to multiple candidate category codes, extracting a candidate category code whose corresponding weight is greater than or equal to a preset threshold from the multiple candidate category codes to obtain at least one category code to be selected;
[0019] In a case where there are a plurality of category codes to be selected, in response to a user's selection operation of one of the plurality of category codes to be selected, the selected category code to be selected is determined as the target category code.
[0020] In some embodiments, the method further comprises:
[0021] When there is a candidate category code, the candidate category code is determined as the target category code.
[0022] In some embodiments, after determining the selected candidate category code as the target category code, the method further includes:
[0023] Comparing the first corresponding weight with the second corresponding weight, the first corresponding weight being the corresponding weight of any one of the multiple candidate category codes except the target category code, and the second corresponding weight being the corresponding weight between the target category information and the target category code;
[0024] When the first corresponding weight is greater than or equal to the second corresponding weight, the second corresponding weight is increased and the first corresponding weight is decreased in the first corresponding relationship.
[0025] In some embodiments, before obtaining the declaration text of the goods to be compiled, the method further includes:
[0026] Obtain historical declaration texts and category codes for multiple coded goods;
[0027] For each coded cargo, the category information of the coded cargo is extracted from the historical declaration text of the coded cargo using a preset large language model;
[0028] For each piece of category information of the coded goods, the category information of the coded goods is matched with the category code of the coded goods, and the corresponding weight between the category information of the coded goods and the category code is set to a preset value, so as to obtain a first corresponding relationship.
[0029] In a second aspect, an embodiment of the present application provides a goods encoding device, including:
[0030] The acquisition module is used to obtain the declaration text of the goods to be compiled;
[0031] An extraction module, used to extract the category information of the goods to be compiled from the declaration text using a preset large language model;
[0032] The search module is used to search for the target category code corresponding to the category information of the goods to be compiled from the first corresponding relationship, the target category code is used as the category code of the goods to be compiled, and the first corresponding relationship includes different category codes corresponding to different category information.
[0033] In a third aspect, an embodiment of the present application provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the coding and classification method for goods as described in any embodiment of the first aspect is implemented.
[0034] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the coding and classification method for goods as described in any embodiment of the first aspect.
[0035] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the coding and classification method for goods described in any one of the embodiments in the first aspect above.
[0036] Compared with the prior art, the embodiments of the present application have the following beneficial effects: by taking advantage of the preset large language model that can accurately and quickly understand natural language, the declaration text of the goods to be compiled can be quickly and accurately semantically understood, and accurate category information can be quickly extracted from the declaration text. Based on the association between different category information and category codes in the first corresponding relationship, the category code corresponding to the category information of the goods to be compiled is automatically found, thereby automatically obtaining the accurate category code corresponding to the goods to be compiled, such as the customs code. The entire process is carried out automatically, without the need for manual judgment of the declaration text of the goods to determine the category code, such as the customs code, which improves the efficiency and accuracy of determining the customs code of the goods, thereby improving the customs declaration efficiency of the goods.
[0037] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0039] Figure 1 It is a structural schematic diagram of a cargo coding system provided in an embodiment of the present application;
[0040] Figure 2 It is a flow chart of a method for coding and classifying goods provided in an embodiment of the present application;
[0041] Figure 3 This is a schematic diagram of an application scenario of a method for coding and classifying goods provided in an embodiment of the present application;
[0042] Figure 4 It is a schematic diagram of a process for determining the category code of goods to be coded provided by an embodiment of the present application;
[0043] Figure 5 It is a flow chart of another method for coding and classifying goods provided in an embodiment of the present application;
[0044] Figure 6 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0045] Figure 7 It is a structural block diagram of a goods encoding device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0047] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0048] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0049] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0050] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0051] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0052] Customs codes are the classification codes for the types, manufacturing methods and sources of imported and exported goods. They are generally composed of 10-12 digits, each of which represents a part of the regulations on the goods. Usually, import and export trading companies need to be equipped with special customs declaration form preparation personnel, who can classify various types of imported and exported goods into different customs codes through understanding of customs policies and analysis of the declaration texts of goods.
[0053] With the development of e-commerce, more and more goods are sold to various countries through online shopping websites and international e-commerce platforms. This results in a large number of scattered goods that need to be declared at the customs of the destination country during the cross-border export of goods. Compared with the traditional import and export trade, where there are only dozens or even a few categories of goods on the waybill for customs declaration, which can still be manually identified and filled in by customs declaration personnel, in the e-commerce model, a waybill contains thousands or even tens of thousands of goods categories. The method of manually classifying the goods passing through customs to determine the customs code is not only inaccurate, but also seriously affects the efficiency of import customs declaration and delays logistics timeliness.
[0054] In addition, the descriptions of the same goods in the declaration texts on e-commerce platforms are not uniform, and it is difficult to standardize the classification of all goods using existing technologies. For example, the traditional regular expression model can only process descriptions that meet certain specifications to determine the customs codes of the goods. In other words, this method can only process a very limited number of goods, and it cannot process natural language descriptions in a unified manner. In actual applications, a large amount of manual intervention is required, which seriously affects the efficiency and accuracy of determining the customs codes of the goods.
[0055] In response to the above problems, a method, device, equipment and medium for coding and classifying goods are provided in the embodiments of the present application, wherein the method can take advantage of the preset large language model to accurately and quickly understand natural language, and quickly and accurately understand the semantics of the declaration text of the goods to be compiled, so as to obtain unified category information of each goods to be compiled. Only based on the association between different category information and category codes in the determined first correspondence, the category code corresponding to the category information of the goods to be compiled, for example, the customs code, is automatically, quickly and accurately found. The entire process is carried out automatically, without the need for manual judgment of the declaration text of the goods, which improves the efficiency and accuracy of determining the customs code of the goods, thereby improving the customs declaration efficiency of the goods, accelerating the logistics timeliness, further reducing the risk of goods seizure, and improving the level of logistics services.
[0056] Figure 1 It is a structural diagram of a cargo coding system adapted to the cargo coding classification method in this application, wherein the system includes a transfer station 110 and a server 120 , and the transfer station 110 establishes a communication connection with the server 120 .
[0057] For example, the transfer station 110 may be an institution with cargo transportation functions such as a customs or logistics transportation transfer station. The server 120 may be a physical server, a cloud server provided by a cloud computing platform, a virtual instance (virtual server) running on a physical server using virtualization technology, an edge server or a distributed server.
[0058] The server 120 is used for the declaration text of the goods to be compiled; extracting the category information of the goods to be compiled from the declaration text by using a preset large language model; searching for the target category code corresponding to the category information of the goods to be compiled from the first corresponding relationship, the target category code being used as the category code of the goods to be compiled, and the first corresponding relationship includes different category codes corresponding to different category information;
[0059] The transfer station 110 is used to transport goods with category codes.
[0060] In some embodiments, the declaration text of the goods to be compiled includes a text description of the goods to be compiled. The server 120 is specifically used to convert the text description of the goods to be compiled into a language vector using a preset large language model, and the language vector is used as the category information of the goods to be compiled.
[0061] In some embodiments, the server 120 is specifically used to extract description words from the text description of the goods to be compiled using a preset large language model; and encode the description words into language vectors using a preset sentence embedding model. Exemplarily, the preset sentence embedding model can be a model such as a sentence transformer (SentenceTransformers) or a universal sentence encoder (UniversalSentenceEncoder, USE).
[0062] In some embodiments, the transfer station 110 is also used to intercept any cargo when it is detected that the category code of the cargo is a restricted code, and the intercepted cargo will not be transported.
[0063] The following is a detailed description of the coding and classification method for the goods of the present application. Figure 2 is a flow chart of a method for coding and classifying goods in an embodiment of the present application. The method can be executed by a terminal device. The terminal device can be Figure 1 The server 120 in the embodiment shown is as follows: Figure 2 As shown, the method comprises the following steps:
[0064] Step S101, obtaining the declaration text of the goods to be compiled.
[0065] The terminal device can be connected to a first database storing at least one declaration text of goods through communication, and the terminal device reads the declaration text of at least one goods from the first database, and the at least one goods is the goods to be compiled.
[0066] Exemplarily, the consignor of the goods to be compiled may also input the declaration text of the goods to be compiled into the terminal device in advance, so that the terminal device can obtain the declaration text.
[0067] Step S102: extracting category information of the goods to be compiled from the declaration text using a preset large language model.
[0068] The preset big language model can be an open source big language model or a third-party big language model service, for example, a bidirectional encoder (Bidirectional Encoder Representations from Transformers, BERT) model or a generative pre-trained transformer 3 (Generative Pre-trained Transformer 3, GPT-3), etc. The terminal device can input the declaration text into the preset big language model, so that the preset big language model can perform semantic understanding on the declaration text to extract category information therefrom.
[0069] In one example, the declaration text includes a text description of the goods to be compiled. The terminal device can use the preset large language model to perform semantic understanding on the text description of the goods to be compiled. The specific operation steps of semantic understanding may include clearing typos, punctuation, grammatical analysis, and removing repeated descriptions, etc., to understand the natural language, so as to extract the category information of the goods to be compiled from the text description. For example, the text description of a pair of pants is "high waist spring jeans, loose new slim ice silk fabric", and the terminal device can use the preset large language model to perform semantic understanding on the text description of the pants, and the category information obtained can be ice silk imitation jeans.
[0070] In another example, the terminal device can use a preset large language model to perform semantic understanding on the text description of the goods to be compiled, so as to extract descriptive words of the goods to be compiled from the text description; the description words are input into a preset sentence embedding model, so that the preset sentence embedding model encodes the description words into a language vector, and the language vector serves as the category information of the goods to be compiled.
[0071] For example, in Figure 3 In the application scenario shown, taking the goods to be edited (original goods) as a clothes hanger as an example, the terminal device can read the declaration text (description data) of the goods to be edited from the first database, and the text description in the declaration text is "bold clothes hanger, household traceless clothes hanger, clothes hanger, plastic clothes hanger wholesale". The terminal device inputs it into the preset large language model, so that the preset large language model can perform semantic understanding on the text description of the goods to be edited, and the description word of the goods to be edited can be "plastic clothes hanger", and then the description word is encoded into a language vector (that is, description vectorization encoding).
[0072] It is understandable that the terminal device can store the description words of the goods to be compiled in the second database, that is, Figure 3 In the original data set after semantic understanding, especially when there are multiple goods to be compiled, the description words of each goods to be compiled can be read from the second database respectively to perform the subsequent step of encoding the description words, and the language vector of each goods to be compiled can be obtained. Then, the same steps are performed on the language vector of each goods to be compiled to determine the category code of each goods to be compiled, thereby completing the encoding operation of the batch of goods to be compiled.
[0073] It should be noted that the specific process of encoding the description words into language vectors by the preset sentence embedding model varies depending on the specific sentence embedding model used. For example, taking the preset sentence embedding model as the Sentence Transformer model as an example, the specific process of converting the description words of the goods to be encoded into language vectors can be: converting the description words into at least one word or sub-word unit; using a constructed vocabulary (the vocabulary includes unique indexes corresponding to different words and different sub-word units), determining the index of the converted word or sub-word unit; based on the index of the converted word or sub-word unit, text encoding the converted word or sub-word unit to obtain a language vector.
[0074] Step S103, searching the first corresponding relationship for the target category code corresponding to the category information of the goods to be compiled, and using the target category code as the category code of the goods to be compiled.
[0075] The first corresponding relationship includes different category codes corresponding to different category information. In the embodiment of the present application, the category code is taken as the customs code as an example. It can be understood that the category code can also be other codes used to distinguish the categories of goods. The terminal device can find the category information of the goods to be compiled from the first corresponding relationship, and then determine the category code corresponding to the category information as the target category code, so as to output the target category code as the category code of the goods to be compiled.
[0076] In one example, continue to refer to Figure 3 Taking the category information as the language vector and the first corresponding relationship as the customs code data set under the standard description as an example, the terminal device can calculate the similarity between each voice vector (category information) in the first corresponding relationship and the language vector corresponding to the goods to be compiled (the description word), thereby completing the step of vector similarity calculation; the largest similarity is selected from the calculated similarities, and the category code corresponding to the language vector corresponding to the largest similarity in the first corresponding relationship is determined as the candidate category code of the goods to be compiled, thereby completing the step of recommending the customs code corresponding to the high similarity.
[0077] It should be noted that one category information in the first correspondence may correspond to at least one category code. When the terminal device detects that the language vector corresponding to the screened similarity in the first correspondence corresponds to multiple category codes, the terminal device may also display multiple category codes and determine the category code selected by the user from the displayed multiple category codes as the target category code to complete the steps of manual correction and marking. Then, the description word (goods description) corresponding to the goods to be compiled is associated with the category code of the goods to be compiled and output, completing the step of outputting the corrected goods description and customs code comparison relationship.
[0078] In the embodiment of the present application, the advantage of the preset large language model that can accurately and quickly understand natural language is used to quickly and accurately understand the semantics of the declaration text of the goods to be compiled, and accurate category information can be quickly extracted from the declaration text. And based on the association between different category information and category codes in the first corresponding relationship, the category code corresponding to the category information of the goods to be compiled is automatically found, so as to automatically obtain the accurate category code corresponding to the goods to be compiled, such as the customs code. The whole process is carried out automatically, and there is no need for manual judgment of the declaration text of the goods to determine the category code, such as the customs code, which improves the efficiency and accuracy of determining the customs code of the goods, thereby improving the customs declaration efficiency of the goods, accelerating the logistics timeliness, further reducing the risk of goods seizure, and improving the level of logistics services.
[0079] Figure 4 is a flow chart of determining the category code of goods to be coded in an embodiment of the present application. The method can be executed by a terminal device. The terminal device can be Figure 1 In the server 120 of the embodiment shown, the method is Figure 2 An example of step S203 in the embodiment shown is as follows: Figure 4 As shown, the method may include steps S2031 to S2033:
[0080] Step S2031: Determine, from the first corresponding relationship, target category information that matches the category information of the goods to be compiled.
[0081] In the first correspondence, one category information corresponds to at least one category code, and there is a corresponding weight between one category information and one category code. For example, taking the category information in the first correspondence as language vector 1 to language vector 3 as an example, the first correspondence can be shown in Table 1 below.
[0082] Table 1
[0083]
[0084] The terminal device can determine the category information closest to the goods to be compiled from the first corresponding relationship to obtain the target category information.
[0085] In some embodiments, determining target category information that matches the category information from the first corresponding relationship includes the following steps (1) to (2):
[0086] Step (1), respectively determining the similarity between each category information in the first corresponding relationship and the category information of the goods to be compiled;
[0087] In one example, the terminal device can use a vector query statement (for example, a Milvus vector query statement, an Elasticsearch vector query statement, or a Faiss vector query statement, etc.) to query a language vector in the first correspondence relationship that is closest to the category information of the goods to be edited, thereby obtaining the similarity between each category information in the first correspondence relationship and the category information of the goods to be edited.
[0088] In another example, the terminal device may calculate the distance (which may be the Euclidean distance) between each language vector in the first correspondence of the language vectors of the goods to be compiled, and the closer the distance, the higher the similarity.
[0089] In yet another example, the terminal device calculates the cosine similarity or Pearson correlation coefficient between each language vector in the first correspondence of the language vectors of the goods to be compiled, and the larger the value, the higher the similarity.
[0090] Step (2), determining the category information corresponding to the similarity with the highest value among the similarities as the target category information.
[0091] The terminal device can determine the category information (language vector) corresponding to the highest similarity in the first correspondence as the target category information. In the above technical solution, the category information corresponding to the highest similarity among the similarities in the first correspondence is directly determined as the target category information, which can not only accurately find the category information matching the goods to be compiled in the first correspondence, but also realize the fuzzy processing of the category information of the goods to be compiled, and can quickly find the target category information that is synonymous, near-synonymous or expressed in different ways with the category information of the goods to be compiled in the first correspondence, thereby improving the matching flexibility of the category information of the goods to be compiled. It also avoids manual screening of the category information of the goods to be compiled, thereby improving the accuracy and efficiency of determining the category code of the candidate goods.
[0092] Step S2032: acquiring, from the first corresponding relationship, at least one candidate category code corresponding to the target category information and a corresponding weight of each candidate category code.
[0093] The terminal device determines each category code corresponding to the target category information in the first relationship as a candidate category code, and determines the corresponding weight between the candidate category code and the target category information as the corresponding weight of the candidate category code. For example, referring to Table 1, the target category information determined by the terminal device is speech vector 2, then there are three candidate category codes, namely code 3 to code 5, wherein the corresponding weight of code 3 is 0.75, the corresponding weight of code 4 is 0.9, and the corresponding weight of code 5 is 0.6.
[0094] Step S2033: determining a target category code from at least one candidate category code according to the corresponding weight of each candidate category code and a preset threshold.
[0095] The preset threshold value may be a number greater than or equal to 0.5 and less than or equal to 1, and is not specifically limited in the embodiments of the present application. The terminal device may filter out candidate category codes whose corresponding weights are greater than or equal to the preset threshold value from all candidate category codes, and then display the filtered candidate category codes to the user. In the case where the candidate category code selected by the user for display is detected, the candidate category code selected by the user is determined as the target category code; in the case where the candidate category code selected by the user for display is not detected, the candidate category code with the highest corresponding weight is determined as the target category code.
[0096] In some embodiments, determining a target category code from at least one candidate category code comprises the following steps:
[0097] In the case where the target category information corresponds to multiple candidate category codes, extracting a candidate category code whose corresponding weight is greater than or equal to a preset threshold from the multiple candidate category codes to obtain at least one category code to be selected;
[0098] In the case where there are multiple category codes to be selected, in response to a user's selection operation of one of the multiple category codes to be selected, determining the selected category code to be selected as the target category code;
[0099] Alternatively, when there is a candidate category code, the candidate category code is determined as the target category code.
[0100] When the terminal device detects that the target category information in the first corresponding relationship corresponds to multiple candidate category codes, the terminal device can display the candidate category codes whose corresponding weights are greater than or equal to the preset threshold, i.e., the category codes to be selected, to the user in order from large to small corresponding weights, and then when the user's selection operation on one of the multiple category codes to be selected is detected, the selected category code to be selected is determined as the target category code in response to the operation. It can be understood that when the user's selection operation on one of the multiple category codes to be selected is not detected, the terminal device can determine the category code to be selected with the largest corresponding weight as the target category code.
[0101] In the above technical solution, when multiple candidate category codes corresponding to the goods to be compiled are determined, each candidate category code can be displayed for user selection, so as to manually select the real category code of the goods to be compiled from the multiple candidate category codes, thereby further improving the accuracy of determining the category code of the goods.
[0102] In some embodiments, when the target category information corresponds to a candidate category code, the candidate category code is displayed; in response to a user's confirmation operation on the candidate category code, the candidate category code is determined as the target category code; or, in response to a user's editing operation on the candidate category code, the edited candidate category code is determined as the target category code.
[0103] In the above technical solution, when the target category information corresponds to a candidate category code, the candidate category code of the goods to be compiled is not determined, but the candidate category code is directly displayed for manual determination or editing, thereby determining the real category code of the goods to be compiled, saving the determination process and further improving the accuracy of the determination of the category code of the goods.
[0104] It can be understood that after the edited candidate category code is determined as the target category code, the method also includes, in a first corresponding relationship, determining the edited candidate category code as a category code corresponding to the target category information, and determining the preset value as the corresponding weight between the edited candidate category code and the target category information.
[0105] In some embodiments, in order to further improve the accuracy of determining the category code of the goods, after determining the selected candidate category code as the target category code, the method further includes the following steps (1) to (2):
[0106] Step (1), comparing the first corresponding weight with the second corresponding weight.
[0107] The first corresponding weight is the corresponding weight of any one of the multiple candidate category codes except the target category code, and the second corresponding weight is the corresponding weight between the target category information and the target category code;
[0108] Step (2), when the first corresponding weight is greater than or equal to the second corresponding weight, increase the second corresponding weight and decrease the first corresponding weight in the first corresponding relationship.
[0109] In an embodiment of the present application, the terminal device may use a correction algorithm to increase the second corresponding weight and reduce the first corresponding weight. There is no specific restriction on the specific process of increasing the second corresponding weight and reducing the first corresponding weight. The weight value of the second corresponding weight may be interchanged with the weight value of the first corresponding weight; the second corresponding weight may be multiplied by a coefficient greater than 1, and the second corresponding weight may be multiplied by a coefficient less than 1 accordingly; the second corresponding weight may be increased to a new value, the first corresponding weight may be reduced to a new value, and then all corresponding weights between the target category information and each selected category code may be normalized so that the total is 1; or the second corresponding weight may be increased and the first corresponding weight may be reduced according to the ratio between the second corresponding weight and the first corresponding weight, etc.
[0110] In the above technical solution, when the second corresponding weight (the corresponding weight between the target category code and the target category information of the goods to be coded) is less than or equal to any corresponding weight (the first corresponding weight) between the target category information and other category codes in the first corresponding relationship, it means that when the goods to be coded are coded this time, the weight of the real category code of the goods to be coded in the first corresponding relationship is relatively small, and the user needs to manually select from multiple category codes to be selected. After the user selects, the second corresponding weight is increased and the first corresponding weight is decreased in the first corresponding relationship, so that the result of the user's selection is recorded in the first corresponding relationship, so that when the goods to be coded are coded next time, the target category code that meets the user's expectations can be further determined based on the data value of the newly determined corresponding weight, so as to achieve the purpose of gradually improving the accuracy of determining the category code of the goods, and it is also possible that the user does not need to make manual selection in the next coding, thereby improving the efficiency of determining the category code of the goods.
[0111] Continue to refer Figure 3 In the application scenario shown, the terminal device selects multiple candidate category codes whose corresponding weights are greater than or equal to a preset threshold from multiple candidate category codes of the goods to be compiled, and displays the multiple candidate category codes in order from large to small. Professional customs declaration personnel (users) manually check the correspondence between the multiple candidate category codes of the goods to be compiled, mark and correct inappropriate candidate category codes (that is, select the target category code from the displayed multiple candidate category codes), and the correction result (that is, the selected target category code) will be recorded, completing the steps of manual correction and marking. Thus, the terminal device uses the correction algorithm to weight different correction results (that is, the second corresponding weight reduces the first corresponding weight), updates the weight to the first corresponding relationship, and completes the steps of recommending the correction algorithm.
[0112] In the embodiment of the present application, the target category information that matches the category information of the goods to be compiled is determined from the first corresponding relationship, so as to quickly select the category code of the goods to be compiled from at least one category code whose corresponding weight is greater than or equal to a preset threshold value in the first corresponding relationship of the target category information. The category code of the goods to be compiled can be determined by matching the category information extracted from the declaration document of the goods to be compiled with each category information in the first corresponding relationship, and the corresponding weight between each category information and the category code in the first corresponding relationship, without the need to perform complex classification calculations of the goods to be compiled, saving the process of determining the category code, and greatly improving the efficiency of determining the category code of the goods, for example, the customs code.
[0113] Figure 5 is a flow chart of another method for coding and classifying goods in an embodiment of the present application. The method can be executed by a terminal device. The terminal device can be Figure 1 The server 120 in the embodiment shown is as follows: Figure 5 As shown, the method may include steps S301 to S306:
[0114] Step S301, obtaining historical declaration texts and category codes of multiple coded goods.
[0115] The third database stores the historical declaration texts and category codes of the coded goods, and the terminal device can read the historical declaration texts and category codes of multiple coded goods from the third database. Exemplarily, the terminal device can also capture the historical declaration texts and category codes of multiple coded goods from the cargo declaration system of at least one transfer station through online data collection, or the user inputs the historical declaration texts and category codes of multiple coded goods into the terminal device.
[0116] Step S302: for each coded cargo, extract the category information of the coded cargo from the historical declaration text of the coded cargo using a preset large language model.
[0117] The specific process of the terminal device using the preset large language model to extract the category information of the coded goods from the historical declaration text of each coded goods is as follows Figure 2 Step S202 in the illustrated embodiment is similar and will not be described in detail here.
[0118] Step S303: for each piece of coded cargo category information, the coded cargo category information is matched with the coded cargo category code, and the corresponding weight between the coded cargo category information and the category code is set to a preset value, so as to obtain a first corresponding relationship.
[0119] In one example, the preset value may be a number greater than or equal to 0 and less than or equal to 1, for example, 0.6 or 1, etc., and the present application embodiment does not impose any specific limitation. It is understandable that if the corresponding weights of the candidate category codes determined by the terminal device are all preset values, and the user's selection operation of any of the multiple candidate category codes is not detected, the terminal device may randomly determine a candidate category code as the target category code.
[0120] Continue to refer Figure 3 In the application scenario shown, the historical declaration text includes a text description of the coded goods. The terminal device will read the historical declaration texts and category codes of multiple coded goods from the third database (other goods description data set) in advance, and use the preset large language model to perform semantic understanding on the text description of each coded goods, so as to extract the description words of the coded goods from the text description, and store the description words to obtain a standardized description data set; the description words of each coded goods in the standardized description data set are input into the preset sentence embedding model, so that the preset sentence embedding model encodes the description words into a language vector (that is, the step of describing the vectorization encoding), and the language vector is used as the category information of the coded goods to be coded. Then, the category information of the coded goods is corresponded to the category code of the coded goods, and the corresponding weight between the category information of the coded goods and the category code is set to a preset value, so as to obtain the first corresponding relationship, that is, the customs code data set under the standard description.
[0121] Therefore, when determining the category code of the goods to be coded, the category information of the goods to be coded is matched with the standard type information in the first corresponding relationship to obtain an accurate category code. It can be understood that after obtaining the first corresponding relationship, each time the category code of the goods to be coded is determined, there is no need to repeat the steps of obtaining the standardized description data set and the description vectorization code.
[0122] For details of steps S304 to S306, see Figure 2 Steps S101 to S103 in the illustrated embodiment are not described in detail here.
[0123] In the embodiment of the present application, before determining the category code of the goods to be compiled, the advantage of the preset large language model that can accurately and quickly understand natural language is first used to quickly and accurately extract the category information from the historical declaration text of the coded goods. Then the extracted category information is matched with the category code of the coded goods to obtain a first corresponding relationship. A large amount of data collection between the category information and category code of the coded goods is achieved, and a standard corresponding relationship between the category information and the category code is established. Therefore, the accurate first corresponding relationship and the preset large language model can be directly used in the subsequent process to automatically, quickly and accurately determine the category code of the goods to be compiled.
[0124] Figure 6 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Figure 6 As shown, the terminal device 6 of this embodiment includes: at least one processor 60 ( Figure 6 Only one is shown in the figure) a processor, a memory 61, and a computer program 62 stored in the memory 61 and executable on the at least one processor 60, and when the processor 60 executes the computer program 62, the steps in any of the above-mentioned coding and classification method embodiments of the goods are implemented.
[0125] The terminal device 6 may be Figure 1 The server, desktop computer, notebook, PDA and cloud server are computing devices in the illustrated embodiment. The terminal device may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will appreciate that Figure 6 It is only an example of the terminal device 6 and does not constitute a limitation on the terminal device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0126] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0127] In some embodiments, the memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or memory of the terminal device 6. In other embodiments, the memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 61 may also be used to temporarily store data that has been output or is to be output.
[0128] Corresponding to the coding and classification method of goods described in the above embodiment, Figure 7 The structural block diagram of a goods encoding device provided by an embodiment of the present application is shown. For the convenience of explanation, only the part related to the embodiment of the present application is shown. Figure 7 , the device comprises:
[0129] The acquisition module 710 is used to acquire the declaration text of the goods to be compiled;
[0130] An extraction module 720 is used to extract the category information of the goods to be compiled from the declaration text using a preset large language model;
[0131] The search module 730 is used to search the target category code corresponding to the category information of the goods to be compiled from the first corresponding relationship, the target category code is used as the category code of the goods to be compiled, and the first corresponding relationship includes different category codes corresponding to different category information.
[0132] In application, the device runs in the terminal equipment.
[0133] In some embodiments, in the first corresponding relationship, one category information corresponds to at least one category code, and there is a corresponding weight between one category information and one category code; the search module includes:
[0134] A determination unit, used to determine, from the first corresponding relationship, target category information that matches the category information of the goods to be compiled;
[0135] An acquiring unit, configured to acquire, from the first corresponding relationship, at least one candidate category code corresponding to the target category information and a corresponding weight of each candidate category code;
[0136] The determination unit is further configured to determine a target category code from at least one candidate category code according to a corresponding weight of each candidate category code and a preset threshold.
[0137] In some embodiments, the determining unit is specifically configured to:
[0138] Determine the similarity between each category information in the first corresponding relationship and the category information of the goods to be compiled;
[0139] The category information corresponding to the similarity with the highest value among the similarities is determined as the target category information.
[0140] In some embodiments, the determining unit is specifically configured to:
[0141] In the case where the target category information corresponds to multiple candidate category codes, extracting a candidate category code whose corresponding weight is greater than or equal to a preset threshold from the multiple candidate category codes to obtain at least one category code to be selected;
[0142] In a case where there are a plurality of category codes to be selected, in response to a user's selection operation of one of the plurality of category codes to be selected, the selected category code to be selected is determined as the target category code.
[0143] In some embodiments, the determining unit is further configured to:
[0144] When there is a candidate category code, the candidate category code is determined as the target category code.
[0145] In some embodiments, the apparatus further comprises:
[0146] After the selected candidate category code is determined as the target category code, a comparison module is used to compare the first corresponding weight with the second corresponding weight, the first corresponding weight being the corresponding weight of any candidate category code except the target category code among the plurality of candidate category codes, and the second corresponding weight being the corresponding weight between the target category information and the target category code;
[0147] The increasing module is used to increase the second corresponding weight and decrease the first corresponding weight in the first corresponding relationship when the first corresponding weight is greater than or equal to the second corresponding weight.
[0148] In some embodiments, the apparatus further comprises:
[0149] Before obtaining the declaration text of the goods to be coded, the acquisition module is also used to obtain the historical declaration texts and category codes of multiple coded goods;
[0150] The extraction module is further used to extract the category information of the coded goods from the historical declaration text of the coded goods by using a preset large language model for each coded goods;
[0151] The corresponding module is used to correspond the category information of each coded cargo to the category code of the coded cargo, and set the corresponding weight between the category information of the coded cargo and the category code to a preset value to obtain a first corresponding relationship.
[0152] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0153] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0154] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0155] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0156] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0157] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0158] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0159] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0160] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0161] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for coding and classifying goods, characterized in that: include: Get the declaration text of the goods to be compiled; Extracting the category information of the goods to be compiled from the declaration text by using a preset large language model; The target category code corresponding to the category information of the goods to be compiled is searched from the first corresponding relationship, and the target category code is used as the category code of the goods to be compiled. The first corresponding relationship includes different category codes corresponding to different category information.
2. The method according to claim 1, characterized in that In the first corresponding relationship, one category information corresponds to at least one category code, and there is a corresponding weight between one category information and one category code; The step of searching the first corresponding relationship for the target category code corresponding to the category information of the goods to be compiled includes: Determining target category information that matches the category information of the goods to be compiled from the first corresponding relationship; Acquire, from the first corresponding relationship, at least one candidate category code corresponding to the target category information and a corresponding weight of each of the candidate category codes; The target category code is determined from the at least one candidate category code according to the corresponding weight of each candidate category code and a preset threshold.
3. The method according to claim 2, characterized in that The determining, from the first corresponding relationship, target category information that matches the category information includes: respectively determining the similarity between each of the category information in the first corresponding relationship and the category information of the goods to be compiled; The category information corresponding to the similarity with the highest value among the similarities is determined as the target category information.
4. The method according to claim 2 or 3, characterized in that: Determining the target category code from the at least one candidate category code includes: In the case where the target category information corresponds to a plurality of candidate category codes, extracting a candidate category code whose corresponding weight is greater than or equal to the preset threshold from the plurality of candidate category codes to obtain at least one category code to be selected; In the case where there are a plurality of the category codes to be selected, in response to a user's selection operation of one of the plurality of category codes to be selected, the selected category code to be selected is determined as the target category code.
5. The method according to claim 4, characterized in that The method further comprises: In the case that there is one of the candidate category codes, the candidate category code is determined as the target category code.
6. The method according to claim 4, characterized in that After determining the selected candidate category code as the target category code, the method further includes: Comparing a first corresponding weight with a second corresponding weight, wherein the first corresponding weight is a corresponding weight of any one of the multiple candidate category codes except the target category code, and the second corresponding weight is a corresponding weight between the target category information and the target category code; When the first corresponding weight is greater than or equal to the second corresponding weight, the second corresponding weight is increased and the first corresponding weight is decreased in the first corresponding relationship.
7. The method according to claim 1, characterized in that Before obtaining the declaration text of the goods to be compiled, the method further includes: Obtain historical declaration texts and category codes for multiple coded goods; For each of the coded goods, extracting the category information of the coded goods from the historical declaration text of the coded goods by using the preset large language model; For each piece of category information of the coded goods, the category information of the coded goods is matched with the category code of the coded goods, and the corresponding weight between the category information of the coded goods and the category code is set to a preset value, so as to obtain the first corresponding relationship.
8. A coding device for goods, characterized in that: include: The acquisition module is used to obtain the declaration text of the goods to be compiled; An extraction module, used for extracting the category information of the goods to be compiled from the declaration text by using a preset large language model; The search module is used to search for the target category code corresponding to the category information of the goods to be compiled from the first corresponding relationship, the target category code is used as the category code of the goods to be compiled, and the first corresponding relationship includes different category codes corresponding to different category information.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Logistics object information processing method and device and computer system
CN110858219A
Commodity information search method and device, storage medium and electronic device
CN111125491A
Customs import and export commodity classification method based on multi-module text intelligent coding algorithm
CN113947061A
Commodity label labeling method and device, equipment and medium
CN115563280A
Import and export goods customs declaration information acquisition method and device and information sheet acquisition method and device
CN117829700A