CN117807482B - Method, device, equipment and storage medium for classifying customs clearance notes - Google Patents

Method, device, equipment and storage medium for classifying customs clearance notes Download PDF

Info

Publication number
CN117807482B
CN117807482B CN202410226924.7A CN202410226924A CN117807482B CN 117807482 B CN117807482 B CN 117807482B CN 202410226924 A CN202410226924 A CN 202410226924A CN 117807482 B CN117807482 B CN 117807482B
Authority
CN
China
Prior art keywords
commodity
result
feature extraction
linear mapping
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410226924.7A
Other languages
Chinese (zh)
Other versions
CN117807482A (en
Inventor
陈大伟
曾伟祥
何中卿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Mingxin Digital Intelligence Technology Co ltd
Original Assignee
Shenzhen Mingxin Digital Intelligence Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Mingxin Digital Intelligence Technology Co ltd filed Critical Shenzhen Mingxin Digital Intelligence Technology Co ltd
Priority to CN202410226924.7A priority Critical patent/CN117807482B/en
Publication of CN117807482A publication Critical patent/CN117807482A/en
Application granted granted Critical
Publication of CN117807482B publication Critical patent/CN117807482B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • G06N3/0455Auto-encoder networks; Encoder-decoder networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Mathematical Physics (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to the technical field of artificial intelligence and discloses a method, a device, equipment and a storage medium for classifying customs clearance notes. The method comprises the following steps: performing text extraction processing on the customs declaration form to obtain commodity description text of commodities to be classified in the customs declaration form; performing feature extraction processing on the commodity description text from a plurality of preset commodity element dimensions by utilizing a pre-trained feature extraction model to obtain a feature extraction result; carrying out commodity category identification processing on commodities to be classified according to the feature extraction result by utilizing a pre-trained identification model to obtain an identification result; and carrying out visual processing on the identification result, acquiring interaction information generated by the user through the commodity category in the man-machine interaction selection identification result, and outputting the selection result according to the interaction information so as to classify customs declaration. The embodiment of the application can improve the classification efficiency and classification accuracy of customs clearance notes.

Description

Method, device, equipment and storage medium for classifying customs clearance notes
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a method, a device, equipment and a storage medium for classifying customs clearance notes.
Background
At present, classification of customs clearance notes is finished by means of manual auditing, however, the manual auditing mode is influenced by knowledge and experience background of a customs inspector, familiarity degree of commodity categories, subjective and objective factors such as manual operation and the like, and the defects of low classification efficiency and unstable classification accuracy exist.
Disclosure of Invention
The application aims to provide a classification method, a device, equipment and a storage medium of customs clearance notes, aiming at improving the classification efficiency and classification accuracy of the customs clearance notes.
The embodiment of the application provides a classification method of customs clearance notes, which comprises the following steps:
Performing text extraction processing on the customs declaration form to obtain commodity description text of commodities to be classified in the customs declaration form;
Performing feature extraction processing on the commodity description text from a plurality of preset commodity element dimensions by utilizing a pre-trained feature extraction model to obtain a feature extraction result; the pre-trained feature extraction model is obtained through training by a Few-shot learning method;
Carrying out commodity category identification processing on the commodities to be classified according to the feature extraction result by utilizing a pre-trained identification model to obtain an identification result; the identification result comprises a plurality of commodity categories;
And carrying out visual processing on the identification result, acquiring interaction information generated by a user selecting commodity categories in the identification result through man-machine interaction, and outputting a selection result according to the interaction information so as to classify the customs declaration.
In some embodiments, the pre-trained feature extraction model includes an encoder network and a decoder network;
the feature extraction processing is performed on the commodity description text from a plurality of preset commodity element dimensions by using a pre-trained feature extraction model to obtain a feature extraction result, and the feature extraction method comprises the following steps:
preprocessing the commodity description text to obtain preprocessed text data;
extracting context information and text characteristic information of each word of the preprocessed text data based on a self-attention mechanism by using the encoder network to obtain a context vector and a word characteristic vector;
and generating classified text representations of the commodity description text in a plurality of preset commodity element dimensions by using the decoder network and using the word feature vector as a value item and a key item and the context vector as a query item, so as to obtain the feature extraction result.
In some embodiments, the preprocessing the commodity description text to obtain preprocessed text data includes:
Word segmentation processing is carried out on the commodity description text to obtain a plurality of commodity description word texts;
coding the commodity description word text to obtain a word feature vector;
And carrying out position coding processing on the word feature vector to obtain the preprocessed text data.
In some embodiments, the pre-trained recognition model includes a recognition network and a linear mapping network having a plurality of linear mapping layers having a hierarchical relationship;
The method for identifying the commodity category of the commodity to be classified by utilizing the pre-trained identification model according to the feature extraction result, comprises the following steps:
Extracting commodity element feature information of the feature extraction result based on a multi-head attention mechanism and a feedforward mechanism by utilizing the identification network to obtain commodity element feature vectors;
And carrying out linear mapping classification processing and coding search processing on the commodity element feature vectors in each linear mapping layer by utilizing the linear mapping network to obtain the identification result.
In some embodiments, the performing, by using the linear mapping network, linear mapping classification processing and code search processing on the commodity element feature vector in each linear mapping layer to obtain the identification result includes:
Inputting the feature vector of the input element into a linear mapping layer of the current level, and performing linear mapping classification processing to obtain a classification result of the current level; the input element feature vector is the commodity element feature vector or the classification result output by the linear mapping layer of the upper level;
Performing coding search processing on the classification result of the current level according to a preset coding rule to search out commodity category codes corresponding to the classification result of the current level;
Outputting the classification result of the current level and the commodity category code thereof to a linear mapping layer of the next level, and performing linear mapping classification processing until the linear mapping layer of the last level outputs the classification result of the last level and the commodity category code thereof, thereby obtaining the identification result.
In some embodiments, the evaluation formula of the pre-trained recognition model is:
wherein F is the score of the pre-trained recognition model, precision is the precision, recall is the recall, TP is the number of real cases, FP is the number of false positive cases, and FN is the number of false negative cases.
In some embodiments, the method for classifying customs clearance notes further comprises:
inputting the commodity description text into a preset commodity name knowledge base to perform fuzzy search matching on the commodity category of the commodity to be classified, so as to obtain a fuzzy search result;
And carrying out visual processing on the fuzzy search result, acquiring interaction information generated by a user selecting commodity categories in the fuzzy search result through man-machine interaction, and outputting a selection result according to the interaction information so as to classify the customs declaration.
The embodiment of the application also provides a device for classifying customs clearance notes, which comprises:
the system comprises a first module, a second module and a third module, wherein the first module is used for carrying out text extraction processing on a customs declaration form to obtain commodity description text of commodities to be classified in the customs declaration form;
The second module is used for carrying out feature extraction processing on the commodity description text from a plurality of preset commodity element dimensions by utilizing a pre-trained feature extraction model to obtain a feature extraction result; the pre-trained feature extraction model is obtained through training by a Few-shot learning method;
The third module is used for carrying out commodity category identification processing on the commodities to be classified according to the feature extraction result by utilizing a pre-trained identification model to obtain an identification result; the identification result comprises a plurality of commodity categories;
And the fourth module is used for carrying out visual processing on the identification result, acquiring interaction information generated by a user selecting commodity categories in the identification result through man-machine interaction, and outputting a selection result according to the interaction information so as to classify the customs declaration.
The embodiment of the application also provides electronic equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the classification method of the customs declaration form when executing the computer program.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the classification method of the customs clearance note when being executed by a processor.
The application has the beneficial effects that: and carrying out feature extraction processing on commodity description texts of commodities to be classified from a plurality of preset commodity element dimensions by utilizing a feature extraction model trained by a Few-shot learning method, carrying out commodity category identification processing on the commodities to be classified according to the extracted feature extraction results by utilizing a pre-trained identification model to obtain identification results containing a plurality of commodity categories, and selecting the most accurate commodity category from the identification results by a user as the commodity category of the commodities to be classified, thereby classifying customs declaration sheets, simplifying the workload and the classification difficulty of customs declaration sheet classification, and improving the classification efficiency and the classification accuracy of customs declaration sheets.
Drawings
Fig. 1 is an optional flowchart of a method for classifying customs clearance notes according to an embodiment of the present application.
Fig. 2 is a flowchart of a specific method of step S102 according to an embodiment of the present application.
Fig. 3 is a flowchart of a specific method of step S103 according to an embodiment of the present application.
Fig. 4 is a flowchart of a specific method of step S302 according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of an alternative classification device for customs clearance notes according to an embodiment of the present application.
Fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
It should be noted that although functional block division is performed in a device diagram and a logic sequence is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the block division in the device, or in the flowchart. The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
At present, classification of customs declaration forms is finished by means of manual auditing, and the defects of low classification efficiency and unstable classification accuracy exist. The artificial intelligent model mainly utilizes a machine learning algorithm in customs classification, and can learn and identify classification rules of different commodities from a large amount of customs data, so that automatic classification is realized, however, the artificial intelligent model faces some difficulties and challenges in customs classification, for example, the quality of customs data directly influences the learning effect of an AI model, if the data contains a large amount of errors or noise, the AI model cannot accurately learn and identify the classification rules, the customs classification relates to a large number of commodities, the classification rules are very complex, the customs classification rules and regulations may change with the passage of time, and the AI model is required to adapt to the changes and continuously and effectively work under the new rules and regulations.
Based on the above, the embodiment of the application provides a method, a device, equipment and a storage medium for classifying customs clearance notes, aiming at improving the classification efficiency and classification accuracy of the customs clearance notes.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Wherein artificial intelligence (ARTIFICIAL INTELLIGENCE, AI) is the theory, method, technique, and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend, and expand human intelligence, sense the environment, acquire knowledge, and use knowledge to obtain optimal results.
Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions.
The embodiment of the application provides a classification method of customs clearance notes, which relates to the technical field of artificial intelligence. The classification method of the customs clearance note provided by the embodiment of the application can be applied to a terminal, a server side and software running in the terminal or the server side. In some embodiments, the terminal may be a smart phone, tablet, notebook, desktop, etc.; the server side can be configured as an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), basic cloud computing services such as big data and artificial intelligent platforms and the like; the software may be an application or the like that implements the text classification method, but is not limited to the above form.
The application is operational with numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network personal computers (Personal Computer, PCs), minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
Referring to fig. 1, fig. 1 is an optional flowchart of a method for classifying customs clearance notes according to an embodiment of the present application. In some embodiments of the present application, the method in fig. 1 may specifically include, but is not limited to, steps S101 to S104, and these four steps are described in detail below in connection with fig. 1.
And step S101, performing text extraction processing on the customs declaration form to obtain commodity description text of commodities to be classified in the customs declaration form.
Step S102, feature extraction processing is carried out on the commodity description text from a plurality of preset commodity element dimensions by utilizing a pre-trained feature extraction model, and a feature extraction result is obtained.
The pre-trained feature extraction model is obtained through training by a Few-shot learning method, namely, only a small amount of labeling samples are used in the training process, so that the pre-trained feature extraction model can quickly adjust parameters of the pre-trained feature extraction model when new commodity description is received, and corresponding commodity feature description is generated.
And step S103, carrying out commodity category identification processing on commodities to be classified according to the feature extraction result by utilizing the pre-trained identification model to obtain an identification result.
Wherein the identification result comprises a plurality of commodity categories.
Step S104, carrying out visual processing on the identification result, obtaining interaction information generated by the user through the selection of commodity categories in the identification result by man-machine interaction, and outputting the selection result according to the interaction information so as to classify customs clearance notes.
In step S101, firstly, a commodity description text is extracted from a commodity name position of a customs declaration form through a text recognition technology, and then the extracted commodity description text is checked to determine that the extraction is complete and that no recognition error exists.
In step S102, the extracted commodity description text is input to a pre-trained feature extraction model, and feature extraction processing is performed on the commodity description text by using the pre-trained feature extraction model, so as to determine commodity attributes of the commodity to be classified corresponding to the commodity description text in multiple commodity element dimensions. Specifically, a pre-trained feature extraction model is obtained, a commodity description text is input into the pre-trained feature extraction model, feature extraction is carried out on the commodity description text through the pre-trained feature extraction model, namely, key features of the commodity description text are subjected to downsampling, data enhancement, convolution pooling and linear transformation, so that word feature information and context information of the commodity description text are obtained, downsampling features are obtained, attention processing is carried out on the downsampling features through a multi-head attention mechanism, attention features are obtained, and then convolution, normalization and pooling processing are sequentially carried out on the attention features, so that feature extraction results can be obtained.
In step S103, the feature extraction result is input to a pre-trained recognition model, and multi-dimensional commodity category recognition processing is performed on the commodity to be classified by using the pre-trained recognition model, so as to predict the most likely commodity category of the commodity to be classified according to the multiple commodity category dimensions, and obtain a recognition result. Specifically, a pre-trained recognition model is obtained, a feature extraction result is input into the pre-trained recognition model, information extraction and feature recognition processing are carried out on the feature extraction result through the pre-trained recognition module, commodity category information of multiple dimensions is extracted, corresponding commodity categories are determined according to the extracted commodity category information, and vector representation of the commodity category information is output, so that a recognition result is obtained.
In step S104, the recognition result is converted into a text form and visualized, and the user views the multiple commodity categories included in the recognition result through the man-machine interface, performs final judgment on the commodity category of the commodity to be classified, and selects the most accurate commodity category from the final judgment as the commodity category of the commodity to be classified, thereby classifying the customs declaration form.
In the steps S101 to S104 shown in the embodiment of the application, feature extraction processing is carried out on commodity description texts of commodities to be classified from a plurality of preset commodity element dimensions by utilizing a feature extraction model trained by a Few-shot learning method, commodity category identification processing is carried out on the commodities to be classified according to the extracted feature extraction result by utilizing a pre-trained identification model, so that identification results containing a plurality of commodity categories are obtained, and a user selects the most accurate commodity category from the identification results to be used as the commodity category of the commodities to be classified, thereby classifying customs declaration, simplifying the workload and the classification difficulty of customs declaration classification, and improving the classification efficiency and the classification accuracy of customs declaration.
As shown in fig. 2, in some embodiments, step S102 may specifically include, but is not limited to, steps S201 to S203, which are described in detail below in conjunction with fig. 2.
In this embodiment, the pre-trained feature extraction model includes an encoder network and a decoder network. Illustratively, the pre-trained feature extraction model may be an optional ChatGLM model.
Step S201, preprocessing the commodity description text to obtain preprocessed text data.
Step S202, extracting context information and text characteristic information of each word of the preprocessed text data based on a self-attention mechanism by utilizing an encoder network to obtain a context vector and a word characteristic vector.
Step S203, using the decoder network, using the word feature vector as a value item and a key item, using the context vector as a query item, generating a classified text representation of the text commodity description text in a plurality of preset commodity element dimensions, and obtaining a feature extraction result.
In step S201, the commodity description text is preprocessed, including removing irrelevant symbols, punctuation, and stop words, so that the pre-trained feature extraction model can better understand the commodity description text. Step S201 may be a step including:
and carrying out word segmentation processing on the commodity description text to obtain a plurality of commodity description word texts. The article description text is segmented (Tokenization) into smaller units, typically words, subwords or characters.
And coding the commodity description word text to obtain a word feature vector. The encoding process (Embedding) is performed on the commodity description word text, and the commodity description word text is converted into a vector with a fixed size, namely a word feature vector.
And carrying out position coding processing on the word feature vector to obtain the preprocessed text data. The word feature vectors are subjected to position coding (Positional Encoding) to order the word feature vectors according to the positions of the word feature vectors in the commodity description text, so that the pre-trained feature extraction model can understand the positions of words in sentences.
In step S202, the preprocessed text data is taken as input, and a plurality of vector representations are provided for the preprocessed text data through multiple self-attention mechanisms, so as to extract context information and text feature information of each word of the preprocessed text data, and the layer further includes a residual structure (the input is added with the output through a residual line) and normalizes the output, so as to obtain a context vector and a word feature vector. Specifically, the preprocessed text data is multiplied by a query matrix, a key matrix and a value matrix (all three matrices are trainable parameters) to obtain a query term, a key term and a value term of a word in a self-attention mechanism, the generated query term of a certain word is multiplied by the key term of the preprocessed text data to obtain contribution degree distribution of all the words to the encoded word, then softmax operation is carried out on the distribution, the distribution is converted into probability distribution, so that the sum of the contribution degrees of all the words in a sequence is 1, text characteristic information of each word based on the self-attention mechanism is obtained, the generated contribution degree distribution is multiplied by the value term of each generated word to obtain vector representation of a certain word based on the self-attention mechanism, a plurality of vector representations are provided for the words through a plurality of different query matrices, key matrices and value matrices, the word vectors are connected and then information is rearranged through a full connection layer, and further the vector representation of a plurality of other words in the sequence is obtained, and the context information based on each word is obtained. And projecting the obtained context information and text characteristic information into a higher-dimensional space, extracting advantageous information in the high-dimensional space, projecting the advantageous information back into the original space, and completing information extraction to finally obtain the context vector and the word characteristic vector.
In step S203, the term feature vector is used as a value item and a key item, the context vector is used as a query item, the query item of the context vector is multiplied by the key item of the term feature vector to obtain the contribution degree distribution of the context information to decoding the term, then softmax operation is performed on the distribution, the distribution is converted into probability distribution, so that the sum of the contribution degrees of all the terms in the sequence is 1, the vector representation of the commodity element classification information of each term based on the self-attention mechanism is obtained, a plurality of vector representations are provided for the terms through a plurality of different query matrixes, key matrixes and value matrixes, the vector representations of the commodity element classification information are rearranged through a full connection layer after being connected, the vector representations of the other terms in the sequence are obtained, the vector representations are projected to a higher-dimensional space, the beneficial information is extracted in the higher-dimensional space, the extraction of the information is completed, and the text representation of the commodity description text in a plurality of preset commodity element dimensions, namely the feature extraction result is obtained.
As shown in fig. 3, in some embodiments, step S103 may specifically include, but is not limited to, step S301 to step S302, which are described in detail below in conjunction with fig. 3.
In this embodiment, the pre-trained recognition model includes a recognition network and a linear mapping network having a plurality of linear mapping layers having a hierarchical relationship. Illustratively, the pre-trained recognition model can be a BERT model, which can effectively process long-distance dependency, understand input features in a fine granularity, and capture complex semantic information in text vectors.
Step S301, extracting commodity element feature information of a feature extraction result based on a multi-head attention mechanism and a feedforward mechanism by utilizing an identification network to obtain commodity element feature vectors.
Step S302, linear mapping network is utilized to conduct linear mapping classification processing and coding search processing on commodity element feature vectors in each linear mapping layer, and recognition results are obtained.
In step S301, a [ CLS ] character is added to the head of the vector representation of the feature extraction result, a [ SEP ] character is added to the tail of the vector representation of the feature extraction result, the feature extraction is performed on the vector representation of the feature extraction result through a self-attention mechanism, that is, the key features of the text vector are subjected to downsampling, data enhancement, convolution pooling and linear transformation to obtain sparse feature representation of the text vector, downsampling features are obtained, attention processing is performed on the downsampling features through a multi-head attention mechanism, initial attention weights are obtained, and the vector representation of the feature extraction result is subjected to dimension transformation by using the initial attention weights, so that the vector representation meets the requirements of classification output results, and commodity element feature vectors are obtained.
In step S302, the commodity element feature vectors are transferred into linear mapping layers, normalization processing is performed on the commodity element feature vectors in each linear mapping layer according to a hierarchical order, classification results of the commodity element feature vectors are judged and output, dimension transformation is performed on the commodity element feature vectors according to the classification results, and the commodities to be classified corresponding to the commodity element feature vectors are encoded according to preset encoding rules, so that recognition results are obtained.
As shown in fig. 4, in some embodiments, step S302 may specifically include, but is not limited to, steps S401 to S403, which are described in detail below in conjunction with fig. 4.
Step S401, inputting the input element feature vector into the linear mapping layer of the current level, and performing linear mapping classification processing to obtain a classification result of the current level.
The input element feature vector is a commodity element feature vector or a classification result output by a linear mapping layer of the upper level, the linear mapping layer of the first level inputs the commodity element feature vector, and the linear mapping layers of other levels input the classification result output by the linear mapping layer of the upper level.
Step S402, performing code search processing on the classification result of the current level according to a preset coding rule to search out commodity category codes corresponding to the classification result of the current level.
Step S403, outputting the classification result of the current level and the commodity category code thereof to the linear mapping layer of the next level, and performing linear mapping classification processing until the linear mapping layer of the last level outputs the classification result of the last level and the commodity category code thereof, thereby obtaining the identification result.
In steps S401 to S403, the commodity element feature vector is input to the linear mapping layer of the first level to perform linear mapping classification processing to obtain a classification result of the first level, then the classification result of the first level is input to the linear mapping layer of the second level to perform linear mapping classification processing to obtain a classification result of the second level, the classification result of the second level is input to the linear mapping layer of the second level to perform linear mapping classification processing to obtain a classification result of the third level, and so on until the linear mapping layer of the last level outputs the classification result of the last level and commodity category codes thereof to obtain the identification result. In the linear mapping layer of the current level, the linear mapping processing is performed on the basis of the classification result of the previous level to obtain the classification result of the current level and the commodity class code of the current level, for example, the classification result of the linear mapping layer of the first level is 97 class commodities, the linear mapping layer of the second level is identified as 1231 class commodities under 97 class commodities from the 97 class commodity range on the basis of the classification result of the first level, the linear mapping layer of the third level is identified as 5615 class commodities under 97 class commodities from the 1231 class commodity range on the basis of the classification result of the second level, and so on until the linear mapping layer of the last level outputs the classification result of the last level and the commodity class code thereof to obtain the identification result.
In some embodiments, the evaluation formula for the pre-trained recognition model is:
wherein F is the score of the pre-trained recognition model, precision is the precision, recall is the recall, TP is the number of real cases, FP is the number of false positive cases, and FN is the number of false negative cases.
The Precision refers to the ratio of the observed value predicted to be positive to the total number of observed values predicted to be positive, and the Recall (Recall) is also referred to as sensitivity, and refers to the ratio of the observed value predicted to be positive to the total number of observed values actually positive.
In some embodiments, the method for classifying customs clearance further includes:
Inputting the commodity description text into a preset commodity name knowledge base to perform fuzzy search matching on commodity categories of commodities to be classified, so as to obtain fuzzy search results;
And carrying out visual processing on the fuzzy search result, obtaining interaction information generated by a user through man-machine interaction selection of commodity categories in the fuzzy search result, and outputting the selection result according to the interaction information so as to classify customs declaration.
Inputting commodity description text into a preset commodity name knowledge base, searching and matching the existing commodity name knowledge base in a fuzzy way, firstly trying to find out the matched commodity name by the system, combining the commodity name with the output result of the classification model, outputting the combined commodity name with the output result of the classification model to a classification result display interface, and if no matching item is found, outputting the combined commodity name with the output result of the classification model to a pre-trained recognition model for matching.
Referring to fig. 5, an embodiment of the present application further provides a device for classifying customs clearance notes, which can implement the method for classifying customs clearance notes, where the device includes:
a first module 501, configured to perform text extraction processing on a customs declaration form, so as to obtain a commodity description text of a commodity to be classified in the customs declaration form;
A second module 502, configured to perform feature extraction processing on the commodity description text from a plurality of preset commodity element dimensions by using a pre-trained feature extraction model, so as to obtain a feature extraction result; the pre-trained feature extraction model is obtained through training by a Few-shot learning method;
a third module 503, configured to perform, according to the feature extraction result, a commodity category identification process on the commodity to be classified by using a pre-trained identification model, so as to obtain an identification result; the identification result comprises a plurality of commodity categories;
and a fourth module 504, configured to perform visualization processing on the identification result, obtain interaction information generated by a user selecting a commodity category in the identification result through man-machine interaction, and output a selection result according to the interaction information, so as to classify the customs declaration.
The specific implementation of the customs clearance classification device is basically the same as the specific embodiment of the customs clearance classification method, and is not described herein.
Fig. 6 is a block diagram of an electronic device, according to an example embodiment.
An electronic device 600 according to such an embodiment of the present disclosure is described below with reference to fig. 6. The electronic device 600 shown in fig. 6 is merely an example and should not be construed to limit the functionality and scope of use of embodiments of the present disclosure in any way.
As shown in fig. 6, the electronic device 600 is in the form of a general purpose computing device. Components of electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one memory unit 620, a bus 630 connecting the different system components (including the memory unit 620 and the processing unit 610), a display unit 640, etc.
Wherein the storage unit stores program code that is executable by the processing unit 610 such that the processing unit 610 performs the steps according to various exemplary embodiments of the present disclosure described in the above-described customs clearance classification method section of the present specification.
The storage unit 620 may include readable media in the form of volatile storage units, such as Random Access Memory (RAM) 6201 and/or cache memory unit 6202, and may further include Read Only Memory (ROM) 6203.
The storage unit 620 may also include a program/utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
Bus 630 may be a local bus representing one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 600' (e.g., keyboard, pointing device, bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 600, and/or any devices (e.g., routers, modems, etc.) that enable the electronic device 600 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 650. Also, electronic device 600 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 over the bus 630. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 600, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program which is executed by a processor to realize the classification method of the customs clearance note.
According to the method, the device, the equipment and the storage medium for classifying the customs clearance, provided by the embodiment of the application, the feature extraction model trained by the Few-shot learning method is utilized to perform feature extraction processing on the commodity description text of the commodity to be classified from a plurality of preset commodity element dimensions, the pre-trained recognition model is utilized to perform commodity category recognition processing on the commodity to be classified according to the extracted feature extraction result, the recognition result containing a plurality of commodity categories is obtained, the user selects the most accurate commodity category from the recognition result to serve as the commodity category of the commodity to be classified, so that the customs clearance is classified, the workload and the classification difficulty of customs clearance classification are simplified, and the classification efficiency and the classification accuracy of the customs clearance are improved.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, including several instructions to cause a computing device (may be a personal computer, a server, or a network device, etc.) to perform the above-described method according to the embodiments of the present disclosure.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable storage medium may also be any readable medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
Those skilled in the art will appreciate that the modules may be distributed throughout several devices as described in the embodiments, and that corresponding variations may be implemented in one or more devices that are unique to the embodiments. The modules of the above embodiments may be combined into one module, or may be further split into a plurality of sub-modules.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or in combination with the necessary hardware. Thus, the technical solutions according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and include several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Exemplary embodiments of the present disclosure are specifically illustrated and described above. It is to be understood that this disclosure is not limited to the particular arrangements, instrumentalities and methods of implementation described herein; on the contrary, the disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (7)

1. A method for classifying customs clearance notes, comprising:
Performing text extraction processing on the customs declaration form to obtain commodity description text of commodities to be classified in the customs declaration form;
Performing feature extraction processing on the commodity description text from a plurality of preset commodity element dimensions by utilizing a pre-trained feature extraction model to obtain a feature extraction result; the pre-trained feature extraction model is obtained through training by a Few-shot learning method;
Carrying out commodity category identification processing on the commodities to be classified according to the feature extraction result by utilizing a pre-trained identification model to obtain an identification result; the identification result comprises a plurality of commodity categories;
Performing visual processing on the identification result, acquiring interaction information generated by a user through man-machine interaction to select commodity categories in the identification result, and outputting a selection result according to the interaction information so as to classify the customs declaration form;
The pre-trained feature extraction model includes an encoder network and a decoder network;
the feature extraction processing is performed on the commodity description text from a plurality of preset commodity element dimensions by using a pre-trained feature extraction model to obtain a feature extraction result, and the feature extraction method comprises the following steps:
preprocessing the commodity description text to obtain preprocessed text data;
extracting context information and text characteristic information of each word of the preprocessed text data based on a self-attention mechanism by using the encoder network to obtain a context vector and a word characteristic vector;
generating classified text representations of the commodity description text in a plurality of preset commodity element dimensions by using the decoder network and using the word feature vector as a value item and a key item and the context vector as a query item, and obtaining the feature extraction result;
the pre-trained recognition model comprises a recognition network and a linear mapping network, wherein the linear mapping network is provided with a plurality of linear mapping layers with hierarchical relations;
The method for identifying the commodity category of the commodity to be classified by utilizing the pre-trained identification model according to the feature extraction result, comprises the following steps:
Extracting commodity element feature information of the feature extraction result based on a multi-head attention mechanism and a feedforward mechanism by utilizing the identification network to obtain commodity element feature vectors;
Performing linear mapping classification processing and coding search processing on the commodity element feature vectors in each linear mapping layer by utilizing the linear mapping network to obtain the identification result;
the method for obtaining the identification result by using the linear mapping network to perform linear mapping classification processing and coding search processing on the commodity element feature vector in each linear mapping layer comprises the following steps:
Inputting the feature vector of the input element into a linear mapping layer of the current level, and performing linear mapping classification processing to obtain a classification result of the current level; the input element feature vector is the commodity element feature vector or the classification result output by the linear mapping layer of the upper level;
Performing coding search processing on the classification result of the current level according to a preset coding rule to search out commodity category codes corresponding to the classification result of the current level;
Outputting the classification result of the current level and the commodity category code thereof to a linear mapping layer of the next level, and performing linear mapping classification processing until the linear mapping layer of the last level outputs the classification result of the last level and the commodity category code thereof, thereby obtaining the identification result.
2. The method for classifying customs clearance notes according to claim 1, wherein,
The preprocessing of the commodity description text to obtain preprocessed text data comprises the following steps:
Word segmentation processing is carried out on the commodity description text to obtain a plurality of commodity description word texts;
coding the commodity description word text to obtain a word feature vector;
And carrying out position coding processing on the word feature vector to obtain the preprocessed text data.
3. The method for classifying customs clearance notes according to claim 1, wherein,
The evaluation formula of the pre-trained recognition model is as follows:
wherein F is the score of the pre-trained recognition model, precision is the precision, recall is the recall, TP is the number of real cases, FP is the number of false positive cases, and FN is the number of false negative cases.
4. The method for classifying customs clearance notes according to claim 1, wherein,
The method for classifying customs clearance notes further comprises the following steps:
inputting the commodity description text into a preset commodity name knowledge base to perform fuzzy search matching on the commodity category of the commodity to be classified, so as to obtain a fuzzy search result;
And carrying out visual processing on the fuzzy search result, acquiring interaction information generated by a user selecting commodity categories in the fuzzy search result through man-machine interaction, and outputting a selection result according to the interaction information so as to classify the customs declaration.
5. A customs clearance note sorting apparatus, comprising:
the system comprises a first module, a second module and a third module, wherein the first module is used for carrying out text extraction processing on a customs declaration form to obtain commodity description text of commodities to be classified in the customs declaration form;
The second module is used for carrying out feature extraction processing on the commodity description text from a plurality of preset commodity element dimensions by utilizing a pre-trained feature extraction model to obtain a feature extraction result; the pre-trained feature extraction model is obtained through training by a Few-shot learning method;
The third module is used for carrying out commodity category identification processing on the commodities to be classified according to the feature extraction result by utilizing a pre-trained identification model to obtain an identification result; the identification result comprises a plurality of commodity categories;
A fourth module, configured to perform visualization processing on the identification result, obtain interaction information generated by a user selecting a commodity category in the identification result through man-machine interaction, and output a selection result according to the interaction information, so as to classify the customs declaration;
The pre-trained feature extraction model includes an encoder network and a decoder network;
the feature extraction processing is performed on the commodity description text from a plurality of preset commodity element dimensions by using a pre-trained feature extraction model to obtain a feature extraction result, and the feature extraction method comprises the following steps:
preprocessing the commodity description text to obtain preprocessed text data;
extracting context information and text characteristic information of each word of the preprocessed text data based on a self-attention mechanism by using the encoder network to obtain a context vector and a word characteristic vector;
generating classified text representations of the commodity description text in a plurality of preset commodity element dimensions by using the decoder network and using the word feature vector as a value item and a key item and the context vector as a query item, and obtaining the feature extraction result;
the pre-trained recognition model comprises a recognition network and a linear mapping network, wherein the linear mapping network is provided with a plurality of linear mapping layers with hierarchical relations;
The method for identifying the commodity category of the commodity to be classified by utilizing the pre-trained identification model according to the feature extraction result, comprises the following steps:
Extracting commodity element feature information of the feature extraction result based on a multi-head attention mechanism and a feedforward mechanism by utilizing the identification network to obtain commodity element feature vectors;
Performing linear mapping classification processing and coding search processing on the commodity element feature vectors in each linear mapping layer by utilizing the linear mapping network to obtain the identification result;
the method for obtaining the identification result by using the linear mapping network to perform linear mapping classification processing and coding search processing on the commodity element feature vector in each linear mapping layer comprises the following steps:
Inputting the feature vector of the input element into a linear mapping layer of the current level, and performing linear mapping classification processing to obtain a classification result of the current level; the input element feature vector is the commodity element feature vector or the classification result output by the linear mapping layer of the upper level;
Performing coding search processing on the classification result of the current level according to a preset coding rule to search out commodity category codes corresponding to the classification result of the current level;
Outputting the classification result of the current level and the commodity category code thereof to a linear mapping layer of the next level, and performing linear mapping classification processing until the linear mapping layer of the last level outputs the classification result of the last level and the commodity category code thereof, thereby obtaining the identification result.
6. An electronic device comprising a memory storing a computer program and a processor implementing the method of classifying customs clearance notes according to any one of claims 1 to 4 when the computer program is executed by the processor.
7. A computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the method of classifying customs clearance notes according to any one of claims 1 to 4.
CN202410226924.7A 2024-02-29 2024-02-29 Method, device, equipment and storage medium for classifying customs clearance notes Active CN117807482B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410226924.7A CN117807482B (en) 2024-02-29 2024-02-29 Method, device, equipment and storage medium for classifying customs clearance notes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410226924.7A CN117807482B (en) 2024-02-29 2024-02-29 Method, device, equipment and storage medium for classifying customs clearance notes

Publications (2)

Publication Number Publication Date
CN117807482A CN117807482A (en) 2024-04-02
CN117807482B true CN117807482B (en) 2024-05-14

Family

ID=90433777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410226924.7A Active CN117807482B (en) 2024-02-29 2024-02-29 Method, device, equipment and storage medium for classifying customs clearance notes

Country Status (1)

Country Link
CN (1) CN117807482B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118035849B (en) * 2024-04-10 2024-07-19 浙江孚临科技有限公司 Goods data goods classification method, system and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019205319A1 (en) * 2018-04-25 2019-10-31 平安科技(深圳)有限公司 Commodity information format processing method and apparatus, and computer device and storage medium
CN110471948A (en) * 2019-07-10 2019-11-19 北京交通大学 A kind of customs declaration commodity classifying intelligently method excavated based on historical data
CN113988059A (en) * 2021-08-23 2022-01-28 北京明略昭辉科技有限公司 Session data type identification method, system, equipment and storage medium
CN117150006A (en) * 2023-07-20 2023-12-01 浙江工业大学 Intelligent import and export commodity classification method integrating knowledge patterns
CN117475199A (en) * 2023-10-16 2024-01-30 深圳市泰洲科技有限公司 Intelligent classification method for customs declaration commodity

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019205319A1 (en) * 2018-04-25 2019-10-31 平安科技(深圳)有限公司 Commodity information format processing method and apparatus, and computer device and storage medium
CN110471948A (en) * 2019-07-10 2019-11-19 北京交通大学 A kind of customs declaration commodity classifying intelligently method excavated based on historical data
CN113988059A (en) * 2021-08-23 2022-01-28 北京明略昭辉科技有限公司 Session data type identification method, system, equipment and storage medium
CN117150006A (en) * 2023-07-20 2023-12-01 浙江工业大学 Intelligent import and export commodity classification method integrating knowledge patterns
CN117475199A (en) * 2023-10-16 2024-01-30 深圳市泰洲科技有限公司 Intelligent classification method for customs declaration commodity

Also Published As

Publication number Publication date
CN117807482A (en) 2024-04-02

Similar Documents

Publication Publication Date Title
CN110232114A (en) Sentence intension recognizing method, device and computer readable storage medium
CN111931517B (en) Text translation method, device, electronic equipment and storage medium
CN117807482B (en) Method, device, equipment and storage medium for classifying customs clearance notes
CN113392209B (en) Text clustering method based on artificial intelligence, related equipment and storage medium
CN113486178B (en) Text recognition model training method, text recognition method, device and medium
US20220358292A1 (en) Method and apparatus for recognizing entity, electronic device and storage medium
CN113946681B (en) Text data event extraction method and device, electronic equipment and readable medium
CN112084779B (en) Entity acquisition method, device, equipment and storage medium for semantic recognition
CN115759119B (en) Financial text emotion analysis method, system, medium and equipment
CN115827819A (en) Intelligent question and answer processing method and device, electronic equipment and storage medium
CN116661805B (en) Code representation generation method and device, storage medium and electronic equipment
CN114372475A (en) Network public opinion emotion analysis method and system based on RoBERTA model
CN118378631B (en) Text examination method, device, equipment and storage medium
CN114492661B (en) Text data classification method and device, computer equipment and storage medium
CN115687934A (en) Intention recognition method and device, computer equipment and storage medium
CN113822040B (en) Subjective question scoring method, subjective question scoring device, computer equipment and storage medium
CN108875024B (en) Text classification method and system, readable storage medium and electronic equipment
CN111241273A (en) Text data classification method and device, electronic equipment and computer readable medium
CN112434889A (en) Expert industry analysis method, device, equipment and storage medium
CN112100360A (en) Dialog response method, device and system based on vector retrieval
CN111782781A (en) Semantic analysis method and device, computer equipment and storage medium
CN112364666B (en) Text characterization method and device and computer equipment
CN114911940A (en) Text emotion recognition method and device, electronic equipment and storage medium
CN109933788B (en) Type determining method, device, equipment and medium
CN115495541B (en) Corpus database, corpus database maintenance method, apparatus, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant